@tsparticles/interaction-light 4.0.0-alpha.8 → 4.0.0-beta.0
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/396.min.js +1 -0
- package/830.min.js +1 -0
- package/README.md +5 -0
- package/browser/ExternalLighter.js +2 -0
- package/browser/Options/Classes/Light.js +2 -0
- package/browser/Options/Classes/LightArea.js +2 -0
- package/browser/Options/Classes/LightGradient.js +2 -0
- package/browser/Options/Classes/LightShadow.js +2 -0
- package/browser/ParticlesLighter.js +3 -0
- package/browser/Utils.js +1 -2
- package/browser/index.js +3 -3
- package/cjs/ExternalLighter.js +2 -0
- package/cjs/Options/Classes/Light.js +2 -0
- package/cjs/Options/Classes/LightArea.js +2 -0
- package/cjs/Options/Classes/LightGradient.js +2 -0
- package/cjs/Options/Classes/LightShadow.js +2 -0
- package/cjs/ParticlesLighter.js +3 -0
- package/cjs/Utils.js +1 -2
- package/cjs/index.js +3 -3
- package/dist_browser_ExternalLighter_js.js +3 -3
- package/dist_browser_ParticlesLighter_js.js +3 -3
- package/esm/ExternalLighter.js +2 -0
- package/esm/Options/Classes/Light.js +2 -0
- package/esm/Options/Classes/LightArea.js +2 -0
- package/esm/Options/Classes/LightGradient.js +2 -0
- package/esm/Options/Classes/LightShadow.js +2 -0
- package/esm/ParticlesLighter.js +3 -0
- package/esm/Utils.js +1 -2
- package/esm/index.js +3 -3
- package/package.json +3 -3
- package/report.html +1 -1
- package/tsparticles.interaction.light.js +46 -34
- package/tsparticles.interaction.light.min.js +2 -2
- package/types/ExternalLighter.d.ts +1 -0
- package/types/ParticlesLighter.d.ts +1 -0
- package/umd/ExternalLighter.js +2 -0
- package/umd/Options/Classes/Light.js +2 -0
- package/umd/Options/Classes/LightArea.js +2 -0
- package/umd/Options/Classes/LightGradient.js +2 -0
- package/umd/Options/Classes/LightShadow.js +2 -0
- package/umd/ParticlesLighter.js +3 -0
- package/umd/Utils.js +1 -2
- package/umd/index.js +3 -3
- package/456.min.js +0 -2
- package/456.min.js.LICENSE.txt +0 -1
- package/70.min.js +0 -2
- package/70.min.js.LICENSE.txt +0 -1
- package/tsparticles.interaction.light.min.js.LICENSE.txt +0 -1
package/396.min.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(this.webpackChunk_tsparticles_interaction_light=this.webpackChunk_tsparticles_interaction_light||[]).push([[396],{396(t,e,i){i.d(e,{ExternalLighter:()=>s});var a=i(303),n=i(702),r=i(183),o=i(12);class s extends n.ExternalInteractorBase{maxDistance=0;_engine;constructor(t,e){super(t),this._engine=e}clear(){}init(){}interact(t){let e=this.container,i=e.actualOptions;if(!i.interactivity?.events.onHover.enable||"pointermove"!==t.status)return;let a=t.mouse.position;a&&e.canvas.draw(t=>{(0,r.tM)(e,t,a)})}isEnabled(t,e){let i=this.container,n=t.mouse,o=e?.interactivity??i.actualOptions.interactivity,s=o?.events;if(!(s?.onHover.enable&&n.position))return!1;let l=(0,a.isInArray)(r.EF,s.onHover.mode);if(l&&o?.modes.light){let t=o.modes.light.area.gradient;i.canvas.mouseLight={start:(0,a.rangeColorToRgb)(this._engine,t.start),stop:(0,a.rangeColorToRgb)(this._engine,t.stop)}}return l}loadModeOptions(t,...e){for(let i of(t.light??=new o.v,e))t.light.load(i?.light)}reset(){}}},183(t,e,i){i.d(e,{EF:()=>o,No:()=>l,tM:()=>s});var a=i(303);let n=Math.PI*a.half,r=Math.PI*a.quarter,o="light";function s(t,e,i){let n=t.actualOptions.interactivity?.modes.light?.area;if(!n)return;e.beginPath(),e.arc(i.x,i.y,n.radius,0,a.doublePI);let r=e.createRadialGradient(i.x,i.y,0,i.x,i.y,n.radius),o=t.canvas.mouseLight;o?.start&&o.stop&&(r.addColorStop(0,(0,a.getStyleFromRgb)(o.start,t.hdr)),r.addColorStop(1,(0,a.getStyleFromRgb)(o.stop,t.hdr)),e.fillStyle=r,e.fill())}function l(t,e,i,o){let s=i.getPosition(),l=t.actualOptions.interactivity?.modes.light?.shadow;if(!l)return;let h=i.lightShadow;if(!h)return;let d=i.getRadius(),g=i.sides,c=a.doublePI/g,u=-i.rotation+r,y=[];for(let t=0;t<g;t++)y.push({x:s.x+d*Math.sin(u+c*t)*1,y:s.y+d*Math.cos(u+c*t)*1});let p=[],f=l.length;for(let t of y){let e=Math.atan2(o.y-t.y,o.x-t.x),i={x:t.x+f*Math.sin(-e-n),y:t.y+f*Math.cos(-e-n)};p.push({end:i,start:t})}let v=(0,a.getStyleFromRgb)(h,t.hdr),x=p.length-1;for(let t=x,i=0;t>=0;i=t--){e.beginPath();let a=p[t],n=p[i];a&&n&&(e.moveTo(a.start.x,a.start.y),e.lineTo(n.start.x,n.start.y),e.lineTo(n.end.x,n.end.y),e.lineTo(a.end.x,a.end.y),e.fillStyle=v,e.fill())}}}}]);
|
package/830.min.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(this.webpackChunk_tsparticles_interaction_light=this.webpackChunk_tsparticles_interaction_light||[]).push([[830],{830(t,e,i){i.d(e,{ParticlesLighter:()=>o});var a=i(303),r=i(702),n=i(183);class o extends r.ParticlesInteractorBase{maxDistance;_engine;constructor(t,e){super(t),this._engine=e,this.maxDistance=0}clear(){}init(){}interact(t,e){let i=this.container,a=i.actualOptions;if(!a.interactivity?.events.onHover.enable||"pointermove"!==e.status)return;let r=e.mouse.position;r&&i.canvas.draw(e=>{(0,n.No)(i,e,t,r)})}isEnabled(t,e){let i=t.interactivity,r=e.mouse,o=i.events;if(!(o.onHover.enable&&r.position))return!1;let s=(0,a.isInArray)(n.EF,o.onHover.mode);if(s&&i.modes.light){let e=i.modes.light.shadow;t.lightShadow=(0,a.rangeColorToRgb)(this._engine,e.color)}return s}reset(){}}},183(t,e,i){i.d(e,{EF:()=>o,No:()=>l,tM:()=>s});var a=i(303);let r=Math.PI*a.half,n=Math.PI*a.quarter,o="light";function s(t,e,i){let r=t.actualOptions.interactivity?.modes.light?.area;if(!r)return;e.beginPath(),e.arc(i.x,i.y,r.radius,0,a.doublePI);let n=e.createRadialGradient(i.x,i.y,0,i.x,i.y,r.radius),o=t.canvas.mouseLight;o?.start&&o.stop&&(n.addColorStop(0,(0,a.getStyleFromRgb)(o.start,t.hdr)),n.addColorStop(1,(0,a.getStyleFromRgb)(o.stop,t.hdr)),e.fillStyle=n,e.fill())}function l(t,e,i,o){let s=i.getPosition(),l=t.actualOptions.interactivity?.modes.light?.shadow;if(!l)return;let h=i.lightShadow;if(!h)return;let c=i.getRadius(),d=i.sides,u=a.doublePI/d,g=-i.rotation+n,y=[];for(let t=0;t<d;t++)y.push({x:s.x+c*Math.sin(g+u*t)*1,y:s.y+c*Math.cos(g+u*t)*1});let p=[],f=l.length;for(let t of y){let e=Math.atan2(o.y-t.y,o.x-t.x),i={x:t.x+f*Math.sin(-e-r),y:t.y+f*Math.cos(-e-r)};p.push({end:i,start:t})}let x=(0,a.getStyleFromRgb)(h,t.hdr),m=p.length-1;for(let t=m,i=0;t>=0;i=t--){e.beginPath();let a=p[t],r=p[i];a&&r&&(e.moveTo(a.start.x,a.start.y),e.lineTo(r.start.x,r.start.y),e.lineTo(r.end.x,r.end.y),e.lineTo(a.end.x,a.end.y),e.fillStyle=x,e.fill())}}}}]);
|
package/README.md
CHANGED
|
@@ -26,6 +26,7 @@ Once the scripts are loaded you can set up `tsParticles` and the interaction plu
|
|
|
26
26
|
|
|
27
27
|
```javascript
|
|
28
28
|
(async () => {
|
|
29
|
+
await loadInteractivityPlugin(tsParticles);
|
|
29
30
|
await loadLightInteraction(tsParticles);
|
|
30
31
|
|
|
31
32
|
await tsParticles.load({
|
|
@@ -55,9 +56,11 @@ Then you need to import it in the app, like this:
|
|
|
55
56
|
|
|
56
57
|
```javascript
|
|
57
58
|
const { tsParticles } = require("@tsparticles/engine");
|
|
59
|
+
const { loadInteractivityPlugin } = require("@tsparticles/plugin-interactivity");
|
|
58
60
|
const { loadLightInteraction } = require("@tsparticles/interaction-light");
|
|
59
61
|
|
|
60
62
|
(async () => {
|
|
63
|
+
await loadInteractivityPlugin(tsParticles);
|
|
61
64
|
await loadLightInteraction(tsParticles);
|
|
62
65
|
})();
|
|
63
66
|
```
|
|
@@ -66,9 +69,11 @@ or
|
|
|
66
69
|
|
|
67
70
|
```javascript
|
|
68
71
|
import { tsParticles } from "@tsparticles/engine";
|
|
72
|
+
import { loadInteractivityPlugin } from "@tsparticles/plugin-interactivity";
|
|
69
73
|
import { loadLightInteraction } from "@tsparticles/interaction-light";
|
|
70
74
|
|
|
71
75
|
(async () => {
|
|
76
|
+
await loadInteractivityPlugin(tsParticles);
|
|
72
77
|
await loadLightInteraction(tsParticles);
|
|
73
78
|
})();
|
|
74
79
|
```
|
|
@@ -3,6 +3,8 @@ import { ExternalInteractorBase, } from "@tsparticles/plugin-interactivity";
|
|
|
3
3
|
import { drawLight, lightMode } from "./Utils.js";
|
|
4
4
|
import { Light } from "./Options/Classes/Light.js";
|
|
5
5
|
export class ExternalLighter extends ExternalInteractorBase {
|
|
6
|
+
maxDistance = 0;
|
|
7
|
+
_engine;
|
|
6
8
|
constructor(container, engine) {
|
|
7
9
|
super(container);
|
|
8
10
|
this._engine = engine;
|
|
@@ -2,9 +2,12 @@ import { isInArray, rangeColorToRgb } from "@tsparticles/engine";
|
|
|
2
2
|
import { ParticlesInteractorBase } from "@tsparticles/plugin-interactivity";
|
|
3
3
|
import { drawParticleShadow, lightMode } from "./Utils.js";
|
|
4
4
|
export class ParticlesLighter extends ParticlesInteractorBase {
|
|
5
|
+
maxDistance;
|
|
6
|
+
_engine;
|
|
5
7
|
constructor(container, engine) {
|
|
6
8
|
super(container);
|
|
7
9
|
this._engine = engine;
|
|
10
|
+
this.maxDistance = 0;
|
|
8
11
|
}
|
|
9
12
|
clear() {
|
|
10
13
|
}
|
package/browser/Utils.js
CHANGED
|
@@ -11,8 +11,7 @@ export function drawLight(container, context, mousePos) {
|
|
|
11
11
|
}
|
|
12
12
|
context.beginPath();
|
|
13
13
|
context.arc(mousePos.x, mousePos.y, lightOptions.radius, arcStart, doublePI);
|
|
14
|
-
const gradientAmbientLight = context.createRadialGradient(mousePos.x, mousePos.y, arcStart, mousePos.x, mousePos.y, lightOptions.radius);
|
|
15
|
-
const gradientRgb = container.canvas.mouseLight;
|
|
14
|
+
const gradientAmbientLight = context.createRadialGradient(mousePos.x, mousePos.y, arcStart, mousePos.x, mousePos.y, lightOptions.radius), gradientRgb = container.canvas.mouseLight;
|
|
16
15
|
if (!gradientRgb?.start || !gradientRgb.stop) {
|
|
17
16
|
return;
|
|
18
17
|
}
|
package/browser/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export async function loadLightInteraction(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-
|
|
2
|
+
engine.checkVersion("4.0.0-beta.0");
|
|
3
3
|
await engine.register(async (e) => {
|
|
4
|
-
const {
|
|
5
|
-
|
|
4
|
+
const { ensureInteractivityPluginLoaded } = await import("@tsparticles/plugin-interactivity");
|
|
5
|
+
ensureInteractivityPluginLoaded(e);
|
|
6
6
|
e.addInteractor?.("externalLight", async (container) => {
|
|
7
7
|
const { ExternalLighter } = await import("./ExternalLighter.js");
|
|
8
8
|
return new ExternalLighter(container, engine);
|
package/cjs/ExternalLighter.js
CHANGED
|
@@ -3,6 +3,8 @@ import { ExternalInteractorBase, } from "@tsparticles/plugin-interactivity";
|
|
|
3
3
|
import { drawLight, lightMode } from "./Utils.js";
|
|
4
4
|
import { Light } from "./Options/Classes/Light.js";
|
|
5
5
|
export class ExternalLighter extends ExternalInteractorBase {
|
|
6
|
+
maxDistance = 0;
|
|
7
|
+
_engine;
|
|
6
8
|
constructor(container, engine) {
|
|
7
9
|
super(container);
|
|
8
10
|
this._engine = engine;
|
package/cjs/ParticlesLighter.js
CHANGED
|
@@ -2,9 +2,12 @@ import { isInArray, rangeColorToRgb } from "@tsparticles/engine";
|
|
|
2
2
|
import { ParticlesInteractorBase } from "@tsparticles/plugin-interactivity";
|
|
3
3
|
import { drawParticleShadow, lightMode } from "./Utils.js";
|
|
4
4
|
export class ParticlesLighter extends ParticlesInteractorBase {
|
|
5
|
+
maxDistance;
|
|
6
|
+
_engine;
|
|
5
7
|
constructor(container, engine) {
|
|
6
8
|
super(container);
|
|
7
9
|
this._engine = engine;
|
|
10
|
+
this.maxDistance = 0;
|
|
8
11
|
}
|
|
9
12
|
clear() {
|
|
10
13
|
}
|
package/cjs/Utils.js
CHANGED
|
@@ -11,8 +11,7 @@ export function drawLight(container, context, mousePos) {
|
|
|
11
11
|
}
|
|
12
12
|
context.beginPath();
|
|
13
13
|
context.arc(mousePos.x, mousePos.y, lightOptions.radius, arcStart, doublePI);
|
|
14
|
-
const gradientAmbientLight = context.createRadialGradient(mousePos.x, mousePos.y, arcStart, mousePos.x, mousePos.y, lightOptions.radius);
|
|
15
|
-
const gradientRgb = container.canvas.mouseLight;
|
|
14
|
+
const gradientAmbientLight = context.createRadialGradient(mousePos.x, mousePos.y, arcStart, mousePos.x, mousePos.y, lightOptions.radius), gradientRgb = container.canvas.mouseLight;
|
|
16
15
|
if (!gradientRgb?.start || !gradientRgb.stop) {
|
|
17
16
|
return;
|
|
18
17
|
}
|
package/cjs/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export async function loadLightInteraction(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-
|
|
2
|
+
engine.checkVersion("4.0.0-beta.0");
|
|
3
3
|
await engine.register(async (e) => {
|
|
4
|
-
const {
|
|
5
|
-
|
|
4
|
+
const { ensureInteractivityPluginLoaded } = await import("@tsparticles/plugin-interactivity");
|
|
5
|
+
ensureInteractivityPluginLoaded(e);
|
|
6
6
|
e.addInteractor?.("externalLight", async (container) => {
|
|
7
7
|
const { ExternalLighter } = await import("./ExternalLighter.js");
|
|
8
8
|
return new ExternalLighter(container, engine);
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Demo / Generator : https://particles.js.org/
|
|
5
5
|
* GitHub : https://www.github.com/matteobruni/tsparticles
|
|
6
6
|
* How to use? : Check the GitHub README
|
|
7
|
-
* v4.0.0-
|
|
7
|
+
* v4.0.0-beta.0
|
|
8
8
|
*/
|
|
9
9
|
"use strict";
|
|
10
10
|
/*
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
\*****************************************/
|
|
24
24
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
25
25
|
|
|
26
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ExternalLighter: () => (/* binding */ ExternalLighter)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_plugin_interactivity__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @tsparticles/plugin-interactivity */ \"@tsparticles/plugin-interactivity\");\n/* harmony import */ var _Utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Utils.js */ \"./dist/browser/Utils.js\");\n/* harmony import */ var _Options_Classes_Light_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Options/Classes/Light.js */ \"./dist/browser/Options/Classes/Light.js\");\n\n\n\n\nclass ExternalLighter extends _tsparticles_plugin_interactivity__WEBPACK_IMPORTED_MODULE_1__.ExternalInteractorBase {\n
|
|
26
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ExternalLighter: () => (/* binding */ ExternalLighter)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_plugin_interactivity__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @tsparticles/plugin-interactivity */ \"@tsparticles/plugin-interactivity\");\n/* harmony import */ var _Utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Utils.js */ \"./dist/browser/Utils.js\");\n/* harmony import */ var _Options_Classes_Light_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Options/Classes/Light.js */ \"./dist/browser/Options/Classes/Light.js\");\n\n\n\n\nclass ExternalLighter extends _tsparticles_plugin_interactivity__WEBPACK_IMPORTED_MODULE_1__.ExternalInteractorBase {\n maxDistance = 0;\n _engine;\n constructor(container, engine){\n super(container);\n this._engine = engine;\n }\n clear() {}\n init() {}\n interact(interactivityData) {\n const container = this.container, options = container.actualOptions, interactivity = interactivityData;\n if (!options.interactivity?.events.onHover.enable || interactivity.status !== \"pointermove\") {\n return;\n }\n const mousePos = interactivity.mouse.position;\n if (!mousePos) {\n return;\n }\n container.canvas.draw((ctx)=>{\n (0,_Utils_js__WEBPACK_IMPORTED_MODULE_2__.drawLight)(container, ctx, mousePos);\n });\n }\n isEnabled(interactivityData, particle) {\n const container = this.container, mouse = interactivityData.mouse, interactivity = particle?.interactivity ?? container.actualOptions.interactivity, events = interactivity?.events;\n if (!(events?.onHover.enable && mouse.position)) {\n return false;\n }\n const res = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isInArray)(_Utils_js__WEBPACK_IMPORTED_MODULE_2__.lightMode, events.onHover.mode);\n if (res && interactivity?.modes.light) {\n const lightGradient = interactivity.modes.light.area.gradient;\n container.canvas.mouseLight = {\n start: (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.rangeColorToRgb)(this._engine, lightGradient.start),\n stop: (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.rangeColorToRgb)(this._engine, lightGradient.stop)\n };\n }\n return res;\n }\n loadModeOptions(options, ...sources) {\n options.light ??= new _Options_Classes_Light_js__WEBPACK_IMPORTED_MODULE_3__.Light();\n for (const source of sources){\n options.light.load(source?.light);\n }\n }\n reset() {}\n}\n\n\n//# sourceURL=webpack://@tsparticles/interaction-light/./dist/browser/ExternalLighter.js?\n}");
|
|
27
27
|
|
|
28
28
|
/***/ },
|
|
29
29
|
|
|
@@ -33,7 +33,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
33
33
|
\*******************************/
|
|
34
34
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
35
35
|
|
|
36
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ drawLight: () => (/* binding */ drawLight),\n/* harmony export */ drawParticleShadow: () => (/* binding */ drawParticleShadow),\n/* harmony export */ lightMode: () => (/* binding */ lightMode)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nconst gradientPos = {\n max: 1,\n min: 0\n
|
|
36
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ drawLight: () => (/* binding */ drawLight),\n/* harmony export */ drawParticleShadow: () => (/* binding */ drawParticleShadow),\n/* harmony export */ lightMode: () => (/* binding */ lightMode)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nconst gradientPos = {\n max: 1,\n min: 0\n}, halfPI = Math.PI * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.half, quarterPI = Math.PI * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.quarter, arcStart = 0;\nconst lightMode = \"light\";\nfunction drawLight(container, context, mousePos) {\n const lightOptions = container.actualOptions.interactivity?.modes.light?.area;\n if (!lightOptions) {\n return;\n }\n context.beginPath();\n context.arc(mousePos.x, mousePos.y, lightOptions.radius, arcStart, _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.doublePI);\n const gradientAmbientLight = context.createRadialGradient(mousePos.x, mousePos.y, arcStart, mousePos.x, mousePos.y, lightOptions.radius), gradientRgb = container.canvas.mouseLight;\n if (!gradientRgb?.start || !gradientRgb.stop) {\n return;\n }\n gradientAmbientLight.addColorStop(gradientPos.min, (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getStyleFromRgb)(gradientRgb.start, container.hdr));\n gradientAmbientLight.addColorStop(gradientPos.max, (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getStyleFromRgb)(gradientRgb.stop, container.hdr));\n context.fillStyle = gradientAmbientLight;\n context.fill();\n}\nfunction drawParticleShadow(container, context, particle, mousePos) {\n const pos = particle.getPosition(), shadowOptions = container.actualOptions.interactivity?.modes.light?.shadow;\n if (!shadowOptions) {\n return;\n }\n const shadowRgb = particle.lightShadow;\n if (!shadowRgb) {\n return;\n }\n const radius = particle.getRadius(), sides = particle.sides, full = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.doublePI / sides, angle = -particle.rotation + quarterPI, factor = 1, dots = [];\n for(let i = 0; i < sides; i++){\n dots.push({\n x: pos.x + radius * Math.sin(angle + full * i) * factor,\n y: pos.y + radius * Math.cos(angle + full * i) * factor\n });\n }\n const points = [], shadowLength = shadowOptions.length;\n for (const dot of dots){\n const dotAngle = Math.atan2(mousePos.y - dot.y, mousePos.x - dot.x), end = {\n x: dot.x + shadowLength * Math.sin(-dotAngle - halfPI),\n y: dot.y + shadowLength * Math.cos(-dotAngle - halfPI)\n };\n points.push({\n end: end,\n start: dot\n });\n }\n const shadowColor = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getStyleFromRgb)(shadowRgb, container.hdr), lastOffset = 1, firstPos = 0, last = points.length - lastOffset;\n for(let i = last, n = 0; i >= firstPos; n = i--){\n context.beginPath();\n const iPoint = points[i], nPoint = points[n];\n if (!iPoint || !nPoint) {\n continue;\n }\n context.moveTo(iPoint.start.x, iPoint.start.y);\n context.lineTo(nPoint.start.x, nPoint.start.y);\n context.lineTo(nPoint.end.x, nPoint.end.y);\n context.lineTo(iPoint.end.x, iPoint.end.y);\n context.fillStyle = shadowColor;\n context.fill();\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/interaction-light/./dist/browser/Utils.js?\n}");
|
|
37
37
|
|
|
38
38
|
/***/ }
|
|
39
39
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Demo / Generator : https://particles.js.org/
|
|
5
5
|
* GitHub : https://www.github.com/matteobruni/tsparticles
|
|
6
6
|
* How to use? : Check the GitHub README
|
|
7
|
-
* v4.0.0-
|
|
7
|
+
* v4.0.0-beta.0
|
|
8
8
|
*/
|
|
9
9
|
"use strict";
|
|
10
10
|
/*
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
\******************************************/
|
|
24
24
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
25
25
|
|
|
26
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ParticlesLighter: () => (/* binding */ ParticlesLighter)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_plugin_interactivity__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @tsparticles/plugin-interactivity */ \"@tsparticles/plugin-interactivity\");\n/* harmony import */ var _Utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Utils.js */ \"./dist/browser/Utils.js\");\n\n\n\nclass ParticlesLighter extends _tsparticles_plugin_interactivity__WEBPACK_IMPORTED_MODULE_1__.ParticlesInteractorBase {\n
|
|
26
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ParticlesLighter: () => (/* binding */ ParticlesLighter)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_plugin_interactivity__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @tsparticles/plugin-interactivity */ \"@tsparticles/plugin-interactivity\");\n/* harmony import */ var _Utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Utils.js */ \"./dist/browser/Utils.js\");\n\n\n\nclass ParticlesLighter extends _tsparticles_plugin_interactivity__WEBPACK_IMPORTED_MODULE_1__.ParticlesInteractorBase {\n maxDistance;\n _engine;\n constructor(container, engine){\n super(container);\n this._engine = engine;\n this.maxDistance = 0;\n }\n clear() {}\n init() {}\n interact(particle, interactivityData) {\n const container = this.container, options = container.actualOptions;\n if (!options.interactivity?.events.onHover.enable || interactivityData.status !== \"pointermove\") {\n return;\n }\n const mousePos = interactivityData.mouse.position;\n if (!mousePos) {\n return;\n }\n container.canvas.draw((ctx)=>{\n (0,_Utils_js__WEBPACK_IMPORTED_MODULE_2__.drawParticleShadow)(container, ctx, particle, mousePos);\n });\n }\n isEnabled(particle, interactivityData) {\n const interactivity = particle.interactivity, mouse = interactivityData.mouse, events = interactivity.events;\n if (!(events.onHover.enable && mouse.position)) {\n return false;\n }\n const res = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isInArray)(_Utils_js__WEBPACK_IMPORTED_MODULE_2__.lightMode, events.onHover.mode);\n if (res && interactivity.modes.light) {\n const shadowOptions = interactivity.modes.light.shadow;\n particle.lightShadow = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.rangeColorToRgb)(this._engine, shadowOptions.color);\n }\n return res;\n }\n reset() {}\n}\n\n\n//# sourceURL=webpack://@tsparticles/interaction-light/./dist/browser/ParticlesLighter.js?\n}");
|
|
27
27
|
|
|
28
28
|
/***/ },
|
|
29
29
|
|
|
@@ -33,7 +33,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
33
33
|
\*******************************/
|
|
34
34
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
35
35
|
|
|
36
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ drawLight: () => (/* binding */ drawLight),\n/* harmony export */ drawParticleShadow: () => (/* binding */ drawParticleShadow),\n/* harmony export */ lightMode: () => (/* binding */ lightMode)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nconst gradientPos = {\n max: 1,\n min: 0\n
|
|
36
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ drawLight: () => (/* binding */ drawLight),\n/* harmony export */ drawParticleShadow: () => (/* binding */ drawParticleShadow),\n/* harmony export */ lightMode: () => (/* binding */ lightMode)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nconst gradientPos = {\n max: 1,\n min: 0\n}, halfPI = Math.PI * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.half, quarterPI = Math.PI * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.quarter, arcStart = 0;\nconst lightMode = \"light\";\nfunction drawLight(container, context, mousePos) {\n const lightOptions = container.actualOptions.interactivity?.modes.light?.area;\n if (!lightOptions) {\n return;\n }\n context.beginPath();\n context.arc(mousePos.x, mousePos.y, lightOptions.radius, arcStart, _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.doublePI);\n const gradientAmbientLight = context.createRadialGradient(mousePos.x, mousePos.y, arcStart, mousePos.x, mousePos.y, lightOptions.radius), gradientRgb = container.canvas.mouseLight;\n if (!gradientRgb?.start || !gradientRgb.stop) {\n return;\n }\n gradientAmbientLight.addColorStop(gradientPos.min, (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getStyleFromRgb)(gradientRgb.start, container.hdr));\n gradientAmbientLight.addColorStop(gradientPos.max, (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getStyleFromRgb)(gradientRgb.stop, container.hdr));\n context.fillStyle = gradientAmbientLight;\n context.fill();\n}\nfunction drawParticleShadow(container, context, particle, mousePos) {\n const pos = particle.getPosition(), shadowOptions = container.actualOptions.interactivity?.modes.light?.shadow;\n if (!shadowOptions) {\n return;\n }\n const shadowRgb = particle.lightShadow;\n if (!shadowRgb) {\n return;\n }\n const radius = particle.getRadius(), sides = particle.sides, full = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.doublePI / sides, angle = -particle.rotation + quarterPI, factor = 1, dots = [];\n for(let i = 0; i < sides; i++){\n dots.push({\n x: pos.x + radius * Math.sin(angle + full * i) * factor,\n y: pos.y + radius * Math.cos(angle + full * i) * factor\n });\n }\n const points = [], shadowLength = shadowOptions.length;\n for (const dot of dots){\n const dotAngle = Math.atan2(mousePos.y - dot.y, mousePos.x - dot.x), end = {\n x: dot.x + shadowLength * Math.sin(-dotAngle - halfPI),\n y: dot.y + shadowLength * Math.cos(-dotAngle - halfPI)\n };\n points.push({\n end: end,\n start: dot\n });\n }\n const shadowColor = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getStyleFromRgb)(shadowRgb, container.hdr), lastOffset = 1, firstPos = 0, last = points.length - lastOffset;\n for(let i = last, n = 0; i >= firstPos; n = i--){\n context.beginPath();\n const iPoint = points[i], nPoint = points[n];\n if (!iPoint || !nPoint) {\n continue;\n }\n context.moveTo(iPoint.start.x, iPoint.start.y);\n context.lineTo(nPoint.start.x, nPoint.start.y);\n context.lineTo(nPoint.end.x, nPoint.end.y);\n context.lineTo(iPoint.end.x, iPoint.end.y);\n context.fillStyle = shadowColor;\n context.fill();\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/interaction-light/./dist/browser/Utils.js?\n}");
|
|
37
37
|
|
|
38
38
|
/***/ }
|
|
39
39
|
|
package/esm/ExternalLighter.js
CHANGED
|
@@ -3,6 +3,8 @@ import { ExternalInteractorBase, } from "@tsparticles/plugin-interactivity";
|
|
|
3
3
|
import { drawLight, lightMode } from "./Utils.js";
|
|
4
4
|
import { Light } from "./Options/Classes/Light.js";
|
|
5
5
|
export class ExternalLighter extends ExternalInteractorBase {
|
|
6
|
+
maxDistance = 0;
|
|
7
|
+
_engine;
|
|
6
8
|
constructor(container, engine) {
|
|
7
9
|
super(container);
|
|
8
10
|
this._engine = engine;
|
package/esm/ParticlesLighter.js
CHANGED
|
@@ -2,9 +2,12 @@ import { isInArray, rangeColorToRgb } from "@tsparticles/engine";
|
|
|
2
2
|
import { ParticlesInteractorBase } from "@tsparticles/plugin-interactivity";
|
|
3
3
|
import { drawParticleShadow, lightMode } from "./Utils.js";
|
|
4
4
|
export class ParticlesLighter extends ParticlesInteractorBase {
|
|
5
|
+
maxDistance;
|
|
6
|
+
_engine;
|
|
5
7
|
constructor(container, engine) {
|
|
6
8
|
super(container);
|
|
7
9
|
this._engine = engine;
|
|
10
|
+
this.maxDistance = 0;
|
|
8
11
|
}
|
|
9
12
|
clear() {
|
|
10
13
|
}
|
package/esm/Utils.js
CHANGED
|
@@ -11,8 +11,7 @@ export function drawLight(container, context, mousePos) {
|
|
|
11
11
|
}
|
|
12
12
|
context.beginPath();
|
|
13
13
|
context.arc(mousePos.x, mousePos.y, lightOptions.radius, arcStart, doublePI);
|
|
14
|
-
const gradientAmbientLight = context.createRadialGradient(mousePos.x, mousePos.y, arcStart, mousePos.x, mousePos.y, lightOptions.radius);
|
|
15
|
-
const gradientRgb = container.canvas.mouseLight;
|
|
14
|
+
const gradientAmbientLight = context.createRadialGradient(mousePos.x, mousePos.y, arcStart, mousePos.x, mousePos.y, lightOptions.radius), gradientRgb = container.canvas.mouseLight;
|
|
16
15
|
if (!gradientRgb?.start || !gradientRgb.stop) {
|
|
17
16
|
return;
|
|
18
17
|
}
|
package/esm/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export async function loadLightInteraction(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-
|
|
2
|
+
engine.checkVersion("4.0.0-beta.0");
|
|
3
3
|
await engine.register(async (e) => {
|
|
4
|
-
const {
|
|
5
|
-
|
|
4
|
+
const { ensureInteractivityPluginLoaded } = await import("@tsparticles/plugin-interactivity");
|
|
5
|
+
ensureInteractivityPluginLoaded(e);
|
|
6
6
|
e.addInteractor?.("externalLight", async (container) => {
|
|
7
7
|
const { ExternalLighter } = await import("./ExternalLighter.js");
|
|
8
8
|
return new ExternalLighter(container, engine);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/interaction-light",
|
|
3
|
-
"version": "4.0.0-
|
|
3
|
+
"version": "4.0.0-beta.0",
|
|
4
4
|
"description": "tsParticles Light interaction",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -101,8 +101,8 @@
|
|
|
101
101
|
"./package.json": "./package.json"
|
|
102
102
|
},
|
|
103
103
|
"dependencies": {
|
|
104
|
-
"@tsparticles/engine": "4.0.0-
|
|
105
|
-
"@tsparticles/plugin-interactivity": "4.0.0-
|
|
104
|
+
"@tsparticles/engine": "4.0.0-beta.0",
|
|
105
|
+
"@tsparticles/plugin-interactivity": "4.0.0-beta.0"
|
|
106
106
|
},
|
|
107
107
|
"publishConfig": {
|
|
108
108
|
"access": "public"
|
package/report.html
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8"/>
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
6
|
-
<title>@tsparticles/interaction-light [
|
|
6
|
+
<title>@tsparticles/interaction-light [19 Mar 2026 at 14:01]</title>
|
|
7
7
|
<link rel="shortcut icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAABrVBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+O1foceMD///+J0/qK1Pr7/v8Xdr/9///W8P4UdL7L7P0Scr2r4Pyj3vwad8D5/f/2/f+55f3E6f34+/2H0/ojfMKpzOd0rNgQcb3F3O/j9f7c8v6g3Pz0/P/w+v/q+P7n9v6T1/uQ1vuE0vqLut/y+v+Z2fvt+f+15Pzv9fuc2/vR7v2V2Pvd6/bg9P7I6/285/2y4/yp3/zp8vk8i8kqgMT7/P31+fyv4vxGkcz6/P6/6P3j7vfS5PNnpNUxhcbO7f7F6v3O4vHK3/DA2u631Ouy0eqXweKJud5wqthfoNMMbLvY8f73+v2dxeR8sNtTmdDx9/zX6PSjyeaCtd1YnNGX2PuQveCGt95Nls42h8dLlM3F4vBtAAAAM3RSTlMAAyOx0/sKBvik8opWGBMOAe3l1snDm2E9LSb06eHcu5JpHbarfHZCN9CBb08zzkdNS0kYaptYAAAFV0lEQVRYw92X51/aYBDHHS2O2qqttVbrqNq9m+TJIAYIShBkWwqIiCgoWvfeq7Z2/s29hyQNyUcR7LveGwVyXy6XH8/9rqxglLfUPLxVduUor3h0rfp2TYvpivk37929TkG037hffoX0+peVtZQc1589rigVUdXS/ABSAyEmGIO/1XfvldSK8vs3OqB6u3m0nxmIrvgB0dj7rr7Y9IbuF68hnfFaiHA/sxqm0wciIG43P60qKv9WXWc1RXGh/mFESFABTSBi0sNAKzqet17eCtOb3kZIDwxEEU0oAIJGYxNBDhBND29e0rtXXbcpuPmED9IhEAAQ/AXEaF8EPmnrrKsv0LvWR3fg5sWDNAFZOgAgaKvZDogHNU9MFwnnYROkc56RD5CjAbQX9Ow4g7upCsvYu55aSI/Nj0H1akgKQEUM94dwK65hYRmFU9MIcH/fqJYOZYcnuJSU/waKDgTOEVaVKhwrTRP5XzgSpAITYzom7UvkhFX5VutmxeNnWDjjswTKTyfgluNDGbUpWissXhF3s7mlSml+czWkg3D0l1nNjGNjz3myOQOa1KM/jOS6ebdbAVTCi4gljHSFrviza7tOgRWcS0MOUX9zdNgag5w7rRqA44Lzw0hr1WqES36dFliSJFlh2rXIae3FFcDDgKdxrUIDePr8jGcSClV1u7A9xeN0ModY/pHMxmR1EzRh8TJiwqsHmKW0l4FCEZI+jHio+JdPPE9qwQtTRxku2D8sIeRL2LnxWSllANCQGOIiqVHAz2ye2JR0DcH+HoxDkaADLjgxjKQ+AwCX/g0+DNgdG0ukYCONAe+dbc2IAc6fwt1ARoDSezNHxV2Cmzwv3O6lDMV55edBGwGK9n1+x2F8EDfAGCxug8MhpsMEcTEAWf3rx2vZhe/LAmtIn/6apE6PN0ULKgywD9mmdxbmFl3OvD5AS5fW5zLbv/YHmcsBTjf/afDz3MaZTVCfAP9z6/Bw6ycv8EUBWJIn9zYcoAWWlW9+OzO3vkTy8H+RANLmdrpOuYWdZYEXpo+TlCJrW5EARb7fF+bWdqf3hhyZI1nWJQHgznErZhbjoEsWqi8dQNoE294aldzFurwSABL2XXMf9+H1VQGke9exw5P/AnA5Pv5ngMul7LOvO922iwACu8WkCwLCafvM4CeWPxfA8lNHcWZSoi8EwMAIciKX2Z4SWCMAa3snCZ/G4EA8D6CMLNFsGQhkkz/gQNEBbPCbWsxGUpYVu3z8IyNAknwJkfPMEhLyrdi5RTyUVACkw4GSFRNWJNEW+fgPGwHD8/JxnRuLabN4CGNRkAE23na2+VmEAUmrYymSGjMAYqH84YUIyzgzs3XC7gNgH36Vcc4zKY9o9fgPBXUAiHHwVboBHGLiX6Zcjp1f2wu4tvzZKo0ecPnDtQYDQvJXaBeNzce45Fp28ZQLrEZVuFqgBwOalArKXnW1UzlnSusQKJqKYNuz4tOnI6sZG4zanpemv+7ySU2jbA9h6uhcgpfy6G2PahirDZ6zvq6zDduMVFTKvzw8wgyEdelwY9in3XkEPs3osJuwRQ4qTkfzifndg9Gfc4pdsu82+tTnHZTBa2EAMrqr2t43pguc8tNm7JQVQ2S0ukj2d22dhXYP0/veWtwKrCkNoNimAN5+Xr/oLrxswKbVJjteWrX7eR63o4j9q0GxnaBdWgGA5VStpanIjQmEhV0/nVt5VOFUvix6awJhPcAaTEShgrG+iGyvb5a0Ndb1YGHFPEwoqAinoaykaID1o1pdPNu7XsnCKQ3R+hwWIIhGvORcJUBYXe3Xa3vq/mF/N9V13ugufMkfXn+KHsRD0B8AAAAASUVORK5CYII=" type="image/x-icon" />
|
|
8
8
|
|
|
9
9
|
<script>
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Demo / Generator : https://particles.js.org/
|
|
5
5
|
* GitHub : https://www.github.com/matteobruni/tsparticles
|
|
6
6
|
* How to use? : Check the GitHub README
|
|
7
|
-
* v4.0.0-
|
|
7
|
+
* v4.0.0-beta.0
|
|
8
8
|
*/
|
|
9
9
|
/*
|
|
10
10
|
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
@@ -28,13 +28,33 @@ return /******/ (() => { // webpackBootstrap
|
|
|
28
28
|
/******/ "use strict";
|
|
29
29
|
/******/ var __webpack_modules__ = ({
|
|
30
30
|
|
|
31
|
+
/***/ "@tsparticles/engine"
|
|
32
|
+
/*!*********************************************************************************************************************************!*\
|
|
33
|
+
!*** external {"commonjs":"@tsparticles/engine","commonjs2":"@tsparticles/engine","amd":"@tsparticles/engine","root":"window"} ***!
|
|
34
|
+
\*********************************************************************************************************************************/
|
|
35
|
+
(module) {
|
|
36
|
+
|
|
37
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
|
|
38
|
+
|
|
39
|
+
/***/ },
|
|
40
|
+
|
|
41
|
+
/***/ "@tsparticles/plugin-interactivity"
|
|
42
|
+
/*!***************************************************************************************************************************************************************************!*\
|
|
43
|
+
!*** external {"commonjs":"@tsparticles/plugin-interactivity","commonjs2":"@tsparticles/plugin-interactivity","amd":"@tsparticles/plugin-interactivity","root":"window"} ***!
|
|
44
|
+
\***************************************************************************************************************************************************************************/
|
|
45
|
+
(module) {
|
|
46
|
+
|
|
47
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_interactivity__;
|
|
48
|
+
|
|
49
|
+
/***/ },
|
|
50
|
+
|
|
31
51
|
/***/ "./dist/browser/Options/Classes/Light.js"
|
|
32
52
|
/*!***********************************************!*\
|
|
33
53
|
!*** ./dist/browser/Options/Classes/Light.js ***!
|
|
34
54
|
\***********************************************/
|
|
35
55
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
36
56
|
|
|
37
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Light: () => (/* binding */ Light)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _LightArea_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./LightArea.js */ \"./dist/browser/Options/Classes/LightArea.js\");\n/* harmony import */ var _LightShadow_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./LightShadow.js */ \"./dist/browser/Options/Classes/LightShadow.js\");\n\n\n\nclass Light {\n
|
|
57
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Light: () => (/* binding */ Light)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _LightArea_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./LightArea.js */ \"./dist/browser/Options/Classes/LightArea.js\");\n/* harmony import */ var _LightShadow_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./LightShadow.js */ \"./dist/browser/Options/Classes/LightShadow.js\");\n\n\n\nclass Light {\n area;\n shadow;\n constructor(){\n this.area = new _LightArea_js__WEBPACK_IMPORTED_MODULE_1__.LightArea();\n this.shadow = new _LightShadow_js__WEBPACK_IMPORTED_MODULE_2__.LightShadow();\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n this.area.load(data.area);\n this.shadow.load(data.shadow);\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/interaction-light/./dist/browser/Options/Classes/Light.js?\n}");
|
|
38
58
|
|
|
39
59
|
/***/ },
|
|
40
60
|
|
|
@@ -44,7 +64,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
44
64
|
\***************************************************/
|
|
45
65
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
46
66
|
|
|
47
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ LightArea: () => (/* binding */ LightArea)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _LightGradient_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./LightGradient.js */ \"./dist/browser/Options/Classes/LightGradient.js\");\n\n\nclass LightArea {\n
|
|
67
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ LightArea: () => (/* binding */ LightArea)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _LightGradient_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./LightGradient.js */ \"./dist/browser/Options/Classes/LightGradient.js\");\n\n\nclass LightArea {\n gradient;\n radius;\n constructor(){\n this.gradient = new _LightGradient_js__WEBPACK_IMPORTED_MODULE_1__.LightGradient();\n this.radius = 1000;\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n this.gradient.load(data.gradient);\n if (data.radius !== undefined) {\n this.radius = data.radius;\n }\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/interaction-light/./dist/browser/Options/Classes/LightArea.js?\n}");
|
|
48
68
|
|
|
49
69
|
/***/ },
|
|
50
70
|
|
|
@@ -54,7 +74,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
54
74
|
\*******************************************************/
|
|
55
75
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
56
76
|
|
|
57
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ LightGradient: () => (/* binding */ LightGradient)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nclass LightGradient {\n
|
|
77
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ LightGradient: () => (/* binding */ LightGradient)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nclass LightGradient {\n start;\n stop;\n constructor(){\n this.start = new _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OptionsColor();\n this.stop = new _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OptionsColor();\n this.start.value = \"#ffffff\";\n this.stop.value = \"#000000\";\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n this.start = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OptionsColor.create(this.start, data.start);\n this.stop = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OptionsColor.create(this.stop, data.stop);\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/interaction-light/./dist/browser/Options/Classes/LightGradient.js?\n}");
|
|
58
78
|
|
|
59
79
|
/***/ },
|
|
60
80
|
|
|
@@ -64,7 +84,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
64
84
|
\*****************************************************/
|
|
65
85
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
66
86
|
|
|
67
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ LightShadow: () => (/* binding */ LightShadow)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nclass LightShadow {\n
|
|
87
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ LightShadow: () => (/* binding */ LightShadow)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nclass LightShadow {\n color;\n length;\n constructor(){\n this.color = new _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OptionsColor();\n this.color.value = \"#000000\";\n this.length = 2000;\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n this.color = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OptionsColor.create(this.color, data.color);\n if (data.length !== undefined) {\n this.length = data.length;\n }\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/interaction-light/./dist/browser/Options/Classes/LightShadow.js?\n}");
|
|
68
88
|
|
|
69
89
|
/***/ },
|
|
70
90
|
|
|
@@ -74,27 +94,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
74
94
|
\*******************************/
|
|
75
95
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
76
96
|
|
|
77
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Light: () => (/* reexport safe */ _Options_Classes_Light_js__WEBPACK_IMPORTED_MODULE_0__.Light),\n/* harmony export */ LightArea: () => (/* reexport safe */ _Options_Classes_LightArea_js__WEBPACK_IMPORTED_MODULE_1__.LightArea),\n/* harmony export */ LightGradient: () => (/* reexport safe */ _Options_Classes_LightGradient_js__WEBPACK_IMPORTED_MODULE_2__.LightGradient),\n/* harmony export */ LightShadow: () => (/* reexport safe */ _Options_Classes_LightShadow_js__WEBPACK_IMPORTED_MODULE_3__.LightShadow),\n/* harmony export */ loadLightInteraction: () => (/* binding */ loadLightInteraction)\n/* harmony export */ });\n/* harmony import */ var _Options_Classes_Light_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Options/Classes/Light.js */ \"./dist/browser/Options/Classes/Light.js\");\n/* harmony import */ var _Options_Classes_LightArea_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Options/Classes/LightArea.js */ \"./dist/browser/Options/Classes/LightArea.js\");\n/* harmony import */ var _Options_Classes_LightGradient_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Options/Classes/LightGradient.js */ \"./dist/browser/Options/Classes/LightGradient.js\");\n/* harmony import */ var _Options_Classes_LightShadow_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Options/Classes/LightShadow.js */ \"./dist/browser/Options/Classes/LightShadow.js\");\nasync function loadLightInteraction(engine) {\n
|
|
78
|
-
|
|
79
|
-
/***/ },
|
|
80
|
-
|
|
81
|
-
/***/ "@tsparticles/engine"
|
|
82
|
-
/*!*********************************************************************************************************************************!*\
|
|
83
|
-
!*** external {"commonjs":"@tsparticles/engine","commonjs2":"@tsparticles/engine","amd":"@tsparticles/engine","root":"window"} ***!
|
|
84
|
-
\*********************************************************************************************************************************/
|
|
85
|
-
(module) {
|
|
86
|
-
|
|
87
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
|
|
88
|
-
|
|
89
|
-
/***/ },
|
|
90
|
-
|
|
91
|
-
/***/ "@tsparticles/plugin-interactivity"
|
|
92
|
-
/*!***************************************************************************************************************************************************************************!*\
|
|
93
|
-
!*** external {"commonjs":"@tsparticles/plugin-interactivity","commonjs2":"@tsparticles/plugin-interactivity","amd":"@tsparticles/plugin-interactivity","root":"window"} ***!
|
|
94
|
-
\***************************************************************************************************************************************************************************/
|
|
95
|
-
(module) {
|
|
96
|
-
|
|
97
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_interactivity__;
|
|
97
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Light: () => (/* reexport safe */ _Options_Classes_Light_js__WEBPACK_IMPORTED_MODULE_0__.Light),\n/* harmony export */ LightArea: () => (/* reexport safe */ _Options_Classes_LightArea_js__WEBPACK_IMPORTED_MODULE_1__.LightArea),\n/* harmony export */ LightGradient: () => (/* reexport safe */ _Options_Classes_LightGradient_js__WEBPACK_IMPORTED_MODULE_2__.LightGradient),\n/* harmony export */ LightShadow: () => (/* reexport safe */ _Options_Classes_LightShadow_js__WEBPACK_IMPORTED_MODULE_3__.LightShadow),\n/* harmony export */ loadLightInteraction: () => (/* binding */ loadLightInteraction)\n/* harmony export */ });\n/* harmony import */ var _Options_Classes_Light_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Options/Classes/Light.js */ \"./dist/browser/Options/Classes/Light.js\");\n/* harmony import */ var _Options_Classes_LightArea_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Options/Classes/LightArea.js */ \"./dist/browser/Options/Classes/LightArea.js\");\n/* harmony import */ var _Options_Classes_LightGradient_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Options/Classes/LightGradient.js */ \"./dist/browser/Options/Classes/LightGradient.js\");\n/* harmony import */ var _Options_Classes_LightShadow_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Options/Classes/LightShadow.js */ \"./dist/browser/Options/Classes/LightShadow.js\");\nasync function loadLightInteraction(engine) {\n engine.checkVersion(\"4.0.0-beta.0\");\n await engine.register(async (e)=>{\n const { ensureInteractivityPluginLoaded } = await Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! @tsparticles/plugin-interactivity */ \"@tsparticles/plugin-interactivity\", 19));\n ensureInteractivityPluginLoaded(e);\n e.addInteractor?.(\"externalLight\", async (container)=>{\n const { ExternalLighter } = await __webpack_require__.e(/*! import() */ \"dist_browser_ExternalLighter_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./ExternalLighter.js */ \"./dist/browser/ExternalLighter.js\"));\n return new ExternalLighter(container, engine);\n });\n e.addInteractor?.(\"particlesLight\", async (container)=>{\n const { ParticlesLighter } = await __webpack_require__.e(/*! import() */ \"dist_browser_ParticlesLighter_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./ParticlesLighter.js */ \"./dist/browser/ParticlesLighter.js\"));\n return new ParticlesLighter(container, engine);\n });\n });\n}\n\n\n\n\n\n\n//# sourceURL=webpack://@tsparticles/interaction-light/./dist/browser/index.js?\n}");
|
|
98
98
|
|
|
99
99
|
/***/ }
|
|
100
100
|
|
|
@@ -110,12 +110,6 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_interactivity__;
|
|
|
110
110
|
/******/ if (cachedModule !== undefined) {
|
|
111
111
|
/******/ return cachedModule.exports;
|
|
112
112
|
/******/ }
|
|
113
|
-
/******/ // Check if module exists (development only)
|
|
114
|
-
/******/ if (__webpack_modules__[moduleId] === undefined) {
|
|
115
|
-
/******/ var e = new Error("Cannot find module '" + moduleId + "'");
|
|
116
|
-
/******/ e.code = 'MODULE_NOT_FOUND';
|
|
117
|
-
/******/ throw e;
|
|
118
|
-
/******/ }
|
|
119
113
|
/******/ // Create a new module (and put it into the cache)
|
|
120
114
|
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
121
115
|
/******/ // no module.id needed
|
|
@@ -124,6 +118,12 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_interactivity__;
|
|
|
124
118
|
/******/ };
|
|
125
119
|
/******/
|
|
126
120
|
/******/ // Execute the module function
|
|
121
|
+
/******/ if (!(moduleId in __webpack_modules__)) {
|
|
122
|
+
/******/ delete __webpack_module_cache__[moduleId];
|
|
123
|
+
/******/ var e = new Error("Cannot find module '" + moduleId + "'");
|
|
124
|
+
/******/ e.code = 'MODULE_NOT_FOUND';
|
|
125
|
+
/******/ throw e;
|
|
126
|
+
/******/ }
|
|
127
127
|
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
128
128
|
/******/
|
|
129
129
|
/******/ // Return the exports of the module
|
|
@@ -198,6 +198,18 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_interactivity__;
|
|
|
198
198
|
/******/ };
|
|
199
199
|
/******/ })();
|
|
200
200
|
/******/
|
|
201
|
+
/******/ /* webpack/runtime/global */
|
|
202
|
+
/******/ (() => {
|
|
203
|
+
/******/ __webpack_require__.g = (function() {
|
|
204
|
+
/******/ if (typeof globalThis === 'object') return globalThis;
|
|
205
|
+
/******/ try {
|
|
206
|
+
/******/ return this || new Function('return this')();
|
|
207
|
+
/******/ } catch (e) {
|
|
208
|
+
/******/ if (typeof window === 'object') return window;
|
|
209
|
+
/******/ }
|
|
210
|
+
/******/ })();
|
|
211
|
+
/******/ })();
|
|
212
|
+
/******/
|
|
201
213
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
202
214
|
/******/ (() => {
|
|
203
215
|
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
@@ -262,8 +274,8 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_interactivity__;
|
|
|
262
274
|
/******/ /* webpack/runtime/publicPath */
|
|
263
275
|
/******/ (() => {
|
|
264
276
|
/******/ var scriptUrl;
|
|
265
|
-
/******/ if (
|
|
266
|
-
/******/ var document =
|
|
277
|
+
/******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + "";
|
|
278
|
+
/******/ var document = __webpack_require__.g.document;
|
|
267
279
|
/******/ if (!scriptUrl && document) {
|
|
268
280
|
/******/ if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')
|
|
269
281
|
/******/ scriptUrl = document.currentScript.src;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("@tsparticles/engine"),require("@tsparticles/plugin-interactivity"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine","@tsparticles/plugin-interactivity"],e);else{var r="object"==typeof exports?e(require("@tsparticles/engine"),require("@tsparticles/plugin-interactivity")):e(t.window,t.window);for(var o in r)("object"==typeof exports?exports:t)[o]=r[o]}}(this,(t,e)=>(()=>{"use strict";var r,o,i,a={303(e){e.exports=t},702(t){t.exports=e},12(t,e,r){r.d(e,{v:()=>n});var o=r(303),i=r(613),a=r(124);class n{area;shadow;constructor(){this.area=new i.O,this.shadow=new a.X}load(t){(0,o.isNull)(t)||(this.area.load(t.area),this.shadow.load(t.shadow))}}},613(t,e,r){r.d(e,{O:()=>a});var o=r(303),i=r(488);class a{gradient;radius;constructor(){this.gradient=new i.V,this.radius=1e3}load(t){(0,o.isNull)(t)||(this.gradient.load(t.gradient),void 0!==t.radius&&(this.radius=t.radius))}}},488(t,e,r){r.d(e,{V:()=>i});var o=r(303);class i{start;stop;constructor(){this.start=new o.OptionsColor,this.stop=new o.OptionsColor,this.start.value="#ffffff",this.stop.value="#000000"}load(t){(0,o.isNull)(t)||(this.start=o.OptionsColor.create(this.start,t.start),this.stop=o.OptionsColor.create(this.stop,t.stop))}}},124(t,e,r){r.d(e,{X:()=>i});var o=r(303);class i{color;length;constructor(){this.color=new o.OptionsColor,this.color.value="#000000",this.length=2e3}load(t){(0,o.isNull)(t)||(this.color=o.OptionsColor.create(this.color,t.color),void 0!==t.length&&(this.length=t.length))}}}},n={};function s(t){var e=n[t];if(void 0!==e)return e.exports;var r=n[t]={exports:{}};return a[t](r,r.exports,s),r.exports}s.m=a,c=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__,s.t=function(t,e){if(1&e&&(t=this(t)),8&e||"object"==typeof t&&t&&(4&e&&t.__esModule||16&e&&"function"==typeof t.then))return t;var r=Object.create(null);s.r(r);var o={};l=l||[null,c({}),c([]),c(c)];for(var i=2&e&&t;("object"==typeof i||"function"==typeof i)&&!~l.indexOf(i);i=c(i))Object.getOwnPropertyNames(i).forEach(e=>o[e]=()=>t[e]);return o.default=()=>t,s.d(r,o),r},s.d=(t,e)=>{for(var r in e)s.o(e,r)&&!s.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},s.f={},s.e=t=>Promise.all(Object.keys(s.f).reduce((e,r)=>(s.f[r](t,e),e),[])),s.u=t=>""+t+".min.js",s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(t){if("object"==typeof window)return window}}(),s.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),p={},s.l=(t,e,r,o)=>{if(p[t])return void p[t].push(e);if(void 0!==r)for(var i,a,n=document.getElementsByTagName("script"),l=0;l<n.length;l++){var c=n[l];if(c.getAttribute("src")==t||c.getAttribute("data-webpack")=="@tsparticles/interaction-light:"+r){i=c;break}}i||(a=!0,(i=document.createElement("script")).charset="utf-8",s.nc&&i.setAttribute("nonce",s.nc),i.setAttribute("data-webpack","@tsparticles/interaction-light:"+r),i.src=t),p[t]=[e];var u=(e,r)=>{i.onerror=i.onload=null,clearTimeout(d);var o=p[t];if(delete p[t],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach(t=>t(r)),e)return e(r)},d=setTimeout(u.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=u.bind(null,i.onerror),i.onload=u.bind(null,i.onload),a&&document.head.appendChild(i)},s.r=t=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.g.importScripts&&(u=s.g.location+"");var l,c,p,u,d=s.g.document;if(!u&&d&&(d.currentScript&&"SCRIPT"===d.currentScript.tagName.toUpperCase()&&(u=d.currentScript.src),!u)){var h=d.getElementsByTagName("script");if(h.length)for(var f=h.length-1;f>-1&&(!u||!/^http(s?):/.test(u));)u=h[f--].src}if(!u)throw Error("Automatic publicPath is not supported in this browser");s.p=u=u.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r={595:0},s.f.j=(t,e)=>{var o=s.o(r,t)?r[t]:void 0;if(0!==o)if(o)e.push(o[2]);else{var i=new Promise((e,i)=>o=r[t]=[e,i]);e.push(o[2]=i);var a=s.p+s.u(t),n=Error();s.l(a,e=>{if(s.o(r,t)&&(0!==(o=r[t])&&(r[t]=void 0),o)){var i=e&&("load"===e.type?"missing":e.type),a=e&&e.target&&e.target.src;n.message="Loading chunk "+t+` failed.
|
|
2
|
+
(`+i+": "+a+")",n.name="ChunkLoadError",n.type=i,n.request=a,o[1](n)}},"chunk-"+t,t)}},o=(t,e)=>{var o,i,[a,n,l]=e,c=0;if(a.some(t=>0!==r[t])){for(o in n)s.o(n,o)&&(s.m[o]=n[o]);l&&l(s)}for(t&&t(e);c<a.length;c++)i=a[c],s.o(r,i)&&r[i]&&r[i][0](),r[i]=0},(i=this.webpackChunk_tsparticles_interaction_light=this.webpackChunk_tsparticles_interaction_light||[]).forEach(o.bind(null,0)),i.push=o.bind(null,i.push.bind(i));var g={};s.r(g),s.d(g,{Light:()=>v.v,LightArea:()=>b.O,LightGradient:()=>y.V,LightShadow:()=>m.X,loadLightInteraction:()=>w});var v=s(12),b=s(613),y=s(488),m=s(124);async function w(t){t.checkVersion("4.0.0-beta.0"),await t.register(async e=>{let{ensureInteractivityPluginLoaded:r}=await Promise.resolve().then(s.t.bind(s,702,19));r(e),e.addInteractor?.("externalLight",async e=>{let{ExternalLighter:r}=await s.e(396).then(s.bind(s,396));return new r(e,t)}),e.addInteractor?.("particlesLight",async e=>{let{ParticlesLighter:r}=await s.e(830).then(s.bind(s,830));return new r(e,t)})})}return g})());
|
|
@@ -2,6 +2,7 @@ import { type Engine, type RecursivePartial } from "@tsparticles/engine";
|
|
|
2
2
|
import { ExternalInteractorBase, type IInteractivityData, type IModes, type Modes } from "@tsparticles/plugin-interactivity";
|
|
3
3
|
import type { ILightMode, LightContainer, LightMode, LightParticle } from "./Types.js";
|
|
4
4
|
export declare class ExternalLighter extends ExternalInteractorBase<LightContainer> {
|
|
5
|
+
readonly maxDistance = 0;
|
|
5
6
|
private readonly _engine;
|
|
6
7
|
constructor(container: LightContainer, engine: Engine);
|
|
7
8
|
clear(): void;
|
|
@@ -2,6 +2,7 @@ import { type Engine } from "@tsparticles/engine";
|
|
|
2
2
|
import { type IInteractivityData, ParticlesInteractorBase } from "@tsparticles/plugin-interactivity";
|
|
3
3
|
import type { LightContainer, LightParticle } from "./Types.js";
|
|
4
4
|
export declare class ParticlesLighter extends ParticlesInteractorBase<LightContainer> {
|
|
5
|
+
readonly maxDistance: number;
|
|
5
6
|
private readonly _engine;
|
|
6
7
|
constructor(container: LightContainer, engine: Engine);
|
|
7
8
|
clear(): void;
|
package/umd/ExternalLighter.js
CHANGED
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
const Utils_js_1 = require("./Utils.js");
|
|
16
16
|
const Light_js_1 = require("./Options/Classes/Light.js");
|
|
17
17
|
class ExternalLighter extends plugin_interactivity_1.ExternalInteractorBase {
|
|
18
|
+
maxDistance = 0;
|
|
19
|
+
_engine;
|
|
18
20
|
constructor(container, engine) {
|
|
19
21
|
super(container);
|
|
20
22
|
this._engine = engine;
|
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
const LightArea_js_1 = require("./LightArea.js");
|
|
15
15
|
const LightShadow_js_1 = require("./LightShadow.js");
|
|
16
16
|
class Light {
|
|
17
|
+
area;
|
|
18
|
+
shadow;
|
|
17
19
|
constructor() {
|
|
18
20
|
this.area = new LightArea_js_1.LightArea();
|
|
19
21
|
this.shadow = new LightShadow_js_1.LightShadow();
|
package/umd/ParticlesLighter.js
CHANGED
|
@@ -14,9 +14,12 @@
|
|
|
14
14
|
const plugin_interactivity_1 = require("@tsparticles/plugin-interactivity");
|
|
15
15
|
const Utils_js_1 = require("./Utils.js");
|
|
16
16
|
class ParticlesLighter extends plugin_interactivity_1.ParticlesInteractorBase {
|
|
17
|
+
maxDistance;
|
|
18
|
+
_engine;
|
|
17
19
|
constructor(container, engine) {
|
|
18
20
|
super(container);
|
|
19
21
|
this._engine = engine;
|
|
22
|
+
this.maxDistance = 0;
|
|
20
23
|
}
|
|
21
24
|
clear() {
|
|
22
25
|
}
|
package/umd/Utils.js
CHANGED
|
@@ -25,8 +25,7 @@
|
|
|
25
25
|
}
|
|
26
26
|
context.beginPath();
|
|
27
27
|
context.arc(mousePos.x, mousePos.y, lightOptions.radius, arcStart, engine_1.doublePI);
|
|
28
|
-
const gradientAmbientLight = context.createRadialGradient(mousePos.x, mousePos.y, arcStart, mousePos.x, mousePos.y, lightOptions.radius);
|
|
29
|
-
const gradientRgb = container.canvas.mouseLight;
|
|
28
|
+
const gradientAmbientLight = context.createRadialGradient(mousePos.x, mousePos.y, arcStart, mousePos.x, mousePos.y, lightOptions.radius), gradientRgb = container.canvas.mouseLight;
|
|
30
29
|
if (!gradientRgb?.start || !gradientRgb.stop) {
|
|
31
30
|
return;
|
|
32
31
|
}
|
package/umd/index.js
CHANGED
|
@@ -48,10 +48,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
48
48
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
49
49
|
exports.loadLightInteraction = loadLightInteraction;
|
|
50
50
|
async function loadLightInteraction(engine) {
|
|
51
|
-
engine.checkVersion("4.0.0-
|
|
51
|
+
engine.checkVersion("4.0.0-beta.0");
|
|
52
52
|
await engine.register(async (e) => {
|
|
53
|
-
const {
|
|
54
|
-
|
|
53
|
+
const { ensureInteractivityPluginLoaded } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("@tsparticles/plugin-interactivity"))) : new Promise((resolve_1, reject_1) => { require(["@tsparticles/plugin-interactivity"], resolve_1, reject_1); }).then(__importStar));
|
|
54
|
+
ensureInteractivityPluginLoaded(e);
|
|
55
55
|
e.addInteractor?.("externalLight", async (container) => {
|
|
56
56
|
const { ExternalLighter } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./ExternalLighter.js"))) : new Promise((resolve_2, reject_2) => { require(["./ExternalLighter.js"], resolve_2, reject_2); }).then(__importStar));
|
|
57
57
|
return new ExternalLighter(container, engine);
|
package/456.min.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see 456.min.js.LICENSE.txt */
|
|
2
|
-
(this.webpackChunk_tsparticles_interaction_light=this.webpackChunk_tsparticles_interaction_light||[]).push([[456],{413(t,e,o){o.d(e,{EF:()=>l,No:()=>h,tM:()=>c});var n=o(303);const i=1,s=0,a=Math.PI*n.half,r=Math.PI*n.quarter,l="light";function c(t,e,o){const a=t.actualOptions.interactivity?.modes.light?.area;if(!a)return;e.beginPath(),e.arc(o.x,o.y,a.radius,0,n.doublePI);const r=e.createRadialGradient(o.x,o.y,0,o.x,o.y,a.radius),l=t.canvas.mouseLight;l?.start&&l.stop&&(r.addColorStop(s,(0,n.getStyleFromRgb)(l.start,t.hdr)),r.addColorStop(i,(0,n.getStyleFromRgb)(l.stop,t.hdr)),e.fillStyle=r,e.fill())}function h(t,e,o,i){const s=o.getPosition(),l=t.actualOptions.interactivity?.modes.light?.shadow;if(!l)return;const c=o.lightShadow;if(!c)return;const h=o.getRadius(),d=o.sides,u=n.doublePI/d,g=-o.rotation+r,y=[];for(let t=0;t<d;t++)y.push({x:s.x+h*Math.sin(g+u*t)*1,y:s.y+h*Math.cos(g+u*t)*1});const p=[],f=l.length;for(const t of y){const e=Math.atan2(i.y-t.y,i.x-t.x),o={x:t.x+f*Math.sin(-e-a),y:t.y+f*Math.cos(-e-a)};p.push({end:o,start:t})}const v=(0,n.getStyleFromRgb)(c,t.hdr);for(let t=p.length-1,o=0;t>=0;o=t--){e.beginPath();const n=p[t],i=p[o];n&&i&&(e.moveTo(n.start.x,n.start.y),e.lineTo(i.start.x,i.start.y),e.lineTo(i.end.x,i.end.y),e.lineTo(n.end.x,n.end.y),e.fillStyle=v,e.fill())}}},456(t,e,o){o.d(e,{ParticlesLighter:()=>a});var n=o(303),i=o(702),s=o(413);class a extends i.ParticlesInteractorBase{constructor(t,e){super(t),this._engine=e}clear(){}init(){}interact(t,e){const o=this.container,n=o.actualOptions;if(!n.interactivity?.events.onHover.enable||"pointermove"!==e.status)return;const i=e.mouse.position;i&&o.canvas.draw((e=>{(0,s.No)(o,e,t,i)}))}isEnabled(t,e){const o=t.interactivity,i=e.mouse,a=o.events;if(!a.onHover.enable||!i.position)return!1;const r=(0,n.isInArray)(s.EF,a.onHover.mode);if(r&&o.modes.light){const e=o.modes.light.shadow;t.lightShadow=(0,n.rangeColorToRgb)(this._engine,e.color)}return r}reset(){}}}}]);
|
package/456.min.js.LICENSE.txt
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! tsParticles Light Interaction v4.0.0-alpha.8 by Matteo Bruni */
|
package/70.min.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see 70.min.js.LICENSE.txt */
|
|
2
|
-
(this.webpackChunk_tsparticles_interaction_light=this.webpackChunk_tsparticles_interaction_light||[]).push([[70],{70(t,e,n){n.d(e,{ExternalLighter:()=>r});var o=n(303),i=n(702),a=n(413),s=n(994);class r extends i.ExternalInteractorBase{constructor(t,e){super(t),this._engine=e}clear(){}init(){}interact(t){const e=this.container,n=e.actualOptions,o=t;if(!n.interactivity?.events.onHover.enable||"pointermove"!==o.status)return;const i=o.mouse.position;i&&e.canvas.draw((t=>{(0,a.tM)(e,t,i)}))}isEnabled(t,e){const n=this.container,i=t.mouse,s=e?.interactivity??n.actualOptions.interactivity,r=s?.events;if(!r?.onHover.enable||!i.position)return!1;const l=(0,o.isInArray)(a.EF,r.onHover.mode);if(l&&s?.modes.light){const t=s.modes.light.area.gradient;n.canvas.mouseLight={start:(0,o.rangeColorToRgb)(this._engine,t.start),stop:(0,o.rangeColorToRgb)(this._engine,t.stop)}}return l}loadModeOptions(t,...e){t.light??=new s.v;for(const n of e)t.light.load(n?.light)}reset(){}}},413(t,e,n){n.d(e,{EF:()=>l,No:()=>h,tM:()=>c});var o=n(303);const i=1,a=0,s=Math.PI*o.half,r=Math.PI*o.quarter,l="light";function c(t,e,n){const s=t.actualOptions.interactivity?.modes.light?.area;if(!s)return;e.beginPath(),e.arc(n.x,n.y,s.radius,0,o.doublePI);const r=e.createRadialGradient(n.x,n.y,0,n.x,n.y,s.radius),l=t.canvas.mouseLight;l?.start&&l.stop&&(r.addColorStop(a,(0,o.getStyleFromRgb)(l.start,t.hdr)),r.addColorStop(i,(0,o.getStyleFromRgb)(l.stop,t.hdr)),e.fillStyle=r,e.fill())}function h(t,e,n,i){const a=n.getPosition(),l=t.actualOptions.interactivity?.modes.light?.shadow;if(!l)return;const c=n.lightShadow;if(!c)return;const h=n.getRadius(),d=n.sides,g=o.doublePI/d,u=-n.rotation+r,y=[];for(let t=0;t<d;t++)y.push({x:a.x+h*Math.sin(u+g*t)*1,y:a.y+h*Math.cos(u+g*t)*1});const p=[],f=l.length;for(const t of y){const e=Math.atan2(i.y-t.y,i.x-t.x),n={x:t.x+f*Math.sin(-e-s),y:t.y+f*Math.cos(-e-s)};p.push({end:n,start:t})}const v=(0,o.getStyleFromRgb)(c,t.hdr);for(let t=p.length-1,n=0;t>=0;n=t--){e.beginPath();const o=p[t],i=p[n];o&&i&&(e.moveTo(o.start.x,o.start.y),e.lineTo(i.start.x,i.start.y),e.lineTo(i.end.x,i.end.y),e.lineTo(o.end.x,o.end.y),e.fillStyle=v,e.fill())}}}}]);
|
package/70.min.js.LICENSE.txt
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! tsParticles Light Interaction v4.0.0-alpha.8 by Matteo Bruni */
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! tsParticles Light Interaction v4.0.0-alpha.8 by Matteo Bruni */
|