@tsparticles/updater-destroy 3.0.3 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/190.min.js ADDED
@@ -0,0 +1,2 @@
1
+ /*! For license information please see 190.min.js.LICENSE.txt */
2
+ (this.webpackChunk_tsparticles_updater_destroy=this.webpackChunk_tsparticles_updater_destroy||[]).push([[190],{190:(t,o,e)=>{e.d(o,{DestroyUpdater:()=>g});var s=e(533);class i{load(t){t&&(void 0!==t.bottom&&(this.bottom=(0,s.setRangeValue)(t.bottom)),void 0!==t.left&&(this.left=(0,s.setRangeValue)(t.left)),void 0!==t.right&&(this.right=(0,s.setRangeValue)(t.right)),void 0!==t.top&&(this.top=(0,s.setRangeValue)(t.top)))}}class n extends s.ValueWithRandom{constructor(){super(),this.value=3}}class l extends s.ValueWithRandom{constructor(){super(),this.value={min:4,max:9}}}class r{constructor(){this.count=1,this.factor=new n,this.rate=new l,this.sizeOffset=!0}load(t){t&&(void 0!==t.color&&(this.color=s.OptionsColor.create(this.color,t.color)),void 0!==t.count&&(this.count=t.count),this.factor.load(t.factor),this.rate.load(t.rate),this.particles=(0,s.executeOnSingleOrMultiple)(t.particles,(t=>(0,s.deepExtend)({},t))),void 0!==t.sizeOffset&&(this.sizeOffset=t.sizeOffset),t.colorOffset&&(this.colorOffset=this.colorOffset??{},void 0!==t.colorOffset.h&&(this.colorOffset.h=t.colorOffset.h),void 0!==t.colorOffset.s&&(this.colorOffset.s=t.colorOffset.s),void 0!==t.colorOffset.l&&(this.colorOffset.l=t.colorOffset.l)))}}class a{constructor(){this.bounds=new i,this.mode="none",this.split=new r}load(t){t&&(t.mode&&(this.mode=t.mode),t.bounds&&this.bounds.load(t.bounds),this.split.load(t.split))}}const c=0,d=.5,u=0,h=1,f=500;async function p(t,o,e,i){const n=e.options.destroy;if(!n)return;const l=n.split,r=(0,s.loadParticlesOptions)(t,o,e.options),a=(0,s.getRangeValue)(l.factor.value),p=e.getFillColor();l.color?r.color.load(l.color):l.colorOffset&&p?r.color.load({value:{hsl:{h:p.h+(0,s.getRangeValue)(l.colorOffset.h??c),s:p.s+(0,s.getRangeValue)(l.colorOffset.s??c),l:p.l+(0,s.getRangeValue)(l.colorOffset.l??c)}}}):r.color.load({value:{hsl:e.getFillColor()}}),r.move.load({center:{x:e.position.x,y:e.position.y,mode:"precise"}}),(0,s.isNumber)(r.size.value)?r.size.value/=a:(r.size.value.min/=a,r.size.value.max/=a),r.load(i);const g=l.sizeOffset?(0,s.setRangeValue)(-e.size.value,e.size.value):c,v={x:e.position.x+(0,s.randomInRange)(g),y:e.position.y+(0,s.randomInRange)(g)};return o.particles.addParticle(v,r,e.group,(t=>!(t.size.value<d)&&(t.velocity.length=(0,s.randomInRange)((0,s.setRangeValue)(e.velocity.length,t.velocity.length)),t.splitCount=(e.splitCount??u)+h,t.unbreakable=!0,setTimeout((()=>{t.unbreakable=!1}),f),!0)))}class g{constructor(t,o){this.container=o,this.engine=t}async init(t){const o=this.container,e=t.options.destroy;if(!e)return;t.splitCount=0;const i=e.bounds;t.destroyBounds||(t.destroyBounds={});const{bottom:n,left:l,right:r,top:a}=i,{destroyBounds:c}=t,d=o.canvas.size;n&&(c.bottom=(0,s.getRangeValue)(n)*d.height/s.percentDenominator),l&&(c.left=(0,s.getRangeValue)(l)*d.width/s.percentDenominator),r&&(c.right=(0,s.getRangeValue)(r)*d.width/s.percentDenominator),a&&(c.top=(0,s.getRangeValue)(a)*d.height/s.percentDenominator),await Promise.resolve()}isEnabled(t){return!t.destroyed}loadOptions(t,...o){t.destroy||(t.destroy=new a);for(const e of o)t.destroy.load(e?.destroy)}particleDestroyed(t,o){if(o)return;const e=t.options.destroy;e&&"split"===e.mode&&async function(t,o,e){const i=e.options.destroy;if(!i)return;const n=i.split;if(n.count>=0&&(void 0===e.splitCount||e.splitCount++>n.count))return;const l=(0,s.getRangeValue)(n.rate.value),r=(0,s.itemFromSingleOrMultiple)(n.particles);for(let s=0;s<l;s++)await p(t,o,e,r)}(this.engine,this.container,t)}async update(t){if(!this.isEnabled(t))return;const o=t.getPosition(),e=t.destroyBounds;e&&((void 0!==e.bottom&&o.y>=e.bottom||void 0!==e.left&&o.x<=e.left||void 0!==e.right&&o.x>=e.right||void 0!==e.top&&o.y<=e.top)&&t.destroy(),await Promise.resolve())}}}}]);
@@ -0,0 +1 @@
1
+ /*! tsParticles Destroy Updater v3.2.0 by Matteo Bruni */
@@ -1,12 +1,12 @@
1
- import { getRangeValue, } from "@tsparticles/engine";
1
+ import { getRangeValue, percentDenominator, } from "@tsparticles/engine";
2
2
  import { Destroy } from "./Options/Classes/Destroy.js";
3
3
  import { split } from "./Utils.js";
