@tsparticles/interaction-light 4.0.0-beta.0 → 4.0.0-beta.2
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/386.min.js +1 -0
- package/456.min.js +1 -0
- package/browser/ExternalLighter.js +7 -7
- package/browser/ParticlesLighter.js +6 -6
- package/browser/Utils.js +1 -1
- package/browser/index.js +7 -6
- package/cjs/ExternalLighter.js +7 -7
- package/cjs/ParticlesLighter.js +6 -6
- package/cjs/Utils.js +1 -1
- package/cjs/index.js +7 -6
- package/dist_browser_ExternalLighter_js.js +2 -2
- package/dist_browser_ParticlesLighter_js.js +2 -2
- package/esm/ExternalLighter.js +7 -7
- package/esm/ParticlesLighter.js +6 -6
- package/esm/Utils.js +1 -1
- package/esm/index.js +7 -6
- package/package.json +5 -6
- package/report.html +84 -29
- package/tsparticles.interaction.light.js +2 -2
- package/tsparticles.interaction.light.min.js +2 -2
- package/types/ExternalLighter.d.ts +3 -3
- package/types/ParticlesLighter.d.ts +3 -3
- package/types/Utils.d.ts +3 -3
- package/396.min.js +0 -1
- package/830.min.js +0 -1
- package/umd/ExternalLighter.js +0 -66
- package/umd/Options/Classes/Light.js +0 -32
- package/umd/Options/Classes/LightArea.js +0 -33
- package/umd/Options/Classes/LightGradient.js +0 -32
- package/umd/Options/Classes/LightOptions.js +0 -12
- package/umd/Options/Classes/LightShadow.js +0 -33
- package/umd/Options/Interfaces/ILight.js +0 -12
- package/umd/Options/Interfaces/ILightArea.js +0 -12
- package/umd/Options/Interfaces/ILightGradient.js +0 -12
- package/umd/Options/Interfaces/ILightShadow.js +0 -12
- package/umd/ParticlesLighter.js +0 -57
- package/umd/Types.js +0 -12
- package/umd/Utils.js +0 -79
- package/umd/index.js +0 -69
|
@@ -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-beta.
|
|
7
|
+
* v4.0.0-beta.2
|
|
8
8
|
*/
|
|
9
9
|
/*
|
|
10
10
|
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
@@ -94,7 +94,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
94
94
|
\*******************************/
|
|
95
95
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
96
96
|
|
|
97
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Light: () => (/* reexport safe */
|
|
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_1__.Light),\n/* harmony export */ LightArea: () => (/* reexport safe */ _Options_Classes_LightArea_js__WEBPACK_IMPORTED_MODULE_2__.LightArea),\n/* harmony export */ LightGradient: () => (/* reexport safe */ _Options_Classes_LightGradient_js__WEBPACK_IMPORTED_MODULE_3__.LightGradient),\n/* harmony export */ LightShadow: () => (/* reexport safe */ _Options_Classes_LightShadow_js__WEBPACK_IMPORTED_MODULE_4__.LightShadow),\n/* harmony export */ loadLightInteraction: () => (/* binding */ loadLightInteraction)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _Options_Classes_Light_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Options/Classes/Light.js */ \"./dist/browser/Options/Classes/Light.js\");\n/* harmony import */ var _Options_Classes_LightArea_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Options/Classes/LightArea.js */ \"./dist/browser/Options/Classes/LightArea.js\");\n/* harmony import */ var _Options_Classes_LightGradient_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Options/Classes/LightGradient.js */ \"./dist/browser/Options/Classes/LightGradient.js\");\n/* harmony import */ var _Options_Classes_LightShadow_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Options/Classes/LightShadow.js */ \"./dist/browser/Options/Classes/LightShadow.js\");\n\nasync function loadLightInteraction(engine) {\n engine.checkVersion(\"4.0.0-beta.2\");\n await engine.pluginManager.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.pluginManager.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(e.pluginManager, container);\n });\n e.pluginManager.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(e.pluginManager, container);\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
|
|
|
@@ -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},
|
|
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(
|
|
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},336(t,e,r){r.d(e,{v:()=>n});var o=r(303),i=r(297),a=r(955);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))}}},297(t,e,r){r.d(e,{O:()=>a});var o=r(303),i=r(100);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))}}},100(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))}}},955(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}),s(303);var v=s(336),b=s(297),y=s(100),m=s(955);async function w(t){t.checkVersion("4.0.0-beta.2"),await t.pluginManager.register(async t=>{let{ensureInteractivityPluginLoaded:e}=await Promise.resolve().then(s.t.bind(s,702,19));e(t),t.pluginManager.addInteractor?.("externalLight",async e=>{let{ExternalLighter:r}=await s.e(456).then(s.bind(s,456));return new r(t.pluginManager,e)}),t.pluginManager.addInteractor?.("particlesLight",async e=>{let{ParticlesLighter:r}=await s.e(386).then(s.bind(s,386));return new r(t.pluginManager,e)})})}return g})());
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { type Engine, type RecursivePartial } from "@tsparticles/engine";
|
|
2
1
|
import { ExternalInteractorBase, type IInteractivityData, type IModes, type Modes } from "@tsparticles/plugin-interactivity";
|
|
3
2
|
import type { ILightMode, LightContainer, LightMode, LightParticle } from "./Types.js";
|
|
3
|
+
import { type PluginManager, type RecursivePartial } from "@tsparticles/engine";
|
|
4
4
|
export declare class ExternalLighter extends ExternalInteractorBase<LightContainer> {
|
|
5
5
|
readonly maxDistance = 0;
|
|
6
|
-
private readonly
|
|
7
|
-
constructor(
|
|
6
|
+
private readonly _pluginManager;
|
|
7
|
+
constructor(pluginManager: PluginManager, container: LightContainer);
|
|
8
8
|
clear(): void;
|
|
9
9
|
init(): void;
|
|
10
10
|
interact(interactivityData: IInteractivityData): void;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { type Engine } from "@tsparticles/engine";
|
|
2
1
|
import { type IInteractivityData, ParticlesInteractorBase } from "@tsparticles/plugin-interactivity";
|
|
3
2
|
import type { LightContainer, LightParticle } from "./Types.js";
|
|
3
|
+
import { type PluginManager } from "@tsparticles/engine";
|
|
4
4
|
export declare class ParticlesLighter extends ParticlesInteractorBase<LightContainer> {
|
|
5
5
|
readonly maxDistance: number;
|
|
6
|
-
private readonly
|
|
7
|
-
constructor(
|
|
6
|
+
private readonly _pluginManager;
|
|
7
|
+
constructor(pluginManager: PluginManager, container: LightContainer);
|
|
8
8
|
clear(): void;
|
|
9
9
|
init(): void;
|
|
10
10
|
interact(particle: LightParticle, interactivityData: IInteractivityData): void;
|
package/types/Utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type ICoordinates } from "@tsparticles/engine";
|
|
1
|
+
import { type CanvasContextType, type ICoordinates } from "@tsparticles/engine";
|
|
2
2
|
import type { LightContainer, LightParticle } from "./Types.js";
|
|
3
3
|
export declare const lightMode = "light";
|
|
4
|
-
export declare function drawLight(container: LightContainer, context:
|
|
5
|
-
export declare function drawParticleShadow(container: LightContainer, context:
|
|
4
|
+
export declare function drawLight(container: LightContainer, context: CanvasContextType, mousePos: ICoordinates): void;
|
|
5
|
+
export declare function drawParticleShadow(container: LightContainer, context: CanvasContextType, particle: LightParticle, mousePos: ICoordinates): void;
|
package/396.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
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
DELETED
|
@@ -1 +0,0 @@
|
|
|
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/umd/ExternalLighter.js
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
(function (factory) {
|
|
2
|
-
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
|
-
var v = factory(require, exports);
|
|
4
|
-
if (v !== undefined) module.exports = v;
|
|
5
|
-
}
|
|
6
|
-
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "@tsparticles/engine", "@tsparticles/plugin-interactivity", "./Utils.js", "./Options/Classes/Light.js"], factory);
|
|
8
|
-
}
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.ExternalLighter = void 0;
|
|
13
|
-
const engine_1 = require("@tsparticles/engine");
|
|
14
|
-
const plugin_interactivity_1 = require("@tsparticles/plugin-interactivity");
|
|
15
|
-
const Utils_js_1 = require("./Utils.js");
|
|
16
|
-
const Light_js_1 = require("./Options/Classes/Light.js");
|
|
17
|
-
class ExternalLighter extends plugin_interactivity_1.ExternalInteractorBase {
|
|
18
|
-
maxDistance = 0;
|
|
19
|
-
_engine;
|
|
20
|
-
constructor(container, engine) {
|
|
21
|
-
super(container);
|
|
22
|
-
this._engine = engine;
|
|
23
|
-
}
|
|
24
|
-
clear() {
|
|
25
|
-
}
|
|
26
|
-
init() {
|
|
27
|
-
}
|
|
28
|
-
interact(interactivityData) {
|
|
29
|
-
const container = this.container, options = container.actualOptions, interactivity = interactivityData;
|
|
30
|
-
if (!options.interactivity?.events.onHover.enable || interactivity.status !== "pointermove") {
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
const mousePos = interactivity.mouse.position;
|
|
34
|
-
if (!mousePos) {
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
container.canvas.draw(ctx => {
|
|
38
|
-
(0, Utils_js_1.drawLight)(container, ctx, mousePos);
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
isEnabled(interactivityData, particle) {
|
|
42
|
-
const container = this.container, mouse = interactivityData.mouse, interactivity = particle?.interactivity ?? container.actualOptions.interactivity, events = interactivity?.events;
|
|
43
|
-
if (!(events?.onHover.enable && mouse.position)) {
|
|
44
|
-
return false;
|
|
45
|
-
}
|
|
46
|
-
const res = (0, engine_1.isInArray)(Utils_js_1.lightMode, events.onHover.mode);
|
|
47
|
-
if (res && interactivity?.modes.light) {
|
|
48
|
-
const lightGradient = interactivity.modes.light.area.gradient;
|
|
49
|
-
container.canvas.mouseLight = {
|
|
50
|
-
start: (0, engine_1.rangeColorToRgb)(this._engine, lightGradient.start),
|
|
51
|
-
stop: (0, engine_1.rangeColorToRgb)(this._engine, lightGradient.stop),
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
return res;
|
|
55
|
-
}
|
|
56
|
-
loadModeOptions(options, ...sources) {
|
|
57
|
-
options.light ??= new Light_js_1.Light();
|
|
58
|
-
for (const source of sources) {
|
|
59
|
-
options.light.load(source?.light);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
reset() {
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
exports.ExternalLighter = ExternalLighter;
|
|
66
|
-
});
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
(function (factory) {
|
|
2
|
-
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
|
-
var v = factory(require, exports);
|
|
4
|
-
if (v !== undefined) module.exports = v;
|
|
5
|
-
}
|
|
6
|
-
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "@tsparticles/engine", "./LightArea.js", "./LightShadow.js"], factory);
|
|
8
|
-
}
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.Light = void 0;
|
|
13
|
-
const engine_1 = require("@tsparticles/engine");
|
|
14
|
-
const LightArea_js_1 = require("./LightArea.js");
|
|
15
|
-
const LightShadow_js_1 = require("./LightShadow.js");
|
|
16
|
-
class Light {
|
|
17
|
-
area;
|
|
18
|
-
shadow;
|
|
19
|
-
constructor() {
|
|
20
|
-
this.area = new LightArea_js_1.LightArea();
|
|
21
|
-
this.shadow = new LightShadow_js_1.LightShadow();
|
|
22
|
-
}
|
|
23
|
-
load(data) {
|
|
24
|
-
if ((0, engine_1.isNull)(data)) {
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
this.area.load(data.area);
|
|
28
|
-
this.shadow.load(data.shadow);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
exports.Light = Light;
|
|
32
|
-
});
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
(function (factory) {
|
|
2
|
-
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
|
-
var v = factory(require, exports);
|
|
4
|
-
if (v !== undefined) module.exports = v;
|
|
5
|
-
}
|
|
6
|
-
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "@tsparticles/engine", "./LightGradient.js"], factory);
|
|
8
|
-
}
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.LightArea = void 0;
|
|
13
|
-
const engine_1 = require("@tsparticles/engine");
|
|
14
|
-
const LightGradient_js_1 = require("./LightGradient.js");
|
|
15
|
-
class LightArea {
|
|
16
|
-
gradient;
|
|
17
|
-
radius;
|
|
18
|
-
constructor() {
|
|
19
|
-
this.gradient = new LightGradient_js_1.LightGradient();
|
|
20
|
-
this.radius = 1000;
|
|
21
|
-
}
|
|
22
|
-
load(data) {
|
|
23
|
-
if ((0, engine_1.isNull)(data)) {
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
this.gradient.load(data.gradient);
|
|
27
|
-
if (data.radius !== undefined) {
|
|
28
|
-
this.radius = data.radius;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
exports.LightArea = LightArea;
|
|
33
|
-
});
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
(function (factory) {
|
|
2
|
-
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
|
-
var v = factory(require, exports);
|
|
4
|
-
if (v !== undefined) module.exports = v;
|
|
5
|
-
}
|
|
6
|
-
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "@tsparticles/engine"], factory);
|
|
8
|
-
}
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.LightGradient = void 0;
|
|
13
|
-
const engine_1 = require("@tsparticles/engine");
|
|
14
|
-
class LightGradient {
|
|
15
|
-
start;
|
|
16
|
-
stop;
|
|
17
|
-
constructor() {
|
|
18
|
-
this.start = new engine_1.OptionsColor();
|
|
19
|
-
this.stop = new engine_1.OptionsColor();
|
|
20
|
-
this.start.value = "#ffffff";
|
|
21
|
-
this.stop.value = "#000000";
|
|
22
|
-
}
|
|
23
|
-
load(data) {
|
|
24
|
-
if ((0, engine_1.isNull)(data)) {
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
this.start = engine_1.OptionsColor.create(this.start, data.start);
|
|
28
|
-
this.stop = engine_1.OptionsColor.create(this.stop, data.stop);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
exports.LightGradient = LightGradient;
|
|
32
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
(function (factory) {
|
|
2
|
-
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
|
-
var v = factory(require, exports);
|
|
4
|
-
if (v !== undefined) module.exports = v;
|
|
5
|
-
}
|
|
6
|
-
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports"], factory);
|
|
8
|
-
}
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
});
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
(function (factory) {
|
|
2
|
-
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
|
-
var v = factory(require, exports);
|
|
4
|
-
if (v !== undefined) module.exports = v;
|
|
5
|
-
}
|
|
6
|
-
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "@tsparticles/engine"], factory);
|
|
8
|
-
}
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.LightShadow = void 0;
|
|
13
|
-
const engine_1 = require("@tsparticles/engine");
|
|
14
|
-
class LightShadow {
|
|
15
|
-
color;
|
|
16
|
-
length;
|
|
17
|
-
constructor() {
|
|
18
|
-
this.color = new engine_1.OptionsColor();
|
|
19
|
-
this.color.value = "#000000";
|
|
20
|
-
this.length = 2000;
|
|
21
|
-
}
|
|
22
|
-
load(data) {
|
|
23
|
-
if ((0, engine_1.isNull)(data)) {
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
this.color = engine_1.OptionsColor.create(this.color, data.color);
|
|
27
|
-
if (data.length !== undefined) {
|
|
28
|
-
this.length = data.length;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
exports.LightShadow = LightShadow;
|
|
33
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
(function (factory) {
|
|
2
|
-
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
|
-
var v = factory(require, exports);
|
|
4
|
-
if (v !== undefined) module.exports = v;
|
|
5
|
-
}
|
|
6
|
-
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports"], factory);
|
|
8
|
-
}
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
(function (factory) {
|
|
2
|
-
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
|
-
var v = factory(require, exports);
|
|
4
|
-
if (v !== undefined) module.exports = v;
|
|
5
|
-
}
|
|
6
|
-
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports"], factory);
|
|
8
|
-
}
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
(function (factory) {
|
|
2
|
-
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
|
-
var v = factory(require, exports);
|
|
4
|
-
if (v !== undefined) module.exports = v;
|
|
5
|
-
}
|
|
6
|
-
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports"], factory);
|
|
8
|
-
}
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
(function (factory) {
|
|
2
|
-
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
|
-
var v = factory(require, exports);
|
|
4
|
-
if (v !== undefined) module.exports = v;
|
|
5
|
-
}
|
|
6
|
-
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports"], factory);
|
|
8
|
-
}
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
});
|
package/umd/ParticlesLighter.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
(function (factory) {
|
|
2
|
-
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
|
-
var v = factory(require, exports);
|
|
4
|
-
if (v !== undefined) module.exports = v;
|
|
5
|
-
}
|
|
6
|
-
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "@tsparticles/engine", "@tsparticles/plugin-interactivity", "./Utils.js"], factory);
|
|
8
|
-
}
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.ParticlesLighter = void 0;
|
|
13
|
-
const engine_1 = require("@tsparticles/engine");
|
|
14
|
-
const plugin_interactivity_1 = require("@tsparticles/plugin-interactivity");
|
|
15
|
-
const Utils_js_1 = require("./Utils.js");
|
|
16
|
-
class ParticlesLighter extends plugin_interactivity_1.ParticlesInteractorBase {
|
|
17
|
-
maxDistance;
|
|
18
|
-
_engine;
|
|
19
|
-
constructor(container, engine) {
|
|
20
|
-
super(container);
|
|
21
|
-
this._engine = engine;
|
|
22
|
-
this.maxDistance = 0;
|
|
23
|
-
}
|
|
24
|
-
clear() {
|
|
25
|
-
}
|
|
26
|
-
init() {
|
|
27
|
-
}
|
|
28
|
-
interact(particle, interactivityData) {
|
|
29
|
-
const container = this.container, options = container.actualOptions;
|
|
30
|
-
if (!options.interactivity?.events.onHover.enable || interactivityData.status !== "pointermove") {
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
const mousePos = interactivityData.mouse.position;
|
|
34
|
-
if (!mousePos) {
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
container.canvas.draw(ctx => {
|
|
38
|
-
(0, Utils_js_1.drawParticleShadow)(container, ctx, particle, mousePos);
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
isEnabled(particle, interactivityData) {
|
|
42
|
-
const interactivity = particle.interactivity, mouse = interactivityData.mouse, events = interactivity.events;
|
|
43
|
-
if (!(events.onHover.enable && mouse.position)) {
|
|
44
|
-
return false;
|
|
45
|
-
}
|
|
46
|
-
const res = (0, engine_1.isInArray)(Utils_js_1.lightMode, events.onHover.mode);
|
|
47
|
-
if (res && interactivity.modes.light) {
|
|
48
|
-
const shadowOptions = interactivity.modes.light.shadow;
|
|
49
|
-
particle.lightShadow = (0, engine_1.rangeColorToRgb)(this._engine, shadowOptions.color);
|
|
50
|
-
}
|
|
51
|
-
return res;
|
|
52
|
-
}
|
|
53
|
-
reset() {
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
exports.ParticlesLighter = ParticlesLighter;
|
|
57
|
-
});
|
package/umd/Types.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
(function (factory) {
|
|
2
|
-
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
|
-
var v = factory(require, exports);
|
|
4
|
-
if (v !== undefined) module.exports = v;
|
|
5
|
-
}
|
|
6
|
-
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports"], factory);
|
|
8
|
-
}
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
});
|
package/umd/Utils.js
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
(function (factory) {
|
|
2
|
-
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
|
-
var v = factory(require, exports);
|
|
4
|
-
if (v !== undefined) module.exports = v;
|
|
5
|
-
}
|
|
6
|
-
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "@tsparticles/engine"], factory);
|
|
8
|
-
}
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.lightMode = void 0;
|
|
13
|
-
exports.drawLight = drawLight;
|
|
14
|
-
exports.drawParticleShadow = drawParticleShadow;
|
|
15
|
-
const engine_1 = require("@tsparticles/engine");
|
|
16
|
-
const gradientPos = {
|
|
17
|
-
max: 1,
|
|
18
|
-
min: 0,
|
|
19
|
-
}, halfPI = Math.PI * engine_1.half, quarterPI = Math.PI * engine_1.quarter, arcStart = 0;
|
|
20
|
-
exports.lightMode = "light";
|
|
21
|
-
function drawLight(container, context, mousePos) {
|
|
22
|
-
const lightOptions = container.actualOptions.interactivity?.modes.light?.area;
|
|
23
|
-
if (!lightOptions) {
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
context.beginPath();
|
|
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), gradientRgb = container.canvas.mouseLight;
|
|
29
|
-
if (!gradientRgb?.start || !gradientRgb.stop) {
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
gradientAmbientLight.addColorStop(gradientPos.min, (0, engine_1.getStyleFromRgb)(gradientRgb.start, container.hdr));
|
|
33
|
-
gradientAmbientLight.addColorStop(gradientPos.max, (0, engine_1.getStyleFromRgb)(gradientRgb.stop, container.hdr));
|
|
34
|
-
context.fillStyle = gradientAmbientLight;
|
|
35
|
-
context.fill();
|
|
36
|
-
}
|
|
37
|
-
function drawParticleShadow(container, context, particle, mousePos) {
|
|
38
|
-
const pos = particle.getPosition(), shadowOptions = container.actualOptions.interactivity?.modes.light?.shadow;
|
|
39
|
-
if (!shadowOptions) {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
const shadowRgb = particle.lightShadow;
|
|
43
|
-
if (!shadowRgb) {
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
const radius = particle.getRadius(), sides = particle.sides, full = engine_1.doublePI / sides, angle = -particle.rotation + quarterPI, factor = 1, dots = [];
|
|
47
|
-
for (let i = 0; i < sides; i++) {
|
|
48
|
-
dots.push({
|
|
49
|
-
x: pos.x + radius * Math.sin(angle + full * i) * factor,
|
|
50
|
-
y: pos.y + radius * Math.cos(angle + full * i) * factor,
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
const points = [], shadowLength = shadowOptions.length;
|
|
54
|
-
for (const dot of dots) {
|
|
55
|
-
const dotAngle = Math.atan2(mousePos.y - dot.y, mousePos.x - dot.x), end = {
|
|
56
|
-
x: dot.x + shadowLength * Math.sin(-dotAngle - halfPI),
|
|
57
|
-
y: dot.y + shadowLength * Math.cos(-dotAngle - halfPI),
|
|
58
|
-
};
|
|
59
|
-
points.push({
|
|
60
|
-
end: end,
|
|
61
|
-
start: dot,
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
const shadowColor = (0, engine_1.getStyleFromRgb)(shadowRgb, container.hdr), lastOffset = 1, firstPos = 0, last = points.length - lastOffset;
|
|
65
|
-
for (let i = last, n = 0; i >= firstPos; n = i--) {
|
|
66
|
-
context.beginPath();
|
|
67
|
-
const iPoint = points[i], nPoint = points[n];
|
|
68
|
-
if (!iPoint || !nPoint) {
|
|
69
|
-
continue;
|
|
70
|
-
}
|
|
71
|
-
context.moveTo(iPoint.start.x, iPoint.start.y);
|
|
72
|
-
context.lineTo(nPoint.start.x, nPoint.start.y);
|
|
73
|
-
context.lineTo(nPoint.end.x, nPoint.end.y);
|
|
74
|
-
context.lineTo(iPoint.end.x, iPoint.end.y);
|
|
75
|
-
context.fillStyle = shadowColor;
|
|
76
|
-
context.fill();
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
});
|
package/umd/index.js
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
2
|
-
if (k2 === undefined) k2 = k;
|
|
3
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
4
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
5
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
6
|
-
}
|
|
7
|
-
Object.defineProperty(o, k2, desc);
|
|
8
|
-
}) : (function(o, m, k, k2) {
|
|
9
|
-
if (k2 === undefined) k2 = k;
|
|
10
|
-
o[k2] = m[k];
|
|
11
|
-
}));
|
|
12
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
13
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
14
|
-
}) : function(o, v) {
|
|
15
|
-
o["default"] = v;
|
|
16
|
-
});
|
|
17
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
18
|
-
var ownKeys = function(o) {
|
|
19
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
20
|
-
var ar = [];
|
|
21
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
22
|
-
return ar;
|
|
23
|
-
};
|
|
24
|
-
return ownKeys(o);
|
|
25
|
-
};
|
|
26
|
-
return function (mod) {
|
|
27
|
-
if (mod && mod.__esModule) return mod;
|
|
28
|
-
var result = {};
|
|
29
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
30
|
-
__setModuleDefault(result, mod);
|
|
31
|
-
return result;
|
|
32
|
-
};
|
|
33
|
-
})();
|
|
34
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
35
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
36
|
-
};
|
|
37
|
-
(function (factory) {
|
|
38
|
-
if (typeof module === "object" && typeof module.exports === "object") {
|
|
39
|
-
var v = factory(require, exports);
|
|
40
|
-
if (v !== undefined) module.exports = v;
|
|
41
|
-
}
|
|
42
|
-
else if (typeof define === "function" && define.amd) {
|
|
43
|
-
define(["require", "exports", "./Options/Classes/Light.js", "./Options/Classes/LightArea.js", "./Options/Classes/LightGradient.js", "./Options/Classes/LightShadow.js"], factory);
|
|
44
|
-
}
|
|
45
|
-
})(function (require, exports) {
|
|
46
|
-
"use strict";
|
|
47
|
-
var __syncRequire = typeof module === "object" && typeof module.exports === "object";
|
|
48
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
49
|
-
exports.loadLightInteraction = loadLightInteraction;
|
|
50
|
-
async function loadLightInteraction(engine) {
|
|
51
|
-
engine.checkVersion("4.0.0-beta.0");
|
|
52
|
-
await engine.register(async (e) => {
|
|
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
|
-
e.addInteractor?.("externalLight", async (container) => {
|
|
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
|
-
return new ExternalLighter(container, engine);
|
|
58
|
-
});
|
|
59
|
-
e.addInteractor?.("particlesLight", async (container) => {
|
|
60
|
-
const { ParticlesLighter } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./ParticlesLighter.js"))) : new Promise((resolve_3, reject_3) => { require(["./ParticlesLighter.js"], resolve_3, reject_3); }).then(__importStar));
|
|
61
|
-
return new ParticlesLighter(container, engine);
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
__exportStar(require("./Options/Classes/Light.js"), exports);
|
|
66
|
-
__exportStar(require("./Options/Classes/LightArea.js"), exports);
|
|
67
|
-
__exportStar(require("./Options/Classes/LightGradient.js"), exports);
|
|
68
|
-
__exportStar(require("./Options/Classes/LightShadow.js"), exports);
|
|
69
|
-
});
|