@tsparticles/updater-destroy 4.1.3 → 4.2.1
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/browser/DestroyUpdater.js +2 -5
- package/browser/Options/Classes/Destroy.js +4 -10
- package/browser/Options/Classes/DestroyBounds.js +5 -13
- package/browser/Options/Classes/Explode.js +5 -13
- package/browser/Options/Classes/Split.js +7 -17
- package/browser/Options/Classes/SplitFactor.js +1 -4
- package/browser/Options/Classes/SplitRate.js +1 -4
- package/browser/index.js +1 -1
- package/browser/index.lazy.js +1 -1
- package/cjs/DestroyUpdater.js +2 -5
- package/cjs/Options/Classes/Destroy.js +4 -10
- package/cjs/Options/Classes/DestroyBounds.js +5 -13
- package/cjs/Options/Classes/Explode.js +5 -13
- package/cjs/Options/Classes/Split.js +7 -17
- package/cjs/Options/Classes/SplitFactor.js +1 -4
- package/cjs/Options/Classes/SplitRate.js +1 -4
- package/cjs/index.js +1 -1
- package/cjs/index.lazy.js +1 -1
- package/esm/DestroyUpdater.js +2 -5
- package/esm/Options/Classes/Destroy.js +4 -10
- package/esm/Options/Classes/DestroyBounds.js +5 -13
- package/esm/Options/Classes/Explode.js +5 -13
- package/esm/Options/Classes/Split.js +7 -17
- package/esm/Options/Classes/SplitFactor.js +1 -4
- package/esm/Options/Classes/SplitRate.js +1 -4
- package/esm/index.js +1 -1
- package/esm/index.lazy.js +1 -1
- package/package.json +2 -2
- package/report.html +1 -1
- package/tsparticles.updater.destroy.js +23 -64
- package/tsparticles.updater.destroy.min.js +1 -1
- package/types/Options/Classes/Destroy.d.ts +3 -4
- package/types/Options/Classes/Explode.d.ts +0 -1
- package/types/Options/Classes/Split.d.ts +2 -3
- package/types/Options/Classes/SplitFactor.d.ts +1 -1
- package/types/Options/Classes/SplitRate.d.ts +4 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getRangeValue, percentDenominator, } from "@tsparticles/engine";
|
|
1
|
+
import { getRangeValue, loadOptionProperty, percentDenominator, } from "@tsparticles/engine";
|
|
2
2
|
import { Destroy } from "./Options/Classes/Destroy.js";
|
|
3
3
|
import { DestroyMode } from "./Enums/DestroyMode.js";
|
|
4
4
|
import { split } from "./Utils.js";
|
|
@@ -38,10 +38,7 @@ export class DestroyUpdater {
|
|
|
38
38
|
return !destroyParticle.destroyed || !!destroyParticle.exploding;
|
|
39
39
|
}
|
|
40
40
|
loadOptions(options, ...sources) {
|
|
41
|
-
options
|
|
42
|
-
for (const source of sources) {
|
|
43
|
-
options.destroy.load(source?.destroy);
|
|
44
|
-
}
|
|
41
|
+
loadOptionProperty(options, "destroy", Destroy, ...sources);
|
|
45
42
|
}
|
|
46
43
|
particleDestroyed(particle, override) {
|
|
47
44
|
if (override) {
|
|
@@ -4,16 +4,10 @@ import { DestroyMode } from "../../Enums/DestroyMode.js";
|
|
|
4
4
|
import { Explode } from "./Explode.js";
|
|
5
5
|
import { Split } from "./Split.js";
|
|
6
6
|
export class Destroy {
|
|
7
|
-
bounds;
|
|
8
|
-
explode;
|
|
9
|
-
mode;
|
|
10
|
-
split;
|
|
11
|
-
constructor() {
|
|
12
|
-
this.bounds = new DestroyBounds();
|
|
13
|
-
this.explode = new Explode();
|
|
14
|
-
this.mode = DestroyMode.none;
|
|
15
|
-
this.split = new Split();
|
|
16
|
-
}
|
|
7
|
+
bounds = new DestroyBounds();
|
|
8
|
+
explode = new Explode();
|
|
9
|
+
mode = DestroyMode.none;
|
|
10
|
+
split = new Split();
|
|
17
11
|
load(data) {
|
|
18
12
|
if (isNull(data)) {
|
|
19
13
|
return;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isNull,
|
|
1
|
+
import { isNull, loadRangeProperty, } from "@tsparticles/engine";
|
|
2
2
|
export class DestroyBounds {
|
|
3
3
|
bottom;
|
|
4
4
|
left;
|
|
@@ -8,17 +8,9 @@ export class DestroyBounds {
|
|
|
8
8
|
if (isNull(data)) {
|
|
9
9
|
return;
|
|
10
10
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
this.left = setRangeValue(data.left);
|
|
16
|
-
}
|
|
17
|
-
if (data.right !== undefined) {
|
|
18
|
-
this.right = setRangeValue(data.right);
|
|
19
|
-
}
|
|
20
|
-
if (data.top !== undefined) {
|
|
21
|
-
this.top = setRangeValue(data.top);
|
|
22
|
-
}
|
|
11
|
+
loadRangeProperty(this, "bottom", data.bottom);
|
|
12
|
+
loadRangeProperty(this, "left", data.left);
|
|
13
|
+
loadRangeProperty(this, "right", data.right);
|
|
14
|
+
loadRangeProperty(this, "top", data.top);
|
|
23
15
|
}
|
|
24
16
|
}
|
|
@@ -1,20 +1,12 @@
|
|
|
1
|
-
import { isNull } from "@tsparticles/engine";
|
|
1
|
+
import { isNull, loadProperty } from "@tsparticles/engine";
|
|
2
2
|
export class Explode {
|
|
3
|
-
maxSizeFactor;
|
|
4
|
-
speed;
|
|
5
|
-
constructor() {
|
|
6
|
-
this.maxSizeFactor = 3;
|
|
7
|
-
this.speed = 2;
|
|
8
|
-
}
|
|
3
|
+
maxSizeFactor = 3;
|
|
4
|
+
speed = 2;
|
|
9
5
|
load(data) {
|
|
10
6
|
if (isNull(data)) {
|
|
11
7
|
return;
|
|
12
8
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
if (data.speed !== undefined) {
|
|
17
|
-
this.speed = data.speed;
|
|
18
|
-
}
|
|
9
|
+
loadProperty(this, "maxSizeFactor", data.maxSizeFactor);
|
|
10
|
+
loadProperty(this, "speed", data.speed);
|
|
19
11
|
}
|
|
20
12
|
}
|
|
@@ -1,22 +1,16 @@
|
|
|
1
|
-
import { OptionsColor, deepExtend, executeOnSingleOrMultiple, isNull, } from "@tsparticles/engine";
|
|
1
|
+
import { OptionsColor, deepExtend, executeOnSingleOrMultiple, isNull, loadProperty, } from "@tsparticles/engine";
|
|
2
2
|
import { SplitFactor } from "./SplitFactor.js";
|
|
3
3
|
import { SplitRate } from "./SplitRate.js";
|
|
4
4
|
export class Split {
|
|
5
|
-
count;
|
|
6
|
-
factor;
|
|
5
|
+
count = 1;
|
|
6
|
+
factor = new SplitFactor();
|
|
7
7
|
fillColor;
|
|
8
8
|
fillColorOffset;
|
|
9
9
|
particles;
|
|
10
|
-
rate;
|
|
11
|
-
sizeOffset;
|
|
10
|
+
rate = new SplitRate();
|
|
11
|
+
sizeOffset = true;
|
|
12
12
|
strokeColor;
|
|
13
13
|
strokeColorOffset;
|
|
14
|
-
constructor() {
|
|
15
|
-
this.count = 1;
|
|
16
|
-
this.factor = new SplitFactor();
|
|
17
|
-
this.rate = new SplitRate();
|
|
18
|
-
this.sizeOffset = true;
|
|
19
|
-
}
|
|
20
14
|
load(data) {
|
|
21
15
|
if (isNull(data)) {
|
|
22
16
|
return;
|
|
@@ -27,17 +21,13 @@ export class Split {
|
|
|
27
21
|
if (data.strokeColor !== undefined) {
|
|
28
22
|
this.strokeColor = OptionsColor.create(this.strokeColor, data.strokeColor);
|
|
29
23
|
}
|
|
30
|
-
|
|
31
|
-
this.count = data.count;
|
|
32
|
-
}
|
|
24
|
+
loadProperty(this, "count", data.count);
|
|
33
25
|
this.factor.load(data.factor);
|
|
34
26
|
this.rate.load(data.rate);
|
|
35
27
|
this.particles = executeOnSingleOrMultiple(data.particles, particles => {
|
|
36
28
|
return deepExtend({}, particles);
|
|
37
29
|
});
|
|
38
|
-
|
|
39
|
-
this.sizeOffset = data.sizeOffset;
|
|
40
|
-
}
|
|
30
|
+
loadProperty(this, "sizeOffset", data.sizeOffset);
|
|
41
31
|
if (data.fillColorOffset) {
|
|
42
32
|
this.fillColorOffset = this.fillColorOffset ?? {};
|
|
43
33
|
if (data.fillColorOffset.h !== undefined) {
|
package/browser/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DestroyUpdater } from "./DestroyUpdater.js";
|
|
2
2
|
export async function loadDestroyUpdater(engine) {
|
|
3
|
-
engine.checkVersion("4.1
|
|
3
|
+
engine.checkVersion("4.2.1");
|
|
4
4
|
await engine.pluginManager.register(e => {
|
|
5
5
|
e.pluginManager.addParticleUpdater("destroy", container => {
|
|
6
6
|
return Promise.resolve(new DestroyUpdater(e.pluginManager, container));
|
package/browser/index.lazy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadDestroyUpdater(engine) {
|
|
2
|
-
engine.checkVersion("4.1
|
|
2
|
+
engine.checkVersion("4.2.1");
|
|
3
3
|
await engine.pluginManager.register(e => {
|
|
4
4
|
e.pluginManager.addParticleUpdater("destroy", async (container) => {
|
|
5
5
|
const { DestroyUpdater } = await import("./DestroyUpdater.js");
|
package/cjs/DestroyUpdater.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getRangeValue, percentDenominator, } from "@tsparticles/engine";
|
|
1
|
+
import { getRangeValue, loadOptionProperty, percentDenominator, } from "@tsparticles/engine";
|
|
2
2
|
import { Destroy } from "./Options/Classes/Destroy.js";
|
|
3
3
|
import { DestroyMode } from "./Enums/DestroyMode.js";
|
|
4
4
|
import { split } from "./Utils.js";
|
|
@@ -38,10 +38,7 @@ export class DestroyUpdater {
|
|
|
38
38
|
return !destroyParticle.destroyed || !!destroyParticle.exploding;
|
|
39
39
|
}
|
|
40
40
|
loadOptions(options, ...sources) {
|
|
41
|
-
options
|
|
42
|
-
for (const source of sources) {
|
|
43
|
-
options.destroy.load(source?.destroy);
|
|
44
|
-
}
|
|
41
|
+
loadOptionProperty(options, "destroy", Destroy, ...sources);
|
|
45
42
|
}
|
|
46
43
|
particleDestroyed(particle, override) {
|
|
47
44
|
if (override) {
|
|
@@ -4,16 +4,10 @@ import { DestroyMode } from "../../Enums/DestroyMode.js";
|
|
|
4
4
|
import { Explode } from "./Explode.js";
|
|
5
5
|
import { Split } from "./Split.js";
|
|
6
6
|
export class Destroy {
|
|
7
|
-
bounds;
|
|
8
|
-
explode;
|
|
9
|
-
mode;
|
|
10
|
-
split;
|
|
11
|
-
constructor() {
|
|
12
|
-
this.bounds = new DestroyBounds();
|
|
13
|
-
this.explode = new Explode();
|
|
14
|
-
this.mode = DestroyMode.none;
|
|
15
|
-
this.split = new Split();
|
|
16
|
-
}
|
|
7
|
+
bounds = new DestroyBounds();
|
|
8
|
+
explode = new Explode();
|
|
9
|
+
mode = DestroyMode.none;
|
|
10
|
+
split = new Split();
|
|
17
11
|
load(data) {
|
|
18
12
|
if (isNull(data)) {
|
|
19
13
|
return;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isNull,
|
|
1
|
+
import { isNull, loadRangeProperty, } from "@tsparticles/engine";
|
|
2
2
|
export class DestroyBounds {
|
|
3
3
|
bottom;
|
|
4
4
|
left;
|
|
@@ -8,17 +8,9 @@ export class DestroyBounds {
|
|
|
8
8
|
if (isNull(data)) {
|
|
9
9
|
return;
|
|
10
10
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
this.left = setRangeValue(data.left);
|
|
16
|
-
}
|
|
17
|
-
if (data.right !== undefined) {
|
|
18
|
-
this.right = setRangeValue(data.right);
|
|
19
|
-
}
|
|
20
|
-
if (data.top !== undefined) {
|
|
21
|
-
this.top = setRangeValue(data.top);
|
|
22
|
-
}
|
|
11
|
+
loadRangeProperty(this, "bottom", data.bottom);
|
|
12
|
+
loadRangeProperty(this, "left", data.left);
|
|
13
|
+
loadRangeProperty(this, "right", data.right);
|
|
14
|
+
loadRangeProperty(this, "top", data.top);
|
|
23
15
|
}
|
|
24
16
|
}
|
|
@@ -1,20 +1,12 @@
|
|
|
1
|
-
import { isNull } from "@tsparticles/engine";
|
|
1
|
+
import { isNull, loadProperty } from "@tsparticles/engine";
|
|
2
2
|
export class Explode {
|
|
3
|
-
maxSizeFactor;
|
|
4
|
-
speed;
|
|
5
|
-
constructor() {
|
|
6
|
-
this.maxSizeFactor = 3;
|
|
7
|
-
this.speed = 2;
|
|
8
|
-
}
|
|
3
|
+
maxSizeFactor = 3;
|
|
4
|
+
speed = 2;
|
|
9
5
|
load(data) {
|
|
10
6
|
if (isNull(data)) {
|
|
11
7
|
return;
|
|
12
8
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
if (data.speed !== undefined) {
|
|
17
|
-
this.speed = data.speed;
|
|
18
|
-
}
|
|
9
|
+
loadProperty(this, "maxSizeFactor", data.maxSizeFactor);
|
|
10
|
+
loadProperty(this, "speed", data.speed);
|
|
19
11
|
}
|
|
20
12
|
}
|
|
@@ -1,22 +1,16 @@
|
|
|
1
|
-
import { OptionsColor, deepExtend, executeOnSingleOrMultiple, isNull, } from "@tsparticles/engine";
|
|
1
|
+
import { OptionsColor, deepExtend, executeOnSingleOrMultiple, isNull, loadProperty, } from "@tsparticles/engine";
|
|
2
2
|
import { SplitFactor } from "./SplitFactor.js";
|
|
3
3
|
import { SplitRate } from "./SplitRate.js";
|
|
4
4
|
export class Split {
|
|
5
|
-
count;
|
|
6
|
-
factor;
|
|
5
|
+
count = 1;
|
|
6
|
+
factor = new SplitFactor();
|
|
7
7
|
fillColor;
|
|
8
8
|
fillColorOffset;
|
|
9
9
|
particles;
|
|
10
|
-
rate;
|
|
11
|
-
sizeOffset;
|
|
10
|
+
rate = new SplitRate();
|
|
11
|
+
sizeOffset = true;
|
|
12
12
|
strokeColor;
|
|
13
13
|
strokeColorOffset;
|
|
14
|
-
constructor() {
|
|
15
|
-
this.count = 1;
|
|
16
|
-
this.factor = new SplitFactor();
|
|
17
|
-
this.rate = new SplitRate();
|
|
18
|
-
this.sizeOffset = true;
|
|
19
|
-
}
|
|
20
14
|
load(data) {
|
|
21
15
|
if (isNull(data)) {
|
|
22
16
|
return;
|
|
@@ -27,17 +21,13 @@ export class Split {
|
|
|
27
21
|
if (data.strokeColor !== undefined) {
|
|
28
22
|
this.strokeColor = OptionsColor.create(this.strokeColor, data.strokeColor);
|
|
29
23
|
}
|
|
30
|
-
|
|
31
|
-
this.count = data.count;
|
|
32
|
-
}
|
|
24
|
+
loadProperty(this, "count", data.count);
|
|
33
25
|
this.factor.load(data.factor);
|
|
34
26
|
this.rate.load(data.rate);
|
|
35
27
|
this.particles = executeOnSingleOrMultiple(data.particles, particles => {
|
|
36
28
|
return deepExtend({}, particles);
|
|
37
29
|
});
|
|
38
|
-
|
|
39
|
-
this.sizeOffset = data.sizeOffset;
|
|
40
|
-
}
|
|
30
|
+
loadProperty(this, "sizeOffset", data.sizeOffset);
|
|
41
31
|
if (data.fillColorOffset) {
|
|
42
32
|
this.fillColorOffset = this.fillColorOffset ?? {};
|
|
43
33
|
if (data.fillColorOffset.h !== undefined) {
|
package/cjs/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DestroyUpdater } from "./DestroyUpdater.js";
|
|
2
2
|
export async function loadDestroyUpdater(engine) {
|
|
3
|
-
engine.checkVersion("4.1
|
|
3
|
+
engine.checkVersion("4.2.1");
|
|
4
4
|
await engine.pluginManager.register(e => {
|
|
5
5
|
e.pluginManager.addParticleUpdater("destroy", container => {
|
|
6
6
|
return Promise.resolve(new DestroyUpdater(e.pluginManager, container));
|
package/cjs/index.lazy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadDestroyUpdater(engine) {
|
|
2
|
-
engine.checkVersion("4.1
|
|
2
|
+
engine.checkVersion("4.2.1");
|
|
3
3
|
await engine.pluginManager.register(e => {
|
|
4
4
|
e.pluginManager.addParticleUpdater("destroy", async (container) => {
|
|
5
5
|
const { DestroyUpdater } = await import("./DestroyUpdater.js");
|
package/esm/DestroyUpdater.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getRangeValue, percentDenominator, } from "@tsparticles/engine";
|
|
1
|
+
import { getRangeValue, loadOptionProperty, percentDenominator, } from "@tsparticles/engine";
|
|
2
2
|
import { Destroy } from "./Options/Classes/Destroy.js";
|
|
3
3
|
import { DestroyMode } from "./Enums/DestroyMode.js";
|
|
4
4
|
import { split } from "./Utils.js";
|
|
@@ -38,10 +38,7 @@ export class DestroyUpdater {
|
|
|
38
38
|
return !destroyParticle.destroyed || !!destroyParticle.exploding;
|
|
39
39
|
}
|
|
40
40
|
loadOptions(options, ...sources) {
|
|
41
|
-
options
|
|
42
|
-
for (const source of sources) {
|
|
43
|
-
options.destroy.load(source?.destroy);
|
|
44
|
-
}
|
|
41
|
+
loadOptionProperty(options, "destroy", Destroy, ...sources);
|
|
45
42
|
}
|
|
46
43
|
particleDestroyed(particle, override) {
|
|
47
44
|
if (override) {
|
|
@@ -4,16 +4,10 @@ import { DestroyMode } from "../../Enums/DestroyMode.js";
|
|
|
4
4
|
import { Explode } from "./Explode.js";
|
|
5
5
|
import { Split } from "./Split.js";
|
|
6
6
|
export class Destroy {
|
|
7
|
-
bounds;
|
|
8
|
-
explode;
|
|
9
|
-
mode;
|
|
10
|
-
split;
|
|
11
|
-
constructor() {
|
|
12
|
-
this.bounds = new DestroyBounds();
|
|
13
|
-
this.explode = new Explode();
|
|
14
|
-
this.mode = DestroyMode.none;
|
|
15
|
-
this.split = new Split();
|
|
16
|
-
}
|
|
7
|
+
bounds = new DestroyBounds();
|
|
8
|
+
explode = new Explode();
|
|
9
|
+
mode = DestroyMode.none;
|
|
10
|
+
split = new Split();
|
|
17
11
|
load(data) {
|
|
18
12
|
if (isNull(data)) {
|
|
19
13
|
return;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isNull,
|
|
1
|
+
import { isNull, loadRangeProperty, } from "@tsparticles/engine";
|
|
2
2
|
export class DestroyBounds {
|
|
3
3
|
bottom;
|
|
4
4
|
left;
|
|
@@ -8,17 +8,9 @@ export class DestroyBounds {
|
|
|
8
8
|
if (isNull(data)) {
|
|
9
9
|
return;
|
|
10
10
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
this.left = setRangeValue(data.left);
|
|
16
|
-
}
|
|
17
|
-
if (data.right !== undefined) {
|
|
18
|
-
this.right = setRangeValue(data.right);
|
|
19
|
-
}
|
|
20
|
-
if (data.top !== undefined) {
|
|
21
|
-
this.top = setRangeValue(data.top);
|
|
22
|
-
}
|
|
11
|
+
loadRangeProperty(this, "bottom", data.bottom);
|
|
12
|
+
loadRangeProperty(this, "left", data.left);
|
|
13
|
+
loadRangeProperty(this, "right", data.right);
|
|
14
|
+
loadRangeProperty(this, "top", data.top);
|
|
23
15
|
}
|
|
24
16
|
}
|
|
@@ -1,20 +1,12 @@
|
|
|
1
|
-
import { isNull } from "@tsparticles/engine";
|
|
1
|
+
import { isNull, loadProperty } from "@tsparticles/engine";
|
|
2
2
|
export class Explode {
|
|
3
|
-
maxSizeFactor;
|
|
4
|
-
speed;
|
|
5
|
-
constructor() {
|
|
6
|
-
this.maxSizeFactor = 3;
|
|
7
|
-
this.speed = 2;
|
|
8
|
-
}
|
|
3
|
+
maxSizeFactor = 3;
|
|
4
|
+
speed = 2;
|
|
9
5
|
load(data) {
|
|
10
6
|
if (isNull(data)) {
|
|
11
7
|
return;
|
|
12
8
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
if (data.speed !== undefined) {
|
|
17
|
-
this.speed = data.speed;
|
|
18
|
-
}
|
|
9
|
+
loadProperty(this, "maxSizeFactor", data.maxSizeFactor);
|
|
10
|
+
loadProperty(this, "speed", data.speed);
|
|
19
11
|
}
|
|
20
12
|
}
|
|
@@ -1,22 +1,16 @@
|
|
|
1
|
-
import { OptionsColor, deepExtend, executeOnSingleOrMultiple, isNull, } from "@tsparticles/engine";
|
|
1
|
+
import { OptionsColor, deepExtend, executeOnSingleOrMultiple, isNull, loadProperty, } from "@tsparticles/engine";
|
|
2
2
|
import { SplitFactor } from "./SplitFactor.js";
|
|
3
3
|
import { SplitRate } from "./SplitRate.js";
|
|
4
4
|
export class Split {
|
|
5
|
-
count;
|
|
6
|
-
factor;
|
|
5
|
+
count = 1;
|
|
6
|
+
factor = new SplitFactor();
|
|
7
7
|
fillColor;
|
|
8
8
|
fillColorOffset;
|
|
9
9
|
particles;
|
|
10
|
-
rate;
|
|
11
|
-
sizeOffset;
|
|
10
|
+
rate = new SplitRate();
|
|
11
|
+
sizeOffset = true;
|
|
12
12
|
strokeColor;
|
|
13
13
|
strokeColorOffset;
|
|
14
|
-
constructor() {
|
|
15
|
-
this.count = 1;
|
|
16
|
-
this.factor = new SplitFactor();
|
|
17
|
-
this.rate = new SplitRate();
|
|
18
|
-
this.sizeOffset = true;
|
|
19
|
-
}
|
|
20
14
|
load(data) {
|
|
21
15
|
if (isNull(data)) {
|
|
22
16
|
return;
|
|
@@ -27,17 +21,13 @@ export class Split {
|
|
|
27
21
|
if (data.strokeColor !== undefined) {
|
|
28
22
|
this.strokeColor = OptionsColor.create(this.strokeColor, data.strokeColor);
|
|
29
23
|
}
|
|
30
|
-
|
|
31
|
-
this.count = data.count;
|
|
32
|
-
}
|
|
24
|
+
loadProperty(this, "count", data.count);
|
|
33
25
|
this.factor.load(data.factor);
|
|
34
26
|
this.rate.load(data.rate);
|
|
35
27
|
this.particles = executeOnSingleOrMultiple(data.particles, particles => {
|
|
36
28
|
return deepExtend({}, particles);
|
|
37
29
|
});
|
|
38
|
-
|
|
39
|
-
this.sizeOffset = data.sizeOffset;
|
|
40
|
-
}
|
|
30
|
+
loadProperty(this, "sizeOffset", data.sizeOffset);
|
|
41
31
|
if (data.fillColorOffset) {
|
|
42
32
|
this.fillColorOffset = this.fillColorOffset ?? {};
|
|
43
33
|
if (data.fillColorOffset.h !== undefined) {
|
package/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DestroyUpdater } from "./DestroyUpdater.js";
|
|
2
2
|
export async function loadDestroyUpdater(engine) {
|
|
3
|
-
engine.checkVersion("4.1
|
|
3
|
+
engine.checkVersion("4.2.1");
|
|
4
4
|
await engine.pluginManager.register(e => {
|
|
5
5
|
e.pluginManager.addParticleUpdater("destroy", container => {
|
|
6
6
|
return Promise.resolve(new DestroyUpdater(e.pluginManager, container));
|
package/esm/index.lazy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadDestroyUpdater(engine) {
|
|
2
|
-
engine.checkVersion("4.1
|
|
2
|
+
engine.checkVersion("4.2.1");
|
|
3
3
|
await engine.pluginManager.register(e => {
|
|
4
4
|
e.pluginManager.addParticleUpdater("destroy", async (container) => {
|
|
5
5
|
const { DestroyUpdater } = await import("./DestroyUpdater.js");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/updater-destroy",
|
|
3
|
-
"version": "4.1
|
|
3
|
+
"version": "4.2.1",
|
|
4
4
|
"description": "tsParticles particles destroy updater",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"./package.json": "./package.json"
|
|
94
94
|
},
|
|
95
95
|
"peerDependencies": {
|
|
96
|
-
"@tsparticles/engine": "4.1
|
|
96
|
+
"@tsparticles/engine": "4.2.1"
|
|
97
97
|
},
|
|
98
98
|
"publishConfig": {
|
|
99
99
|
"access": "public"
|
package/report.html
CHANGED
|
@@ -4930,7 +4930,7 @@ var drawChart = (function (exports) {
|
|
|
4930
4930
|
</script>
|
|
4931
4931
|
<script>
|
|
4932
4932
|
/*<!--*/
|
|
4933
|
-
const data = {"version":2,"tree":{"name":"root","children":[{"name":"tsparticles.updater.destroy.js","children":[{"name":"dist/browser","children":[{"name":"Options/Classes","children":[{"uid":"
|
|
4933
|
+
const data = {"version":2,"tree":{"name":"root","children":[{"name":"tsparticles.updater.destroy.js","children":[{"name":"dist/browser","children":[{"name":"Options/Classes","children":[{"uid":"7fdefec8-1","name":"DestroyBounds.js"},{"uid":"7fdefec8-5","name":"Explode.js"},{"uid":"7fdefec8-7","name":"SplitFactor.js"},{"uid":"7fdefec8-9","name":"SplitRate.js"},{"uid":"7fdefec8-11","name":"Split.js"},{"uid":"7fdefec8-13","name":"Destroy.js"}]},{"name":"Enums/DestroyMode.js","uid":"7fdefec8-3"},{"uid":"7fdefec8-15","name":"Utils.js"},{"uid":"7fdefec8-17","name":"DestroyUpdater.js"},{"uid":"7fdefec8-19","name":"index.js"},{"uid":"7fdefec8-21","name":"browser.js"}]}]}],"isRoot":true},"nodeParts":{"7fdefec8-1":{"renderedLength":453,"gzipLength":0,"brotliLength":0,"metaUid":"7fdefec8-0"},"7fdefec8-3":{"renderedLength":215,"gzipLength":0,"brotliLength":0,"metaUid":"7fdefec8-2"},"7fdefec8-5":{"renderedLength":315,"gzipLength":0,"brotliLength":0,"metaUid":"7fdefec8-4"},"7fdefec8-7":{"renderedLength":79,"gzipLength":0,"brotliLength":0,"metaUid":"7fdefec8-6"},"7fdefec8-9":{"renderedLength":94,"gzipLength":0,"brotliLength":0,"metaUid":"7fdefec8-8"},"7fdefec8-11":{"renderedLength":2200,"gzipLength":0,"brotliLength":0,"metaUid":"7fdefec8-10"},"7fdefec8-13":{"renderedLength":526,"gzipLength":0,"brotliLength":0,"metaUid":"7fdefec8-12"},"7fdefec8-15":{"renderedLength":5283,"gzipLength":0,"brotliLength":0,"metaUid":"7fdefec8-14"},"7fdefec8-17":{"renderedLength":4860,"gzipLength":0,"brotliLength":0,"metaUid":"7fdefec8-16"},"7fdefec8-19":{"renderedLength":331,"gzipLength":0,"brotliLength":0,"metaUid":"7fdefec8-18"},"7fdefec8-21":{"renderedLength":179,"gzipLength":0,"brotliLength":0,"metaUid":"7fdefec8-20"}},"nodeMetas":{"7fdefec8-0":{"id":"/dist/browser/Options/Classes/DestroyBounds.js","moduleParts":{"tsparticles.updater.destroy.js":"7fdefec8-1"},"imported":[{"uid":"7fdefec8-22"}],"importedBy":[{"uid":"7fdefec8-12"}]},"7fdefec8-2":{"id":"/dist/browser/Enums/DestroyMode.js","moduleParts":{"tsparticles.updater.destroy.js":"7fdefec8-3"},"imported":[],"importedBy":[{"uid":"7fdefec8-16"},{"uid":"7fdefec8-12"}]},"7fdefec8-4":{"id":"/dist/browser/Options/Classes/Explode.js","moduleParts":{"tsparticles.updater.destroy.js":"7fdefec8-5"},"imported":[{"uid":"7fdefec8-22"}],"importedBy":[{"uid":"7fdefec8-12"}]},"7fdefec8-6":{"id":"/dist/browser/Options/Classes/SplitFactor.js","moduleParts":{"tsparticles.updater.destroy.js":"7fdefec8-7"},"imported":[{"uid":"7fdefec8-22"}],"importedBy":[{"uid":"7fdefec8-10"}]},"7fdefec8-8":{"id":"/dist/browser/Options/Classes/SplitRate.js","moduleParts":{"tsparticles.updater.destroy.js":"7fdefec8-9"},"imported":[{"uid":"7fdefec8-22"}],"importedBy":[{"uid":"7fdefec8-10"}]},"7fdefec8-10":{"id":"/dist/browser/Options/Classes/Split.js","moduleParts":{"tsparticles.updater.destroy.js":"7fdefec8-11"},"imported":[{"uid":"7fdefec8-22"},{"uid":"7fdefec8-6"},{"uid":"7fdefec8-8"}],"importedBy":[{"uid":"7fdefec8-12"}]},"7fdefec8-12":{"id":"/dist/browser/Options/Classes/Destroy.js","moduleParts":{"tsparticles.updater.destroy.js":"7fdefec8-13"},"imported":[{"uid":"7fdefec8-22"},{"uid":"7fdefec8-0"},{"uid":"7fdefec8-2"},{"uid":"7fdefec8-4"},{"uid":"7fdefec8-10"}],"importedBy":[{"uid":"7fdefec8-16"}]},"7fdefec8-14":{"id":"/dist/browser/Utils.js","moduleParts":{"tsparticles.updater.destroy.js":"7fdefec8-15"},"imported":[{"uid":"7fdefec8-22"}],"importedBy":[{"uid":"7fdefec8-16"}]},"7fdefec8-16":{"id":"/dist/browser/DestroyUpdater.js","moduleParts":{"tsparticles.updater.destroy.js":"7fdefec8-17"},"imported":[{"uid":"7fdefec8-22"},{"uid":"7fdefec8-12"},{"uid":"7fdefec8-2"},{"uid":"7fdefec8-14"}],"importedBy":[{"uid":"7fdefec8-18"}]},"7fdefec8-18":{"id":"/dist/browser/index.js","moduleParts":{"tsparticles.updater.destroy.js":"7fdefec8-19"},"imported":[{"uid":"7fdefec8-16"}],"importedBy":[{"uid":"7fdefec8-20"}]},"7fdefec8-20":{"id":"/dist/browser/browser.js","moduleParts":{"tsparticles.updater.destroy.js":"7fdefec8-21"},"imported":[{"uid":"7fdefec8-18"}],"importedBy":[],"isEntry":true},"7fdefec8-22":{"id":"@tsparticles/engine","moduleParts":{},"imported":[],"importedBy":[{"uid":"7fdefec8-16"},{"uid":"7fdefec8-12"},{"uid":"7fdefec8-14"},{"uid":"7fdefec8-0"},{"uid":"7fdefec8-4"},{"uid":"7fdefec8-10"},{"uid":"7fdefec8-6"},{"uid":"7fdefec8-8"}],"isExternal":true}},"env":{"rollup":"4.62.0"},"options":{"gzip":false,"brotli":false,"sourcemap":false}};
|
|
4934
4934
|
|
|
4935
4935
|
const run = () => {
|
|
4936
4936
|
const width = window.innerWidth;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
(function(g){g.__tsParticlesInternals=g.__tsParticlesInternals||{};g.__tsParticlesInternals.bundles=g.__tsParticlesInternals.bundles||{};g.__tsParticlesInternals.effects=g.__tsParticlesInternals.effects||{};g.__tsParticlesInternals.engine=g.__tsParticlesInternals.engine||{};g.__tsParticlesInternals.interactions=g.__tsParticlesInternals.interactions||{};g.__tsParticlesInternals.palettes=g.__tsParticlesInternals.palettes||{};g.__tsParticlesInternals.paths=g.__tsParticlesInternals.paths||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins.emittersShapes=g.__tsParticlesInternals.plugins.emittersShapes||{};g.__tsParticlesInternals.presets=g.__tsParticlesInternals.presets||{};g.__tsParticlesInternals.shapes=g.__tsParticlesInternals.shapes||{};g.__tsParticlesInternals.updaters=g.__tsParticlesInternals.updaters||{};g.__tsParticlesInternals.utils=g.__tsParticlesInternals.utils||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas.utils=g.__tsParticlesInternals.canvas.utils||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path.utils=g.__tsParticlesInternals.path.utils||{};var __tsProxyFactory=typeof Proxy!=="undefined"?function(obj){return new Proxy(obj,{get:function(target,key){if(!(key in target)){target[key]={};}return target[key];}});}:function(obj){return obj;};g.__tsParticlesInternals.bundles=__tsProxyFactory(g.__tsParticlesInternals.bundles);g.__tsParticlesInternals.effects=__tsProxyFactory(g.__tsParticlesInternals.effects);g.__tsParticlesInternals.interactions=__tsProxyFactory(g.__tsParticlesInternals.interactions);g.__tsParticlesInternals.palettes=__tsProxyFactory(g.__tsParticlesInternals.palettes);g.__tsParticlesInternals.paths=__tsProxyFactory(g.__tsParticlesInternals.paths);g.__tsParticlesInternals.plugins=__tsProxyFactory(g.__tsParticlesInternals.plugins);g.__tsParticlesInternals.plugins.emittersShapes=__tsProxyFactory(g.__tsParticlesInternals.plugins.emittersShapes);g.__tsParticlesInternals.presets=__tsProxyFactory(g.__tsParticlesInternals.presets);g.__tsParticlesInternals.shapes=__tsProxyFactory(g.__tsParticlesInternals.shapes);g.__tsParticlesInternals.updaters=__tsProxyFactory(g.__tsParticlesInternals.updaters);g.__tsParticlesInternals.utils=__tsProxyFactory(g.__tsParticlesInternals.utils);g.__tsParticlesInternals.canvas=__tsProxyFactory(g.__tsParticlesInternals.canvas);g.__tsParticlesInternals.path=__tsProxyFactory(g.__tsParticlesInternals.path);g.tsparticlesInternalExports=g.tsparticlesInternalExports||{};})(typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:this);
|
|
2
|
-
/* Updater v4.1
|
|
2
|
+
/* Updater v4.2.1 */
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tsparticles/engine')) :
|
|
5
5
|
typeof define === 'function' && define.amd ? define(['exports', '@tsparticles/engine'], factory) :
|
|
@@ -15,18 +15,10 @@
|
|
|
15
15
|
if (engine.isNull(data)) {
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
this.left = engine.setRangeValue(data.left);
|
|
23
|
-
}
|
|
24
|
-
if (data.right !== undefined) {
|
|
25
|
-
this.right = engine.setRangeValue(data.right);
|
|
26
|
-
}
|
|
27
|
-
if (data.top !== undefined) {
|
|
28
|
-
this.top = engine.setRangeValue(data.top);
|
|
29
|
-
}
|
|
18
|
+
engine.loadRangeProperty(this, "bottom", data.bottom);
|
|
19
|
+
engine.loadRangeProperty(this, "left", data.left);
|
|
20
|
+
engine.loadRangeProperty(this, "right", data.right);
|
|
21
|
+
engine.loadRangeProperty(this, "top", data.top);
|
|
30
22
|
}
|
|
31
23
|
}
|
|
32
24
|
|
|
@@ -38,55 +30,35 @@
|
|
|
38
30
|
})(DestroyMode || (DestroyMode = {}));
|
|
39
31
|
|
|
40
32
|
class Explode {
|
|
41
|
-
maxSizeFactor;
|
|
42
|
-
speed;
|
|
43
|
-
constructor() {
|
|
44
|
-
this.maxSizeFactor = 3;
|
|
45
|
-
this.speed = 2;
|
|
46
|
-
}
|
|
33
|
+
maxSizeFactor = 3;
|
|
34
|
+
speed = 2;
|
|
47
35
|
load(data) {
|
|
48
36
|
if (engine.isNull(data)) {
|
|
49
37
|
return;
|
|
50
38
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
if (data.speed !== undefined) {
|
|
55
|
-
this.speed = data.speed;
|
|
56
|
-
}
|
|
39
|
+
engine.loadProperty(this, "maxSizeFactor", data.maxSizeFactor);
|
|
40
|
+
engine.loadProperty(this, "speed", data.speed);
|
|
57
41
|
}
|
|
58
42
|
}
|
|
59
43
|
|
|
60
44
|
class SplitFactor extends engine.ValueWithRandom {
|
|
61
|
-
|
|
62
|
-
super();
|
|
63
|
-
this.value = 3;
|
|
64
|
-
}
|
|
45
|
+
value = 3;
|
|
65
46
|
}
|
|
66
47
|
|
|
67
48
|
class SplitRate extends engine.ValueWithRandom {
|
|
68
|
-
|
|
69
|
-
super();
|
|
70
|
-
this.value = { min: 4, max: 9 };
|
|
71
|
-
}
|
|
49
|
+
value = { min: 4, max: 9 };
|
|
72
50
|
}
|
|
73
51
|
|
|
74
52
|
class Split {
|
|
75
|
-
count;
|
|
76
|
-
factor;
|
|
53
|
+
count = 1;
|
|
54
|
+
factor = new SplitFactor();
|
|
77
55
|
fillColor;
|
|
78
56
|
fillColorOffset;
|
|
79
57
|
particles;
|
|
80
|
-
rate;
|
|
81
|
-
sizeOffset;
|
|
58
|
+
rate = new SplitRate();
|
|
59
|
+
sizeOffset = true;
|
|
82
60
|
strokeColor;
|
|
83
61
|
strokeColorOffset;
|
|
84
|
-
constructor() {
|
|
85
|
-
this.count = 1;
|
|
86
|
-
this.factor = new SplitFactor();
|
|
87
|
-
this.rate = new SplitRate();
|
|
88
|
-
this.sizeOffset = true;
|
|
89
|
-
}
|
|
90
62
|
load(data) {
|
|
91
63
|
if (engine.isNull(data)) {
|
|
92
64
|
return;
|
|
@@ -97,17 +69,13 @@
|
|
|
97
69
|
if (data.strokeColor !== undefined) {
|
|
98
70
|
this.strokeColor = engine.OptionsColor.create(this.strokeColor, data.strokeColor);
|
|
99
71
|
}
|
|
100
|
-
|
|
101
|
-
this.count = data.count;
|
|
102
|
-
}
|
|
72
|
+
engine.loadProperty(this, "count", data.count);
|
|
103
73
|
this.factor.load(data.factor);
|
|
104
74
|
this.rate.load(data.rate);
|
|
105
75
|
this.particles = engine.executeOnSingleOrMultiple(data.particles, particles => {
|
|
106
76
|
return engine.deepExtend({}, particles);
|
|
107
77
|
});
|
|
108
|
-
|
|
109
|
-
this.sizeOffset = data.sizeOffset;
|
|
110
|
-
}
|
|
78
|
+
engine.loadProperty(this, "sizeOffset", data.sizeOffset);
|
|
111
79
|
if (data.fillColorOffset) {
|
|
112
80
|
this.fillColorOffset = this.fillColorOffset ?? {};
|
|
113
81
|
if (data.fillColorOffset.h !== undefined) {
|
|
@@ -136,16 +104,10 @@
|
|
|
136
104
|
}
|
|
137
105
|
|
|
138
106
|
class Destroy {
|
|
139
|
-
bounds;
|
|
140
|
-
explode;
|
|
141
|
-
mode;
|
|
142
|
-
split;
|
|
143
|
-
constructor() {
|
|
144
|
-
this.bounds = new DestroyBounds();
|
|
145
|
-
this.explode = new Explode();
|
|
146
|
-
this.mode = DestroyMode.none;
|
|
147
|
-
this.split = new Split();
|
|
148
|
-
}
|
|
107
|
+
bounds = new DestroyBounds();
|
|
108
|
+
explode = new Explode();
|
|
109
|
+
mode = DestroyMode.none;
|
|
110
|
+
split = new Split();
|
|
149
111
|
load(data) {
|
|
150
112
|
if (engine.isNull(data)) {
|
|
151
113
|
return;
|
|
@@ -293,10 +255,7 @@
|
|
|
293
255
|
return !destroyParticle.destroyed || !!destroyParticle.exploding;
|
|
294
256
|
}
|
|
295
257
|
loadOptions(options, ...sources) {
|
|
296
|
-
options
|
|
297
|
-
for (const source of sources) {
|
|
298
|
-
options.destroy.load(source?.destroy);
|
|
299
|
-
}
|
|
258
|
+
engine.loadOptionProperty(options, "destroy", Destroy, ...sources);
|
|
300
259
|
}
|
|
301
260
|
particleDestroyed(particle, override) {
|
|
302
261
|
if (override) {
|
|
@@ -361,7 +320,7 @@
|
|
|
361
320
|
}
|
|
362
321
|
|
|
363
322
|
async function loadDestroyUpdater(engine) {
|
|
364
|
-
engine.checkVersion("4.1
|
|
323
|
+
engine.checkVersion("4.2.1");
|
|
365
324
|
await engine.pluginManager.register(e => {
|
|
366
325
|
e.pluginManager.addParticleUpdater("destroy", container => {
|
|
367
326
|
return Promise.resolve(new DestroyUpdater(e.pluginManager, container));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t){t.__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.bundles=t.__tsParticlesInternals.bundles||{},t.__tsParticlesInternals.effects=t.__tsParticlesInternals.effects||{},t.__tsParticlesInternals.engine=t.__tsParticlesInternals.engine||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},t.__tsParticlesInternals.palettes=t.__tsParticlesInternals.palettes||{},t.__tsParticlesInternals.paths=t.__tsParticlesInternals.paths||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins.emittersShapes=t.__tsParticlesInternals.plugins.emittersShapes||{},t.__tsParticlesInternals.presets=t.__tsParticlesInternals.presets||{},t.__tsParticlesInternals.shapes=t.__tsParticlesInternals.shapes||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.utils=t.__tsParticlesInternals.utils||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas.utils=t.__tsParticlesInternals.canvas.utils||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path.utils=t.__tsParticlesInternals.path.utils||{};var e="undefined"!=typeof Proxy?function(t){return new Proxy(t,{get:function(t,e){return e in t||(t[e]={}),t[e]}})}:function(t){return t};t.__tsParticlesInternals.bundles=e(t.__tsParticlesInternals.bundles),t.__tsParticlesInternals.effects=e(t.__tsParticlesInternals.effects),t.__tsParticlesInternals.interactions=e(t.__tsParticlesInternals.interactions),t.__tsParticlesInternals.palettes=e(t.__tsParticlesInternals.palettes),t.__tsParticlesInternals.paths=e(t.__tsParticlesInternals.paths),t.__tsParticlesInternals.plugins=e(t.__tsParticlesInternals.plugins),t.__tsParticlesInternals.plugins.emittersShapes=e(t.__tsParticlesInternals.plugins.emittersShapes),t.__tsParticlesInternals.presets=e(t.__tsParticlesInternals.presets),t.__tsParticlesInternals.shapes=e(t.__tsParticlesInternals.shapes),t.__tsParticlesInternals.updaters=e(t.__tsParticlesInternals.updaters),t.__tsParticlesInternals.utils=e(t.__tsParticlesInternals.utils),t.__tsParticlesInternals.canvas=e(t.__tsParticlesInternals.canvas),t.__tsParticlesInternals.path=e(t.__tsParticlesInternals.path),t.tsparticlesInternalExports=t.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@tsparticles/engine")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/engine"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.updaters.destroy=t.__tsParticlesInternals.updaters.destroy||{}),t.__tsParticlesInternals.engine)}(this,function(t,e){"use strict";class s{bottom;left;right;top;load(t){e.isNull(t)||(
|
|
1
|
+
!function(t){t.__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.bundles=t.__tsParticlesInternals.bundles||{},t.__tsParticlesInternals.effects=t.__tsParticlesInternals.effects||{},t.__tsParticlesInternals.engine=t.__tsParticlesInternals.engine||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},t.__tsParticlesInternals.palettes=t.__tsParticlesInternals.palettes||{},t.__tsParticlesInternals.paths=t.__tsParticlesInternals.paths||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins.emittersShapes=t.__tsParticlesInternals.plugins.emittersShapes||{},t.__tsParticlesInternals.presets=t.__tsParticlesInternals.presets||{},t.__tsParticlesInternals.shapes=t.__tsParticlesInternals.shapes||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.utils=t.__tsParticlesInternals.utils||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas.utils=t.__tsParticlesInternals.canvas.utils||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path.utils=t.__tsParticlesInternals.path.utils||{};var e="undefined"!=typeof Proxy?function(t){return new Proxy(t,{get:function(t,e){return e in t||(t[e]={}),t[e]}})}:function(t){return t};t.__tsParticlesInternals.bundles=e(t.__tsParticlesInternals.bundles),t.__tsParticlesInternals.effects=e(t.__tsParticlesInternals.effects),t.__tsParticlesInternals.interactions=e(t.__tsParticlesInternals.interactions),t.__tsParticlesInternals.palettes=e(t.__tsParticlesInternals.palettes),t.__tsParticlesInternals.paths=e(t.__tsParticlesInternals.paths),t.__tsParticlesInternals.plugins=e(t.__tsParticlesInternals.plugins),t.__tsParticlesInternals.plugins.emittersShapes=e(t.__tsParticlesInternals.plugins.emittersShapes),t.__tsParticlesInternals.presets=e(t.__tsParticlesInternals.presets),t.__tsParticlesInternals.shapes=e(t.__tsParticlesInternals.shapes),t.__tsParticlesInternals.updaters=e(t.__tsParticlesInternals.updaters),t.__tsParticlesInternals.utils=e(t.__tsParticlesInternals.utils),t.__tsParticlesInternals.canvas=e(t.__tsParticlesInternals.canvas),t.__tsParticlesInternals.path=e(t.__tsParticlesInternals.path),t.tsparticlesInternalExports=t.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@tsparticles/engine")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/engine"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.updaters.destroy=t.__tsParticlesInternals.updaters.destroy||{}),t.__tsParticlesInternals.engine)}(this,function(t,e){"use strict";class s{bottom;left;right;top;load(t){e.isNull(t)||(e.loadRangeProperty(this,"bottom",t.bottom),e.loadRangeProperty(this,"left",t.left),e.loadRangeProperty(this,"right",t.right),e.loadRangeProperty(this,"top",t.top))}}var l;!function(t){t.explode="explode",t.none="none",t.split="split"}(l||(l={}));class r{maxSizeFactor=3;speed=2;load(t){e.isNull(t)||(e.loadProperty(this,"maxSizeFactor",t.maxSizeFactor),e.loadProperty(this,"speed",t.speed))}}class a extends e.ValueWithRandom{value=3}class n extends e.ValueWithRandom{value={min:4,max:9}}class i{count=1;factor=new a;fillColor;fillColorOffset;particles;rate=new n;sizeOffset=!0;strokeColor;strokeColorOffset;load(t){e.isNull(t)||(void 0!==t.fillColor&&(this.fillColor=e.OptionsColor.create(this.fillColor,t.fillColor)),void 0!==t.strokeColor&&(this.strokeColor=e.OptionsColor.create(this.strokeColor,t.strokeColor)),e.loadProperty(this,"count",t.count),this.factor.load(t.factor),this.rate.load(t.rate),this.particles=e.executeOnSingleOrMultiple(t.particles,t=>e.deepExtend({},t)),e.loadProperty(this,"sizeOffset",t.sizeOffset),t.fillColorOffset&&(this.fillColorOffset=this.fillColorOffset??{},void 0!==t.fillColorOffset.h&&(this.fillColorOffset.h=t.fillColorOffset.h),void 0!==t.fillColorOffset.s&&(this.fillColorOffset.s=t.fillColorOffset.s),void 0!==t.fillColorOffset.l&&(this.fillColorOffset.l=t.fillColorOffset.l)),t.strokeColorOffset&&(this.strokeColorOffset=this.strokeColorOffset??{},void 0!==t.strokeColorOffset.h&&(this.strokeColorOffset.h=t.strokeColorOffset.h),void 0!==t.strokeColorOffset.s&&(this.strokeColorOffset.s=t.strokeColorOffset.s),void 0!==t.strokeColorOffset.l&&(this.strokeColorOffset.l=t.strokeColorOffset.l)))}}class o{bounds=new s;explode=new r;mode=l.none;split=new i;load(t){e.isNull(t)||(t.mode&&(this.mode=t.mode),t.bounds&&this.bounds.load(t.bounds),this.explode.load(t.explode),this.split.load(t.split))}}function c(t,s,l,r){return t&&r?function(t,s){const l=e.getRangeValue(s.h??0),r=e.getRangeValue(s.s??0),a=e.getRangeValue(s.l??0),n=(t.h+l)%360,i=Math.max(0,Math.min(100,t.s+r)),o=Math.max(0,Math.min(100,t.l+a));return e.AnimatableColor.create(void 0,{value:{hsl:{h:n<0?n+360:n,s:i,l:o}}})}(r,t):s?e.AnimatableColor.create(void 0,s):l?e.AnimatableColor.create(void 0,l):r?function(t){return e.AnimatableColor.create(void 0,{value:{hsl:t}})}(r):void 0}function p(t,s,l,r){const a=l.options.destroy;if(!a)return;const n=a.split,i=e.loadParticlesOptions(t,s,l.options),o=e.itemFromSingleOrMultiple(n.fillColor),p=e.itemFromSingleOrMultiple(n.strokeColor),d=l.getFillColor(),_=l.getStrokeColor();i.move.load({center:{x:l.position.x,y:l.position.y,mode:e.PixelMode.precise}});const f=e.identity/e.getRangeValue(n.factor.value),u=i.size;u&&(e.isNumber(u.value)?u.value*=f:(u.value.min*=f,u.value.max*=f)),i.load(r);const h=e.itemFromSingleOrMultiple(i.paint),g=h?.fill,P=h?.stroke,I=c(n.fillColorOffset,o,g?.color,d),y=c(n.strokeColorOffset,p,P?.color,_);I&&g&&(g.color=I),y&&P&&(P.color=y);const m=n.sizeOffset?e.setRangeValue(-l.size.value,l.size.value):0,O={x:l.position.x+e.randomInRangeValue(m),y:l.position.y+e.randomInRangeValue(m)};return s.particles.addParticle(O,i,l.group,t=>!(t.size.value<.5)&&(t.velocity.length=e.randomInRangeValue(e.setRangeValue(l.velocity.length,t.velocity.length)),t.splitCount=(l.splitCount??0)+1,t.unbreakable=!0,t.unbreakableUntil=performance.now()+500,!0))}class d{#t;#e;constructor(t,e){this.#t=e,this.#e=t}init(t){const s=this.#t,l=t.options.destroy;if(!l)return;t.exploding=void 0,t.splitCount=0;const r=l.bounds;t.destroyBounds??={};const{bottom:a,left:n,right:i,top:o}=r,{destroyBounds:c}=t,p=s.canvas.size;a&&(c.bottom=e.getRangeValue(a)*p.height/e.percentDenominator),n&&(c.left=e.getRangeValue(n)*p.width/e.percentDenominator),i&&(c.right=e.getRangeValue(i)*p.width/e.percentDenominator),o&&(c.top=e.getRangeValue(o)*p.height/e.percentDenominator)}isEnabled(t){const e=t;return!e.destroyed||!!e.exploding}loadOptions(t,...s){e.loadOptionProperty(t,"destroy",o,...s)}particleDestroyed(t,s){if(s)return;const r=t.options.destroy;switch(r?.mode){case l.split:!function(t,s,l){const r=l.options.destroy;if(!r)return;const a=r.split;if(a.count>=0){if(void 0===l.splitCount||l.splitCount>a.count)return;l.splitCount++}const n=e.getRangeValue(a.rate.value),i=e.itemFromSingleOrMultiple(a.particles);for(let e=0;e<n;e++)p(t,s,l,i)}(this.#e,this.#t,t);break;case l.explode:{if(t.exploding){t.destroyed=!1;break}const{explode:e}=r,s=t.size.value,l=s*e.maxSizeFactor,a=t.getOpacity();t.exploding={initialFillOpacity:a.fillOpacity,initialSize:s,initialStrokeOpacity:a.strokeOpacity,maxSize:l,progress:0,speed:Math.max(e.speed,.01)},t.fillOpacity=a.fillOpacity,t.strokeOpacity=a.strokeOpacity,t.destroyed=!1;break}}}update(t,e){if(t.exploding){const s=t.exploding,l=e.factor||1;s.progress=Math.min(1,s.progress+s.speed*l/60);const r=s.progress;return t.size.value=s.initialSize+(s.maxSize-s.initialSize)*r,t.fillOpacity=s.initialFillOpacity*(1-r),t.strokeOpacity=s.initialStrokeOpacity*(1-r),void(r>=1&&(t.exploding=void 0,t.destroy(!0)))}void 0!==t.unbreakableUntil&&performance.now()>=t.unbreakableUntil&&(t.unbreakable=!1,t.unbreakableUntil=void 0);const s=t.getPosition(),l=t.destroyBounds;l&&(void 0!==l.bottom&&s.y>=l.bottom||void 0!==l.left&&s.x<=l.left||void 0!==l.right&&s.x>=l.right||void 0!==l.top&&s.y<=l.top)&&t.destroy()}}async function _(t){t.checkVersion("4.2.1"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("destroy",e=>Promise.resolve(new d(t.pluginManager,e)))})}const f=globalThis;f.__tsParticlesInternals=f.__tsParticlesInternals??{},f.loadDestroyUpdater=_,t.loadDestroyUpdater=_}),Object.assign(globalThis.window||globalThis,{loadDestroyUpdater:(globalThis.__tsParticlesInternals.updaters.destroy||{}).loadDestroyUpdater}),delete(globalThis.window||globalThis).tsparticlesInternalExports;
|
|
@@ -5,10 +5,9 @@ import { Explode } from "./Explode.js";
|
|
|
5
5
|
import type { IDestroy } from "../Interfaces/IDestroy.js";
|
|
6
6
|
import { Split } from "./Split.js";
|
|
7
7
|
export declare class Destroy implements IDestroy, IOptionLoader<IDestroy> {
|
|
8
|
-
bounds: DestroyBounds;
|
|
9
|
-
explode: Explode;
|
|
8
|
+
readonly bounds: DestroyBounds;
|
|
9
|
+
readonly explode: Explode;
|
|
10
10
|
mode: DestroyMode | keyof typeof DestroyMode;
|
|
11
|
-
split: Split;
|
|
12
|
-
constructor();
|
|
11
|
+
readonly split: Split;
|
|
13
12
|
load(data?: RecursivePartial<IDestroy>): void;
|
|
14
13
|
}
|
|
@@ -4,14 +4,13 @@ import { SplitFactor } from "./SplitFactor.js";
|
|
|
4
4
|
import { SplitRate } from "./SplitRate.js";
|
|
5
5
|
export declare class Split implements ISplit, IOptionLoader<ISplit> {
|
|
6
6
|
count: number;
|
|
7
|
-
factor: SplitFactor;
|
|
7
|
+
readonly factor: SplitFactor;
|
|
8
8
|
fillColor?: OptionsColor;
|
|
9
9
|
fillColorOffset?: Partial<IRangeHsl>;
|
|
10
10
|
particles?: SingleOrMultiple<RecursivePartial<IParticlesOptions>>;
|
|
11
|
-
rate: SplitRate;
|
|
11
|
+
readonly rate: SplitRate;
|
|
12
12
|
sizeOffset: boolean;
|
|
13
13
|
strokeColor?: OptionsColor;
|
|
14
14
|
strokeColorOffset?: Partial<IRangeHsl>;
|
|
15
|
-
constructor();
|
|
16
15
|
load(data?: RecursivePartial<ISplit>): void;
|
|
17
16
|
}
|