4
4
  export class DestroyUpdater {
5
5
  constructor(engine, container) {
6
- this.engine = engine;
7
6
  this.container = container;
7
+ this.engine = engine;
8
8
  }
9
- init(particle) {
9
+ async init(particle) {
10
10
  const container = this.container, particlesOptions = particle.options, destroyOptions = particlesOptions.destroy;
11
11
  if (!destroyOptions) {
12
12
  return;
@@ -18,17 +18,18 @@ export class DestroyUpdater {
18
18
  }
19
19
  const { bottom, left, right, top } = destroyBoundsOptions, { destroyBounds } = particle, canvasSize = container.canvas.size;
20
20
  if (bottom) {
21
- destroyBounds.bottom = (getRangeValue(bottom) * canvasSize.height) / 100;
21
+ destroyBounds.bottom = (getRangeValue(bottom) * canvasSize.height) / percentDenominator;
22
22
  }
23
23
  if (left) {
24
- destroyBounds.left = (getRangeValue(left) * canvasSize.width) / 100;
24
+ destroyBounds.left = (getRangeValue(left) * canvasSize.width) / percentDenominator;
25
25
  }
26
26
  if (right) {
27
- destroyBounds.right = (getRangeValue(right) * canvasSize.width) / 100;
27
+ destroyBounds.right = (getRangeValue(right) * canvasSize.width) / percentDenominator;
28
28
  }
29
29
  if (top) {
30
- destroyBounds.top = (getRangeValue(top) * canvasSize.height) / 100;
30
+ destroyBounds.top = (getRangeValue(top) * canvasSize.height) / percentDenominator;
31
31
  }
32
+ await Promise.resolve();
32
33
  }
33
34
  isEnabled(particle) {
34
35
  return !particle.destroyed;
@@ -47,10 +48,10 @@ export class DestroyUpdater {
47
48
  }
48
49
  const destroyOptions = particle.options.destroy;
49
50
  if (destroyOptions && destroyOptions.mode === "split") {
50
- split(this.engine, this.container, particle);
51
+ void split(this.engine, this.container, particle);
51
52
  }
52
53
  }
53
- update(particle) {
54
+ async update(particle) {
54
55
  if (!this.isEnabled(particle)) {
55
56
  return;
56
57
  }
@@ -64,5 +65,6 @@ export class DestroyUpdater {
64
65
  (bounds.top !== undefined && position.y <= bounds.top)) {
65
66
  particle.destroy();
66
67
  }
68
+ await Promise.resolve();
67
69
  }
68
70
  }
package/browser/Utils.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { getRangeValue, isNumber, itemFromSingleOrMultiple, loadParticlesOptions, randomInRange, setRangeValue, } from "@tsparticles/engine";
2
- function addSplitParticle(engine, container, parent, splitParticlesOptions) {
2
+ const defaultOffset = 0, minDestroySize = 0.5, defaultSplitCount = 0, increment = 1, unbreakableTime = 500, minSplitCount = 0;
3
+ async function addSplitParticle(engine, container, parent, splitParticlesOptions) {
3
4
  const destroyOptions = parent.options.destroy;
4
5
  if (!destroyOptions) {
5
6
  return;
@@ -12,9 +13,9 @@ function addSplitParticle(engine, container, parent, splitParticlesOptions) {
12
13
  options.color.load({
13
14
  value: {
14
15
  hsl: {
15
- h: parentColor.h + getRangeValue(splitOptions.colorOffset.h ?? 0),
16
- s: parentColor.s + getRangeValue(splitOptions.colorOffset.s ?? 0),
17
- l: parentColor.l + getRangeValue(splitOptions.colorOffset.l ?? 0),
16
+ h: parentColor.h + getRangeValue(splitOptions.colorOffset.h ?? defaultOffset),
17
+ s: parentColor.s + getRangeValue(splitOptions.colorOffset.s ?? defaultOffset),
18
+ l: parentColor.l + getRangeValue(splitOptions.colorOffset.l ?? defaultOffset),
18
19
  },
19
20
  },
20
21
  });
@@ -41,34 +42,35 @@ function addSplitParticle(engine, container, parent, splitParticlesOptions) {
41
42
  options.size.value.max /= factor;
42
43
  }
43
44
  options.load(splitParticlesOptions);
44
- const offset = splitOptions.sizeOffset ? setRangeValue(-parent.size.value, parent.size.value) : 0, position = {
45
+ const offset = splitOptions.sizeOffset ? setRangeValue(-parent.size.value, parent.size.value) : defaultOffset, position = {
45
46
  x: parent.position.x + randomInRange(offset),
46
47
  y: parent.position.y + randomInRange(offset),
47
48
  };
48
49
  return container.particles.addParticle(position, options, parent.group, (particle) => {
49
- if (particle.size.value < 0.5) {
50
+ if (particle.size.value < minDestroySize) {
50
51
  return false;
51
52
  }
52
53
  particle.velocity.length = randomInRange(setRangeValue(parent.velocity.length, particle.velocity.length));
53
- particle.splitCount = (parent.splitCount ?? 0) + 1;
54
+ particle.splitCount = (parent.splitCount ?? defaultSplitCount) + increment;
54
55
  particle.unbreakable = true;
55
56
  setTimeout(() => {
56
57
  particle.unbreakable = false;
57
- }, 500);
58
+ }, unbreakableTime);
58
59
  return true;
59
60
  });
60
61
  }
61
- export function split(engine, container, particle) {
62
+ export async function split(engine, container, particle) {
62
63
  const destroyOptions = particle.options.destroy;
63
64
  if (!destroyOptions) {
64
65
  return;
65
66
  }
66
67
  const splitOptions = destroyOptions.split;
67
- if (splitOptions.count >= 0 && (particle.splitCount === undefined || particle.splitCount++ > splitOptions.count)) {
68
+ if (splitOptions.count >= minSplitCount &&
69
+ (particle.splitCount === undefined || particle.splitCount++ > splitOptions.count)) {
68
70
  return;
69
71
  }
70
72
  const rate = getRangeValue(splitOptions.rate.value), particlesSplitOptions = itemFromSingleOrMultiple(splitOptions.particles);
71
73
  for (let i = 0; i < rate; i++) {
72
- addSplitParticle(engine, container, particle, particlesSplitOptions);
74
+ await addSplitParticle(engine, container, particle, particlesSplitOptions);
73
75
  }
74
76
  }
package/browser/index.js CHANGED
@@ -1,4 +1,6 @@
1
- import { DestroyUpdater } from "./DestroyUpdater.js";
2
1
  export async function loadDestroyUpdater(engine, refresh = true) {
3
- await engine.addParticleUpdater("destroy", (container) => new DestroyUpdater(engine, container), refresh);
2
+ await engine.addParticleUpdater("destroy", async (container) => {
3
+ const { DestroyUpdater } = await import("./DestroyUpdater.js");
4
+ return new DestroyUpdater(engine, container);
5
+ }, refresh);
4
6
  }
@@ -6,10 +6,10 @@ const Destroy_js_1 = require("./Options/Classes/Destroy.js");
6
6
  const Utils_js_1 = require("./Utils.js");
7
7
  class DestroyUpdater {
8
8
  constructor(engine, container) {
9
- this.engine = engine;
10
9
  this.container = container;
10
+ this.engine = engine;
11
11
  }
12
- init(particle) {
12
+ async init(particle) {
13
13
  const container = this.container, particlesOptions = particle.options, destroyOptions = particlesOptions.destroy;
14
14
  if (!destroyOptions) {
15
15
  return;
@@ -21,17 +21,18 @@ class DestroyUpdater {
21
21
  }
22
22
  const { bottom, left, right, top } = destroyBoundsOptions, { destroyBounds } = particle, canvasSize = container.canvas.size;
23
23
  if (bottom) {
24
- destroyBounds.bottom = ((0, engine_1.getRangeValue)(bottom) * canvasSize.height) / 100;
24
+ destroyBounds.bottom = ((0, engine_1.getRangeValue)(bottom) * canvasSize.height) / engine_1.percentDenominator;
25
25
  }
26
26
  if (left) {
27
- destroyBounds.left = ((0, engine_1.getRangeValue)(left) * canvasSize.width) / 100;
27
+ destroyBounds.left = ((0, engine_1.getRangeValue)(left) * canvasSize.width) / engine_1.percentDenominator;
28
28
  }
29
29
  if (right) {
30
- destroyBounds.right = ((0, engine_1.getRangeValue)(right) * canvasSize.width) / 100;
30
+ destroyBounds.right = ((0, engine_1.getRangeValue)(right) * canvasSize.width) / engine_1.percentDenominator;
31
31
  }
32
32
  if (top) {
33
- destroyBounds.top = ((0, engine_1.getRangeValue)(top) * canvasSize.height) / 100;
33
+ destroyBounds.top = ((0, engine_1.getRangeValue)(top) * canvasSize.height) / engine_1.percentDenominator;
34
34
  }
35
+ await Promise.resolve();
35
36
  }
36
37
  isEnabled(particle) {
37
38
  return !particle.destroyed;
@@ -50,10 +51,10 @@ class DestroyUpdater {
50
51
  }
51
52
  const destroyOptions = particle.options.destroy;
52
53
  if (destroyOptions && destroyOptions.mode === "split") {
53
- (0, Utils_js_1.split)(this.engine, this.container, particle);
54
+ void (0, Utils_js_1.split)(this.engine, this.container, particle);
54
55
  }
55
56
  }
56
- update(particle) {
57
+ async update(particle) {
57
58
  if (!this.isEnabled(particle)) {
58
59
  return;
59
60
  }
@@ -67,6 +68,7 @@ class DestroyUpdater {
67
68
  (bounds.top !== undefined && position.y <= bounds.top)) {
68
69
  particle.destroy();
69
70
  }
71
+ await Promise.resolve();
70
72
  }
71
73
  }
72
74
  exports.DestroyUpdater = DestroyUpdater;
package/cjs/Utils.js CHANGED
@@ -2,7 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.split = void 0;
4
4
  const engine_1 = require("@tsparticles/engine");
5
- function addSplitParticle(engine, container, parent, splitParticlesOptions) {
5
+ const defaultOffset = 0, minDestroySize = 0.5, defaultSplitCount = 0, increment = 1, unbreakableTime = 500, minSplitCount = 0;
6
+ async function addSplitParticle(engine, container, parent, splitParticlesOptions) {
6
7
  const destroyOptions = parent.options.destroy;
7
8
  if (!destroyOptions) {
8
9
  return;
@@ -15,9 +16,9 @@ function addSplitParticle(engine, container, parent, splitParticlesOptions) {
15
16
  options.color.load({
16
17
  value: {
17
18
  hsl: {
18
- h: parentColor.h + (0, engine_1.getRangeValue)(splitOptions.colorOffset.h ?? 0),
19
- s: parentColor.s + (0, engine_1.getRangeValue)(splitOptions.colorOffset.s ?? 0),
20
- l: parentColor.l + (0, engine_1.getRangeValue)(splitOptions.colorOffset.l ?? 0),
19
+ h: parentColor.h + (0, engine_1.getRangeValue)(splitOptions.colorOffset.h ?? defaultOffset),
20
+ s: parentColor.s + (0, engine_1.getRangeValue)(splitOptions.colorOffset.s ?? defaultOffset),
21
+ l: parentColor.l + (0, engine_1.getRangeValue)(splitOptions.colorOffset.l ?? defaultOffset),
21
22
  },
22
23
  },
23
24
  });
@@ -44,35 +45,36 @@ function addSplitParticle(engine, container, parent, splitParticlesOptions) {
44
45
  options.size.value.max /= factor;
45
46
  }
46
47
  options.load(splitParticlesOptions);
47
- const offset = splitOptions.sizeOffset ? (0, engine_1.setRangeValue)(-parent.size.value, parent.size.value) : 0, position = {
48
+ const offset = splitOptions.sizeOffset ? (0, engine_1.setRangeValue)(-parent.size.value, parent.size.value) : defaultOffset, position = {
48
49
  x: parent.position.x + (0, engine_1.randomInRange)(offset),
49
50
  y: parent.position.y + (0, engine_1.randomInRange)(offset),
50
51
  };
51
52
  return container.particles.addParticle(position, options, parent.group, (particle) => {
52
- if (particle.size.value < 0.5) {
53
+ if (particle.size.value < minDestroySize) {
53
54
  return false;
54
55
  }
55
56
  particle.velocity.length = (0, engine_1.randomInRange)((0, engine_1.setRangeValue)(parent.velocity.length, particle.velocity.length));
56
- particle.splitCount = (parent.splitCount ?? 0) + 1;
57
+ particle.splitCount = (parent.splitCount ?? defaultSplitCount) + increment;
57
58
  particle.unbreakable = true;
58
59
  setTimeout(() => {
59
60
  particle.unbreakable = false;
60
- }, 500);
61
+ }, unbreakableTime);
61
62
  return true;
62
63
  });
63
64
  }
64
- function split(engine, container, particle) {
65
+ async function split(engine, container, particle) {
65
66
  const destroyOptions = particle.options.destroy;
66
67
  if (!destroyOptions) {
67
68
  return;
68
69
  }
69
70
  const splitOptions = destroyOptions.split;
70
- if (splitOptions.count >= 0 && (particle.splitCount === undefined || particle.splitCount++ > splitOptions.count)) {
71
+ if (splitOptions.count >= minSplitCount &&
72
+ (particle.splitCount === undefined || particle.splitCount++ > splitOptions.count)) {
71
73
  return;
72
74
  }
73
75
  const rate = (0, engine_1.getRangeValue)(splitOptions.rate.value), particlesSplitOptions = (0, engine_1.itemFromSingleOrMultiple)(splitOptions.particles);
74
76
  for (let i = 0; i < rate; i++) {
75
- addSplitParticle(engine, container, particle, particlesSplitOptions);
77
+ await addSplitParticle(engine, container, particle, particlesSplitOptions);
76
78
  }
77
79
  }
78
80
  exports.split = split;
package/cjs/index.js CHANGED
@@ -1,8 +1,33 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  Object.defineProperty(exports, "__esModule", { value: true });
3
26
  exports.loadDestroyUpdater = void 0;
4
- const DestroyUpdater_js_1 = require("./DestroyUpdater.js");
5
27
  async function loadDestroyUpdater(engine, refresh = true) {
6
- await engine.addParticleUpdater("destroy", (container) => new DestroyUpdater_js_1.DestroyUpdater(engine, container), refresh);
28
+ await engine.addParticleUpdater("destroy", async (container) => {
29
+ const { DestroyUpdater } = await Promise.resolve().then(() => __importStar(require("./DestroyUpdater.js")));
30
+ return new DestroyUpdater(engine, container);
31
+ }, refresh);
7
32
  }
8
33
  exports.loadDestroyUpdater = loadDestroyUpdater;
@@ -0,0 +1,90 @@
1
+ /*!
2
+ * Author : Matteo Bruni
3
+ * MIT license: https://opensource.org/licenses/MIT
4
+ * Demo / Generator : https://particles.js.org/
5
+ * GitHub : https://www.github.com/matteobruni/tsparticles
6
+ * How to use? : Check the GitHub README
7
+ * v3.2.0
8
+ */
9
+ "use strict";
10
+ /*
11
+ * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
12
+ * This devtool is neither made for production nor for readable output files.
13
+ * It uses "eval()" calls to create a separate source file in the browser devtools.
14
+ * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
15
+ * or disable the default devtool with "devtool: false".
16
+ * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
17
+ */
18
+ (this["webpackChunk_tsparticles_updater_destroy"] = this["webpackChunk_tsparticles_updater_destroy"] || []).push([["dist_browser_DestroyUpdater_js"],{
19
+
20
+ /***/ "./dist/browser/DestroyUpdater.js":
21
+ /*!****************************************!*\
22
+ !*** ./dist/browser/DestroyUpdater.js ***!
23
+ \****************************************/
24
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
25
+
26
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ DestroyUpdater: () => (/* binding */ DestroyUpdater)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _Options_Classes_Destroy_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Options/Classes/Destroy.js */ \"./dist/browser/Options/Classes/Destroy.js\");\n/* harmony import */ var _Utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Utils.js */ \"./dist/browser/Utils.js\");\n\n\n\nclass DestroyUpdater {\n constructor(engine, container) {\n this.container = container;\n this.engine = engine;\n }\n async init(particle) {\n const container = this.container,\n particlesOptions = particle.options,\n destroyOptions = particlesOptions.destroy;\n if (!destroyOptions) {\n return;\n }\n particle.splitCount = 0;\n const destroyBoundsOptions = destroyOptions.bounds;\n if (!particle.destroyBounds) {\n particle.destroyBounds = {};\n }\n const {\n bottom,\n left,\n right,\n top\n } = destroyBoundsOptions,\n {\n destroyBounds\n } = particle,\n canvasSize = container.canvas.size;\n if (bottom) {\n destroyBounds.bottom = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(bottom) * canvasSize.height / _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.percentDenominator;\n }\n if (left) {\n destroyBounds.left = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(left) * canvasSize.width / _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.percentDenominator;\n }\n if (right) {\n destroyBounds.right = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(right) * canvasSize.width / _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.percentDenominator;\n }\n if (top) {\n destroyBounds.top = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(top) * canvasSize.height / _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.percentDenominator;\n }\n await Promise.resolve();\n }\n isEnabled(particle) {\n return !particle.destroyed;\n }\n loadOptions(options, ...sources) {\n if (!options.destroy) {\n options.destroy = new _Options_Classes_Destroy_js__WEBPACK_IMPORTED_MODULE_1__.Destroy();\n }\n for (const source of sources) {\n options.destroy.load(source?.destroy);\n }\n }\n particleDestroyed(particle, override) {\n if (override) {\n return;\n }\n const destroyOptions = particle.options.destroy;\n if (destroyOptions && destroyOptions.mode === \"split\") {\n void (0,_Utils_js__WEBPACK_IMPORTED_MODULE_2__.split)(this.engine, this.container, particle);\n }\n }\n async update(particle) {\n if (!this.isEnabled(particle)) {\n return;\n }\n const position = particle.getPosition(),\n bounds = particle.destroyBounds;\n if (!bounds) {\n return;\n }\n if (bounds.bottom !== undefined && position.y >= bounds.bottom || bounds.left !== undefined && position.x <= bounds.left || bounds.right !== undefined && position.x >= bounds.right || bounds.top !== undefined && position.y <= bounds.top) {\n particle.destroy();\n }\n await Promise.resolve();\n }\n}\n\n//# sourceURL=webpack://@tsparticles/updater-destroy/./dist/browser/DestroyUpdater.js?");
27
+
28
+ /***/ }),
29
+
30
+ /***/ "./dist/browser/Options/Classes/Destroy.js":
31
+ /*!*************************************************!*\
32
+ !*** ./dist/browser/Options/Classes/Destroy.js ***!
33
+ \*************************************************/
34
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
35
+
36
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Destroy: () => (/* binding */ Destroy)\n/* harmony export */ });\n/* harmony import */ var _DestroyBounds_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./DestroyBounds.js */ \"./dist/browser/Options/Classes/DestroyBounds.js\");\n/* harmony import */ var _Split_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Split.js */ \"./dist/browser/Options/Classes/Split.js\");\n\n\nclass Destroy {\n constructor() {\n this.bounds = new _DestroyBounds_js__WEBPACK_IMPORTED_MODULE_0__.DestroyBounds();\n this.mode = \"none\";\n this.split = new _Split_js__WEBPACK_IMPORTED_MODULE_1__.Split();\n }\n load(data) {\n if (!data) {\n return;\n }\n if (data.mode) {\n this.mode = data.mode;\n }\n if (data.bounds) {\n this.bounds.load(data.bounds);\n }\n this.split.load(data.split);\n }\n}\n\n//# sourceURL=webpack://@tsparticles/updater-destroy/./dist/browser/Options/Classes/Destroy.js?");
37
+
38
+ /***/ }),
39
+
40
+ /***/ "./dist/browser/Options/Classes/DestroyBounds.js":
41
+ /*!*******************************************************!*\
42
+ !*** ./dist/browser/Options/Classes/DestroyBounds.js ***!
43
+ \*******************************************************/
44
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
45
+
46
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ DestroyBounds: () => (/* binding */ DestroyBounds)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n\nclass DestroyBounds {\n load(data) {\n if (!data) {\n return;\n }\n if (data.bottom !== undefined) {\n this.bottom = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.bottom);\n }\n if (data.left !== undefined) {\n this.left = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.left);\n }\n if (data.right !== undefined) {\n this.right = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.right);\n }\n if (data.top !== undefined) {\n this.top = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.top);\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/updater-destroy/./dist/browser/Options/Classes/DestroyBounds.js?");
47
+
48
+ /***/ }),
49
+
50
+ /***/ "./dist/browser/Options/Classes/Split.js":
51
+ /*!***********************************************!*\
52
+ !*** ./dist/browser/Options/Classes/Split.js ***!
53
+ \***********************************************/
54
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
55
+
56
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Split: () => (/* binding */ Split)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _SplitFactor_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SplitFactor.js */ \"./dist/browser/Options/Classes/SplitFactor.js\");\n/* harmony import */ var _SplitRate_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./SplitRate.js */ \"./dist/browser/Options/Classes/SplitRate.js\");\n\n\n\nclass Split {\n constructor() {\n this.count = 1;\n this.factor = new _SplitFactor_js__WEBPACK_IMPORTED_MODULE_1__.SplitFactor();\n this.rate = new _SplitRate_js__WEBPACK_IMPORTED_MODULE_2__.SplitRate();\n this.sizeOffset = true;\n }\n load(data) {\n if (!data) {\n return;\n }\n if (data.color !== undefined) {\n this.color = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OptionsColor.create(this.color, data.color);\n }\n if (data.count !== undefined) {\n this.count = data.count;\n }\n this.factor.load(data.factor);\n this.rate.load(data.rate);\n this.particles = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.executeOnSingleOrMultiple)(data.particles, particles => {\n return (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.deepExtend)({}, particles);\n });\n if (data.sizeOffset !== undefined) {\n this.sizeOffset = data.sizeOffset;\n }\n if (data.colorOffset) {\n this.colorOffset = this.colorOffset ?? {};\n if (data.colorOffset.h !== undefined) {\n this.colorOffset.h = data.colorOffset.h;\n }\n if (data.colorOffset.s !== undefined) {\n this.colorOffset.s = data.colorOffset.s;\n }\n if (data.colorOffset.l !== undefined) {\n this.colorOffset.l = data.colorOffset.l;\n }\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/updater-destroy/./dist/browser/Options/Classes/Split.js?");
57
+
58
+ /***/ }),
59
+
60
+ /***/ "./dist/browser/Options/Classes/SplitFactor.js":
61
+ /*!*****************************************************!*\
62
+ !*** ./dist/browser/Options/Classes/SplitFactor.js ***!
63
+ \*****************************************************/
64
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
65
+
66
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SplitFactor: () => (/* binding */ SplitFactor)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n\nclass SplitFactor extends _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.ValueWithRandom {\n constructor() {\n super();\n this.value = 3;\n }\n}\n\n//# sourceURL=webpack://@tsparticles/updater-destroy/./dist/browser/Options/Classes/SplitFactor.js?");
67
+
68
+ /***/ }),
69
+
70
+ /***/ "./dist/browser/Options/Classes/SplitRate.js":
71
+ /*!***************************************************!*\
72
+ !*** ./dist/browser/Options/Classes/SplitRate.js ***!
73
+ \***************************************************/
74
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
75
+
76
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SplitRate: () => (/* binding */ SplitRate)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n\nclass SplitRate extends _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.ValueWithRandom {\n constructor() {\n super();\n this.value = {\n min: 4,\n max: 9\n };\n }\n}\n\n//# sourceURL=webpack://@tsparticles/updater-destroy/./dist/browser/Options/Classes/SplitRate.js?");
77
+
78
+ /***/ }),
79
+
80
+ /***/ "./dist/browser/Utils.js":
81
+ /*!*******************************!*\
82
+ !*** ./dist/browser/Utils.js ***!
83
+ \*******************************/
84
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
85
+
86
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ split: () => (/* binding */ split)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n\nconst defaultOffset = 0,\n minDestroySize = 0.5,\n defaultSplitCount = 0,\n increment = 1,\n unbreakableTime = 500,\n minSplitCount = 0;\nasync function addSplitParticle(engine, container, parent, splitParticlesOptions) {\n const destroyOptions = parent.options.destroy;\n if (!destroyOptions) {\n return;\n }\n const splitOptions = destroyOptions.split,\n options = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.loadParticlesOptions)(engine, container, parent.options),\n factor = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(splitOptions.factor.value),\n parentColor = parent.getFillColor();\n if (splitOptions.color) {\n options.color.load(splitOptions.color);\n } else if (splitOptions.colorOffset && parentColor) {\n options.color.load({\n value: {\n hsl: {\n h: parentColor.h + (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(splitOptions.colorOffset.h ?? defaultOffset),\n s: parentColor.s + (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(splitOptions.colorOffset.s ?? defaultOffset),\n l: parentColor.l + (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(splitOptions.colorOffset.l ?? defaultOffset)\n }\n }\n });\n } else {\n options.color.load({\n value: {\n hsl: parent.getFillColor()\n }\n });\n }\n options.move.load({\n center: {\n x: parent.position.x,\n y: parent.position.y,\n mode: \"precise\"\n }\n });\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNumber)(options.size.value)) {\n options.size.value /= factor;\n } else {\n options.size.value.min /= factor;\n options.size.value.max /= factor;\n }\n options.load(splitParticlesOptions);\n const offset = splitOptions.sizeOffset ? (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(-parent.size.value, parent.size.value) : defaultOffset,\n position = {\n x: parent.position.x + (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.randomInRange)(offset),\n y: parent.position.y + (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.randomInRange)(offset)\n };\n return container.particles.addParticle(position, options, parent.group, particle => {\n if (particle.size.value < minDestroySize) {\n return false;\n }\n particle.velocity.length = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.randomInRange)((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(parent.velocity.length, particle.velocity.length));\n particle.splitCount = (parent.splitCount ?? defaultSplitCount) + increment;\n particle.unbreakable = true;\n setTimeout(() => {\n particle.unbreakable = false;\n }, unbreakableTime);\n return true;\n });\n}\nasync function split(engine, container, particle) {\n const destroyOptions = particle.options.destroy;\n if (!destroyOptions) {\n return;\n }\n const splitOptions = destroyOptions.split;\n if (splitOptions.count >= minSplitCount && (particle.splitCount === undefined || particle.splitCount++ > splitOptions.count)) {\n return;\n }\n const rate = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(splitOptions.rate.value),\n particlesSplitOptions = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.itemFromSingleOrMultiple)(splitOptions.particles);\n for (let i = 0; i < rate; i++) {\n await addSplitParticle(engine, container, particle, particlesSplitOptions);\n }\n}\n\n//# sourceURL=webpack://@tsparticles/updater-destroy/./dist/browser/Utils.js?");
87
+
88
+ /***/ })
89
+
90
+ }]);
@@ -1,12 +1,12 @@
1
- import { getRangeValue, } from "@tsparticles/engine";
1
+ import { getRangeValue, percentDenominator, } from "@tsparticles/engine";
2
2
  import { Destroy } from "./Options/Classes/Destroy.js";
3
3
  import { split } from "./Utils.js";
4
4
  export class DestroyUpdater {
5
5
  constructor(engine, container) {
6
- this.engine = engine;
7
6
  this.container = container;
7
+ this.engine = engine;
8
8
  }
9
- init(particle) {
9
+ async init(particle) {
10
10
  const container = this.container, particlesOptions = particle.options, destroyOptions = particlesOptions.destroy;
11
11
  if (!destroyOptions) {
12
12
  return;
@@ -18,17 +18,18 @@ export class DestroyUpdater {
18
18
  }
19
19
  const { bottom, left, right, top } = destroyBoundsOptions, { destroyBounds } = particle, canvasSize = container.canvas.size;
20
20
  if (bottom) {
21
- destroyBounds.bottom = (getRangeValue(bottom) * canvasSize.height) / 100;
21
+ destroyBounds.bottom = (getRangeValue(bottom) * canvasSize.height) / percentDenominator;
22
22
  }
23
23
  if (left) {
24
- destroyBounds.left = (getRangeValue(left) * canvasSize.width) / 100;
24
+ destroyBounds.left = (getRangeValue(left) * canvasSize.width) / percentDenominator;
25
25
  }
26
26
  if (right) {
27
- destroyBounds.right = (getRangeValue(right) * canvasSize.width) / 100;
27
+ destroyBounds.right = (getRangeValue(right) * canvasSize.width) / percentDenominator;
28
28
  }
29
29
  if (top) {
30
- destroyBounds.top = (getRangeValue(top) * canvasSize.height) / 100;
30
+ destroyBounds.top = (getRangeValue(top) * canvasSize.height) / percentDenominator;
31
31
  }
32
+ await Promise.resolve();
32
33
  }
33
34
  isEnabled(particle) {
34
35
  return !particle.destroyed;
@@ -47,10 +48,10 @@ export class DestroyUpdater {
47
48
  }
48
49
  const destroyOptions = particle.options.destroy;
49
50
  if (destroyOptions && destroyOptions.mode === "split") {
50
- split(this.engine, this.container, particle);
51
+ void split(this.engine, this.container, particle);
51
52
  }
52
53
  }
53
- update(particle) {
54
+ async update(particle) {
54
55
  if (!this.isEnabled(particle)) {
55
56
  return;
56
57
  }
@@ -64,5 +65,6 @@ export class DestroyUpdater {
64
65
  (bounds.top !== undefined && position.y <= bounds.top)) {
65
66
  particle.destroy();
66
67
  }
68
+ await Promise.resolve();
67
69
  }
68
70
  }
package/esm/Utils.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { getRangeValue, isNumber, itemFromSingleOrMultiple, loadParticlesOptions, randomInRange, setRangeValue, } from "@tsparticles/engine";
2
- function addSplitParticle(engine, container, parent, splitParticlesOptions) {
2
+ const defaultOffset = 0, minDestroySize = 0.5, defaultSplitCount = 0, increment = 1, unbreakableTime = 500, minSplitCount = 0;
3
+ async function addSplitParticle(engine, container, parent, splitParticlesOptions) {
3
4
  const destroyOptions = parent.options.destroy;
4
5
  if (!destroyOptions) {
5
6
  return;
@@ -12,9 +13,9 @@ function addSplitParticle(engine, container, parent, splitParticlesOptions) {
12
13
  options.color.load({
13
14
  value: {
14
15
  hsl: {
15
- h: parentColor.h + getRangeValue(splitOptions.colorOffset.h ?? 0),
16
- s: parentColor.s + getRangeValue(splitOptions.colorOffset.s ?? 0),
17
- l: parentColor.l + getRangeValue(splitOptions.colorOffset.l ?? 0),
16
+ h: parentColor.h + getRangeValue(splitOptions.colorOffset.h ?? defaultOffset),
17
+ s: parentColor.s + getRangeValue(splitOptions.colorOffset.s ?? defaultOffset),
18
+ l: parentColor.l + getRangeValue(splitOptions.colorOffset.l ?? defaultOffset),
18
19
  },
19
20
  },
20
21
  });
@@ -41,34 +42,35 @@ function addSplitParticle(engine, container, parent, splitParticlesOptions) {
41
42
  options.size.value.max /= factor;
42
43
  }
43
44
  options.load(splitParticlesOptions);
44
- const offset = splitOptions.sizeOffset ? setRangeValue(-parent.size.value, parent.size.value) : 0, position = {
45
+ const offset = splitOptions.sizeOffset ? setRangeValue(-parent.size.value, parent.size.value) : defaultOffset, position = {
45
46
  x: parent.position.x + randomInRange(offset),
46
47
  y: parent.position.y + randomInRange(offset),
47
48
  };
48
49
  return container.particles.addParticle(position, options, parent.group, (particle) => {
49
- if (particle.size.value < 0.5) {
50
+ if (particle.size.value < minDestroySize) {
50
51
  return false;
51
52
  }
52
53
  particle.velocity.length = randomInRange(setRangeValue(parent.velocity.length, particle.velocity.length));
53
- particle.splitCount = (parent.splitCount ?? 0) + 1;
54
+ particle.splitCount = (parent.splitCount ?? defaultSplitCount) + increment;
54
55
  particle.unbreakable = true;
55
56
  setTimeout(() => {
56
57
  particle.unbreakable = false;
57
- }, 500);
58
+ }, unbreakableTime);
58
59
  return true;
59
60
  });
60
61
  }
61
- export function split(engine, container, particle) {
62
+ export async function split(engine, container, particle) {
62
63
  const destroyOptions = particle.options.destroy;
63
64
  if (!destroyOptions) {
64
65
  return;
65
66
  }
66
67
  const splitOptions = destroyOptions.split;
67
- if (splitOptions.count >= 0 && (particle.splitCount === undefined || particle.splitCount++ > splitOptions.count)) {
68
+ if (splitOptions.count >= minSplitCount &&
69
+ (particle.splitCount === undefined || particle.splitCount++ > splitOptions.count)) {
68
70
  return;
69
71
  }
70
72
  const rate = getRangeValue(splitOptions.rate.value), particlesSplitOptions = itemFromSingleOrMultiple(splitOptions.particles);
71
73
  for (let i = 0; i < rate; i++) {
72
- addSplitParticle(engine, container, particle, particlesSplitOptions);
74
+ await addSplitParticle(engine, container, particle, particlesSplitOptions);
73
75
  }
74
76
  }
package/esm/index.js CHANGED
@@ -1,4 +1,6 @@
1
- import { DestroyUpdater } from "./DestroyUpdater.js";
2
1
  export async function loadDestroyUpdater(engine, refresh = true) {
3
- await engine.addParticleUpdater("destroy", (container) => new DestroyUpdater(engine, container), refresh);
2
+ await engine.addParticleUpdater("destroy", async (container) => {
3
+ const { DestroyUpdater } = await import("./DestroyUpdater.js");
4
+ return new DestroyUpdater(engine, container);
5
+ }, refresh);
4
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsparticles/updater-destroy",
3
- "version": "3.0.3",
3
+ "version": "3.2.0",
4
4
  "description": "tsParticles particles destroy updater",
5
5
  "homepage": "https://particles.js.org",
6
6
  "repository": {
@@ -87,7 +87,7 @@
87
87
  "./package.json": "./package.json"
88
88
  },
89
89
  "dependencies": {
90
- "@tsparticles/engine": "^3.0.3"
90
+ "@tsparticles/engine": "^3.2.0"
91
91
  },
92
92
  "publishConfig": {
93
93
  "access": "public"
package/report.html CHANGED
@@ -3,7 +3,7 @@
3
3
  <head>
4
4
  <meta charset="UTF-8"/>
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1"/>
6
- <title>@tsparticles/updater-destroy [26 Dec 2023 at 19:31]</title>
6
+ <title>@tsparticles/updater-destroy [31 Jan 2024 at 02:10]</title>
7
7
  <link rel="shortcut icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAABrVBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+O1foceMD///+J0/qK1Pr7/v8Xdr/9///W8P4UdL7L7P0Scr2r4Pyj3vwad8D5/f/2/f+55f3E6f34+/2H0/ojfMKpzOd0rNgQcb3F3O/j9f7c8v6g3Pz0/P/w+v/q+P7n9v6T1/uQ1vuE0vqLut/y+v+Z2fvt+f+15Pzv9fuc2/vR7v2V2Pvd6/bg9P7I6/285/2y4/yp3/zp8vk8i8kqgMT7/P31+fyv4vxGkcz6/P6/6P3j7vfS5PNnpNUxhcbO7f7F6v3O4vHK3/DA2u631Ouy0eqXweKJud5wqthfoNMMbLvY8f73+v2dxeR8sNtTmdDx9/zX6PSjyeaCtd1YnNGX2PuQveCGt95Nls42h8dLlM3F4vBtAAAAM3RSTlMAAyOx0/sKBvik8opWGBMOAe3l1snDm2E9LSb06eHcu5JpHbarfHZCN9CBb08zzkdNS0kYaptYAAAFV0lEQVRYw92X51/aYBDHHS2O2qqttVbrqNq9m+TJIAYIShBkWwqIiCgoWvfeq7Z2/s29hyQNyUcR7LveGwVyXy6XH8/9rqxglLfUPLxVduUor3h0rfp2TYvpivk37929TkG037hffoX0+peVtZQc1589rigVUdXS/ABSAyEmGIO/1XfvldSK8vs3OqB6u3m0nxmIrvgB0dj7rr7Y9IbuF68hnfFaiHA/sxqm0wciIG43P60qKv9WXWc1RXGh/mFESFABTSBi0sNAKzqet17eCtOb3kZIDwxEEU0oAIJGYxNBDhBND29e0rtXXbcpuPmED9IhEAAQ/AXEaF8EPmnrrKsv0LvWR3fg5sWDNAFZOgAgaKvZDogHNU9MFwnnYROkc56RD5CjAbQX9Ow4g7upCsvYu55aSI/Nj0H1akgKQEUM94dwK65hYRmFU9MIcH/fqJYOZYcnuJSU/waKDgTOEVaVKhwrTRP5XzgSpAITYzom7UvkhFX5VutmxeNnWDjjswTKTyfgluNDGbUpWissXhF3s7mlSml+czWkg3D0l1nNjGNjz3myOQOa1KM/jOS6ebdbAVTCi4gljHSFrviza7tOgRWcS0MOUX9zdNgag5w7rRqA44Lzw0hr1WqES36dFliSJFlh2rXIae3FFcDDgKdxrUIDePr8jGcSClV1u7A9xeN0ModY/pHMxmR1EzRh8TJiwqsHmKW0l4FCEZI+jHio+JdPPE9qwQtTRxku2D8sIeRL2LnxWSllANCQGOIiqVHAz2ye2JR0DcH+HoxDkaADLjgxjKQ+AwCX/g0+DNgdG0ukYCONAe+dbc2IAc6fwt1ARoDSezNHxV2Cmzwv3O6lDMV55edBGwGK9n1+x2F8EDfAGCxug8MhpsMEcTEAWf3rx2vZhe/LAmtIn/6apE6PN0ULKgywD9mmdxbmFl3OvD5AS5fW5zLbv/YHmcsBTjf/afDz3MaZTVCfAP9z6/Bw6ycv8EUBWJIn9zYcoAWWlW9+OzO3vkTy8H+RANLmdrpOuYWdZYEXpo+TlCJrW5EARb7fF+bWdqf3hhyZI1nWJQHgznErZhbjoEsWqi8dQNoE294aldzFurwSABL2XXMf9+H1VQGke9exw5P/AnA5Pv5ngMul7LOvO922iwACu8WkCwLCafvM4CeWPxfA8lNHcWZSoi8EwMAIciKX2Z4SWCMAa3snCZ/G4EA8D6CMLNFsGQhkkz/gQNEBbPCbWsxGUpYVu3z8IyNAknwJkfPMEhLyrdi5RTyUVACkw4GSFRNWJNEW+fgPGwHD8/JxnRuLabN4CGNRkAE23na2+VmEAUmrYymSGjMAYqH84YUIyzgzs3XC7gNgH36Vcc4zKY9o9fgPBXUAiHHwVboBHGLiX6Zcjp1f2wu4tvzZKo0ecPnDtQYDQvJXaBeNzce45Fp28ZQLrEZVuFqgBwOalArKXnW1UzlnSusQKJqKYNuz4tOnI6sZG4zanpemv+7ySU2jbA9h6uhcgpfy6G2PahirDZ6zvq6zDduMVFTKvzw8wgyEdelwY9in3XkEPs3osJuwRQ4qTkfzifndg9Gfc4pdsu82+tTnHZTBa2EAMrqr2t43pguc8tNm7JQVQ2S0ukj2d22dhXYP0/veWtwKrCkNoNimAN5+Xr/oLrxswKbVJjteWrX7eR63o4j9q0GxnaBdWgGA5VStpanIjQmEhV0/nVt5VOFUvix6awJhPcAaTEShgrG+iGyvb5a0Ndb1YGHFPEwoqAinoaykaID1o1pdPNu7XsnCKQ3R+hwWIIhGvORcJUBYXe3Xa3vq/mF/N9V13ugufMkfXn+KHsRD0B8AAAAASUVORK5CYII=" type="image/x-icon" />
8
8
 
9
9
  <script>
@@ -31,8 +31,8 @@
31
31
  <body>
32
32
  <div id="app"></div>
33
33
  <script>
34
- window.chartData = [{"label":"tsparticles.updater.destroy.js","isAsset":true,"statSize":7657,"parsedSize":11748,"gzipSize":2961,"groups":[{"label":"dist/browser","path":"./dist/browser","statSize":7615,"groups":[{"id":759,"label":"index.js + 7 modules (concatenated)","path":"./dist/browser/index.js + 7 modules (concatenated)","statSize":7615,"parsedSize":11748,"gzipSize":2961,"concatenated":true,"groups":[{"label":"dist/browser","path":"./dist/browser/index.js + 7 modules (concatenated)/dist/browser","statSize":7615,"groups":[{"id":null,"label":"index.js","path":"./dist/browser/index.js + 7 modules (concatenated)/dist/browser/index.js","statSize":229,"parsedSize":353,"gzipSize":89,"inaccurateSizes":true},{"id":null,"label":"DestroyUpdater.js","path":"./dist/browser/index.js + 7 modules (concatenated)/dist/browser/DestroyUpdater.js","statSize":2215,"parsedSize":3417,"gzipSize":861,"inaccurateSizes":true},{"label":"Options/Classes","path":"./dist/browser/index.js + 7 modules (concatenated)/dist/browser/Options/Classes","statSize":2530,"groups":[{"id":null,"label":"Destroy.js","path":"./dist/browser/index.js + 7 modules (concatenated)/dist/browser/Options/Classes/Destroy.js","statSize":438,"parsedSize":675,"gzipSize":170,"inaccurateSizes":true},{"id":null,"label":"DestroyBounds.js","path":"./dist/browser/index.js + 7 modules (concatenated)/dist/browser/Options/Classes/DestroyBounds.js","statSize":485,"parsedSize":748,"gzipSize":188,"inaccurateSizes":true},{"id":null,"label":"Split.js","path":"./dist/browser/index.js + 7 modules (concatenated)/dist/browser/Options/Classes/Split.js","statSize":1252,"parsedSize":1931,"gzipSize":486,"inaccurateSizes":true},{"id":null,"label":"SplitFactor.js","path":"./dist/browser/index.js + 7 modules (concatenated)/dist/browser/Options/Classes/SplitFactor.js","statSize":162,"parsedSize":249,"gzipSize":62,"inaccurateSizes":true},{"id":null,"label":"SplitRate.js","path":"./dist/browser/index.js + 7 modules (concatenated)/dist/browser/Options/Classes/SplitRate.js","statSize":193,"parsedSize":297,"gzipSize":75,"inaccurateSizes":true}],"parsedSize":3903,"gzipSize":983,"inaccurateSizes":true},{"id":null,"label":"Utils.js","path":"./dist/browser/index.js + 7 modules (concatenated)/dist/browser/Utils.js","statSize":2641,"parsedSize":4074,"gzipSize":1026,"inaccurateSizes":true}],"parsedSize":11748,"gzipSize":2961,"inaccurateSizes":true}]}],"parsedSize":11748,"gzipSize":2961},{"label":"engine\",\"commonjs2\":\"@tsparticles/engine\",\"amd\":\"@tsparticles","path":"./engine\",\"commonjs2\":\"@tsparticles/engine\",\"amd\":\"@tsparticles","statSize":42,"groups":[{"id":533,"label":"engine\",\"root\":\"window\"}","path":"./engine\",\"commonjs2\":\"@tsparticles/engine\",\"amd\":\"@tsparticles/engine\",\"root\":\"window\"}","statSize":42}],"parsedSize":0,"gzipSize":0}],"isInitialByEntrypoint":{"tsparticles.updater.destroy":true}}];
35
- window.entrypoints = ["tsparticles.updater.destroy","tsparticles.updater.destroy.min"];
34
+ window.chartData = [];
35
+ window.entrypoints = ["tsparticles.updater.destroy.min"];
36
36
  window.defaultSizes = "parsed";
37
37
  </script>
38
38
  </body>