@tsparticles/updater-rotate 4.1.3 → 4.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/browser/Options/Classes/Rotate.js +6 -17
- package/browser/Options/Classes/RotateAnimation.js +9 -23
- package/browser/RotateUpdater.js +3 -5
- package/browser/index.js +1 -1
- package/browser/index.lazy.js +1 -1
- package/cjs/Options/Classes/Rotate.js +6 -17
- package/cjs/Options/Classes/RotateAnimation.js +9 -23
- package/cjs/RotateUpdater.js +3 -5
- package/cjs/index.js +1 -1
- package/cjs/index.lazy.js +1 -1
- package/esm/Options/Classes/Rotate.js +6 -17
- package/esm/Options/Classes/RotateAnimation.js +9 -23
- package/esm/RotateUpdater.js +3 -5
- package/esm/index.js +1 -1
- package/esm/index.lazy.js +1 -1
- package/package.json +5 -2
- package/report.html +1 -1
- package/tsparticles.updater.rotate.js +21 -49
- package/tsparticles.updater.rotate.min.js +1 -1
- package/types/Options/Classes/Rotate.d.ts +1 -2
- package/types/Options/Classes/RotateAnimation.d.ts +0 -1
|
@@ -1,27 +1,16 @@
|
|
|
1
|
-
import { RotateDirection, ValueWithRandom, isNull, } from "@tsparticles/engine";
|
|
1
|
+
import { RotateDirection, ValueWithRandom, isNull, loadProperty, } from "@tsparticles/engine";
|
|
2
2
|
import { RotateAnimation } from "./RotateAnimation.js";
|
|
3
3
|
export class Rotate extends ValueWithRandom {
|
|
4
|
-
animation;
|
|
5
|
-
direction;
|
|
6
|
-
path;
|
|
7
|
-
constructor() {
|
|
8
|
-
super();
|
|
9
|
-
this.animation = new RotateAnimation();
|
|
10
|
-
this.direction = RotateDirection.clockwise;
|
|
11
|
-
this.path = false;
|
|
12
|
-
this.value = 0;
|
|
13
|
-
}
|
|
4
|
+
animation = new RotateAnimation();
|
|
5
|
+
direction = RotateDirection.clockwise;
|
|
6
|
+
path = false;
|
|
14
7
|
load(data) {
|
|
15
8
|
if (isNull(data)) {
|
|
16
9
|
return;
|
|
17
10
|
}
|
|
18
11
|
super.load(data);
|
|
19
|
-
|
|
20
|
-
this.direction = data.direction;
|
|
21
|
-
}
|
|
12
|
+
loadProperty(this, "direction", data.direction);
|
|
22
13
|
this.animation.load(data.animation);
|
|
23
|
-
|
|
24
|
-
this.path = data.path;
|
|
25
|
-
}
|
|
14
|
+
loadProperty(this, "path", data.path);
|
|
26
15
|
}
|
|
27
16
|
}
|
|
@@ -1,30 +1,16 @@
|
|
|
1
|
-
import { isNull,
|
|
1
|
+
import { isNull, loadProperty, loadRangeProperty, } from "@tsparticles/engine";
|
|
2
2
|
export class RotateAnimation {
|
|
3
|
-
decay;
|
|
4
|
-
enable;
|
|
5
|
-
speed;
|
|
6
|
-
sync;
|
|
7
|
-
constructor() {
|
|
8
|
-
this.enable = false;
|
|
9
|
-
this.speed = 0;
|
|
10
|
-
this.decay = 0;
|
|
11
|
-
this.sync = false;
|
|
12
|
-
}
|
|
3
|
+
decay = 0;
|
|
4
|
+
enable = false;
|
|
5
|
+
speed = 0;
|
|
6
|
+
sync = false;
|
|
13
7
|
load(data) {
|
|
14
8
|
if (isNull(data)) {
|
|
15
9
|
return;
|
|
16
10
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
this.speed = setRangeValue(data.speed);
|
|
22
|
-
}
|
|
23
|
-
if (data.decay !== undefined) {
|
|
24
|
-
this.decay = setRangeValue(data.decay);
|
|
25
|
-
}
|
|
26
|
-
if (data.sync !== undefined) {
|
|
27
|
-
this.sync = data.sync;
|
|
28
|
-
}
|
|
11
|
+
loadProperty(this, "enable", data.enable);
|
|
12
|
+
loadRangeProperty(this, "speed", data.speed);
|
|
13
|
+
loadRangeProperty(this, "decay", data.decay);
|
|
14
|
+
loadProperty(this, "sync", data.sync);
|
|
29
15
|
}
|
|
30
16
|
}
|
package/browser/RotateUpdater.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { AnimationStatus, DestroyType, RotateDirection, degToRad, double, doublePI, getRandom, getRangeValue, identity,
|
|
1
|
+
import { AnimationStatus, DestroyType, RotateDirection, degToRad, double, doublePI, getRandom, getRangeValue, identity, loadOptionProperty, } from "@tsparticles/engine";
|
|
2
2
|
import { Rotate } from "./Options/Classes/Rotate.js";
|
|
3
|
+
import { updateAnimation } from "@tsparticles/animation-utils";
|
|
3
4
|
const doublePIDeg = 360;
|
|
4
5
|
export class RotateUpdater {
|
|
5
6
|
#container;
|
|
@@ -53,10 +54,7 @@ export class RotateUpdater {
|
|
|
53
54
|
return !particle.destroyed && !particle.spawning && (!!rotate.value || rotate.animation.enable || rotate.path);
|
|
54
55
|
}
|
|
55
56
|
loadOptions(options, ...sources) {
|
|
56
|
-
options
|
|
57
|
-
for (const source of sources) {
|
|
58
|
-
options.rotate.load(source?.rotate);
|
|
59
|
-
}
|
|
57
|
+
loadOptionProperty(options, "rotate", Rotate, ...sources);
|
|
60
58
|
}
|
|
61
59
|
update(particle, delta) {
|
|
62
60
|
if (!this.isEnabled(particle)) {
|
package/browser/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RotateUpdater } from "./RotateUpdater.js";
|
|
2
2
|
export async function loadRotateUpdater(engine) {
|
|
3
|
-
engine.checkVersion("4.
|
|
3
|
+
engine.checkVersion("4.2.0");
|
|
4
4
|
await engine.pluginManager.register(e => {
|
|
5
5
|
e.pluginManager.addParticleUpdater("rotate", container => {
|
|
6
6
|
return Promise.resolve(new RotateUpdater(container));
|
package/browser/index.lazy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadRotateUpdater(engine) {
|
|
2
|
-
engine.checkVersion("4.
|
|
2
|
+
engine.checkVersion("4.2.0");
|
|
3
3
|
await engine.pluginManager.register(e => {
|
|
4
4
|
e.pluginManager.addParticleUpdater("rotate", async (container) => {
|
|
5
5
|
const { RotateUpdater } = await import("./RotateUpdater.js");
|
|
@@ -1,27 +1,16 @@
|
|
|
1
|
-
import { RotateDirection, ValueWithRandom, isNull, } from "@tsparticles/engine";
|
|
1
|
+
import { RotateDirection, ValueWithRandom, isNull, loadProperty, } from "@tsparticles/engine";
|
|
2
2
|
import { RotateAnimation } from "./RotateAnimation.js";
|
|
3
3
|
export class Rotate extends ValueWithRandom {
|
|
4
|
-
animation;
|
|
5
|
-
direction;
|
|
6
|
-
path;
|
|
7
|
-
constructor() {
|
|
8
|
-
super();
|
|
9
|
-
this.animation = new RotateAnimation();
|
|
10
|
-
this.direction = RotateDirection.clockwise;
|
|
11
|
-
this.path = false;
|
|
12
|
-
this.value = 0;
|
|
13
|
-
}
|
|
4
|
+
animation = new RotateAnimation();
|
|
5
|
+
direction = RotateDirection.clockwise;
|
|
6
|
+
path = false;
|
|
14
7
|
load(data) {
|
|
15
8
|
if (isNull(data)) {
|
|
16
9
|
return;
|
|
17
10
|
}
|
|
18
11
|
super.load(data);
|
|
19
|
-
|
|
20
|
-
this.direction = data.direction;
|
|
21
|
-
}
|
|
12
|
+
loadProperty(this, "direction", data.direction);
|
|
22
13
|
this.animation.load(data.animation);
|
|
23
|
-
|
|
24
|
-
this.path = data.path;
|
|
25
|
-
}
|
|
14
|
+
loadProperty(this, "path", data.path);
|
|
26
15
|
}
|
|
27
16
|
}
|
|
@@ -1,30 +1,16 @@
|
|
|
1
|
-
import { isNull,
|
|
1
|
+
import { isNull, loadProperty, loadRangeProperty, } from "@tsparticles/engine";
|
|
2
2
|
export class RotateAnimation {
|
|
3
|
-
decay;
|
|
4
|
-
enable;
|
|
5
|
-
speed;
|
|
6
|
-
sync;
|
|
7
|
-
constructor() {
|
|
8
|
-
this.enable = false;
|
|
9
|
-
this.speed = 0;
|
|
10
|
-
this.decay = 0;
|
|
11
|
-
this.sync = false;
|
|
12
|
-
}
|
|
3
|
+
decay = 0;
|
|
4
|
+
enable = false;
|
|
5
|
+
speed = 0;
|
|
6
|
+
sync = false;
|
|
13
7
|
load(data) {
|
|
14
8
|
if (isNull(data)) {
|
|
15
9
|
return;
|
|
16
10
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
this.speed = setRangeValue(data.speed);
|
|
22
|
-
}
|
|
23
|
-
if (data.decay !== undefined) {
|
|
24
|
-
this.decay = setRangeValue(data.decay);
|
|
25
|
-
}
|
|
26
|
-
if (data.sync !== undefined) {
|
|
27
|
-
this.sync = data.sync;
|
|
28
|
-
}
|
|
11
|
+
loadProperty(this, "enable", data.enable);
|
|
12
|
+
loadRangeProperty(this, "speed", data.speed);
|
|
13
|
+
loadRangeProperty(this, "decay", data.decay);
|
|
14
|
+
loadProperty(this, "sync", data.sync);
|
|
29
15
|
}
|
|
30
16
|
}
|
package/cjs/RotateUpdater.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { AnimationStatus, DestroyType, RotateDirection, degToRad, double, doublePI, getRandom, getRangeValue, identity,
|
|
1
|
+
import { AnimationStatus, DestroyType, RotateDirection, degToRad, double, doublePI, getRandom, getRangeValue, identity, loadOptionProperty, } from "@tsparticles/engine";
|
|
2
2
|
import { Rotate } from "./Options/Classes/Rotate.js";
|
|
3
|
+
import { updateAnimation } from "@tsparticles/animation-utils";
|
|
3
4
|
const doublePIDeg = 360;
|
|
4
5
|
export class RotateUpdater {
|
|
5
6
|
#container;
|
|
@@ -53,10 +54,7 @@ export class RotateUpdater {
|
|
|
53
54
|
return !particle.destroyed && !particle.spawning && (!!rotate.value || rotate.animation.enable || rotate.path);
|
|
54
55
|
}
|
|
55
56
|
loadOptions(options, ...sources) {
|
|
56
|
-
options
|
|
57
|
-
for (const source of sources) {
|
|
58
|
-
options.rotate.load(source?.rotate);
|
|
59
|
-
}
|
|
57
|
+
loadOptionProperty(options, "rotate", Rotate, ...sources);
|
|
60
58
|
}
|
|
61
59
|
update(particle, delta) {
|
|
62
60
|
if (!this.isEnabled(particle)) {
|
package/cjs/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RotateUpdater } from "./RotateUpdater.js";
|
|
2
2
|
export async function loadRotateUpdater(engine) {
|
|
3
|
-
engine.checkVersion("4.
|
|
3
|
+
engine.checkVersion("4.2.0");
|
|
4
4
|
await engine.pluginManager.register(e => {
|
|
5
5
|
e.pluginManager.addParticleUpdater("rotate", container => {
|
|
6
6
|
return Promise.resolve(new RotateUpdater(container));
|
package/cjs/index.lazy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadRotateUpdater(engine) {
|
|
2
|
-
engine.checkVersion("4.
|
|
2
|
+
engine.checkVersion("4.2.0");
|
|
3
3
|
await engine.pluginManager.register(e => {
|
|
4
4
|
e.pluginManager.addParticleUpdater("rotate", async (container) => {
|
|
5
5
|
const { RotateUpdater } = await import("./RotateUpdater.js");
|
|
@@ -1,27 +1,16 @@
|
|
|
1
|
-
import { RotateDirection, ValueWithRandom, isNull, } from "@tsparticles/engine";
|
|
1
|
+
import { RotateDirection, ValueWithRandom, isNull, loadProperty, } from "@tsparticles/engine";
|
|
2
2
|
import { RotateAnimation } from "./RotateAnimation.js";
|
|
3
3
|
export class Rotate extends ValueWithRandom {
|
|
4
|
-
animation;
|
|
5
|
-
direction;
|
|
6
|
-
path;
|
|
7
|
-
constructor() {
|
|
8
|
-
super();
|
|
9
|
-
this.animation = new RotateAnimation();
|
|
10
|
-
this.direction = RotateDirection.clockwise;
|
|
11
|
-
this.path = false;
|
|
12
|
-
this.value = 0;
|
|
13
|
-
}
|
|
4
|
+
animation = new RotateAnimation();
|
|
5
|
+
direction = RotateDirection.clockwise;
|
|
6
|
+
path = false;
|
|
14
7
|
load(data) {
|
|
15
8
|
if (isNull(data)) {
|
|
16
9
|
return;
|
|
17
10
|
}
|
|
18
11
|
super.load(data);
|
|
19
|
-
|
|
20
|
-
this.direction = data.direction;
|
|
21
|
-
}
|
|
12
|
+
loadProperty(this, "direction", data.direction);
|
|
22
13
|
this.animation.load(data.animation);
|
|
23
|
-
|
|
24
|
-
this.path = data.path;
|
|
25
|
-
}
|
|
14
|
+
loadProperty(this, "path", data.path);
|
|
26
15
|
}
|
|
27
16
|
}
|
|
@@ -1,30 +1,16 @@
|
|
|
1
|
-
import { isNull,
|
|
1
|
+
import { isNull, loadProperty, loadRangeProperty, } from "@tsparticles/engine";
|
|
2
2
|
export class RotateAnimation {
|
|
3
|
-
decay;
|
|
4
|
-
enable;
|
|
5
|
-
speed;
|
|
6
|
-
sync;
|
|
7
|
-
constructor() {
|
|
8
|
-
this.enable = false;
|
|
9
|
-
this.speed = 0;
|
|
10
|
-
this.decay = 0;
|
|
11
|
-
this.sync = false;
|
|
12
|
-
}
|
|
3
|
+
decay = 0;
|
|
4
|
+
enable = false;
|
|
5
|
+
speed = 0;
|
|
6
|
+
sync = false;
|
|
13
7
|
load(data) {
|
|
14
8
|
if (isNull(data)) {
|
|
15
9
|
return;
|
|
16
10
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
this.speed = setRangeValue(data.speed);
|
|
22
|
-
}
|
|
23
|
-
if (data.decay !== undefined) {
|
|
24
|
-
this.decay = setRangeValue(data.decay);
|
|
25
|
-
}
|
|
26
|
-
if (data.sync !== undefined) {
|
|
27
|
-
this.sync = data.sync;
|
|
28
|
-
}
|
|
11
|
+
loadProperty(this, "enable", data.enable);
|
|
12
|
+
loadRangeProperty(this, "speed", data.speed);
|
|
13
|
+
loadRangeProperty(this, "decay", data.decay);
|
|
14
|
+
loadProperty(this, "sync", data.sync);
|
|
29
15
|
}
|
|
30
16
|
}
|
package/esm/RotateUpdater.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { AnimationStatus, DestroyType, RotateDirection, degToRad, double, doublePI, getRandom, getRangeValue, identity,
|
|
1
|
+
import { AnimationStatus, DestroyType, RotateDirection, degToRad, double, doublePI, getRandom, getRangeValue, identity, loadOptionProperty, } from "@tsparticles/engine";
|
|
2
2
|
import { Rotate } from "./Options/Classes/Rotate.js";
|
|
3
|
+
import { updateAnimation } from "@tsparticles/animation-utils";
|
|
3
4
|
const doublePIDeg = 360;
|
|
4
5
|
export class RotateUpdater {
|
|
5
6
|
#container;
|
|
@@ -53,10 +54,7 @@ export class RotateUpdater {
|
|
|
53
54
|
return !particle.destroyed && !particle.spawning && (!!rotate.value || rotate.animation.enable || rotate.path);
|
|
54
55
|
}
|
|
55
56
|
loadOptions(options, ...sources) {
|
|
56
|
-
options
|
|
57
|
-
for (const source of sources) {
|
|
58
|
-
options.rotate.load(source?.rotate);
|
|
59
|
-
}
|
|
57
|
+
loadOptionProperty(options, "rotate", Rotate, ...sources);
|
|
60
58
|
}
|
|
61
59
|
update(particle, delta) {
|
|
62
60
|
if (!this.isEnabled(particle)) {
|
package/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RotateUpdater } from "./RotateUpdater.js";
|
|
2
2
|
export async function loadRotateUpdater(engine) {
|
|
3
|
-
engine.checkVersion("4.
|
|
3
|
+
engine.checkVersion("4.2.0");
|
|
4
4
|
await engine.pluginManager.register(e => {
|
|
5
5
|
e.pluginManager.addParticleUpdater("rotate", container => {
|
|
6
6
|
return Promise.resolve(new RotateUpdater(container));
|
package/esm/index.lazy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadRotateUpdater(engine) {
|
|
2
|
-
engine.checkVersion("4.
|
|
2
|
+
engine.checkVersion("4.2.0");
|
|
3
3
|
await engine.pluginManager.register(e => {
|
|
4
4
|
e.pluginManager.addParticleUpdater("rotate", async (container) => {
|
|
5
5
|
const { RotateUpdater } = await import("./RotateUpdater.js");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/updater-rotate",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"description": "tsParticles particles rotate updater",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -92,8 +92,11 @@
|
|
|
92
92
|
},
|
|
93
93
|
"./package.json": "./package.json"
|
|
94
94
|
},
|
|
95
|
+
"dependencies": {
|
|
96
|
+
"@tsparticles/animation-utils": "4.2.0"
|
|
97
|
+
},
|
|
95
98
|
"peerDependencies": {
|
|
96
|
-
"@tsparticles/engine": "4.
|
|
99
|
+
"@tsparticles/engine": "4.2.0"
|
|
97
100
|
},
|
|
98
101
|
"publishConfig": {
|
|
99
102
|
"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.rotate.js","children":[{"name":"dist/browser","children":[{"name":"Options/Classes","children":[{"uid":"
|
|
4933
|
+
const data = {"version":2,"tree":{"name":"root","children":[{"name":"tsparticles.updater.rotate.js","children":[{"name":"dist/browser","children":[{"name":"Options/Classes","children":[{"uid":"4edf6ae7-1","name":"RotateAnimation.js"},{"uid":"4edf6ae7-3","name":"Rotate.js"}]},{"uid":"4edf6ae7-5","name":"RotateUpdater.js"},{"uid":"4edf6ae7-7","name":"index.js"},{"uid":"4edf6ae7-9","name":"browser.js"}]}]}],"isRoot":true},"nodeParts":{"4edf6ae7-1":{"renderedLength":475,"gzipLength":0,"brotliLength":0,"metaUid":"4edf6ae7-0"},"4edf6ae7-3":{"renderedLength":487,"gzipLength":0,"brotliLength":0,"metaUid":"4edf6ae7-2"},"4edf6ae7-5":{"renderedLength":2827,"gzipLength":0,"brotliLength":0,"metaUid":"4edf6ae7-4"},"4edf6ae7-7":{"renderedLength":311,"gzipLength":0,"brotliLength":0,"metaUid":"4edf6ae7-6"},"4edf6ae7-9":{"renderedLength":177,"gzipLength":0,"brotliLength":0,"metaUid":"4edf6ae7-8"}},"nodeMetas":{"4edf6ae7-0":{"id":"/dist/browser/Options/Classes/RotateAnimation.js","moduleParts":{"tsparticles.updater.rotate.js":"4edf6ae7-1"},"imported":[{"uid":"4edf6ae7-10"}],"importedBy":[{"uid":"4edf6ae7-2"}]},"4edf6ae7-2":{"id":"/dist/browser/Options/Classes/Rotate.js","moduleParts":{"tsparticles.updater.rotate.js":"4edf6ae7-3"},"imported":[{"uid":"4edf6ae7-10"},{"uid":"4edf6ae7-0"}],"importedBy":[{"uid":"4edf6ae7-4"}]},"4edf6ae7-4":{"id":"/dist/browser/RotateUpdater.js","moduleParts":{"tsparticles.updater.rotate.js":"4edf6ae7-5"},"imported":[{"uid":"4edf6ae7-10"},{"uid":"4edf6ae7-2"},{"uid":"4edf6ae7-11"}],"importedBy":[{"uid":"4edf6ae7-6"}]},"4edf6ae7-6":{"id":"/dist/browser/index.js","moduleParts":{"tsparticles.updater.rotate.js":"4edf6ae7-7"},"imported":[{"uid":"4edf6ae7-4"}],"importedBy":[{"uid":"4edf6ae7-8"}]},"4edf6ae7-8":{"id":"/dist/browser/browser.js","moduleParts":{"tsparticles.updater.rotate.js":"4edf6ae7-9"},"imported":[{"uid":"4edf6ae7-6"}],"importedBy":[],"isEntry":true},"4edf6ae7-10":{"id":"@tsparticles/engine","moduleParts":{},"imported":[],"importedBy":[{"uid":"4edf6ae7-4"},{"uid":"4edf6ae7-2"},{"uid":"4edf6ae7-0"}],"isExternal":true},"4edf6ae7-11":{"id":"@tsparticles/animation-utils","moduleParts":{},"imported":[],"importedBy":[{"uid":"4edf6ae7-4"}],"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,64 +1,39 @@
|
|
|
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.
|
|
2
|
+
/* Updater v4.2.0 */
|
|
3
3
|
(function (global, factory) {
|
|
4
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tsparticles/engine')) :
|
|
5
|
-
typeof define === 'function' && define.amd ? define(['exports', '@tsparticles/engine'], factory) :
|
|
6
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.__tsParticlesInternals = global.__tsParticlesInternals || {}, global.__tsParticlesInternals.updaters = global.__tsParticlesInternals.updaters || {}, global.__tsParticlesInternals.updaters.rotate = global.__tsParticlesInternals.updaters.rotate || {}), global.__tsParticlesInternals.engine));
|
|
7
|
-
})(this, (function (exports, engine) { 'use strict';
|
|
4
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tsparticles/engine'), require('@tsparticles/animation-utils')) :
|
|
5
|
+
typeof define === 'function' && define.amd ? define(['exports', '@tsparticles/engine', '@tsparticles/animation-utils'], factory) :
|
|
6
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.__tsParticlesInternals = global.__tsParticlesInternals || {}, global.__tsParticlesInternals.updaters = global.__tsParticlesInternals.updaters || {}, global.__tsParticlesInternals.updaters.rotate = global.__tsParticlesInternals.updaters.rotate || {}), global.__tsParticlesInternals.engine, global.__tsParticlesInternals.animation.utils));
|
|
7
|
+
})(this, (function (exports, engine, animationUtils) { 'use strict';
|
|
8
8
|
|
|
9
9
|
class RotateAnimation {
|
|
10
|
-
decay;
|
|
11
|
-
enable;
|
|
12
|
-
speed;
|
|
13
|
-
sync;
|
|
14
|
-
constructor() {
|
|
15
|
-
this.enable = false;
|
|
16
|
-
this.speed = 0;
|
|
17
|
-
this.decay = 0;
|
|
18
|
-
this.sync = false;
|
|
19
|
-
}
|
|
10
|
+
decay = 0;
|
|
11
|
+
enable = false;
|
|
12
|
+
speed = 0;
|
|
13
|
+
sync = false;
|
|
20
14
|
load(data) {
|
|
21
15
|
if (engine.isNull(data)) {
|
|
22
16
|
return;
|
|
23
17
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
this.speed = engine.setRangeValue(data.speed);
|
|
29
|
-
}
|
|
30
|
-
if (data.decay !== undefined) {
|
|
31
|
-
this.decay = engine.setRangeValue(data.decay);
|
|
32
|
-
}
|
|
33
|
-
if (data.sync !== undefined) {
|
|
34
|
-
this.sync = data.sync;
|
|
35
|
-
}
|
|
18
|
+
engine.loadProperty(this, "enable", data.enable);
|
|
19
|
+
engine.loadRangeProperty(this, "speed", data.speed);
|
|
20
|
+
engine.loadRangeProperty(this, "decay", data.decay);
|
|
21
|
+
engine.loadProperty(this, "sync", data.sync);
|
|
36
22
|
}
|
|
37
23
|
}
|
|
38
24
|
|
|
39
25
|
class Rotate extends engine.ValueWithRandom {
|
|
40
|
-
animation;
|
|
41
|
-
direction;
|
|
42
|
-
path;
|
|
43
|
-
constructor() {
|
|
44
|
-
super();
|
|
45
|
-
this.animation = new RotateAnimation();
|
|
46
|
-
this.direction = engine.RotateDirection.clockwise;
|
|
47
|
-
this.path = false;
|
|
48
|
-
this.value = 0;
|
|
49
|
-
}
|
|
26
|
+
animation = new RotateAnimation();
|
|
27
|
+
direction = engine.RotateDirection.clockwise;
|
|
28
|
+
path = false;
|
|
50
29
|
load(data) {
|
|
51
30
|
if (engine.isNull(data)) {
|
|
52
31
|
return;
|
|
53
32
|
}
|
|
54
33
|
super.load(data);
|
|
55
|
-
|
|
56
|
-
this.direction = data.direction;
|
|
57
|
-
}
|
|
34
|
+
engine.loadProperty(this, "direction", data.direction);
|
|
58
35
|
this.animation.load(data.animation);
|
|
59
|
-
|
|
60
|
-
this.path = data.path;
|
|
61
|
-
}
|
|
36
|
+
engine.loadProperty(this, "path", data.path);
|
|
62
37
|
}
|
|
63
38
|
}
|
|
64
39
|
|
|
@@ -113,10 +88,7 @@
|
|
|
113
88
|
return !particle.destroyed && !particle.spawning && (!!rotate.value || rotate.animation.enable || rotate.path);
|
|
114
89
|
}
|
|
115
90
|
loadOptions(options, ...sources) {
|
|
116
|
-
options
|
|
117
|
-
for (const source of sources) {
|
|
118
|
-
options.rotate.load(source?.rotate);
|
|
119
|
-
}
|
|
91
|
+
engine.loadOptionProperty(options, "rotate", Rotate, ...sources);
|
|
120
92
|
}
|
|
121
93
|
update(particle, delta) {
|
|
122
94
|
if (!this.isEnabled(particle)) {
|
|
@@ -126,13 +98,13 @@
|
|
|
126
98
|
if (!particle.rotate) {
|
|
127
99
|
return;
|
|
128
100
|
}
|
|
129
|
-
|
|
101
|
+
animationUtils.updateAnimation(particle, particle.rotate, false, engine.DestroyType.none, delta);
|
|
130
102
|
particle.rotation = particle.rotate.value;
|
|
131
103
|
}
|
|
132
104
|
}
|
|
133
105
|
|
|
134
106
|
async function loadRotateUpdater(engine) {
|
|
135
|
-
engine.checkVersion("4.
|
|
107
|
+
engine.checkVersion("4.2.0");
|
|
136
108
|
await engine.pluginManager.register(e => {
|
|
137
109
|
e.pluginManager.addParticleUpdater("rotate", container => {
|
|
138
110
|
return Promise.resolve(new RotateUpdater(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.rotate=t.__tsParticlesInternals.updaters.rotate||{}),t.__tsParticlesInternals.engine)}(this,function(t,e){"use strict";class
|
|
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"),require("@tsparticles/animation-utils")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/engine","@tsparticles/animation-utils"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.updaters.rotate=t.__tsParticlesInternals.updaters.rotate||{}),t.__tsParticlesInternals.engine,t.__tsParticlesInternals.animation.utils)}(this,function(t,e,s){"use strict";class a{decay=0;enable=!1;speed=0;sync=!1;load(t){e.isNull(t)||(e.loadProperty(this,"enable",t.enable),e.loadRangeProperty(this,"speed",t.speed),e.loadRangeProperty(this,"decay",t.decay),e.loadProperty(this,"sync",t.sync))}}class n extends e.ValueWithRandom{animation=new a;direction=e.RotateDirection.clockwise;path=!1;load(t){e.isNull(t)||(super.load(t),e.loadProperty(this,"direction",t.direction),this.animation.load(t.animation),e.loadProperty(this,"path",t.path))}}class r{#t;constructor(t){this.#t=t}init(t){const s=t.options.rotate;if(!s)return;t.rotate={enable:s.animation.enable,value:e.degToRad(e.getRangeValue(s.value)),min:0,max:e.doublePI},t.pathRotation=s.path;let a=s.direction;if(a===e.RotateDirection.random){a=Math.floor(e.getRandom()*e.double)>0?e.RotateDirection.counterClockwise:e.RotateDirection.clockwise}switch(a){case e.RotateDirection.counterClockwise:case"counterClockwise":t.rotate.status=e.AnimationStatus.decreasing;break;case e.RotateDirection.clockwise:t.rotate.status=e.AnimationStatus.increasing}const n=s.animation;n.enable&&(t.rotate.decay=e.identity-e.getRangeValue(n.decay),t.rotate.velocity=e.getRangeValue(n.speed)/360*this.#t.retina.reduceFactor,n.sync||(t.rotate.velocity*=e.getRandom())),t.rotation=t.rotate.value}isEnabled(t){const e=t.options.rotate;return!!e&&(!t.destroyed&&!t.spawning&&(!!e.value||e.animation.enable||e.path))}loadOptions(t,...s){e.loadOptionProperty(t,"rotate",n,...s)}update(t,a){this.isEnabled(t)&&(t.isRotating=!!t.rotate,t.rotate&&(s.updateAnimation(t,t.rotate,!1,e.DestroyType.none,a),t.rotation=t.rotate.value))}}async function l(t){t.checkVersion("4.2.0"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("rotate",t=>Promise.resolve(new r(t)))})}const i=globalThis;i.__tsParticlesInternals=i.__tsParticlesInternals??{},i.loadRotateUpdater=l,t.loadRotateUpdater=l}),Object.assign(globalThis.window||globalThis,{loadRotateUpdater:(globalThis.__tsParticlesInternals.updaters.rotate||{}).loadRotateUpdater}),delete(globalThis.window||globalThis).tsparticlesInternalExports;
|
|
@@ -2,9 +2,8 @@ import { type IOptionLoader, type RecursivePartial, RotateDirection, type Rotate
|
|
|
2
2
|
import type { IRotate } from "../Interfaces/IRotate.js";
|
|
3
3
|
import { RotateAnimation } from "./RotateAnimation.js";
|
|
4
4
|
export declare class Rotate extends ValueWithRandom implements IRotate, IOptionLoader<IRotate> {
|
|
5
|
-
animation: RotateAnimation;
|
|
5
|
+
readonly animation: RotateAnimation;
|
|
6
6
|
direction: RotateDirection | keyof typeof RotateDirection | RotateDirectionAlt;
|
|
7
7
|
path: boolean;
|
|
8
|
-
constructor();
|
|
9
8
|
load(data?: RecursivePartial<IRotate>): void;
|
|
10
9
|
}
|