@tsparticles/plugin-emitters 4.0.0-alpha.2 → 4.0.0-alpha.21
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/278.min.js +1 -0
- package/615.min.js +1 -0
- package/751.min.js +1 -0
- package/816.min.js +1 -0
- package/88.min.js +1 -0
- package/975.min.js +1 -0
- package/README.md +5 -0
- package/browser/EmitterInstance.js +69 -47
- package/browser/EmitterShapeBase.js +4 -0
- package/browser/EmittersInstancesManager.js +71 -0
- package/browser/EmittersInteractor.js +114 -0
- package/browser/EmittersPlugin.js +10 -56
- package/browser/EmittersPluginInstance.js +44 -0
- package/browser/Options/Classes/Emitter.js +13 -0
- package/browser/Options/Classes/EmitterLife.js +4 -0
- package/browser/Options/Classes/EmitterRate.js +2 -0
- package/browser/Options/Classes/EmitterShape.js +3 -0
- package/browser/Options/Classes/EmitterShapeReplace.js +2 -0
- package/browser/Options/Classes/EmitterSize.js +3 -0
- package/browser/ShapeManager.js +4 -4
- package/browser/constants.js +4 -0
- package/browser/index.js +20 -6
- package/cjs/EmitterInstance.js +69 -47
- package/cjs/EmitterShapeBase.js +4 -0
- package/cjs/EmittersInstancesManager.js +71 -0
- package/cjs/EmittersInteractor.js +114 -0
- package/cjs/EmittersPlugin.js +10 -56
- package/cjs/EmittersPluginInstance.js +44 -0
- package/cjs/Options/Classes/Emitter.js +13 -0
- package/cjs/Options/Classes/EmitterLife.js +4 -0
- package/cjs/Options/Classes/EmitterRate.js +2 -0
- package/cjs/Options/Classes/EmitterShape.js +3 -0
- package/cjs/Options/Classes/EmitterShapeReplace.js +2 -0
- package/cjs/Options/Classes/EmitterSize.js +3 -0
- package/cjs/ShapeManager.js +4 -4
- package/cjs/constants.js +4 -0
- package/cjs/index.js +20 -6
- package/dist_browser_EmitterInstance_js.js +30 -0
- package/dist_browser_EmittersInstancesManager_js.js +90 -0
- package/dist_browser_EmittersInteractor_js.js +100 -0
- package/dist_browser_EmittersPluginInstance_js.js +30 -0
- package/dist_browser_EmittersPlugin_js.js +8 -28
- package/dist_browser_ShapeManager_js.js +2 -2
- package/esm/EmitterInstance.js +69 -47
- package/esm/EmitterShapeBase.js +4 -0
- package/esm/EmittersInstancesManager.js +71 -0
- package/esm/EmittersInteractor.js +114 -0
- package/esm/EmittersPlugin.js +10 -56
- package/esm/EmittersPluginInstance.js +44 -0
- package/esm/Options/Classes/Emitter.js +13 -0
- package/esm/Options/Classes/EmitterLife.js +4 -0
- package/esm/Options/Classes/EmitterRate.js +2 -0
- package/esm/Options/Classes/EmitterShape.js +3 -0
- package/esm/Options/Classes/EmitterShapeReplace.js +2 -0
- package/esm/Options/Classes/EmitterSize.js +3 -0
- package/esm/ShapeManager.js +4 -4
- package/esm/constants.js +4 -0
- package/esm/index.js +20 -6
- package/package.json +3 -2
- package/report.html +3 -3
- package/tsparticles.plugin.emitters.js +58 -18
- package/tsparticles.plugin.emitters.min.js +2 -2
- package/types/EmitterContainer.d.ts +8 -7
- package/types/EmitterInstance.d.ts +2 -3
- package/types/EmittersEngine.d.ts +2 -2
- package/types/EmittersInstancesManager.d.ts +15 -0
- package/types/EmittersInteractor.d.ts +18 -0
- package/types/EmittersPlugin.d.ts +7 -8
- package/types/EmittersPluginInstance.d.ts +14 -0
- package/types/IEmitterShapeGenerator.d.ts +2 -2
- package/types/constants.d.ts +2 -0
- package/types/index.d.ts +3 -2
- package/types/types.d.ts +15 -9
- package/umd/EmitterInstance.js +69 -47
- package/umd/EmitterShapeBase.js +4 -0
- package/umd/EmittersInstancesManager.js +119 -0
- package/umd/EmittersInteractor.js +128 -0
- package/umd/EmittersPlugin.js +44 -56
- package/umd/EmittersPluginInstance.js +58 -0
- package/umd/Options/Classes/Emitter.js +13 -0
- package/umd/Options/Classes/EmitterLife.js +4 -0
- package/umd/Options/Classes/EmitterRate.js +2 -0
- package/umd/Options/Classes/EmitterShape.js +3 -0
- package/umd/Options/Classes/EmitterShapeReplace.js +2 -0
- package/umd/Options/Classes/EmitterSize.js +3 -0
- package/umd/ShapeManager.js +4 -4
- package/umd/constants.js +17 -0
- package/umd/index.js +21 -6
- package/214.min.js +0 -2
- package/214.min.js.LICENSE.txt +0 -1
- package/921.min.js +0 -2
- package/921.min.js.LICENSE.txt +0 -1
- package/browser/Emitters.js +0 -128
- package/cjs/Emitters.js +0 -128
- package/esm/Emitters.js +0 -128
- package/tsparticles.plugin.emitters.min.js.LICENSE.txt +0 -1
- package/types/Emitters.d.ts +0 -24
- package/umd/Emitters.js +0 -142
|
@@ -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-alpha.
|
|
7
|
+
* v4.0.0-alpha.21
|
|
8
8
|
*/
|
|
9
9
|
/*
|
|
10
10
|
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
@@ -16,25 +16,45 @@
|
|
|
16
16
|
*/
|
|
17
17
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
18
18
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
19
|
-
module.exports = factory(require("@tsparticles/engine"));
|
|
19
|
+
module.exports = factory(require("@tsparticles/plugin-interactivity"), require("@tsparticles/engine"));
|
|
20
20
|
else if(typeof define === 'function' && define.amd)
|
|
21
|
-
define(["@tsparticles/engine"], factory);
|
|
21
|
+
define(["@tsparticles/plugin-interactivity", "@tsparticles/engine"], factory);
|
|
22
22
|
else {
|
|
23
|
-
var a = typeof exports === 'object' ? factory(require("@tsparticles/engine")) : factory(root["window"]);
|
|
23
|
+
var a = typeof exports === 'object' ? factory(require("@tsparticles/plugin-interactivity"), require("@tsparticles/engine")) : factory(root["window"], root["window"]);
|
|
24
24
|
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
|
|
25
25
|
}
|
|
26
|
-
})(this, (__WEBPACK_EXTERNAL_MODULE__tsparticles_engine__) => {
|
|
26
|
+
})(this, (__WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_interactivity__, __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__) => {
|
|
27
27
|
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/EmitterShapeBase.js"
|
|
32
52
|
/*!******************************************!*\
|
|
33
53
|
!*** ./dist/browser/EmitterShapeBase.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 */ EmitterShapeBase: () => (/* binding */ EmitterShapeBase)\n/* harmony export */ });\nclass EmitterShapeBase {\n
|
|
57
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ EmitterShapeBase: () => (/* binding */ EmitterShapeBase)\n/* harmony export */ });\nclass EmitterShapeBase {\n fill;\n options;\n position;\n size;\n constructor(position, size, fill, options){\n this.position = position;\n this.size = size;\n this.fill = fill;\n this.options = options;\n }\n resize(position, size) {\n this.position = position;\n this.size = size;\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/plugin-emitters/./dist/browser/EmitterShapeBase.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 */ EmitterClickMode: () => (/* binding */ EmitterClickMode)\n/* harmony export */ });\nvar EmitterClickMode;\n(function
|
|
67
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ EmitterClickMode: () => (/* binding */ EmitterClickMode)\n/* harmony export */ });\nvar EmitterClickMode;\n(function(EmitterClickMode) {\n EmitterClickMode[\"emitter\"] = \"emitter\";\n})(EmitterClickMode || (EmitterClickMode = {}));\n\n\n//# sourceURL=webpack://@tsparticles/plugin-emitters/./dist/browser/Enums/EmitterClickMode.js?\n}");
|
|
48
68
|
|
|
49
69
|
/***/ },
|
|
50
70
|
|
|
@@ -54,17 +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 */ EmitterClickMode: () => (/* reexport safe */ _Enums_EmitterClickMode_js__WEBPACK_IMPORTED_MODULE_1__.EmitterClickMode),\n/* harmony export */ EmitterShapeBase: () => (/* reexport safe */ _EmitterShapeBase_js__WEBPACK_IMPORTED_MODULE_0__.EmitterShapeBase),\n/* harmony export */ loadEmittersPlugin: () => (/* binding */ loadEmittersPlugin)\n/* harmony export */ });\n/* harmony import */ var _EmitterShapeBase_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./EmitterShapeBase.js */ \"./dist/browser/EmitterShapeBase.js\");\n/* harmony import */ var _Enums_EmitterClickMode_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Enums/EmitterClickMode.js */ \"./dist/browser/Enums/EmitterClickMode.js\");\
|
|
58
|
-
|
|
59
|
-
/***/ },
|
|
60
|
-
|
|
61
|
-
/***/ "@tsparticles/engine"
|
|
62
|
-
/*!*********************************************************************************************************************************!*\
|
|
63
|
-
!*** external {"commonjs":"@tsparticles/engine","commonjs2":"@tsparticles/engine","amd":"@tsparticles/engine","root":"window"} ***!
|
|
64
|
-
\*********************************************************************************************************************************/
|
|
65
|
-
(module) {
|
|
66
|
-
|
|
67
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
|
|
77
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ EmitterClickMode: () => (/* reexport safe */ _Enums_EmitterClickMode_js__WEBPACK_IMPORTED_MODULE_1__.EmitterClickMode),\n/* harmony export */ EmitterShapeBase: () => (/* reexport safe */ _EmitterShapeBase_js__WEBPACK_IMPORTED_MODULE_0__.EmitterShapeBase),\n/* harmony export */ ensureEmittersPluginLoaded: () => (/* binding */ ensureEmittersPluginLoaded),\n/* harmony export */ loadEmittersPlugin: () => (/* binding */ loadEmittersPlugin)\n/* harmony export */ });\n/* harmony import */ var _EmitterShapeBase_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./EmitterShapeBase.js */ \"./dist/browser/EmitterShapeBase.js\");\n/* harmony import */ var _Enums_EmitterClickMode_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Enums/EmitterClickMode.js */ \"./dist/browser/Enums/EmitterClickMode.js\");\nasync function loadEmittersPlugin(engine) {\n engine.checkVersion(\"4.0.0-alpha.21\");\n await engine.register(async (e)=>{\n const [{ ensureInteractivityPluginLoaded }, { ShapeManager }, { EmittersInstancesManager }, { EmittersPlugin }] = await Promise.all([\n Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! @tsparticles/plugin-interactivity */ \"@tsparticles/plugin-interactivity\", 19)),\n __webpack_require__.e(/*! import() */ \"dist_browser_ShapeManager_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./ShapeManager.js */ \"./dist/browser/ShapeManager.js\")),\n __webpack_require__.e(/*! import() */ \"dist_browser_EmittersInstancesManager_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./EmittersInstancesManager.js */ \"./dist/browser/EmittersInstancesManager.js\")),\n __webpack_require__.e(/*! import() */ \"dist_browser_EmittersPlugin_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./EmittersPlugin.js */ \"./dist/browser/EmittersPlugin.js\"))\n ]), instancesManager = new EmittersInstancesManager(e);\n ensureInteractivityPluginLoaded(e);\n e.emitterShapeManager ??= new ShapeManager();\n e.addEmitterShapeGenerator ??= (name, generator)=>{\n e.emitterShapeManager?.addShapeGenerator(name, generator);\n };\n e.addPlugin(new EmittersPlugin(instancesManager));\n e.addInteractor?.(\"externalEmitters\", async (container)=>{\n const { EmittersInteractor } = await __webpack_require__.e(/*! import() */ \"dist_browser_EmittersInteractor_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./EmittersInteractor.js */ \"./dist/browser/EmittersInteractor.js\"));\n return new EmittersInteractor(instancesManager, container);\n });\n });\n}\nfunction ensureEmittersPluginLoaded(e) {\n if (!e.addEmitterShapeGenerator) {\n throw new Error(\"tsParticles Emitters Plugin is not loaded\");\n }\n}\n\n\n\n\n//# sourceURL=webpack://@tsparticles/plugin-emitters/./dist/browser/index.js?\n}");
|
|
68
78
|
|
|
69
79
|
/***/ }
|
|
70
80
|
|
|
@@ -104,6 +114,36 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
|
|
|
104
114
|
/******/ __webpack_require__.m = __webpack_modules__;
|
|
105
115
|
/******/
|
|
106
116
|
/************************************************************************/
|
|
117
|
+
/******/ /* webpack/runtime/create fake namespace object */
|
|
118
|
+
/******/ (() => {
|
|
119
|
+
/******/ var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);
|
|
120
|
+
/******/ var leafPrototypes;
|
|
121
|
+
/******/ // create a fake namespace object
|
|
122
|
+
/******/ // mode & 1: value is a module id, require it
|
|
123
|
+
/******/ // mode & 2: merge all properties of value into the ns
|
|
124
|
+
/******/ // mode & 4: return value when already ns object
|
|
125
|
+
/******/ // mode & 16: return value when it's Promise-like
|
|
126
|
+
/******/ // mode & 8|1: behave like require
|
|
127
|
+
/******/ __webpack_require__.t = function(value, mode) {
|
|
128
|
+
/******/ if(mode & 1) value = this(value);
|
|
129
|
+
/******/ if(mode & 8) return value;
|
|
130
|
+
/******/ if(typeof value === 'object' && value) {
|
|
131
|
+
/******/ if((mode & 4) && value.__esModule) return value;
|
|
132
|
+
/******/ if((mode & 16) && typeof value.then === 'function') return value;
|
|
133
|
+
/******/ }
|
|
134
|
+
/******/ var ns = Object.create(null);
|
|
135
|
+
/******/ __webpack_require__.r(ns);
|
|
136
|
+
/******/ var def = {};
|
|
137
|
+
/******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];
|
|
138
|
+
/******/ for(var current = mode & 2 && value; (typeof current == 'object' || typeof current == 'function') && !~leafPrototypes.indexOf(current); current = getProto(current)) {
|
|
139
|
+
/******/ Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));
|
|
140
|
+
/******/ }
|
|
141
|
+
/******/ def['default'] = () => (value);
|
|
142
|
+
/******/ __webpack_require__.d(ns, def);
|
|
143
|
+
/******/ return ns;
|
|
144
|
+
/******/ };
|
|
145
|
+
/******/ })();
|
|
146
|
+
/******/
|
|
107
147
|
/******/ /* webpack/runtime/define property getters */
|
|
108
148
|
/******/ (() => {
|
|
109
149
|
/******/ // define getter functions for harmony exports
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/plugin-interactivity"),require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/plugin-interactivity","@tsparticles/engine"],t);else{var r="object"==typeof exports?t(require("@tsparticles/plugin-interactivity"),require("@tsparticles/engine")):t(e.window,e.window);for(var i in r)("object"==typeof exports?exports:e)[i]=r[i]}}(this,(e,t)=>(()=>{"use strict";var r,i,o,n,a={303(e){e.exports=t},702(t){t.exports=e}},s={};function l(e){var t=s[e];if(void 0!==t)return t.exports;var r=s[e]={exports:{}};return a[e](r,r.exports,l),r.exports}l.m=a,c=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,l.t=function(e,t){if(1&t&&(e=this(e)),8&t||"object"==typeof e&&e&&(4&t&&e.__esModule||16&t&&"function"==typeof e.then))return e;var r=Object.create(null);l.r(r);var i={};p=p||[null,c({}),c([]),c(c)];for(var o=2&t&&e;("object"==typeof o||"function"==typeof o)&&!~p.indexOf(o);o=c(o))Object.getOwnPropertyNames(o).forEach(t=>i[t]=()=>e[t]);return i.default=()=>e,l.d(r,i),r},l.d=(e,t)=>{for(var r in t)l.o(t,r)&&!l.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},l.f={},l.e=e=>Promise.all(Object.keys(l.f).reduce((t,r)=>(l.f[r](e,t),t),[])),l.u=e=>""+e+".min.js",l.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),u={},l.l=(e,t,r,i)=>{if(u[e])return void u[e].push(t);if(void 0!==r)for(var o,n,a=document.getElementsByTagName("script"),s=0;s<a.length;s++){var p=a[s];if(p.getAttribute("src")==e||p.getAttribute("data-webpack")=="@tsparticles/plugin-emitters:"+r){o=p;break}}o||(n=!0,(o=document.createElement("script")).charset="utf-8",l.nc&&o.setAttribute("nonce",l.nc),o.setAttribute("data-webpack","@tsparticles/plugin-emitters:"+r),o.src=e),u[e]=[t];var c=(t,r)=>{o.onerror=o.onload=null,clearTimeout(d);var i=u[e];if(delete u[e],o.parentNode&&o.parentNode.removeChild(o),i&&i.forEach(e=>e(r)),t)return t(r)},d=setTimeout(c.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=c.bind(null,o.onerror),o.onload=c.bind(null,o.onload),n&&document.head.appendChild(o)},l.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.g.importScripts&&(d=l.g.location+"");var p,c,u,d,f=l.g.document;if(!d&&f&&(f.currentScript&&"SCRIPT"===f.currentScript.tagName.toUpperCase()&&(d=f.currentScript.src),!d)){var h=f.getElementsByTagName("script");if(h.length)for(var m=h.length-1;m>-1&&(!d||!/^http(s?):/.test(d));)d=h[m--].src}if(!d)throw Error("Automatic publicPath is not supported in this browser");l.p=d=d.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r={833:0},l.f.j=(e,t)=>{var i=l.o(r,e)?r[e]:void 0;if(0!==i)if(i)t.push(i[2]);else{var o=new Promise((t,o)=>i=r[e]=[t,o]);t.push(i[2]=o);var n=l.p+l.u(e),a=Error();l.l(n,t=>{if(l.o(r,e)&&(0!==(i=r[e])&&(r[e]=void 0),i)){var o=t&&("load"===t.type?"missing":t.type),n=t&&t.target&&t.target.src;a.message="Loading chunk "+e+` failed.
|
|
2
|
+
(`+o+": "+n+")",a.name="ChunkLoadError",a.type=o,a.request=n,i[1](a)}},"chunk-"+e,e)}},i=(e,t)=>{var i,o,[n,a,s]=t,p=0;if(n.some(e=>0!==r[e])){for(i in a)l.o(a,i)&&(l.m[i]=a[i]);s&&s(l)}for(e&&e(t);p<n.length;p++)o=n[p],l.o(r,o)&&r[o]&&r[o][0](),r[o]=0},(o=this.webpackChunk_tsparticles_plugin_emitters=this.webpackChunk_tsparticles_plugin_emitters||[]).forEach(i.bind(null,0)),o.push=i.bind(null,o.push.bind(o));var g={};l.r(g),l.d(g,{EmitterClickMode:()=>n,EmitterShapeBase:()=>b,ensureEmittersPluginLoaded:()=>v,loadEmittersPlugin:()=>y});class b{fill;options;position;size;constructor(e,t,r,i){this.position=e,this.size=t,this.fill=r,this.options=i}resize(e,t){this.position=e,this.size=t}}async function y(e){e.checkVersion("4.0.0-alpha.21"),await e.register(async e=>{let[{ensureInteractivityPluginLoaded:t},{ShapeManager:r},{EmittersInstancesManager:i},{EmittersPlugin:o}]=await Promise.all([Promise.resolve().then(l.t.bind(l,702,19)),l.e(975).then(l.bind(l,975)),l.e(615).then(l.bind(l,615)),l.e(751).then(l.bind(l,751))]),n=new i(e);t(e),e.emitterShapeManager??=new r,e.addEmitterShapeGenerator??=(t,r)=>{e.emitterShapeManager?.addShapeGenerator(t,r)},e.addPlugin(new o(n)),e.addInteractor?.("externalEmitters",async e=>{let{EmittersInteractor:t}=await l.e(816).then(l.bind(l,816));return new t(n,e)})})}function v(e){if(!e.addEmitterShapeGenerator)throw Error("tsParticles Emitters Plugin is not loaded")}return(n||(n={})).emitter="emitter",g})());
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ICoordinates, RecursivePartial } from "@tsparticles/engine";
|
|
2
2
|
import type { EmitterInstance } from "./EmitterInstance.js";
|
|
3
3
|
import type { EmitterOptions } from "./types.js";
|
|
4
4
|
import type { IEmitter } from "./Options/Interfaces/IEmitter.js";
|
|
5
|
-
|
|
5
|
+
import type { InteractivityContainer } from "@tsparticles/plugin-interactivity";
|
|
6
|
+
export type EmitterContainer = InteractivityContainer & {
|
|
6
7
|
actualOptions: EmitterOptions;
|
|
7
|
-
addEmitter
|
|
8
|
-
getEmitter
|
|
9
|
-
pauseEmitter
|
|
10
|
-
playEmitter
|
|
11
|
-
removeEmitter
|
|
8
|
+
addEmitter?: (options: RecursivePartial<IEmitter>, position?: ICoordinates) => Promise<EmitterInstance>;
|
|
9
|
+
getEmitter?: (idxOrName?: number | string) => EmitterInstance | undefined;
|
|
10
|
+
pauseEmitter?: (idxOrName?: number | string) => void;
|
|
11
|
+
playEmitter?: (idxOrName?: number | string) => void;
|
|
12
|
+
removeEmitter?: (idxOrName?: number | string) => void;
|
|
12
13
|
};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { type Container, type ICoordinates, type IDelta, type IDimension, type IHsl, type RecursivePartial } from "@tsparticles/engine";
|
|
2
2
|
import { Emitter } from "./Options/Classes/Emitter.js";
|
|
3
|
-
import type { Emitters } from "./Emitters.js";
|
|
4
3
|
import type { EmittersEngine } from "./EmittersEngine.js";
|
|
5
4
|
import type { IEmitter } from "./Options/Interfaces/IEmitter.js";
|
|
6
5
|
export declare class EmitterInstance {
|
|
7
|
-
private readonly emitters;
|
|
8
6
|
private readonly container;
|
|
7
|
+
private readonly removeCallback;
|
|
9
8
|
fill: boolean;
|
|
10
9
|
readonly name?: string;
|
|
11
10
|
options: Emitter;
|
|
@@ -30,7 +29,7 @@ export declare class EmitterInstance {
|
|
|
30
29
|
private _size;
|
|
31
30
|
private _spawnDelay?;
|
|
32
31
|
private _startParticlesAdded;
|
|
33
|
-
constructor(engine: EmittersEngine,
|
|
32
|
+
constructor(engine: EmittersEngine, container: Container, removeCallback: (emitter: EmitterInstance) => void, options: Emitter | RecursivePartial<IEmitter>, position?: ICoordinates);
|
|
34
33
|
externalPause(): void;
|
|
35
34
|
externalPlay(): void;
|
|
36
35
|
init(): Promise<void>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Engine } from "@tsparticles/engine";
|
|
2
1
|
import type { IEmitterShapeGenerator } from "./IEmitterShapeGenerator.js";
|
|
2
|
+
import type { InteractivityEngine } from "@tsparticles/plugin-interactivity";
|
|
3
3
|
import type { ShapeManager } from "./ShapeManager.js";
|
|
4
|
-
export type EmittersEngine =
|
|
4
|
+
export type EmittersEngine = InteractivityEngine & {
|
|
5
5
|
addEmitterShapeGenerator?: (name: string, shape: IEmitterShapeGenerator) => void;
|
|
6
6
|
emitterShapeManager?: ShapeManager;
|
|
7
7
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type ICoordinates, type RecursivePartial } from "@tsparticles/engine";
|
|
2
|
+
import type { EmitterContainer } from "./EmitterContainer.js";
|
|
3
|
+
import type { EmitterInstance } from "./EmitterInstance.js";
|
|
4
|
+
import type { EmittersEngine } from "./EmittersEngine.js";
|
|
5
|
+
import type { IEmitter } from "./Options/Interfaces/IEmitter.js";
|
|
6
|
+
export declare class EmittersInstancesManager {
|
|
7
|
+
private readonly _containerArrays;
|
|
8
|
+
private readonly _engine;
|
|
9
|
+
constructor(engine: EmittersEngine);
|
|
10
|
+
addEmitter(container: EmitterContainer, options: RecursivePartial<IEmitter>, position?: ICoordinates): Promise<EmitterInstance>;
|
|
11
|
+
clear(container: EmitterContainer): void;
|
|
12
|
+
getArray(container: EmitterContainer): EmitterInstance[];
|
|
13
|
+
initContainer(container: EmitterContainer): void;
|
|
14
|
+
removeEmitter(container: EmitterContainer, emitter: EmitterInstance): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { EmitterModeOptions, IEmitterModeOptions } from "./types.js";
|
|
2
|
+
import { ExternalInteractorBase, type IInteractivityData, type IModes, type InteractivityParticle, type Modes } from "@tsparticles/plugin-interactivity";
|
|
3
|
+
import { type IDelta, type RecursivePartial } from "@tsparticles/engine";
|
|
4
|
+
import type { EmitterContainer } from "./EmitterContainer.js";
|
|
5
|
+
import type { EmitterInstance } from "./EmitterInstance.js";
|
|
6
|
+
import type { EmittersInstancesManager } from "./EmittersInstancesManager.js";
|
|
7
|
+
export declare class EmittersInteractor extends ExternalInteractorBase<EmitterContainer> {
|
|
8
|
+
handleClickMode: (mode: string, interactivityData: IInteractivityData) => void;
|
|
9
|
+
private readonly _instancesManager;
|
|
10
|
+
constructor(instancesManager: EmittersInstancesManager, container: EmitterContainer);
|
|
11
|
+
clear(): void;
|
|
12
|
+
init(): void;
|
|
13
|
+
interact(_interactivityData: IInteractivityData, delta: IDelta): void;
|
|
14
|
+
isEnabled(interactivityData: IInteractivityData, particle?: InteractivityParticle): boolean;
|
|
15
|
+
loadModeOptions(options: Modes & EmitterModeOptions, ...sources: RecursivePartial<(IModes & IEmitterModeOptions) | undefined>[]): void;
|
|
16
|
+
removeEmitter(emitter: EmitterInstance): void;
|
|
17
|
+
reset(): void;
|
|
18
|
+
}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
+
import { type Container, type IContainerPlugin, type IOptions, type IPlugin, type RecursivePartial } from "@tsparticles/engine";
|
|
1
2
|
import type { EmitterOptions, IEmitterOptions } from "./types.js";
|
|
2
|
-
import { type IOptions, type IPlugin, type RecursivePartial } from "@tsparticles/engine";
|
|
3
3
|
import type { EmitterContainer } from "./EmitterContainer.js";
|
|
4
|
-
import {
|
|
5
|
-
import type { EmittersEngine } from "./EmittersEngine.js";
|
|
4
|
+
import type { EmittersInstancesManager } from "./EmittersInstancesManager.js";
|
|
6
5
|
export declare class EmittersPlugin implements IPlugin {
|
|
7
|
-
readonly id
|
|
8
|
-
private readonly
|
|
9
|
-
constructor(
|
|
10
|
-
getPlugin(container: EmitterContainer): Promise<
|
|
11
|
-
loadOptions(options: EmitterOptions, source?: RecursivePartial<IEmitterOptions>): void;
|
|
6
|
+
readonly id = "emitters";
|
|
7
|
+
private readonly _instancesManager;
|
|
8
|
+
constructor(instancesManager: EmittersInstancesManager);
|
|
9
|
+
getPlugin(container: EmitterContainer): Promise<IContainerPlugin>;
|
|
10
|
+
loadOptions(_container: Container, options: EmitterOptions, source?: RecursivePartial<IEmitterOptions>): void;
|
|
12
11
|
needsPlugin(options?: RecursivePartial<IOptions & IEmitterOptions>): boolean;
|
|
13
12
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type IContainerPlugin, type IDelta } from "@tsparticles/engine";
|
|
2
|
+
import type { EmitterContainer } from "./EmitterContainer.js";
|
|
3
|
+
import type { EmittersInstancesManager } from "./EmittersInstancesManager.js";
|
|
4
|
+
export declare class EmittersPluginInstance implements IContainerPlugin {
|
|
5
|
+
private readonly container;
|
|
6
|
+
private readonly _instancesManager;
|
|
7
|
+
constructor(instancesManager: EmittersInstancesManager, container: EmitterContainer);
|
|
8
|
+
init(): Promise<void>;
|
|
9
|
+
pause(): void;
|
|
10
|
+
play(): void;
|
|
11
|
+
resize(): void;
|
|
12
|
+
stop(): void;
|
|
13
|
+
update(delta: IDelta): void;
|
|
14
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ICoordinates, IDimension } from "@tsparticles/engine";
|
|
1
|
+
import type { Container, ICoordinates, IDimension } from "@tsparticles/engine";
|
|
2
2
|
import type { IEmitterShape } from "./IEmitterShape.js";
|
|
3
3
|
export interface IEmitterShapeGenerator<TOptions = unknown> {
|
|
4
|
-
generate(position: ICoordinates, size: IDimension, fill: boolean, options: TOptions): IEmitterShape;
|
|
4
|
+
generate(container: Container, position: ICoordinates, size: IDimension, fill: boolean, options: TOptions): IEmitterShape;
|
|
5
5
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare function loadEmittersPlugin(engine:
|
|
1
|
+
import type { EmittersEngine } from "./EmittersEngine.js";
|
|
2
|
+
export declare function loadEmittersPlugin(engine: EmittersEngine): Promise<void>;
|
|
3
|
+
export declare function ensureEmittersPluginLoaded(e: EmittersEngine): void;
|
|
3
4
|
export type * from "./EmitterContainer.js";
|
|
4
5
|
export * from "./EmitterShapeBase.js";
|
|
5
6
|
export type * from "./EmittersEngine.js";
|
package/types/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { IOptions, Options, SingleOrMultiple } from "@tsparticles/engine";
|
|
2
2
|
import type { Emitter } from "./Options/Classes/Emitter.js";
|
|
3
3
|
import type { IEmitter } from "./Options/Interfaces/IEmitter.js";
|
|
4
|
-
export interface
|
|
4
|
+
export interface IEmitterDataModeOptions {
|
|
5
5
|
random: IEmitterModeRandomOptions;
|
|
6
6
|
value: SingleOrMultiple<IEmitter>;
|
|
7
7
|
}
|
|
@@ -9,23 +9,29 @@ export interface IEmitterModeRandomOptions {
|
|
|
9
9
|
count: number;
|
|
10
10
|
enable: boolean;
|
|
11
11
|
}
|
|
12
|
+
export interface EmitterModeRandomOptions {
|
|
13
|
+
count: number;
|
|
14
|
+
enable: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface EmitterDataModeOptions {
|
|
17
|
+
random: EmitterModeRandomOptions;
|
|
18
|
+
value: Emitter[];
|
|
19
|
+
}
|
|
12
20
|
export interface EmitterModeOptions {
|
|
13
|
-
|
|
14
|
-
|
|
21
|
+
emitters?: EmitterDataModeOptions;
|
|
22
|
+
}
|
|
23
|
+
export interface IEmitterModeOptions {
|
|
24
|
+
emitters?: IEmitterDataModeOptions | SingleOrMultiple<IEmitter>;
|
|
15
25
|
}
|
|
16
26
|
export type IEmitterOptions = IOptions & {
|
|
17
27
|
emitters: SingleOrMultiple<IEmitter>;
|
|
18
28
|
interactivity: {
|
|
19
|
-
modes:
|
|
20
|
-
emitters: IEmitterModeOptions | SingleOrMultiple<IEmitter>;
|
|
21
|
-
};
|
|
29
|
+
modes: IEmitterModeOptions;
|
|
22
30
|
};
|
|
23
31
|
};
|
|
24
32
|
export type EmitterOptions = Options & {
|
|
25
33
|
emitters: SingleOrMultiple<Emitter>;
|
|
26
34
|
interactivity: {
|
|
27
|
-
modes:
|
|
28
|
-
emitters: EmitterModeOptions;
|
|
29
|
-
};
|
|
35
|
+
modes: EmitterModeOptions;
|
|
30
36
|
};
|
|
31
37
|
};
|
package/umd/EmitterInstance.js
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
const engine_1 = require("@tsparticles/engine");
|
|
14
14
|
const Emitter_js_1 = require("./Options/Classes/Emitter.js");
|
|
15
15
|
const EmitterSize_js_1 = require("./Options/Classes/EmitterSize.js");
|
|
16
|
-
const defaultLifeDelay = 0, minLifeCount = 0, defaultSpawnDelay = 0, defaultEmitDelay = 0, defaultLifeCount = -1, defaultColorAnimationFactor = 1;
|
|
16
|
+
const defaultLifeDelay = 0, minLifeCount = 0, defaultSpawnDelay = 0, defaultEmitDelay = 0, defaultLifeCount = -1, defaultColorAnimationFactor = 1, colorFactor = 3.6;
|
|
17
17
|
function setParticlesOptionsColor(particlesOptions, color) {
|
|
18
18
|
if (particlesOptions.color) {
|
|
19
19
|
particlesOptions.color.value = color;
|
|
@@ -25,41 +25,35 @@
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
class EmitterInstance {
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
container;
|
|
29
|
+
removeCallback;
|
|
30
|
+
fill;
|
|
31
|
+
name;
|
|
32
|
+
options;
|
|
33
|
+
position;
|
|
34
|
+
size;
|
|
35
|
+
spawnColor;
|
|
36
|
+
_currentDuration;
|
|
37
|
+
_currentEmitDelay;
|
|
38
|
+
_currentSpawnDelay;
|
|
39
|
+
_duration;
|
|
40
|
+
_emitDelay;
|
|
41
|
+
_engine;
|
|
42
|
+
_firstSpawn;
|
|
43
|
+
_immortal;
|
|
44
|
+
_initialPosition;
|
|
45
|
+
_lifeCount;
|
|
46
|
+
_mutationObserver;
|
|
47
|
+
_particlesOptions;
|
|
48
|
+
_paused;
|
|
49
|
+
_resizeObserver;
|
|
50
|
+
_shape;
|
|
51
|
+
_size;
|
|
52
|
+
_spawnDelay;
|
|
53
|
+
_startParticlesAdded;
|
|
54
|
+
constructor(engine, container, removeCallback, options, position) {
|
|
30
55
|
this.container = container;
|
|
31
|
-
this.
|
|
32
|
-
this._mutationObserver?.disconnect();
|
|
33
|
-
this._mutationObserver = undefined;
|
|
34
|
-
this._resizeObserver?.disconnect();
|
|
35
|
-
this._resizeObserver = undefined;
|
|
36
|
-
this.emitters.removeEmitter(this);
|
|
37
|
-
this._engine.dispatchEvent("emitterDestroyed", {
|
|
38
|
-
container: this.container,
|
|
39
|
-
data: {
|
|
40
|
-
emitter: this,
|
|
41
|
-
},
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
this._prepareToDie = () => {
|
|
45
|
-
if (this._paused) {
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
const duration = this.options.life.duration !== undefined ? (0, engine_1.getRangeValue)(this.options.life.duration) : undefined, minDuration = 0, minLifeCount = 0;
|
|
49
|
-
if ((this._lifeCount > minLifeCount || this._immortal) && duration !== undefined && duration > minDuration) {
|
|
50
|
-
this._duration = duration * engine_1.millisecondsToSeconds;
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
this._setColorAnimation = (animation, initValue, maxValue, factor = defaultColorAnimationFactor) => {
|
|
54
|
-
const container = this.container;
|
|
55
|
-
if (!animation.enable) {
|
|
56
|
-
return initValue;
|
|
57
|
-
}
|
|
58
|
-
const colorOffset = (0, engine_1.randomInRangeValue)(animation.offset), delay = (0, engine_1.getRangeValue)(this.options.rate.delay), emitFactor = container.retina.reduceFactor
|
|
59
|
-
? (delay * engine_1.millisecondsToSeconds) / container.retina.reduceFactor
|
|
60
|
-
: Infinity, colorSpeed = (0, engine_1.getRangeValue)(animation.speed);
|
|
61
|
-
return (initValue + (colorSpeed * container.fpsLimit) / emitFactor + colorOffset * factor) % maxValue;
|
|
62
|
-
};
|
|
56
|
+
this.removeCallback = removeCallback;
|
|
63
57
|
this._engine = engine;
|
|
64
58
|
this._currentDuration = 0;
|
|
65
59
|
this._currentEmitDelay = 0;
|
|
@@ -111,7 +105,7 @@
|
|
|
111
105
|
}
|
|
112
106
|
const shapeOptions = this.options.shape, shapeGenerator = this._engine.emitterShapeManager?.getShapeGenerator(shapeOptions.type);
|
|
113
107
|
if (shapeGenerator) {
|
|
114
|
-
this._shape = shapeGenerator.generate(this.position, this.size, this.fill, shapeOptions.options);
|
|
108
|
+
this._shape = shapeGenerator.generate(this.container, this.position, this.size, this.fill, shapeOptions.options);
|
|
115
109
|
}
|
|
116
110
|
this._engine.dispatchEvent("emitterCreated", {
|
|
117
111
|
container,
|
|
@@ -213,7 +207,7 @@
|
|
|
213
207
|
container: this.container,
|
|
214
208
|
});
|
|
215
209
|
this.play();
|
|
216
|
-
this._currentSpawnDelay -= this.
|
|
210
|
+
this._currentSpawnDelay -= this._spawnDelay;
|
|
217
211
|
delete this._spawnDelay;
|
|
218
212
|
}
|
|
219
213
|
}
|
|
@@ -266,6 +260,19 @@
|
|
|
266
260
|
return size;
|
|
267
261
|
})());
|
|
268
262
|
}
|
|
263
|
+
_destroy = () => {
|
|
264
|
+
this._mutationObserver?.disconnect();
|
|
265
|
+
this._mutationObserver = undefined;
|
|
266
|
+
this._resizeObserver?.disconnect();
|
|
267
|
+
this._resizeObserver = undefined;
|
|
268
|
+
this.removeCallback(this);
|
|
269
|
+
this._engine.dispatchEvent("emitterDestroyed", {
|
|
270
|
+
container: this.container,
|
|
271
|
+
data: {
|
|
272
|
+
emitter: this,
|
|
273
|
+
},
|
|
274
|
+
});
|
|
275
|
+
};
|
|
269
276
|
_emit() {
|
|
270
277
|
if (this._paused) {
|
|
271
278
|
return;
|
|
@@ -274,24 +281,20 @@
|
|
|
274
281
|
this._emitParticles(quantity);
|
|
275
282
|
}
|
|
276
283
|
_emitParticles(quantity) {
|
|
277
|
-
const singleParticlesOptions = (0, engine_1.itemFromSingleOrMultiple)(this._particlesOptions)
|
|
284
|
+
const singleParticlesOptions = ((0, engine_1.itemFromSingleOrMultiple)(this._particlesOptions) ??
|
|
285
|
+
{}), hslAnimation = this.options.spawnColor?.animation, reduceFactor = this.container.retina.reduceFactor, needsColorAnimation = !!hslAnimation, needsShapeData = !!this._shape, needsCopy = needsColorAnimation || needsShapeData, maxValues = needsColorAnimation ? { h: engine_1.hMax, s: engine_1.sMax, l: engine_1.lMax } : null, shapeOptions = this.options.shape;
|
|
278
286
|
for (let i = 0; i < quantity * reduceFactor; i++) {
|
|
279
|
-
const particlesOptions =
|
|
287
|
+
const particlesOptions = needsCopy
|
|
288
|
+
? (0, engine_1.deepExtend)({}, singleParticlesOptions)
|
|
289
|
+
: singleParticlesOptions;
|
|
280
290
|
if (this.spawnColor) {
|
|
281
|
-
|
|
282
|
-
if (hslAnimation) {
|
|
283
|
-
const maxValues = {
|
|
284
|
-
h: engine_1.hMax,
|
|
285
|
-
s: engine_1.sMax,
|
|
286
|
-
l: engine_1.lMax,
|
|
287
|
-
}, colorFactor = 3.6;
|
|
291
|
+
if (hslAnimation && maxValues) {
|
|
288
292
|
this.spawnColor.h = this._setColorAnimation(hslAnimation.h, this.spawnColor.h, maxValues.h, colorFactor);
|
|
289
293
|
this.spawnColor.s = this._setColorAnimation(hslAnimation.s, this.spawnColor.s, maxValues.s);
|
|
290
294
|
this.spawnColor.l = this._setColorAnimation(hslAnimation.l, this.spawnColor.l, maxValues.l);
|
|
291
295
|
}
|
|
292
296
|
setParticlesOptionsColor(particlesOptions, this.spawnColor);
|
|
293
297
|
}
|
|
294
|
-
const shapeOptions = this.options.shape;
|
|
295
298
|
let position = this.position;
|
|
296
299
|
if (this._shape) {
|
|
297
300
|
const shapePosData = this._shape.randomPosition();
|
|
@@ -321,6 +324,25 @@
|
|
|
321
324
|
}
|
|
322
325
|
}
|
|
323
326
|
}
|
|
327
|
+
_prepareToDie = () => {
|
|
328
|
+
if (this._paused) {
|
|
329
|
+
return;
|
|
330
|
+
}
|
|
331
|
+
const duration = this.options.life.duration !== undefined ? (0, engine_1.getRangeValue)(this.options.life.duration) : undefined, minDuration = 0, minLifeCount = 0;
|
|
332
|
+
if ((this._lifeCount > minLifeCount || this._immortal) && duration !== undefined && duration > minDuration) {
|
|
333
|
+
this._duration = duration * engine_1.millisecondsToSeconds;
|
|
334
|
+
}
|
|
335
|
+
};
|
|
336
|
+
_setColorAnimation = (animation, initValue, maxValue, factor = defaultColorAnimationFactor) => {
|
|
337
|
+
const container = this.container;
|
|
338
|
+
if (!animation.enable) {
|
|
339
|
+
return initValue;
|
|
340
|
+
}
|
|
341
|
+
const colorOffset = (0, engine_1.randomInRangeValue)(animation.offset), delay = (0, engine_1.getRangeValue)(this.options.rate.delay), emitFactor = container.retina.reduceFactor
|
|
342
|
+
? (delay * engine_1.millisecondsToSeconds) / container.retina.reduceFactor
|
|
343
|
+
: Infinity, colorSpeed = (0, engine_1.getRangeValue)(animation.speed);
|
|
344
|
+
return (initValue + (colorSpeed * container.fpsLimit) / emitFactor + colorOffset * factor) % maxValue;
|
|
345
|
+
};
|
|
324
346
|
}
|
|
325
347
|
exports.EmitterInstance = EmitterInstance;
|
|
326
348
|
});
|
package/umd/EmitterShapeBase.js
CHANGED
|
@@ -11,6 +11,10 @@
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.EmitterShapeBase = void 0;
|
|
13
13
|
class EmitterShapeBase {
|
|
14
|
+
fill;
|
|
15
|
+
options;
|
|
16
|
+
position;
|
|
17
|
+
size;
|
|
14
18
|
constructor(position, size, fill, options) {
|
|
15
19
|
this.position = position;
|
|
16
20
|
this.size = size;
|