@tsparticles/interaction-light 4.0.2 → 4.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/index.js +1 -1
- package/browser/index.lazy.js +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.lazy.js +1 -1
- package/esm/index.js +1 -1
- package/esm/index.lazy.js +1 -1
- package/package.json +3 -3
- package/report.html +1 -1
- package/tsparticles.interaction.light.js +2 -2
- package/tsparticles.interaction.light.min.js +1 -1
package/browser/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { ensureInteractivityPluginLoaded } from "@tsparticles/plugin-interactivi
|
|
|
2
2
|
import { ExternalLighter } from "./ExternalLighter.js";
|
|
3
3
|
import { ParticlesLighter } from "./ParticlesLighter.js";
|
|
4
4
|
export async function loadLightInteraction(engine) {
|
|
5
|
-
engine.checkVersion("4.0.
|
|
5
|
+
engine.checkVersion("4.0.4");
|
|
6
6
|
await engine.pluginManager.register((e) => {
|
|
7
7
|
ensureInteractivityPluginLoaded(e);
|
|
8
8
|
e.pluginManager.addInteractor?.("externalLight", container => {
|
package/browser/index.lazy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadLightInteraction(engine) {
|
|
2
|
-
engine.checkVersion("4.0.
|
|
2
|
+
engine.checkVersion("4.0.4");
|
|
3
3
|
await engine.pluginManager.register(async (e) => {
|
|
4
4
|
const { ensureInteractivityPluginLoaded } = await import("@tsparticles/plugin-interactivity/lazy");
|
|
5
5
|
ensureInteractivityPluginLoaded(e);
|
package/cjs/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { ensureInteractivityPluginLoaded } from "@tsparticles/plugin-interactivi
|
|
|
2
2
|
import { ExternalLighter } from "./ExternalLighter.js";
|
|
3
3
|
import { ParticlesLighter } from "./ParticlesLighter.js";
|
|
4
4
|
export async function loadLightInteraction(engine) {
|
|
5
|
-
engine.checkVersion("4.0.
|
|
5
|
+
engine.checkVersion("4.0.4");
|
|
6
6
|
await engine.pluginManager.register((e) => {
|
|
7
7
|
ensureInteractivityPluginLoaded(e);
|
|
8
8
|
e.pluginManager.addInteractor?.("externalLight", container => {
|
package/cjs/index.lazy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadLightInteraction(engine) {
|
|
2
|
-
engine.checkVersion("4.0.
|
|
2
|
+
engine.checkVersion("4.0.4");
|
|
3
3
|
await engine.pluginManager.register(async (e) => {
|
|
4
4
|
const { ensureInteractivityPluginLoaded } = await import("@tsparticles/plugin-interactivity/lazy");
|
|
5
5
|
ensureInteractivityPluginLoaded(e);
|
package/esm/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { ensureInteractivityPluginLoaded } from "@tsparticles/plugin-interactivi
|
|
|
2
2
|
import { ExternalLighter } from "./ExternalLighter.js";
|
|
3
3
|
import { ParticlesLighter } from "./ParticlesLighter.js";
|
|
4
4
|
export async function loadLightInteraction(engine) {
|
|
5
|
-
engine.checkVersion("4.0.
|
|
5
|
+
engine.checkVersion("4.0.4");
|
|
6
6
|
await engine.pluginManager.register((e) => {
|
|
7
7
|
ensureInteractivityPluginLoaded(e);
|
|
8
8
|
e.pluginManager.addInteractor?.("externalLight", container => {
|
package/esm/index.lazy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadLightInteraction(engine) {
|
|
2
|
-
engine.checkVersion("4.0.
|
|
2
|
+
engine.checkVersion("4.0.4");
|
|
3
3
|
await engine.pluginManager.register(async (e) => {
|
|
4
4
|
const { ensureInteractivityPluginLoaded } = await import("@tsparticles/plugin-interactivity/lazy");
|
|
5
5
|
ensureInteractivityPluginLoaded(e);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/interaction-light",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.4",
|
|
4
4
|
"description": "tsParticles Light interaction",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -107,8 +107,8 @@
|
|
|
107
107
|
"./package.json": "./package.json"
|
|
108
108
|
},
|
|
109
109
|
"peerDependencies": {
|
|
110
|
-
"@tsparticles/engine": "4.0.
|
|
111
|
-
"@tsparticles/plugin-interactivity": "4.0.
|
|
110
|
+
"@tsparticles/engine": "4.0.4",
|
|
111
|
+
"@tsparticles/plugin-interactivity": "4.0.4"
|
|
112
112
|
},
|
|
113
113
|
"publishConfig": {
|
|
114
114
|
"access": "public"
|
package/report.html
CHANGED
|
@@ -4930,7 +4930,7 @@ var drawChart = (function (exports) {
|
|
|
4930
4930
|
</script>
|
|
4931
4931
|
<script>
|
|
4932
4932
|
/*<!--*/
|
|
4933
|
-
const data = {"version":2,"tree":{"name":"root","children":[{"name":"tsparticles.interaction.light.js","children":[{"name":"dist/browser","children":[{"uid":"
|
|
4933
|
+
const data = {"version":2,"tree":{"name":"root","children":[{"name":"tsparticles.interaction.light.js","children":[{"name":"dist/browser","children":[{"uid":"72afbc0a-1","name":"Utils.js"},{"name":"Options/Classes","children":[{"uid":"72afbc0a-3","name":"LightGradient.js"},{"uid":"72afbc0a-5","name":"LightArea.js"},{"uid":"72afbc0a-7","name":"LightShadow.js"},{"uid":"72afbc0a-9","name":"Light.js"}]},{"uid":"72afbc0a-11","name":"ExternalLighter.js"},{"uid":"72afbc0a-13","name":"ParticlesLighter.js"},{"uid":"72afbc0a-15","name":"index.js"},{"uid":"72afbc0a-17","name":"browser.js"}]}]}],"isRoot":true},"nodeParts":{"72afbc0a-1":{"renderedLength":2997,"gzipLength":0,"brotliLength":0,"metaUid":"72afbc0a-0"},"72afbc0a-3":{"renderedLength":539,"gzipLength":0,"brotliLength":0,"metaUid":"72afbc0a-2"},"72afbc0a-5":{"renderedLength":433,"gzipLength":0,"brotliLength":0,"metaUid":"72afbc0a-4"},"72afbc0a-7":{"renderedLength":507,"gzipLength":0,"brotliLength":0,"metaUid":"72afbc0a-6"},"72afbc0a-9":{"renderedLength":363,"gzipLength":0,"brotliLength":0,"metaUid":"72afbc0a-8"},"72afbc0a-11":{"renderedLength":1970,"gzipLength":0,"brotliLength":0,"metaUid":"72afbc0a-10"},"72afbc0a-13":{"renderedLength":1569,"gzipLength":0,"brotliLength":0,"metaUid":"72afbc0a-12"},"72afbc0a-15":{"renderedLength":590,"gzipLength":0,"brotliLength":0,"metaUid":"72afbc0a-14"},"72afbc0a-17":{"renderedLength":183,"gzipLength":0,"brotliLength":0,"metaUid":"72afbc0a-16"}},"nodeMetas":{"72afbc0a-0":{"id":"/dist/browser/Utils.js","moduleParts":{"tsparticles.interaction.light.js":"72afbc0a-1"},"imported":[{"uid":"72afbc0a-19"}],"importedBy":[{"uid":"72afbc0a-10"},{"uid":"72afbc0a-12"}]},"72afbc0a-2":{"id":"/dist/browser/Options/Classes/LightGradient.js","moduleParts":{"tsparticles.interaction.light.js":"72afbc0a-3"},"imported":[{"uid":"72afbc0a-19"}],"importedBy":[{"uid":"72afbc0a-14"},{"uid":"72afbc0a-4"}]},"72afbc0a-4":{"id":"/dist/browser/Options/Classes/LightArea.js","moduleParts":{"tsparticles.interaction.light.js":"72afbc0a-5"},"imported":[{"uid":"72afbc0a-19"},{"uid":"72afbc0a-2"}],"importedBy":[{"uid":"72afbc0a-14"},{"uid":"72afbc0a-8"}]},"72afbc0a-6":{"id":"/dist/browser/Options/Classes/LightShadow.js","moduleParts":{"tsparticles.interaction.light.js":"72afbc0a-7"},"imported":[{"uid":"72afbc0a-19"}],"importedBy":[{"uid":"72afbc0a-14"},{"uid":"72afbc0a-8"}]},"72afbc0a-8":{"id":"/dist/browser/Options/Classes/Light.js","moduleParts":{"tsparticles.interaction.light.js":"72afbc0a-9"},"imported":[{"uid":"72afbc0a-19"},{"uid":"72afbc0a-4"},{"uid":"72afbc0a-6"}],"importedBy":[{"uid":"72afbc0a-14"},{"uid":"72afbc0a-10"}]},"72afbc0a-10":{"id":"/dist/browser/ExternalLighter.js","moduleParts":{"tsparticles.interaction.light.js":"72afbc0a-11"},"imported":[{"uid":"72afbc0a-18"},{"uid":"72afbc0a-19"},{"uid":"72afbc0a-0"},{"uid":"72afbc0a-8"}],"importedBy":[{"uid":"72afbc0a-14"}]},"72afbc0a-12":{"id":"/dist/browser/ParticlesLighter.js","moduleParts":{"tsparticles.interaction.light.js":"72afbc0a-13"},"imported":[{"uid":"72afbc0a-18"},{"uid":"72afbc0a-19"},{"uid":"72afbc0a-0"}],"importedBy":[{"uid":"72afbc0a-14"}]},"72afbc0a-14":{"id":"/dist/browser/index.js","moduleParts":{"tsparticles.interaction.light.js":"72afbc0a-15"},"imported":[{"uid":"72afbc0a-18"},{"uid":"72afbc0a-10"},{"uid":"72afbc0a-12"},{"uid":"72afbc0a-8"},{"uid":"72afbc0a-4"},{"uid":"72afbc0a-2"},{"uid":"72afbc0a-6"}],"importedBy":[{"uid":"72afbc0a-16"}]},"72afbc0a-16":{"id":"/dist/browser/browser.js","moduleParts":{"tsparticles.interaction.light.js":"72afbc0a-17"},"imported":[{"uid":"72afbc0a-14"}],"importedBy":[],"isEntry":true},"72afbc0a-18":{"id":"@tsparticles/plugin-interactivity","moduleParts":{},"imported":[],"importedBy":[{"uid":"72afbc0a-14"},{"uid":"72afbc0a-10"},{"uid":"72afbc0a-12"}],"isExternal":true},"72afbc0a-19":{"id":"@tsparticles/engine","moduleParts":{},"imported":[],"importedBy":[{"uid":"72afbc0a-10"},{"uid":"72afbc0a-12"},{"uid":"72afbc0a-8"},{"uid":"72afbc0a-4"},{"uid":"72afbc0a-2"},{"uid":"72afbc0a-6"},{"uid":"72afbc0a-0"}],"isExternal":true}},"env":{"rollup":"4.60.4"},"options":{"gzip":false,"brotli":false,"sourcemap":false}};
|
|
4934
4934
|
|
|
4935
4935
|
const run = () => {
|
|
4936
4936
|
const width = window.innerWidth;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
(function(g){g.__tsParticlesInternals=g.__tsParticlesInternals||{};g.__tsParticlesInternals.bundles=g.__tsParticlesInternals.bundles||{};g.__tsParticlesInternals.effects=g.__tsParticlesInternals.effects||{};g.__tsParticlesInternals.engine=g.__tsParticlesInternals.engine||{};g.__tsParticlesInternals.interactions=g.__tsParticlesInternals.interactions||{};g.__tsParticlesInternals.palettes=g.__tsParticlesInternals.palettes||{};g.__tsParticlesInternals.paths=g.__tsParticlesInternals.paths||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins.emittersShapes=g.__tsParticlesInternals.plugins.emittersShapes||{};g.__tsParticlesInternals.presets=g.__tsParticlesInternals.presets||{};g.__tsParticlesInternals.shapes=g.__tsParticlesInternals.shapes||{};g.__tsParticlesInternals.updaters=g.__tsParticlesInternals.updaters||{};g.__tsParticlesInternals.utils=g.__tsParticlesInternals.utils||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas.utils=g.__tsParticlesInternals.canvas.utils||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path.utils=g.__tsParticlesInternals.path.utils||{};var __tsProxyFactory=typeof Proxy!=="undefined"?function(obj){return new Proxy(obj,{get:function(target,key){if(!(key in target)){target[key]={};}return target[key];}});}:function(obj){return obj;};g.__tsParticlesInternals.bundles=__tsProxyFactory(g.__tsParticlesInternals.bundles);g.__tsParticlesInternals.effects=__tsProxyFactory(g.__tsParticlesInternals.effects);g.__tsParticlesInternals.interactions=__tsProxyFactory(g.__tsParticlesInternals.interactions);g.__tsParticlesInternals.palettes=__tsProxyFactory(g.__tsParticlesInternals.palettes);g.__tsParticlesInternals.paths=__tsProxyFactory(g.__tsParticlesInternals.paths);g.__tsParticlesInternals.plugins=__tsProxyFactory(g.__tsParticlesInternals.plugins);g.__tsParticlesInternals.plugins.emittersShapes=__tsProxyFactory(g.__tsParticlesInternals.plugins.emittersShapes);g.__tsParticlesInternals.presets=__tsProxyFactory(g.__tsParticlesInternals.presets);g.__tsParticlesInternals.shapes=__tsProxyFactory(g.__tsParticlesInternals.shapes);g.__tsParticlesInternals.updaters=__tsProxyFactory(g.__tsParticlesInternals.updaters);g.__tsParticlesInternals.utils=__tsProxyFactory(g.__tsParticlesInternals.utils);g.__tsParticlesInternals.canvas=__tsProxyFactory(g.__tsParticlesInternals.canvas);g.__tsParticlesInternals.path=__tsProxyFactory(g.__tsParticlesInternals.path);g.tsparticlesInternalExports=g.tsparticlesInternalExports||{};})(typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:this);
|
|
2
|
-
/* Interaction v4.0.
|
|
2
|
+
/* Interaction v4.0.4 */
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tsparticles/plugin-interactivity'), require('@tsparticles/engine')) :
|
|
5
5
|
typeof define === 'function' && define.amd ? define(['exports', '@tsparticles/plugin-interactivity', '@tsparticles/engine'], factory) :
|
|
@@ -232,7 +232,7 @@
|
|
|
232
232
|
}
|
|
233
233
|
|
|
234
234
|
async function loadLightInteraction(engine) {
|
|
235
|
-
engine.checkVersion("4.0.
|
|
235
|
+
engine.checkVersion("4.0.4");
|
|
236
236
|
await engine.pluginManager.register((e) => {
|
|
237
237
|
pluginInteractivity.ensureInteractivityPluginLoaded(e);
|
|
238
238
|
e.pluginManager.addInteractor?.("externalLight", container => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t){t.__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.bundles=t.__tsParticlesInternals.bundles||{},t.__tsParticlesInternals.effects=t.__tsParticlesInternals.effects||{},t.__tsParticlesInternals.engine=t.__tsParticlesInternals.engine||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},t.__tsParticlesInternals.palettes=t.__tsParticlesInternals.palettes||{},t.__tsParticlesInternals.paths=t.__tsParticlesInternals.paths||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins.emittersShapes=t.__tsParticlesInternals.plugins.emittersShapes||{},t.__tsParticlesInternals.presets=t.__tsParticlesInternals.presets||{},t.__tsParticlesInternals.shapes=t.__tsParticlesInternals.shapes||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.utils=t.__tsParticlesInternals.utils||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas.utils=t.__tsParticlesInternals.canvas.utils||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path.utils=t.__tsParticlesInternals.path.utils||{};var s="undefined"!=typeof Proxy?function(t){return new Proxy(t,{get:function(t,s){return s in t||(t[s]={}),t[s]}})}:function(t){return t};t.__tsParticlesInternals.bundles=s(t.__tsParticlesInternals.bundles),t.__tsParticlesInternals.effects=s(t.__tsParticlesInternals.effects),t.__tsParticlesInternals.interactions=s(t.__tsParticlesInternals.interactions),t.__tsParticlesInternals.palettes=s(t.__tsParticlesInternals.palettes),t.__tsParticlesInternals.paths=s(t.__tsParticlesInternals.paths),t.__tsParticlesInternals.plugins=s(t.__tsParticlesInternals.plugins),t.__tsParticlesInternals.plugins.emittersShapes=s(t.__tsParticlesInternals.plugins.emittersShapes),t.__tsParticlesInternals.presets=s(t.__tsParticlesInternals.presets),t.__tsParticlesInternals.shapes=s(t.__tsParticlesInternals.shapes),t.__tsParticlesInternals.updaters=s(t.__tsParticlesInternals.updaters),t.__tsParticlesInternals.utils=s(t.__tsParticlesInternals.utils),t.__tsParticlesInternals.canvas=s(t.__tsParticlesInternals.canvas),t.__tsParticlesInternals.path=s(t.__tsParticlesInternals.path),t.tsparticlesInternalExports=t.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(t,s){"object"==typeof exports&&"undefined"!=typeof module?s(exports,require("@tsparticles/plugin-interactivity"),require("@tsparticles/engine")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/plugin-interactivity","@tsparticles/engine"],s):s(((t="undefined"!=typeof globalThis?globalThis:t||self).__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},t.__tsParticlesInternals.interactions.light=t.__tsParticlesInternals.interactions.light||{}),t.__tsParticlesInternals.plugins.interactivity,t.__tsParticlesInternals.engine)}(this,function(t,s,e){"use strict";const n=1,a=0,r=Math.PI*e.half,i=Math.PI*e.quarter,l="light";class o{start;stop;constructor(){this.start=new e.OptionsColor,this.stop=new e.OptionsColor,this.start.value="#ffffff",this.stop.value="#000000"}load(t){e.isNull(t)||(this.start=e.OptionsColor.create(this.start,t.start),this.stop=e.OptionsColor.create(this.stop,t.stop))}}class c{gradient;radius;constructor(){this.gradient=new o,this.radius=1e3}load(t){e.isNull(t)||(this.gradient.load(t.gradient),void 0!==t.radius&&(this.radius=t.radius))}}class _{color;length;constructor(){this.color=new e.OptionsColor,this.color.value="#000000",this.length=2e3}load(t){e.isNull(t)||(this.color=e.OptionsColor.create(this.color,t.color),void 0!==t.length&&(this.length=t.length))}}class h{area;shadow;constructor(){this.area=new c,this.shadow=new _}load(t){e.isNull(t)||(this.area.load(t.area),this.shadow.load(t.shadow))}}class u extends s.ExternalInteractorBase{maxDistance=0;_pluginManager;constructor(t,s){super(s),this._pluginManager=t}clear(){}init(){}interact(t){const s=this.container,r=s.actualOptions,i=t;if(!r.interactivity?.events.onHover.enable||"pointermove"!==i.status)return;const l=i.mouse.position;l&&s.canvas.render.draw(t=>{!function(t,s,r){const i=t.actualOptions.interactivity?.modes.light?.area;if(!i)return;s.beginPath(),s.arc(r.x,r.y,i.radius,0,e.doublePI);const l=s.createRadialGradient(r.x,r.y,0,r.x,r.y,i.radius),o=t.canvas.mouseLight;o?.start&&o.stop&&(l.addColorStop(a,e.getStyleFromRgb(o.start,t.hdr)),l.addColorStop(n,e.getStyleFromRgb(o.stop,t.hdr)),s.fillStyle=l,s.fill())}(s,t,l)})}isEnabled(t,s){const n=this.container,a=t.mouse,r=s?.interactivity??n.actualOptions.interactivity,i=r?.events;if(!i?.onHover.enable||!a.position)return!1;const o=e.isInArray(l,i.onHover.mode);if(o&&r?.modes.light){const t=r.modes.light.area.gradient;n.canvas.mouseLight={start:e.rangeColorToRgb(this._pluginManager,t.start),stop:e.rangeColorToRgb(this._pluginManager,t.stop)}}return o}loadModeOptions(t,...s){t.light??=new h;for(const e of s)t.light.load(e?.light)}reset(){}}class p extends s.ParticlesInteractorBase{maxDistance;_pluginManager;constructor(t,s){super(s),this._pluginManager=t,this.maxDistance=0}clear(){}init(){}interact(t,s){const n=this.container,a=n.actualOptions;if(!a.interactivity?.events.onHover.enable||"pointermove"!==s.status)return;const l=s.mouse.position;l&&n.canvas.render.draw(s=>{!function(t,s,n,a){const l=n.getPosition(),o=t.actualOptions.interactivity?.modes.light?.shadow;if(!o)return;const c=n.lightShadow;if(!c)return;const _=n.getRadius(),h=n.sides,u=e.doublePI/h,p=-n.rotation+i,g=[];for(let t=0;t<h;t++)g.push({x:l.x+_*Math.sin(p+u*t)*1,y:l.y+_*Math.cos(p+u*t)*1});const d=[],I=o.length;for(const t of g){const s=Math.atan2(a.y-t.y,a.x-t.x),e={x:t.x+I*Math.sin(-s-r),y:t.y+I*Math.cos(-s-r)};d.push({end:e,start:t})}const P=e.getStyleFromRgb(c,t.hdr);for(let t=d.length-1,e=0;t>=0;e=t--){s.beginPath();const n=d[t],a=d[e];n&&a&&(s.moveTo(n.start.x,n.start.y),s.lineTo(a.start.x,a.start.y),s.lineTo(a.end.x,a.end.y),s.lineTo(n.end.x,n.end.y),s.fillStyle=P,s.fill())}}(n,s,t,l)})}isEnabled(t,s){const n=t.interactivity,a=s.mouse,r=n.events;if(!r.onHover.enable||!a.position)return!1;const i=e.isInArray(l,r.onHover.mode);if(i&&n.modes.light){const s=n.modes.light.shadow;t.lightShadow=e.rangeColorToRgb(this._pluginManager,s.color)}return i}reset(){}}async function g(t){t.checkVersion("4.0.
|
|
1
|
+
!function(t){t.__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.bundles=t.__tsParticlesInternals.bundles||{},t.__tsParticlesInternals.effects=t.__tsParticlesInternals.effects||{},t.__tsParticlesInternals.engine=t.__tsParticlesInternals.engine||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},t.__tsParticlesInternals.palettes=t.__tsParticlesInternals.palettes||{},t.__tsParticlesInternals.paths=t.__tsParticlesInternals.paths||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins.emittersShapes=t.__tsParticlesInternals.plugins.emittersShapes||{},t.__tsParticlesInternals.presets=t.__tsParticlesInternals.presets||{},t.__tsParticlesInternals.shapes=t.__tsParticlesInternals.shapes||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.utils=t.__tsParticlesInternals.utils||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas.utils=t.__tsParticlesInternals.canvas.utils||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path.utils=t.__tsParticlesInternals.path.utils||{};var s="undefined"!=typeof Proxy?function(t){return new Proxy(t,{get:function(t,s){return s in t||(t[s]={}),t[s]}})}:function(t){return t};t.__tsParticlesInternals.bundles=s(t.__tsParticlesInternals.bundles),t.__tsParticlesInternals.effects=s(t.__tsParticlesInternals.effects),t.__tsParticlesInternals.interactions=s(t.__tsParticlesInternals.interactions),t.__tsParticlesInternals.palettes=s(t.__tsParticlesInternals.palettes),t.__tsParticlesInternals.paths=s(t.__tsParticlesInternals.paths),t.__tsParticlesInternals.plugins=s(t.__tsParticlesInternals.plugins),t.__tsParticlesInternals.plugins.emittersShapes=s(t.__tsParticlesInternals.plugins.emittersShapes),t.__tsParticlesInternals.presets=s(t.__tsParticlesInternals.presets),t.__tsParticlesInternals.shapes=s(t.__tsParticlesInternals.shapes),t.__tsParticlesInternals.updaters=s(t.__tsParticlesInternals.updaters),t.__tsParticlesInternals.utils=s(t.__tsParticlesInternals.utils),t.__tsParticlesInternals.canvas=s(t.__tsParticlesInternals.canvas),t.__tsParticlesInternals.path=s(t.__tsParticlesInternals.path),t.tsparticlesInternalExports=t.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(t,s){"object"==typeof exports&&"undefined"!=typeof module?s(exports,require("@tsparticles/plugin-interactivity"),require("@tsparticles/engine")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/plugin-interactivity","@tsparticles/engine"],s):s(((t="undefined"!=typeof globalThis?globalThis:t||self).__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},t.__tsParticlesInternals.interactions.light=t.__tsParticlesInternals.interactions.light||{}),t.__tsParticlesInternals.plugins.interactivity,t.__tsParticlesInternals.engine)}(this,function(t,s,e){"use strict";const n=1,a=0,r=Math.PI*e.half,i=Math.PI*e.quarter,l="light";class o{start;stop;constructor(){this.start=new e.OptionsColor,this.stop=new e.OptionsColor,this.start.value="#ffffff",this.stop.value="#000000"}load(t){e.isNull(t)||(this.start=e.OptionsColor.create(this.start,t.start),this.stop=e.OptionsColor.create(this.stop,t.stop))}}class c{gradient;radius;constructor(){this.gradient=new o,this.radius=1e3}load(t){e.isNull(t)||(this.gradient.load(t.gradient),void 0!==t.radius&&(this.radius=t.radius))}}class _{color;length;constructor(){this.color=new e.OptionsColor,this.color.value="#000000",this.length=2e3}load(t){e.isNull(t)||(this.color=e.OptionsColor.create(this.color,t.color),void 0!==t.length&&(this.length=t.length))}}class h{area;shadow;constructor(){this.area=new c,this.shadow=new _}load(t){e.isNull(t)||(this.area.load(t.area),this.shadow.load(t.shadow))}}class u extends s.ExternalInteractorBase{maxDistance=0;_pluginManager;constructor(t,s){super(s),this._pluginManager=t}clear(){}init(){}interact(t){const s=this.container,r=s.actualOptions,i=t;if(!r.interactivity?.events.onHover.enable||"pointermove"!==i.status)return;const l=i.mouse.position;l&&s.canvas.render.draw(t=>{!function(t,s,r){const i=t.actualOptions.interactivity?.modes.light?.area;if(!i)return;s.beginPath(),s.arc(r.x,r.y,i.radius,0,e.doublePI);const l=s.createRadialGradient(r.x,r.y,0,r.x,r.y,i.radius),o=t.canvas.mouseLight;o?.start&&o.stop&&(l.addColorStop(a,e.getStyleFromRgb(o.start,t.hdr)),l.addColorStop(n,e.getStyleFromRgb(o.stop,t.hdr)),s.fillStyle=l,s.fill())}(s,t,l)})}isEnabled(t,s){const n=this.container,a=t.mouse,r=s?.interactivity??n.actualOptions.interactivity,i=r?.events;if(!i?.onHover.enable||!a.position)return!1;const o=e.isInArray(l,i.onHover.mode);if(o&&r?.modes.light){const t=r.modes.light.area.gradient;n.canvas.mouseLight={start:e.rangeColorToRgb(this._pluginManager,t.start),stop:e.rangeColorToRgb(this._pluginManager,t.stop)}}return o}loadModeOptions(t,...s){t.light??=new h;for(const e of s)t.light.load(e?.light)}reset(){}}class p extends s.ParticlesInteractorBase{maxDistance;_pluginManager;constructor(t,s){super(s),this._pluginManager=t,this.maxDistance=0}clear(){}init(){}interact(t,s){const n=this.container,a=n.actualOptions;if(!a.interactivity?.events.onHover.enable||"pointermove"!==s.status)return;const l=s.mouse.position;l&&n.canvas.render.draw(s=>{!function(t,s,n,a){const l=n.getPosition(),o=t.actualOptions.interactivity?.modes.light?.shadow;if(!o)return;const c=n.lightShadow;if(!c)return;const _=n.getRadius(),h=n.sides,u=e.doublePI/h,p=-n.rotation+i,g=[];for(let t=0;t<h;t++)g.push({x:l.x+_*Math.sin(p+u*t)*1,y:l.y+_*Math.cos(p+u*t)*1});const d=[],I=o.length;for(const t of g){const s=Math.atan2(a.y-t.y,a.x-t.x),e={x:t.x+I*Math.sin(-s-r),y:t.y+I*Math.cos(-s-r)};d.push({end:e,start:t})}const P=e.getStyleFromRgb(c,t.hdr);for(let t=d.length-1,e=0;t>=0;e=t--){s.beginPath();const n=d[t],a=d[e];n&&a&&(s.moveTo(n.start.x,n.start.y),s.lineTo(a.start.x,a.start.y),s.lineTo(a.end.x,a.end.y),s.lineTo(n.end.x,n.end.y),s.fillStyle=P,s.fill())}}(n,s,t,l)})}isEnabled(t,s){const n=t.interactivity,a=s.mouse,r=n.events;if(!r.onHover.enable||!a.position)return!1;const i=e.isInArray(l,r.onHover.mode);if(i&&n.modes.light){const s=n.modes.light.shadow;t.lightShadow=e.rangeColorToRgb(this._pluginManager,s.color)}return i}reset(){}}async function g(t){t.checkVersion("4.0.4"),await t.pluginManager.register(t=>{s.ensureInteractivityPluginLoaded(t),t.pluginManager.addInteractor?.("externalLight",s=>Promise.resolve(new u(t.pluginManager,s))),t.pluginManager.addInteractor?.("particlesLight",s=>Promise.resolve(new p(t.pluginManager,s)))})}const d=globalThis;d.__tsParticlesInternals=d.__tsParticlesInternals??{},d.loadLightInteraction=g,t.Light=h,t.LightArea=c,t.LightGradient=o,t.LightShadow=_,t.loadLightInteraction=g}),Object.assign(globalThis.window||globalThis,{loadLightInteraction:(globalThis.__tsParticlesInternals.interactions.light||{}).loadLightInteraction}),delete(globalThis.window||globalThis).tsparticlesInternalExports;
|