@tsparticles/updater-life 4.0.0-beta.12 → 4.0.0-beta.16
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/LifeUpdater.js +3 -4
- package/browser/browser.js +5 -0
- package/browser/index.js +4 -4
- package/browser/index.lazy.js +9 -0
- package/cjs/LifeUpdater.js +3 -4
- package/cjs/browser.js +5 -0
- package/cjs/index.js +4 -4
- package/cjs/index.lazy.js +9 -0
- package/esm/LifeUpdater.js +3 -4
- package/esm/browser.js +5 -0
- package/esm/index.js +4 -4
- package/esm/index.lazy.js +9 -0
- package/package.json +9 -2
- package/report.html +4949 -94
- package/tsparticles.updater.life.js +177 -310
- package/tsparticles.updater.life.min.js +1 -2
- package/types/browser.d.ts +1 -0
- package/types/index.lazy.d.ts +2 -0
- package/442.min.js +0 -1
- package/dist_browser_LifeUpdater_js.js +0 -70
package/browser/LifeUpdater.js
CHANGED
|
@@ -12,16 +12,15 @@ export class LifeUpdater {
|
|
|
12
12
|
if (!lifeOptions) {
|
|
13
13
|
return;
|
|
14
14
|
}
|
|
15
|
+
const delayFactor = lifeOptions.delay.sync ? identity : getRandom(), durationFactor = lifeOptions.duration.sync ? identity : getRandom();
|
|
15
16
|
particle.life = {
|
|
16
17
|
delay: container.retina.reduceFactor
|
|
17
|
-
? ((getRangeValue(lifeOptions.delay.value) *
|
|
18
|
-
container.retina.reduceFactor) *
|
|
18
|
+
? ((getRangeValue(lifeOptions.delay.value) * delayFactor) / container.retina.reduceFactor) *
|
|
19
19
|
millisecondsToSeconds
|
|
20
20
|
: noTime,
|
|
21
21
|
delayTime: noTime,
|
|
22
22
|
duration: container.retina.reduceFactor
|
|
23
|
-
? ((getRangeValue(lifeOptions.duration.value) *
|
|
24
|
-
container.retina.reduceFactor) *
|
|
23
|
+
? ((getRangeValue(lifeOptions.duration.value) * durationFactor) / container.retina.reduceFactor) *
|
|
25
24
|
millisecondsToSeconds
|
|
26
25
|
: noTime,
|
|
27
26
|
time: noTime,
|
package/browser/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { LifeUpdater } from "./LifeUpdater.js";
|
|
1
2
|
export async function loadLifeUpdater(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-beta.
|
|
3
|
+
engine.checkVersion("4.0.0-beta.16");
|
|
3
4
|
await engine.pluginManager.register(e => {
|
|
4
|
-
e.pluginManager.addParticleUpdater("life",
|
|
5
|
-
|
|
6
|
-
return new LifeUpdater(container);
|
|
5
|
+
e.pluginManager.addParticleUpdater("life", container => {
|
|
6
|
+
return Promise.resolve(new LifeUpdater(container));
|
|
7
7
|
});
|
|
8
8
|
});
|
|
9
9
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export async function loadLifeUpdater(engine) {
|
|
2
|
+
engine.checkVersion("4.0.0-beta.16");
|
|
3
|
+
await engine.pluginManager.register(e => {
|
|
4
|
+
e.pluginManager.addParticleUpdater("life", async (container) => {
|
|
5
|
+
const { LifeUpdater } = await import("./LifeUpdater.js");
|
|
6
|
+
return new LifeUpdater(container);
|
|
7
|
+
});
|
|
8
|
+
});
|
|
9
|
+
}
|
package/cjs/LifeUpdater.js
CHANGED
|
@@ -12,16 +12,15 @@ export class LifeUpdater {
|
|
|
12
12
|
if (!lifeOptions) {
|
|
13
13
|
return;
|
|
14
14
|
}
|
|
15
|
+
const delayFactor = lifeOptions.delay.sync ? identity : getRandom(), durationFactor = lifeOptions.duration.sync ? identity : getRandom();
|
|
15
16
|
particle.life = {
|
|
16
17
|
delay: container.retina.reduceFactor
|
|
17
|
-
? ((getRangeValue(lifeOptions.delay.value) *
|
|
18
|
-
container.retina.reduceFactor) *
|
|
18
|
+
? ((getRangeValue(lifeOptions.delay.value) * delayFactor) / container.retina.reduceFactor) *
|
|
19
19
|
millisecondsToSeconds
|
|
20
20
|
: noTime,
|
|
21
21
|
delayTime: noTime,
|
|
22
22
|
duration: container.retina.reduceFactor
|
|
23
|
-
? ((getRangeValue(lifeOptions.duration.value) *
|
|
24
|
-
container.retina.reduceFactor) *
|
|
23
|
+
? ((getRangeValue(lifeOptions.duration.value) * durationFactor) / container.retina.reduceFactor) *
|
|
25
24
|
millisecondsToSeconds
|
|
26
25
|
: noTime,
|
|
27
26
|
time: noTime,
|
package/cjs/browser.js
ADDED
package/cjs/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { LifeUpdater } from "./LifeUpdater.js";
|
|
1
2
|
export async function loadLifeUpdater(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-beta.
|
|
3
|
+
engine.checkVersion("4.0.0-beta.16");
|
|
3
4
|
await engine.pluginManager.register(e => {
|
|
4
|
-
e.pluginManager.addParticleUpdater("life",
|
|
5
|
-
|
|
6
|
-
return new LifeUpdater(container);
|
|
5
|
+
e.pluginManager.addParticleUpdater("life", container => {
|
|
6
|
+
return Promise.resolve(new LifeUpdater(container));
|
|
7
7
|
});
|
|
8
8
|
});
|
|
9
9
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export async function loadLifeUpdater(engine) {
|
|
2
|
+
engine.checkVersion("4.0.0-beta.16");
|
|
3
|
+
await engine.pluginManager.register(e => {
|
|
4
|
+
e.pluginManager.addParticleUpdater("life", async (container) => {
|
|
5
|
+
const { LifeUpdater } = await import("./LifeUpdater.js");
|
|
6
|
+
return new LifeUpdater(container);
|
|
7
|
+
});
|
|
8
|
+
});
|
|
9
|
+
}
|
package/esm/LifeUpdater.js
CHANGED
|
@@ -12,16 +12,15 @@ export class LifeUpdater {
|
|
|
12
12
|
if (!lifeOptions) {
|
|
13
13
|
return;
|
|
14
14
|
}
|
|
15
|
+
const delayFactor = lifeOptions.delay.sync ? identity : getRandom(), durationFactor = lifeOptions.duration.sync ? identity : getRandom();
|
|
15
16
|
particle.life = {
|
|
16
17
|
delay: container.retina.reduceFactor
|
|
17
|
-
? ((getRangeValue(lifeOptions.delay.value) *
|
|
18
|
-
container.retina.reduceFactor) *
|
|
18
|
+
? ((getRangeValue(lifeOptions.delay.value) * delayFactor) / container.retina.reduceFactor) *
|
|
19
19
|
millisecondsToSeconds
|
|
20
20
|
: noTime,
|
|
21
21
|
delayTime: noTime,
|
|
22
22
|
duration: container.retina.reduceFactor
|
|
23
|
-
? ((getRangeValue(lifeOptions.duration.value) *
|
|
24
|
-
container.retina.reduceFactor) *
|
|
23
|
+
? ((getRangeValue(lifeOptions.duration.value) * durationFactor) / container.retina.reduceFactor) *
|
|
25
24
|
millisecondsToSeconds
|
|
26
25
|
: noTime,
|
|
27
26
|
time: noTime,
|
package/esm/browser.js
ADDED
package/esm/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { LifeUpdater } from "./LifeUpdater.js";
|
|
1
2
|
export async function loadLifeUpdater(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-beta.
|
|
3
|
+
engine.checkVersion("4.0.0-beta.16");
|
|
3
4
|
await engine.pluginManager.register(e => {
|
|
4
|
-
e.pluginManager.addParticleUpdater("life",
|
|
5
|
-
|
|
6
|
-
return new LifeUpdater(container);
|
|
5
|
+
e.pluginManager.addParticleUpdater("life", container => {
|
|
6
|
+
return Promise.resolve(new LifeUpdater(container));
|
|
7
7
|
});
|
|
8
8
|
});
|
|
9
9
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export async function loadLifeUpdater(engine) {
|
|
2
|
+
engine.checkVersion("4.0.0-beta.16");
|
|
3
|
+
await engine.pluginManager.register(e => {
|
|
4
|
+
e.pluginManager.addParticleUpdater("life", async (container) => {
|
|
5
|
+
const { LifeUpdater } = await import("./LifeUpdater.js");
|
|
6
|
+
return new LifeUpdater(container);
|
|
7
|
+
});
|
|
8
|
+
});
|
|
9
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/updater-life",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.16",
|
|
4
4
|
"description": "tsParticles particles life updater",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -83,10 +83,17 @@
|
|
|
83
83
|
"require": "./cjs/index.js",
|
|
84
84
|
"default": "./esm/index.js"
|
|
85
85
|
},
|
|
86
|
+
"./lazy": {
|
|
87
|
+
"types": "./types/index.lazy.d.ts",
|
|
88
|
+
"browser": "./browser/index.lazy.js",
|
|
89
|
+
"import": "./esm/index.lazy.js",
|
|
90
|
+
"require": "./cjs/index.lazy.js",
|
|
91
|
+
"default": "./esm/index.lazy.js"
|
|
92
|
+
},
|
|
86
93
|
"./package.json": "./package.json"
|
|
87
94
|
},
|
|
88
95
|
"peerDependencies": {
|
|
89
|
-
"@tsparticles/engine": "4.0.0-beta.
|
|
96
|
+
"@tsparticles/engine": "4.0.0-beta.16"
|
|
90
97
|
},
|
|
91
98
|
"publishConfig": {
|
|
92
99
|
"access": "public"
|