@tsparticles/plugin-absorbers 4.0.0-alpha.2 → 4.0.0-alpha.20
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/295.min.js +1 -0
- package/415.min.js +1 -0
- package/776.min.js +1 -0
- package/830.min.js +1 -0
- package/991.min.js +1 -0
- package/README.md +5 -0
- package/browser/AbsorberInstance.js +130 -75
- package/browser/AbsorbersInstancesManager.js +49 -0
- package/browser/AbsorbersInteractor.js +93 -0
- package/browser/AbsorbersPlugin.js +8 -17
- package/browser/AbsorbersPluginInstance.js +42 -0
- package/browser/Options/Classes/Absorber.js +14 -0
- package/browser/Options/Classes/AbsorberLife.js +27 -0
- package/browser/Options/Classes/AbsorberSize.js +2 -0
- package/browser/Options/Classes/AbsorberSizeLimit.js +2 -0
- package/browser/Options/Interfaces/IAbsorberLife.js +1 -0
- package/browser/index.js +14 -6
- package/cjs/AbsorberInstance.js +130 -75
- package/cjs/AbsorbersInstancesManager.js +49 -0
- package/cjs/AbsorbersInteractor.js +93 -0
- package/cjs/AbsorbersPlugin.js +8 -17
- package/cjs/AbsorbersPluginInstance.js +42 -0
- package/cjs/Options/Classes/Absorber.js +14 -0
- package/cjs/Options/Classes/AbsorberLife.js +27 -0
- package/cjs/Options/Classes/AbsorberSize.js +2 -0
- package/cjs/Options/Classes/AbsorberSizeLimit.js +2 -0
- package/cjs/Options/Interfaces/IAbsorberLife.js +1 -0
- package/cjs/index.js +14 -6
- package/dist_browser_AbsorberInstance_js.js +70 -0
- package/dist_browser_AbsorbersInstancesManager_js.js +30 -0
- package/dist_browser_AbsorbersInteractor_js.js +70 -0
- package/dist_browser_AbsorbersPluginInstance_js.js +30 -0
- package/dist_browser_AbsorbersPlugin_js.js +15 -25
- package/esm/AbsorberInstance.js +130 -75
- package/esm/AbsorbersInstancesManager.js +49 -0
- package/esm/AbsorbersInteractor.js +93 -0
- package/esm/AbsorbersPlugin.js +8 -17
- package/esm/AbsorbersPluginInstance.js +42 -0
- package/esm/Options/Classes/Absorber.js +14 -0
- package/esm/Options/Classes/AbsorberLife.js +27 -0
- package/esm/Options/Classes/AbsorberSize.js +2 -0
- package/esm/Options/Classes/AbsorberSizeLimit.js +2 -0
- package/esm/Options/Interfaces/IAbsorberLife.js +1 -0
- package/esm/index.js +14 -6
- package/package.json +3 -2
- package/report.html +3 -3
- package/tsparticles.plugin.absorbers.js +52 -22
- package/tsparticles.plugin.absorbers.min.js +2 -2
- package/types/AbsorberContainer.d.ts +5 -4
- package/types/AbsorberInstance.d.ts +15 -5
- package/types/AbsorbersInstancesManager.d.ts +14 -0
- package/types/AbsorbersInteractor.d.ts +18 -0
- package/types/AbsorbersPlugin.d.ts +7 -7
- package/types/AbsorbersPluginInstance.d.ts +13 -0
- package/types/Options/Classes/Absorber.d.ts +2 -0
- package/types/Options/Classes/AbsorberLife.d.ts +10 -0
- package/types/Options/Interfaces/IAbsorber.d.ts +2 -0
- package/types/Options/Interfaces/IAbsorberLife.d.ts +7 -0
- package/types/index.d.ts +1 -2
- package/types/types.d.ts +12 -9
- package/umd/AbsorberInstance.js +129 -74
- package/umd/AbsorbersInstancesManager.js +97 -0
- package/umd/AbsorbersInteractor.js +107 -0
- package/umd/AbsorbersPlugin.js +42 -17
- package/umd/AbsorbersPluginInstance.js +56 -0
- package/umd/Options/Classes/Absorber.js +15 -1
- package/umd/Options/Classes/AbsorberLife.js +41 -0
- package/umd/Options/Classes/AbsorberSize.js +2 -0
- package/umd/Options/Classes/AbsorberSizeLimit.js +2 -0
- package/umd/{Enums/AbsorberClickMode.js → Options/Interfaces/IAbsorberLife.js} +0 -5
- package/umd/index.js +15 -10
- package/47.min.js +0 -2
- package/47.min.js.LICENSE.txt +0 -1
- package/browser/Absorbers.js +0 -70
- package/browser/Enums/AbsorberClickMode.js +0 -4
- package/cjs/Absorbers.js +0 -70
- package/cjs/Enums/AbsorberClickMode.js +0 -4
- package/esm/Absorbers.js +0 -70
- package/esm/Enums/AbsorberClickMode.js +0 -4
- package/tsparticles.plugin.absorbers.min.js.LICENSE.txt +0 -1
- package/types/Absorbers.d.ts +0 -21
- package/types/Enums/AbsorberClickMode.d.ts +0 -3
- package/umd/Absorbers.js +0 -84
|
@@ -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.20
|
|
8
8
|
*/
|
|
9
9
|
/*
|
|
10
10
|
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
@@ -16,25 +16,35 @@
|
|
|
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
|
-
/***/ "
|
|
32
|
-
|
|
33
|
-
!***
|
|
34
|
-
|
|
35
|
-
(
|
|
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
|
+
/***/ },
|
|
36
40
|
|
|
37
|
-
|
|
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__;
|
|
38
48
|
|
|
39
49
|
/***/ },
|
|
40
50
|
|
|
@@ -44,17 +54,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
44
54
|
\*******************************/
|
|
45
55
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
46
56
|
|
|
47
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */
|
|
48
|
-
|
|
49
|
-
/***/ },
|
|
50
|
-
|
|
51
|
-
/***/ "@tsparticles/engine"
|
|
52
|
-
/*!*********************************************************************************************************************************!*\
|
|
53
|
-
!*** external {"commonjs":"@tsparticles/engine","commonjs2":"@tsparticles/engine","amd":"@tsparticles/engine","root":"window"} ***!
|
|
54
|
-
\*********************************************************************************************************************************/
|
|
55
|
-
(module) {
|
|
56
|
-
|
|
57
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
|
|
57
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadAbsorbersPlugin: () => (/* binding */ loadAbsorbersPlugin)\n/* harmony export */ });\nasync function loadAbsorbersPlugin(engine) {\n engine.checkVersion(\"4.0.0-alpha.20\");\n await engine.register(async (e)=>{\n const [{ ensureInteractivityPluginLoaded }, { AbsorbersInstancesManager }, { AbsorbersPlugin }] = 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_AbsorbersInstancesManager_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./AbsorbersInstancesManager.js */ \"./dist/browser/AbsorbersInstancesManager.js\")),\n __webpack_require__.e(/*! import() */ \"dist_browser_AbsorbersPlugin_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./AbsorbersPlugin.js */ \"./dist/browser/AbsorbersPlugin.js\"))\n ]), instancesManager = new AbsorbersInstancesManager(e);\n ensureInteractivityPluginLoaded(e);\n e.addPlugin(new AbsorbersPlugin(instancesManager));\n e.addInteractor?.(\"externalAbsorbers\", async (container)=>{\n const { AbsorbersInteractor } = await __webpack_require__.e(/*! import() */ \"dist_browser_AbsorbersInteractor_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./AbsorbersInteractor.js */ \"./dist/browser/AbsorbersInteractor.js\"));\n return new AbsorbersInteractor(container, instancesManager);\n });\n });\n}\n\n\n//# sourceURL=webpack://@tsparticles/plugin-absorbers/./dist/browser/index.js?\n}");
|
|
58
58
|
|
|
59
59
|
/***/ }
|
|
60
60
|
|
|
@@ -94,6 +94,36 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
|
|
|
94
94
|
/******/ __webpack_require__.m = __webpack_modules__;
|
|
95
95
|
/******/
|
|
96
96
|
/************************************************************************/
|
|
97
|
+
/******/ /* webpack/runtime/create fake namespace object */
|
|
98
|
+
/******/ (() => {
|
|
99
|
+
/******/ var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);
|
|
100
|
+
/******/ var leafPrototypes;
|
|
101
|
+
/******/ // create a fake namespace object
|
|
102
|
+
/******/ // mode & 1: value is a module id, require it
|
|
103
|
+
/******/ // mode & 2: merge all properties of value into the ns
|
|
104
|
+
/******/ // mode & 4: return value when already ns object
|
|
105
|
+
/******/ // mode & 16: return value when it's Promise-like
|
|
106
|
+
/******/ // mode & 8|1: behave like require
|
|
107
|
+
/******/ __webpack_require__.t = function(value, mode) {
|
|
108
|
+
/******/ if(mode & 1) value = this(value);
|
|
109
|
+
/******/ if(mode & 8) return value;
|
|
110
|
+
/******/ if(typeof value === 'object' && value) {
|
|
111
|
+
/******/ if((mode & 4) && value.__esModule) return value;
|
|
112
|
+
/******/ if((mode & 16) && typeof value.then === 'function') return value;
|
|
113
|
+
/******/ }
|
|
114
|
+
/******/ var ns = Object.create(null);
|
|
115
|
+
/******/ __webpack_require__.r(ns);
|
|
116
|
+
/******/ var def = {};
|
|
117
|
+
/******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];
|
|
118
|
+
/******/ for(var current = mode & 2 && value; (typeof current == 'object' || typeof current == 'function') && !~leafPrototypes.indexOf(current); current = getProto(current)) {
|
|
119
|
+
/******/ Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));
|
|
120
|
+
/******/ }
|
|
121
|
+
/******/ def['default'] = () => (value);
|
|
122
|
+
/******/ __webpack_require__.d(ns, def);
|
|
123
|
+
/******/ return ns;
|
|
124
|
+
/******/ };
|
|
125
|
+
/******/ })();
|
|
126
|
+
/******/
|
|
97
127
|
/******/ /* webpack/runtime/define property getters */
|
|
98
128
|
/******/ (() => {
|
|
99
129
|
/******/ // 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 o in r)("object"==typeof exports?exports:e)[o]=r[o]}}(this,(e,t)=>(()=>{"use strict";var r,o,i,n={303(e){e.exports=t},702(t){t.exports=e}},a={};function s(e){var t=a[e];if(void 0!==t)return t.exports;var r=a[e]={exports:{}};return n[e](r,r.exports,s),r.exports}s.m=n,l=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,s.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);s.r(r);var o={};c=c||[null,l({}),l([]),l(l)];for(var i=2&t&&e;("object"==typeof i||"function"==typeof i)&&!~c.indexOf(i);i=l(i))Object.getOwnPropertyNames(i).forEach(t=>o[t]=()=>e[t]);return o.default=()=>e,s.d(r,o),r},s.d=(e,t)=>{for(var r in t)s.o(t,r)&&!s.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},s.f={},s.e=e=>Promise.all(Object.keys(s.f).reduce((t,r)=>(s.f[r](e,t),t),[])),s.u=e=>""+e+".min.js",s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),p={},s.l=(e,t,r,o)=>{if(p[e])return void p[e].push(t);if(void 0!==r)for(var i,n,a=document.getElementsByTagName("script"),c=0;c<a.length;c++){var l=a[c];if(l.getAttribute("src")==e||l.getAttribute("data-webpack")=="@tsparticles/plugin-absorbers:"+r){i=l;break}}i||(n=!0,(i=document.createElement("script")).charset="utf-8",s.nc&&i.setAttribute("nonce",s.nc),i.setAttribute("data-webpack","@tsparticles/plugin-absorbers:"+r),i.src=e),p[e]=[t];var u=(t,r)=>{i.onerror=i.onload=null,clearTimeout(d);var o=p[e];if(delete p[e],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach(e=>e(r)),t)return t(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),n&&document.head.appendChild(i)},s.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.g.importScripts&&(u=s.g.location+"");var c,l,p,u,d=s.g.document;if(!u&&d&&(d.currentScript&&"SCRIPT"===d.currentScript.tagName.toUpperCase()&&(u=d.currentScript.src),!u)){var f=d.getElementsByTagName("script");if(f.length)for(var b=f.length-1;b>-1&&(!u||!/^http(s?):/.test(u));)u=f[b--].src}if(!u)throw Error("Automatic publicPath is not supported in this browser");s.p=u=u.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r={425:0},s.f.j=(e,t)=>{var o=s.o(r,e)?r[e]:void 0;if(0!==o)if(o)t.push(o[2]);else{var i=new Promise((t,i)=>o=r[e]=[t,i]);t.push(o[2]=i);var n=s.p+s.u(e),a=Error();s.l(n,t=>{if(s.o(r,e)&&(0!==(o=r[e])&&(r[e]=void 0),o)){var i=t&&("load"===t.type?"missing":t.type),n=t&&t.target&&t.target.src;a.message="Loading chunk "+e+` failed.
|
|
2
|
+
(`+i+": "+n+")",a.name="ChunkLoadError",a.type=i,a.request=n,o[1](a)}},"chunk-"+e,e)}},o=(e,t)=>{var o,i,[n,a,c]=t,l=0;if(n.some(e=>0!==r[e])){for(o in a)s.o(a,o)&&(s.m[o]=a[o]);c&&c(s)}for(e&&e(t);l<n.length;l++)i=n[l],s.o(r,i)&&r[i]&&r[i][0](),r[i]=0},(i=this.webpackChunk_tsparticles_plugin_absorbers=this.webpackChunk_tsparticles_plugin_absorbers||[]).forEach(o.bind(null,0)),i.push=o.bind(null,i.push.bind(i));var g={};async function h(e){e.checkVersion("4.0.0-alpha.20"),await e.register(async e=>{let[{ensureInteractivityPluginLoaded:t},{AbsorbersInstancesManager:r},{AbsorbersPlugin:o}]=await Promise.all([Promise.resolve().then(s.t.bind(s,702,19)),s.e(991).then(s.bind(s,991)),s.e(295).then(s.bind(s,295))]),i=new r(e);t(e),e.addPlugin(new o(i)),e.addInteractor?.("externalAbsorbers",async e=>{let{AbsorbersInteractor:t}=await s.e(415).then(s.bind(s,415));return new t(e,i)})})}return s.r(g),s.d(g,{loadAbsorbersPlugin:()=>h}),g})());
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ICoordinates, RecursivePartial } from "@tsparticles/engine";
|
|
2
2
|
import type { AbsorberInstance } from "./AbsorberInstance.js";
|
|
3
3
|
import type { AbsorberOptions } from "./types.js";
|
|
4
4
|
import type { IAbsorber } from "./Options/Interfaces/IAbsorber.js";
|
|
5
|
-
|
|
5
|
+
import type { InteractivityContainer } from "@tsparticles/plugin-interactivity";
|
|
6
|
+
export interface AbsorberContainer extends InteractivityContainer {
|
|
6
7
|
actualOptions: AbsorberOptions;
|
|
7
|
-
addAbsorber
|
|
8
|
-
getAbsorber
|
|
8
|
+
addAbsorber?: (options: RecursivePartial<IAbsorber>, position?: ICoordinates) => Promise<AbsorberInstance>;
|
|
9
|
+
getAbsorber?: (idxOrName?: number | string) => AbsorberInstance | undefined;
|
|
9
10
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { type Container, type Engine, type ICoordinates, type IRgb, type Particle, type RecursivePartial, RotateDirection, Vector } from "@tsparticles/engine";
|
|
1
|
+
import { type Container, type Engine, type ICoordinates, type IDelta, type IRgb, type Particle, type RecursivePartial, RotateDirection, Vector } from "@tsparticles/engine";
|
|
2
|
+
import { Absorber } from "./Options/Classes/Absorber.js";
|
|
2
3
|
import type { IAbsorber } from "./Options/Interfaces/IAbsorber.js";
|
|
3
4
|
import type { IAbsorberSizeLimit } from "./Options/Interfaces/IAbsorberSizeLimit.js";
|
|
4
5
|
type OrbitingParticle = Particle & {
|
|
@@ -12,18 +13,27 @@ export declare class AbsorberInstance {
|
|
|
12
13
|
mass: number;
|
|
13
14
|
readonly name?: string;
|
|
14
15
|
opacity: number;
|
|
16
|
+
readonly options: Absorber;
|
|
15
17
|
position: Vector;
|
|
16
18
|
size: number;
|
|
17
19
|
private readonly _container;
|
|
20
|
+
private _currentDuration;
|
|
21
|
+
private _currentSpawnDelay;
|
|
22
|
+
private _duration?;
|
|
18
23
|
private readonly _engine;
|
|
19
|
-
private
|
|
24
|
+
private _firstSpawn;
|
|
25
|
+
private readonly _immortal;
|
|
26
|
+
private _lifeCount;
|
|
27
|
+
private _spawnDelay?;
|
|
20
28
|
private readonly initialPosition?;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
attract(particle: OrbitingParticle): void;
|
|
29
|
+
constructor(engine: Engine, container: Container, options: RecursivePartial<IAbsorber>, position?: ICoordinates);
|
|
30
|
+
attract(particle: OrbitingParticle, delta: IDelta): void;
|
|
24
31
|
draw(context: CanvasRenderingContext2D): void;
|
|
25
32
|
resize(): void;
|
|
33
|
+
update(delta: IDelta): void;
|
|
26
34
|
private readonly _calcPosition;
|
|
35
|
+
private readonly _prepareToDie;
|
|
27
36
|
private readonly _updateParticlePosition;
|
|
37
|
+
private readonly play;
|
|
28
38
|
}
|
|
29
39
|
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type Engine, type ICoordinates, type RecursivePartial } from "@tsparticles/engine";
|
|
2
|
+
import type { AbsorberContainer } from "./AbsorberContainer.js";
|
|
3
|
+
import type { AbsorberInstance } from "./AbsorberInstance.js";
|
|
4
|
+
import type { IAbsorber } from "./Options/Interfaces/IAbsorber.js";
|
|
5
|
+
export declare class AbsorbersInstancesManager {
|
|
6
|
+
private readonly _containerArrays;
|
|
7
|
+
private readonly _engine;
|
|
8
|
+
constructor(engine: Engine);
|
|
9
|
+
addAbsorber(container: AbsorberContainer, options: RecursivePartial<IAbsorber>, position?: ICoordinates): Promise<AbsorberInstance>;
|
|
10
|
+
clear(container: AbsorberContainer): void;
|
|
11
|
+
getArray(container: AbsorberContainer): AbsorberInstance[];
|
|
12
|
+
initContainer(container: AbsorberContainer): void;
|
|
13
|
+
removeAbsorber(container: AbsorberContainer, absorber: AbsorberInstance): void;
|
|
14
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { AbsorberModeOptions, IAbsorberModeOptions } 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 { AbsorberContainer } from "./AbsorberContainer.js";
|
|
5
|
+
import type { AbsorbersInstancesManager } from "./AbsorbersInstancesManager.js";
|
|
6
|
+
export declare class AbsorbersInteractor extends ExternalInteractorBase<AbsorberContainer> {
|
|
7
|
+
handleClickMode: (mode: string, interactivityData: IInteractivityData) => void;
|
|
8
|
+
private readonly _instancesManager;
|
|
9
|
+
private dragging;
|
|
10
|
+
private draggingAbsorber;
|
|
11
|
+
constructor(container: AbsorberContainer, instancesManager: AbsorbersInstancesManager);
|
|
12
|
+
clear(): void;
|
|
13
|
+
init(): void;
|
|
14
|
+
interact(interactivityData: IInteractivityData, delta: IDelta): void;
|
|
15
|
+
isEnabled(interactivityData: IInteractivityData, particle?: InteractivityParticle): boolean;
|
|
16
|
+
loadModeOptions(options: Modes & AbsorberModeOptions, ...sources: RecursivePartial<(IModes & IAbsorberModeOptions) | undefined>[]): void;
|
|
17
|
+
reset(): void;
|
|
18
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { AbsorberOptions, IAbsorberOptions } from "./types.js";
|
|
2
|
-
import { type
|
|
2
|
+
import { type Container, type IContainerPlugin, type IOptions, type IPlugin, type RecursivePartial } from "@tsparticles/engine";
|
|
3
3
|
import type { AbsorberContainer } from "./AbsorberContainer.js";
|
|
4
|
-
import {
|
|
4
|
+
import type { AbsorbersInstancesManager } from "./AbsorbersInstancesManager.js";
|
|
5
5
|
export declare class AbsorbersPlugin implements IPlugin {
|
|
6
|
-
readonly id
|
|
7
|
-
private readonly
|
|
8
|
-
constructor(
|
|
9
|
-
getPlugin(container: AbsorberContainer): Promise<
|
|
10
|
-
loadOptions(options: AbsorberOptions, source?: RecursivePartial<IAbsorberOptions>): void;
|
|
6
|
+
readonly id = "absorbers";
|
|
7
|
+
private readonly _instancesManager;
|
|
8
|
+
constructor(instancesManager: AbsorbersInstancesManager);
|
|
9
|
+
getPlugin(container: AbsorberContainer): Promise<IContainerPlugin>;
|
|
10
|
+
loadOptions(_container: Container, options: AbsorberOptions, source?: RecursivePartial<IAbsorberOptions>): void;
|
|
11
11
|
needsPlugin(options?: RecursivePartial<IOptions & IAbsorberOptions>): boolean;
|
|
12
12
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type IContainerPlugin, type IDelta, type Particle } from "@tsparticles/engine";
|
|
2
|
+
import type { AbsorberContainer } from "./AbsorberContainer.js";
|
|
3
|
+
import type { AbsorbersInstancesManager } from "./AbsorbersInstancesManager.js";
|
|
4
|
+
export declare class AbsorbersPluginInstance implements IContainerPlugin {
|
|
5
|
+
private readonly _container;
|
|
6
|
+
private readonly _instancesManager;
|
|
7
|
+
constructor(container: AbsorberContainer, instancesManager: AbsorbersInstancesManager);
|
|
8
|
+
draw(context: CanvasRenderingContext2D): void;
|
|
9
|
+
init(): Promise<void>;
|
|
10
|
+
particleUpdate(particle: Particle, delta: IDelta): void;
|
|
11
|
+
resize(): void;
|
|
12
|
+
stop(): void;
|
|
13
|
+
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { type IOptionLoader, type IRangedCoordinates, OptionsColor, type RecursivePartial } from "@tsparticles/engine";
|
|
2
|
+
import { AbsorberLife } from "./AbsorberLife.js";
|
|
2
3
|
import { AbsorberSize } from "./AbsorberSize.js";
|
|
3
4
|
import type { IAbsorber } from "../Interfaces/IAbsorber.js";
|
|
4
5
|
export declare class Absorber implements IAbsorber, IOptionLoader<IAbsorber> {
|
|
5
6
|
color: OptionsColor;
|
|
6
7
|
destroy: boolean;
|
|
7
8
|
draggable: boolean;
|
|
9
|
+
life: AbsorberLife;
|
|
8
10
|
name?: string;
|
|
9
11
|
opacity: number;
|
|
10
12
|
orbits: boolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type IOptionLoader, type RangeValue, type RecursivePartial } from "@tsparticles/engine";
|
|
2
|
+
import type { IAbsorberLife } from "../Interfaces/IAbsorberLife.js";
|
|
3
|
+
export declare class AbsorberLife implements IAbsorberLife, IOptionLoader<IAbsorberLife> {
|
|
4
|
+
count?: number;
|
|
5
|
+
delay?: RangeValue;
|
|
6
|
+
duration?: RangeValue;
|
|
7
|
+
wait: boolean;
|
|
8
|
+
constructor();
|
|
9
|
+
load(data?: RecursivePartial<IAbsorberLife>): void;
|
|
10
|
+
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { IOptionsColor, IRangedCoordinates, RecursivePartial } from "@tsparticles/engine";
|
|
2
|
+
import type { IAbsorberLife } from "./IAbsorberLife.js";
|
|
2
3
|
import type { IAbsorberSize } from "./IAbsorberSize.js";
|
|
3
4
|
export interface IAbsorber {
|
|
4
5
|
color: string | IOptionsColor;
|
|
5
6
|
destroy: boolean;
|
|
6
7
|
draggable: boolean;
|
|
8
|
+
life: IAbsorberLife;
|
|
7
9
|
name?: string;
|
|
8
10
|
opacity: number;
|
|
9
11
|
orbits: boolean;
|
package/types/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import { type Engine } from "@tsparticles/engine";
|
|
2
|
-
export declare function loadAbsorbersPlugin(engine: Engine): void
|
|
2
|
+
export declare function loadAbsorbersPlugin(engine: Engine): Promise<void>;
|
|
3
3
|
export type * from "./AbsorberContainer.js";
|
|
4
|
-
export * from "./Enums/AbsorberClickMode.js";
|
package/types/types.d.ts
CHANGED
|
@@ -1,19 +1,22 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IInteractivityOptions, InteractivityOptions } from "@tsparticles/plugin-interactivity";
|
|
2
2
|
import type { Absorber } from "./Options/Classes/Absorber.js";
|
|
3
3
|
import type { IAbsorber } from "./Options/Interfaces/IAbsorber.js";
|
|
4
|
-
|
|
4
|
+
import type { SingleOrMultiple } from "@tsparticles/engine";
|
|
5
|
+
export interface AbsorberModeOptions {
|
|
6
|
+
absorbers?: Absorber[];
|
|
7
|
+
}
|
|
8
|
+
export interface IAbsorberModeOptions {
|
|
9
|
+
absorbers?: SingleOrMultiple<IAbsorber>;
|
|
10
|
+
}
|
|
11
|
+
export type AbsorberOptions = InteractivityOptions & {
|
|
5
12
|
absorbers: SingleOrMultiple<Absorber>;
|
|
6
13
|
interactivity: {
|
|
7
|
-
modes:
|
|
8
|
-
absorbers: SingleOrMultiple<Absorber>;
|
|
9
|
-
};
|
|
14
|
+
modes: AbsorberModeOptions;
|
|
10
15
|
};
|
|
11
16
|
};
|
|
12
|
-
export type IAbsorberOptions =
|
|
17
|
+
export type IAbsorberOptions = IInteractivityOptions & {
|
|
13
18
|
absorbers: SingleOrMultiple<IAbsorber>;
|
|
14
19
|
interactivity: {
|
|
15
|
-
modes:
|
|
16
|
-
absorbers: SingleOrMultiple<IAbsorber>;
|
|
17
|
-
};
|
|
20
|
+
modes: IAbsorberModeOptions;
|
|
18
21
|
};
|
|
19
22
|
};
|
package/umd/AbsorberInstance.js
CHANGED
|
@@ -12,62 +12,31 @@
|
|
|
12
12
|
exports.AbsorberInstance = void 0;
|
|
13
13
|
const engine_1 = require("@tsparticles/engine");
|
|
14
14
|
const Absorber_js_1 = require("./Options/Classes/Absorber.js");
|
|
15
|
-
const squareExp = 2, absorbFactor = 0.033, minOrbitLength = 0, minRadius = 0, minMass = 0, minAngle = 0,
|
|
15
|
+
const squareExp = 2, absorbFactor = 0.033, minOrbitLength = 0, minRadius = 0, minMass = 0, minAngle = 0, maxAngle = engine_1.doublePI, minVelocity = 0, defaultLifeDelay = 0, minLifeCount = 0, defaultSpawnDelay = 0, defaultLifeCount = -1;
|
|
16
16
|
class AbsorberInstance {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
if (this.options.orbits) {
|
|
38
|
-
if (particle.absorberOrbit === undefined) {
|
|
39
|
-
particle.absorberOrbit = engine_1.Vector.origin;
|
|
40
|
-
particle.absorberOrbit.length = (0, engine_1.getDistance)(particle.getPosition(), this.position);
|
|
41
|
-
particle.absorberOrbit.angle = (0, engine_1.getRandom)() * maxAngle;
|
|
42
|
-
}
|
|
43
|
-
if (particle.absorberOrbit.length <= this.size && !this.options.destroy) {
|
|
44
|
-
const minSize = Math.min(canvasSize.width, canvasSize.height), offset = 1, randomOffset = 0.1, randomFactor = 0.2;
|
|
45
|
-
particle.absorberOrbit.length = minSize * (offset + ((0, engine_1.getRandom)() * randomFactor - randomOffset));
|
|
46
|
-
}
|
|
47
|
-
particle.absorberOrbitDirection ??=
|
|
48
|
-
particle.velocity.x >= minVelocity ? engine_1.RotateDirection.clockwise : engine_1.RotateDirection.counterClockwise;
|
|
49
|
-
const orbitRadius = particle.absorberOrbit.length, orbitAngle = particle.absorberOrbit.angle, orbitDirection = particle.absorberOrbitDirection;
|
|
50
|
-
particle.velocity.setTo(engine_1.Vector.origin);
|
|
51
|
-
const updateFunc = {
|
|
52
|
-
x: orbitDirection === engine_1.RotateDirection.clockwise ? Math.cos : Math.sin,
|
|
53
|
-
y: orbitDirection === engine_1.RotateDirection.clockwise ? Math.sin : Math.cos,
|
|
54
|
-
};
|
|
55
|
-
particle.position.x = this.position.x + orbitRadius * updateFunc.x(orbitAngle);
|
|
56
|
-
particle.position.y = this.position.y + orbitRadius * updateFunc.y(orbitAngle);
|
|
57
|
-
particle.absorberOrbit.length -= v.length;
|
|
58
|
-
particle.absorberOrbit.angle +=
|
|
59
|
-
(((particle.retina.moveSpeed ?? minVelocity) * container.retina.pixelRatio) / engine_1.percentDenominator) *
|
|
60
|
-
container.retina.reduceFactor;
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
63
|
-
const addV = engine_1.Vector.origin;
|
|
64
|
-
addV.length = v.length;
|
|
65
|
-
addV.angle = v.angle;
|
|
66
|
-
particle.velocity.addTo(addV);
|
|
67
|
-
}
|
|
68
|
-
};
|
|
17
|
+
color;
|
|
18
|
+
limit;
|
|
19
|
+
mass;
|
|
20
|
+
name;
|
|
21
|
+
opacity;
|
|
22
|
+
options;
|
|
23
|
+
position;
|
|
24
|
+
size;
|
|
25
|
+
_container;
|
|
26
|
+
_currentDuration;
|
|
27
|
+
_currentSpawnDelay;
|
|
28
|
+
_duration;
|
|
29
|
+
_engine;
|
|
30
|
+
_firstSpawn;
|
|
31
|
+
_immortal;
|
|
32
|
+
_lifeCount;
|
|
33
|
+
_spawnDelay;
|
|
34
|
+
initialPosition;
|
|
35
|
+
constructor(engine, container, options, position) {
|
|
69
36
|
this._container = container;
|
|
70
37
|
this._engine = engine;
|
|
38
|
+
this._currentDuration = 0;
|
|
39
|
+
this._currentSpawnDelay = 0;
|
|
71
40
|
this.initialPosition = position ? engine_1.Vector.create(position.x, position.y) : undefined;
|
|
72
41
|
if (options instanceof Absorber_js_1.Absorber) {
|
|
73
42
|
this.options = options;
|
|
@@ -76,7 +45,6 @@
|
|
|
76
45
|
this.options = new Absorber_js_1.Absorber();
|
|
77
46
|
this.options.load(options);
|
|
78
47
|
}
|
|
79
|
-
this.dragging = false;
|
|
80
48
|
this.name = this.options.name;
|
|
81
49
|
this.opacity = this.options.opacity;
|
|
82
50
|
this.size = (0, engine_1.getRangeValue)(this.options.size.value) * container.retina.pixelRatio;
|
|
@@ -92,29 +60,19 @@
|
|
|
92
60
|
r: 0,
|
|
93
61
|
};
|
|
94
62
|
this.position = this.initialPosition?.copy() ?? this._calcPosition();
|
|
63
|
+
this._firstSpawn = !this.options.life.wait;
|
|
64
|
+
this._lifeCount = this.options.life.count ?? defaultLifeCount;
|
|
65
|
+
this._immortal = this._lifeCount <= minLifeCount;
|
|
66
|
+
this._spawnDelay = container.retina.reduceFactor
|
|
67
|
+
? ((0, engine_1.getRangeValue)(this.options.life.delay ?? defaultLifeDelay) * engine_1.millisecondsToSeconds) /
|
|
68
|
+
container.retina.reduceFactor
|
|
69
|
+
: Infinity;
|
|
95
70
|
}
|
|
96
|
-
attract(particle) {
|
|
97
|
-
const container = this._container, options = this.options;
|
|
98
|
-
if (options.draggable) {
|
|
99
|
-
const mouse = container.interactivity.mouse;
|
|
100
|
-
if (mouse.clicking && mouse.downPosition) {
|
|
101
|
-
const mouseDist = (0, engine_1.getDistance)(this.position, mouse.downPosition);
|
|
102
|
-
if (mouseDist <= this.size) {
|
|
103
|
-
this.dragging = true;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
else {
|
|
107
|
-
this.dragging = false;
|
|
108
|
-
}
|
|
109
|
-
if (this.dragging && mouse.position) {
|
|
110
|
-
this.position.x = mouse.position.x;
|
|
111
|
-
this.position.y = mouse.position.y;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
const pos = particle.getPosition(), { dx, dy, distance } = (0, engine_1.getDistances)(this.position, pos), v = engine_1.Vector.create(dx, dy);
|
|
71
|
+
attract(particle, delta) {
|
|
72
|
+
const container = this._container, options = this.options, pos = particle.getPosition(), { dx, dy, distance } = (0, engine_1.getDistances)(this.position, pos), v = engine_1.Vector.create(dx, dy);
|
|
115
73
|
v.length = (this.mass / Math.pow(distance, squareExp)) * container.retina.reduceFactor;
|
|
116
74
|
if (distance < this.size + particle.getRadius()) {
|
|
117
|
-
const sizeFactor = particle.getRadius() * absorbFactor * container.retina.pixelRatio;
|
|
75
|
+
const sizeFactor = particle.getRadius() * absorbFactor * container.retina.pixelRatio * delta.factor;
|
|
118
76
|
if ((this.size > particle.getRadius() && distance < this.size - particle.getRadius()) ||
|
|
119
77
|
(particle.absorberOrbit !== undefined && particle.absorberOrbit.length < minOrbitLength)) {
|
|
120
78
|
if (options.destroy) {
|
|
@@ -157,6 +115,103 @@
|
|
|
157
115
|
? initialPosition
|
|
158
116
|
: this._calcPosition();
|
|
159
117
|
}
|
|
118
|
+
update(delta) {
|
|
119
|
+
if (this._firstSpawn) {
|
|
120
|
+
this._firstSpawn = false;
|
|
121
|
+
this._currentSpawnDelay = this._spawnDelay ?? defaultSpawnDelay;
|
|
122
|
+
}
|
|
123
|
+
if (this._duration !== undefined) {
|
|
124
|
+
this._currentDuration += delta.value;
|
|
125
|
+
if (this._currentDuration >= this._duration) {
|
|
126
|
+
if (!this._immortal) {
|
|
127
|
+
this._lifeCount--;
|
|
128
|
+
}
|
|
129
|
+
if (this._lifeCount > minLifeCount || this._immortal) {
|
|
130
|
+
this.position = this._calcPosition();
|
|
131
|
+
this._spawnDelay = this._container.retina.reduceFactor
|
|
132
|
+
? ((0, engine_1.getRangeValue)(this.options.life.delay ?? defaultLifeDelay) * engine_1.millisecondsToSeconds) /
|
|
133
|
+
this._container.retina.reduceFactor
|
|
134
|
+
: Infinity;
|
|
135
|
+
}
|
|
136
|
+
this._currentDuration -= this._duration;
|
|
137
|
+
delete this._duration;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
if (this._spawnDelay !== undefined) {
|
|
141
|
+
this._currentSpawnDelay += delta.value;
|
|
142
|
+
if (this._currentSpawnDelay >= this._spawnDelay) {
|
|
143
|
+
this.play();
|
|
144
|
+
this._currentSpawnDelay -= this._spawnDelay;
|
|
145
|
+
delete this._spawnDelay;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
_calcPosition = () => {
|
|
150
|
+
const exactPosition = (0, engine_1.calcPositionOrRandomFromSizeRanged)({
|
|
151
|
+
size: this._container.canvas.size,
|
|
152
|
+
position: this.options.position,
|
|
153
|
+
});
|
|
154
|
+
return engine_1.Vector.create(exactPosition.x, exactPosition.y);
|
|
155
|
+
};
|
|
156
|
+
_prepareToDie = () => {
|
|
157
|
+
const duration = this.options.life.duration !== undefined ? (0, engine_1.getRangeValue)(this.options.life.duration) : undefined, minDuration = 0;
|
|
158
|
+
if ((this._lifeCount > minLifeCount || this._immortal) && duration !== undefined && duration > minDuration) {
|
|
159
|
+
this._duration = duration * engine_1.millisecondsToSeconds;
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
_updateParticlePosition = (particle, v) => {
|
|
163
|
+
if (particle.destroyed) {
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
const container = this._container, canvasSize = container.canvas.size;
|
|
167
|
+
if (particle.needsNewPosition) {
|
|
168
|
+
const newPosition = (0, engine_1.calcPositionOrRandomFromSize)({ size: canvasSize });
|
|
169
|
+
particle.position.setTo(newPosition);
|
|
170
|
+
particle.velocity.setTo(particle.initialVelocity);
|
|
171
|
+
particle.absorberOrbit = undefined;
|
|
172
|
+
particle.needsNewPosition = false;
|
|
173
|
+
}
|
|
174
|
+
if (this.options.orbits) {
|
|
175
|
+
if (particle.absorberOrbit === undefined) {
|
|
176
|
+
particle.absorberOrbit = engine_1.Vector.origin;
|
|
177
|
+
particle.absorberOrbit.length = (0, engine_1.getDistance)(particle.getPosition(), this.position);
|
|
178
|
+
particle.absorberOrbit.angle = (0, engine_1.getRandom)() * maxAngle;
|
|
179
|
+
}
|
|
180
|
+
if (particle.absorberOrbit.length <= this.size && !this.options.destroy) {
|
|
181
|
+
const minSize = Math.min(canvasSize.width, canvasSize.height), offset = 1, randomOffset = 0.1, randomFactor = 0.2;
|
|
182
|
+
particle.absorberOrbit.length = minSize * (offset + ((0, engine_1.getRandom)() * randomFactor - randomOffset));
|
|
183
|
+
}
|
|
184
|
+
particle.absorberOrbitDirection ??=
|
|
185
|
+
particle.velocity.x >= minVelocity ? engine_1.RotateDirection.clockwise : engine_1.RotateDirection.counterClockwise;
|
|
186
|
+
const orbitRadius = particle.absorberOrbit.length, orbitAngle = particle.absorberOrbit.angle, orbitDirection = particle.absorberOrbitDirection;
|
|
187
|
+
particle.velocity.setTo(engine_1.Vector.origin);
|
|
188
|
+
const updateFunc = {
|
|
189
|
+
x: orbitDirection === engine_1.RotateDirection.clockwise ? Math.cos : Math.sin,
|
|
190
|
+
y: orbitDirection === engine_1.RotateDirection.clockwise ? Math.sin : Math.cos,
|
|
191
|
+
};
|
|
192
|
+
particle.position.x = this.position.x + orbitRadius * updateFunc.x(orbitAngle);
|
|
193
|
+
particle.position.y = this.position.y + orbitRadius * updateFunc.y(orbitAngle);
|
|
194
|
+
particle.absorberOrbit.length -= v.length;
|
|
195
|
+
particle.absorberOrbit.angle +=
|
|
196
|
+
(((particle.retina.moveSpeed ?? minVelocity) * container.retina.pixelRatio) / engine_1.percentDenominator) *
|
|
197
|
+
container.retina.reduceFactor;
|
|
198
|
+
}
|
|
199
|
+
else {
|
|
200
|
+
const addV = engine_1.Vector.origin;
|
|
201
|
+
addV.length = v.length;
|
|
202
|
+
addV.angle = v.angle;
|
|
203
|
+
particle.velocity.addTo(addV);
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
play = () => {
|
|
207
|
+
if (!((this._lifeCount > minLifeCount || this._immortal || !this.options.life.count) &&
|
|
208
|
+
(this._firstSpawn || this._currentSpawnDelay >= (this._spawnDelay ?? defaultSpawnDelay)))) {
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
if (this._lifeCount > minLifeCount || this._immortal) {
|
|
212
|
+
this._prepareToDie();
|
|
213
|
+
}
|
|
214
|
+
};
|
|
160
215
|
}
|
|
161
216
|
exports.AbsorberInstance = AbsorberInstance;
|
|
162
217
|
});
|