@tsparticles/updater-wobble 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/Wobble.js +6 -15
- package/browser/Options/Classes/WobbleSpeed.js +5 -13
- package/browser/WobbleUpdater.js +2 -5
- package/browser/index.js +1 -1
- package/browser/index.lazy.js +1 -1
- package/cjs/Options/Classes/Wobble.js +6 -15
- package/cjs/Options/Classes/WobbleSpeed.js +5 -13
- package/cjs/WobbleUpdater.js +2 -5
- package/cjs/index.js +1 -1
- package/cjs/index.lazy.js +1 -1
- package/esm/Options/Classes/Wobble.js +6 -15
- package/esm/Options/Classes/WobbleSpeed.js +5 -13
- package/esm/WobbleUpdater.js +2 -5
- 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.wobble.js +12 -32
- package/tsparticles.updater.wobble.min.js +1 -1
- package/types/Options/Classes/Wobble.d.ts +1 -2
- package/types/Options/Classes/WobbleSpeed.d.ts +0 -1
|
@@ -1,24 +1,15 @@
|
|
|
1
|
-
import { isNull, isNumber,
|
|
1
|
+
import { isNull, isNumber, loadProperty, loadRangeProperty, } from "@tsparticles/engine";
|
|
2
2
|
import { WobbleSpeed } from "./WobbleSpeed.js";
|
|
3
3
|
export class Wobble {
|
|
4
|
-
distance;
|
|
5
|
-
enable;
|
|
6
|
-
speed;
|
|
7
|
-
constructor() {
|
|
8
|
-
this.distance = 5;
|
|
9
|
-
this.enable = false;
|
|
10
|
-
this.speed = new WobbleSpeed();
|
|
11
|
-
}
|
|
4
|
+
distance = 5;
|
|
5
|
+
enable = false;
|
|
6
|
+
speed = new WobbleSpeed();
|
|
12
7
|
load(data) {
|
|
13
8
|
if (isNull(data)) {
|
|
14
9
|
return;
|
|
15
10
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
if (data.enable !== undefined) {
|
|
20
|
-
this.enable = data.enable;
|
|
21
|
-
}
|
|
11
|
+
loadRangeProperty(this, "distance", data.distance);
|
|
12
|
+
loadProperty(this, "enable", data.enable);
|
|
22
13
|
if (data.speed !== undefined) {
|
|
23
14
|
if (isNumber(data.speed)) {
|
|
24
15
|
this.speed.load({ angle: data.speed });
|
|
@@ -1,20 +1,12 @@
|
|
|
1
|
-
import { isNull,
|
|
1
|
+
import { isNull, loadRangeProperty, } from "@tsparticles/engine";
|
|
2
2
|
export class WobbleSpeed {
|
|
3
|
-
angle;
|
|
4
|
-
move;
|
|
5
|
-
constructor() {
|
|
6
|
-
this.angle = 50;
|
|
7
|
-
this.move = 10;
|
|
8
|
-
}
|
|
3
|
+
angle = 50;
|
|
4
|
+
move = 10;
|
|
9
5
|
load(data) {
|
|
10
6
|
if (isNull(data)) {
|
|
11
7
|
return;
|
|
12
8
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
if (data.move !== undefined) {
|
|
17
|
-
this.move = setRangeValue(data.move);
|
|
18
|
-
}
|
|
9
|
+
loadRangeProperty(this, "angle", data.angle);
|
|
10
|
+
loadRangeProperty(this, "move", data.move);
|
|
19
11
|
}
|
|
20
12
|
}
|
package/browser/WobbleUpdater.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { doublePI, getRandom, getRangeValue, } from "@tsparticles/engine";
|
|
1
|
+
import { doublePI, getRandom, getRangeValue, loadOptionProperty, } from "@tsparticles/engine";
|
|
2
2
|
import { Wobble } from "./Options/Classes/Wobble.js";
|
|
3
3
|
import { updateWobble } from "./Utils.js";
|
|
4
4
|
const maxAngle = 360, moveSpeedFactor = 10, defaultDistance = 0;
|
|
@@ -30,10 +30,7 @@ export class WobbleUpdater {
|
|
|
30
30
|
return !particle.destroyed && !particle.spawning && !!particle.options.wobble?.enable;
|
|
31
31
|
}
|
|
32
32
|
loadOptions(options, ...sources) {
|
|
33
|
-
options
|
|
34
|
-
for (const source of sources) {
|
|
35
|
-
options.wobble.load(source?.wobble);
|
|
36
|
-
}
|
|
33
|
+
loadOptionProperty(options, "wobble", Wobble, ...sources);
|
|
37
34
|
}
|
|
38
35
|
update(particle, delta) {
|
|
39
36
|
if (!this.isEnabled(particle)) {
|
package/browser/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { WobbleUpdater } from "./WobbleUpdater.js";
|
|
2
2
|
export async function loadWobbleUpdater(engine) {
|
|
3
|
-
engine.checkVersion("4.
|
|
3
|
+
engine.checkVersion("4.2.0");
|
|
4
4
|
await engine.pluginManager.register(e => {
|
|
5
5
|
e.pluginManager.addParticleUpdater("wobble", container => {
|
|
6
6
|
return Promise.resolve(new WobbleUpdater(container));
|
package/browser/index.lazy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadWobbleUpdater(engine) {
|
|
2
|
-
engine.checkVersion("4.
|
|
2
|
+
engine.checkVersion("4.2.0");
|
|
3
3
|
await engine.pluginManager.register(e => {
|
|
4
4
|
e.pluginManager.addParticleUpdater("wobble", async (container) => {
|
|
5
5
|
const { WobbleUpdater } = await import("./WobbleUpdater.js");
|
|
@@ -1,24 +1,15 @@
|
|
|
1
|
-
import { isNull, isNumber,
|
|
1
|
+
import { isNull, isNumber, loadProperty, loadRangeProperty, } from "@tsparticles/engine";
|
|
2
2
|
import { WobbleSpeed } from "./WobbleSpeed.js";
|
|
3
3
|
export class Wobble {
|
|
4
|
-
distance;
|
|
5
|
-
enable;
|
|
6
|
-
speed;
|
|
7
|
-
constructor() {
|
|
8
|
-
this.distance = 5;
|
|
9
|
-
this.enable = false;
|
|
10
|
-
this.speed = new WobbleSpeed();
|
|
11
|
-
}
|
|
4
|
+
distance = 5;
|
|
5
|
+
enable = false;
|
|
6
|
+
speed = new WobbleSpeed();
|
|
12
7
|
load(data) {
|
|
13
8
|
if (isNull(data)) {
|
|
14
9
|
return;
|
|
15
10
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
if (data.enable !== undefined) {
|
|
20
|
-
this.enable = data.enable;
|
|
21
|
-
}
|
|
11
|
+
loadRangeProperty(this, "distance", data.distance);
|
|
12
|
+
loadProperty(this, "enable", data.enable);
|
|
22
13
|
if (data.speed !== undefined) {
|
|
23
14
|
if (isNumber(data.speed)) {
|
|
24
15
|
this.speed.load({ angle: data.speed });
|
|
@@ -1,20 +1,12 @@
|
|
|
1
|
-
import { isNull,
|
|
1
|
+
import { isNull, loadRangeProperty, } from "@tsparticles/engine";
|
|
2
2
|
export class WobbleSpeed {
|
|
3
|
-
angle;
|
|
4
|
-
move;
|
|
5
|
-
constructor() {
|
|
6
|
-
this.angle = 50;
|
|
7
|
-
this.move = 10;
|
|
8
|
-
}
|
|
3
|
+
angle = 50;
|
|
4
|
+
move = 10;
|
|
9
5
|
load(data) {
|
|
10
6
|
if (isNull(data)) {
|
|
11
7
|
return;
|
|
12
8
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
if (data.move !== undefined) {
|
|
17
|
-
this.move = setRangeValue(data.move);
|
|
18
|
-
}
|
|
9
|
+
loadRangeProperty(this, "angle", data.angle);
|
|
10
|
+
loadRangeProperty(this, "move", data.move);
|
|
19
11
|
}
|
|
20
12
|
}
|
package/cjs/WobbleUpdater.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { doublePI, getRandom, getRangeValue, } from "@tsparticles/engine";
|
|
1
|
+
import { doublePI, getRandom, getRangeValue, loadOptionProperty, } from "@tsparticles/engine";
|
|
2
2
|
import { Wobble } from "./Options/Classes/Wobble.js";
|
|
3
3
|
import { updateWobble } from "./Utils.js";
|
|
4
4
|
const maxAngle = 360, moveSpeedFactor = 10, defaultDistance = 0;
|
|
@@ -30,10 +30,7 @@ export class WobbleUpdater {
|
|
|
30
30
|
return !particle.destroyed && !particle.spawning && !!particle.options.wobble?.enable;
|
|
31
31
|
}
|
|
32
32
|
loadOptions(options, ...sources) {
|
|
33
|
-
options
|
|
34
|
-
for (const source of sources) {
|
|
35
|
-
options.wobble.load(source?.wobble);
|
|
36
|
-
}
|
|
33
|
+
loadOptionProperty(options, "wobble", Wobble, ...sources);
|
|
37
34
|
}
|
|
38
35
|
update(particle, delta) {
|
|
39
36
|
if (!this.isEnabled(particle)) {
|
package/cjs/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { WobbleUpdater } from "./WobbleUpdater.js";
|
|
2
2
|
export async function loadWobbleUpdater(engine) {
|
|
3
|
-
engine.checkVersion("4.
|
|
3
|
+
engine.checkVersion("4.2.0");
|
|
4
4
|
await engine.pluginManager.register(e => {
|
|
5
5
|
e.pluginManager.addParticleUpdater("wobble", container => {
|
|
6
6
|
return Promise.resolve(new WobbleUpdater(container));
|
package/cjs/index.lazy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadWobbleUpdater(engine) {
|
|
2
|
-
engine.checkVersion("4.
|
|
2
|
+
engine.checkVersion("4.2.0");
|
|
3
3
|
await engine.pluginManager.register(e => {
|
|
4
4
|
e.pluginManager.addParticleUpdater("wobble", async (container) => {
|
|
5
5
|
const { WobbleUpdater } = await import("./WobbleUpdater.js");
|
|
@@ -1,24 +1,15 @@
|
|
|
1
|
-
import { isNull, isNumber,
|
|
1
|
+
import { isNull, isNumber, loadProperty, loadRangeProperty, } from "@tsparticles/engine";
|
|
2
2
|
import { WobbleSpeed } from "./WobbleSpeed.js";
|
|
3
3
|
export class Wobble {
|
|
4
|
-
distance;
|
|
5
|
-
enable;
|
|
6
|
-
speed;
|
|
7
|
-
constructor() {
|
|
8
|
-
this.distance = 5;
|
|
9
|
-
this.enable = false;
|
|
10
|
-
this.speed = new WobbleSpeed();
|
|
11
|
-
}
|
|
4
|
+
distance = 5;
|
|
5
|
+
enable = false;
|
|
6
|
+
speed = new WobbleSpeed();
|
|
12
7
|
load(data) {
|
|
13
8
|
if (isNull(data)) {
|
|
14
9
|
return;
|
|
15
10
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
if (data.enable !== undefined) {
|
|
20
|
-
this.enable = data.enable;
|
|
21
|
-
}
|
|
11
|
+
loadRangeProperty(this, "distance", data.distance);
|
|
12
|
+
loadProperty(this, "enable", data.enable);
|
|
22
13
|
if (data.speed !== undefined) {
|
|
23
14
|
if (isNumber(data.speed)) {
|
|
24
15
|
this.speed.load({ angle: data.speed });
|
|
@@ -1,20 +1,12 @@
|
|
|
1
|
-
import { isNull,
|
|
1
|
+
import { isNull, loadRangeProperty, } from "@tsparticles/engine";
|
|
2
2
|
export class WobbleSpeed {
|
|
3
|
-
angle;
|
|
4
|
-
move;
|
|
5
|
-
constructor() {
|
|
6
|
-
this.angle = 50;
|
|
7
|
-
this.move = 10;
|
|
8
|
-
}
|
|
3
|
+
angle = 50;
|
|
4
|
+
move = 10;
|
|
9
5
|
load(data) {
|
|
10
6
|
if (isNull(data)) {
|
|
11
7
|
return;
|
|
12
8
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
if (data.move !== undefined) {
|
|
17
|
-
this.move = setRangeValue(data.move);
|
|
18
|
-
}
|
|
9
|
+
loadRangeProperty(this, "angle", data.angle);
|
|
10
|
+
loadRangeProperty(this, "move", data.move);
|
|
19
11
|
}
|
|
20
12
|
}
|
package/esm/WobbleUpdater.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { doublePI, getRandom, getRangeValue, } from "@tsparticles/engine";
|
|
1
|
+
import { doublePI, getRandom, getRangeValue, loadOptionProperty, } from "@tsparticles/engine";
|
|
2
2
|
import { Wobble } from "./Options/Classes/Wobble.js";
|
|
3
3
|
import { updateWobble } from "./Utils.js";
|
|
4
4
|
const maxAngle = 360, moveSpeedFactor = 10, defaultDistance = 0;
|
|
@@ -30,10 +30,7 @@ export class WobbleUpdater {
|
|
|
30
30
|
return !particle.destroyed && !particle.spawning && !!particle.options.wobble?.enable;
|
|
31
31
|
}
|
|
32
32
|
loadOptions(options, ...sources) {
|
|
33
|
-
options
|
|
34
|
-
for (const source of sources) {
|
|
35
|
-
options.wobble.load(source?.wobble);
|
|
36
|
-
}
|
|
33
|
+
loadOptionProperty(options, "wobble", Wobble, ...sources);
|
|
37
34
|
}
|
|
38
35
|
update(particle, delta) {
|
|
39
36
|
if (!this.isEnabled(particle)) {
|
package/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { WobbleUpdater } from "./WobbleUpdater.js";
|
|
2
2
|
export async function loadWobbleUpdater(engine) {
|
|
3
|
-
engine.checkVersion("4.
|
|
3
|
+
engine.checkVersion("4.2.0");
|
|
4
4
|
await engine.pluginManager.register(e => {
|
|
5
5
|
e.pluginManager.addParticleUpdater("wobble", container => {
|
|
6
6
|
return Promise.resolve(new WobbleUpdater(container));
|
package/esm/index.lazy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadWobbleUpdater(engine) {
|
|
2
|
-
engine.checkVersion("4.
|
|
2
|
+
engine.checkVersion("4.2.0");
|
|
3
3
|
await engine.pluginManager.register(e => {
|
|
4
4
|
e.pluginManager.addParticleUpdater("wobble", async (container) => {
|
|
5
5
|
const { WobbleUpdater } = await import("./WobbleUpdater.js");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/updater-wobble",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"description": "tsParticles particles wobble 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.
|
|
96
|
+
"@tsparticles/engine": "4.2.0"
|
|
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.wobble.js","children":[{"name":"dist/browser","children":[{"name":"Options/Classes","children":[{"uid":"
|
|
4933
|
+
const data = {"version":2,"tree":{"name":"root","children":[{"name":"tsparticles.updater.wobble.js","children":[{"name":"dist/browser","children":[{"name":"Options/Classes","children":[{"uid":"2143c378-1","name":"WobbleSpeed.js"},{"uid":"2143c378-3","name":"Wobble.js"}]},{"uid":"2143c378-5","name":"Utils.js"},{"uid":"2143c378-7","name":"WobbleUpdater.js"},{"uid":"2143c378-9","name":"index.js"},{"uid":"2143c378-11","name":"browser.js"}]}]}],"isRoot":true},"nodeParts":{"2143c378-1":{"renderedLength":304,"gzipLength":0,"brotliLength":0,"metaUid":"2143c378-0"},"2143c378-3":{"renderedLength":860,"gzipLength":0,"brotliLength":0,"metaUid":"2143c378-2"},"2143c378-5":{"renderedLength":874,"gzipLength":0,"brotliLength":0,"metaUid":"2143c378-4"},"2143c378-7":{"renderedLength":1449,"gzipLength":0,"brotliLength":0,"metaUid":"2143c378-6"},"2143c378-9":{"renderedLength":311,"gzipLength":0,"brotliLength":0,"metaUid":"2143c378-8"},"2143c378-11":{"renderedLength":177,"gzipLength":0,"brotliLength":0,"metaUid":"2143c378-10"}},"nodeMetas":{"2143c378-0":{"id":"/dist/browser/Options/Classes/WobbleSpeed.js","moduleParts":{"tsparticles.updater.wobble.js":"2143c378-1"},"imported":[{"uid":"2143c378-12"}],"importedBy":[{"uid":"2143c378-2"}]},"2143c378-2":{"id":"/dist/browser/Options/Classes/Wobble.js","moduleParts":{"tsparticles.updater.wobble.js":"2143c378-3"},"imported":[{"uid":"2143c378-12"},{"uid":"2143c378-0"}],"importedBy":[{"uid":"2143c378-6"}]},"2143c378-4":{"id":"/dist/browser/Utils.js","moduleParts":{"tsparticles.updater.wobble.js":"2143c378-5"},"imported":[{"uid":"2143c378-12"}],"importedBy":[{"uid":"2143c378-6"}]},"2143c378-6":{"id":"/dist/browser/WobbleUpdater.js","moduleParts":{"tsparticles.updater.wobble.js":"2143c378-7"},"imported":[{"uid":"2143c378-12"},{"uid":"2143c378-2"},{"uid":"2143c378-4"}],"importedBy":[{"uid":"2143c378-8"}]},"2143c378-8":{"id":"/dist/browser/index.js","moduleParts":{"tsparticles.updater.wobble.js":"2143c378-9"},"imported":[{"uid":"2143c378-6"}],"importedBy":[{"uid":"2143c378-10"}]},"2143c378-10":{"id":"/dist/browser/browser.js","moduleParts":{"tsparticles.updater.wobble.js":"2143c378-11"},"imported":[{"uid":"2143c378-8"}],"importedBy":[],"isEntry":true},"2143c378-12":{"id":"@tsparticles/engine","moduleParts":{},"imported":[],"importedBy":[{"uid":"2143c378-6"},{"uid":"2143c378-2"},{"uid":"2143c378-4"},{"uid":"2143c378-0"}],"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.
|
|
2
|
+
/* Updater v4.2.0 */
|
|
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) :
|
|
@@ -7,44 +7,27 @@
|
|
|
7
7
|
})(this, (function (exports, engine) { 'use strict';
|
|
8
8
|
|
|
9
9
|
class WobbleSpeed {
|
|
10
|
-
angle;
|
|
11
|
-
move;
|
|
12
|
-
constructor() {
|
|
13
|
-
this.angle = 50;
|
|
14
|
-
this.move = 10;
|
|
15
|
-
}
|
|
10
|
+
angle = 50;
|
|
11
|
+
move = 10;
|
|
16
12
|
load(data) {
|
|
17
13
|
if (engine.isNull(data)) {
|
|
18
14
|
return;
|
|
19
15
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
if (data.move !== undefined) {
|
|
24
|
-
this.move = engine.setRangeValue(data.move);
|
|
25
|
-
}
|
|
16
|
+
engine.loadRangeProperty(this, "angle", data.angle);
|
|
17
|
+
engine.loadRangeProperty(this, "move", data.move);
|
|
26
18
|
}
|
|
27
19
|
}
|
|
28
20
|
|
|
29
21
|
class Wobble {
|
|
30
|
-
distance;
|
|
31
|
-
enable;
|
|
32
|
-
speed;
|
|
33
|
-
constructor() {
|
|
34
|
-
this.distance = 5;
|
|
35
|
-
this.enable = false;
|
|
36
|
-
this.speed = new WobbleSpeed();
|
|
37
|
-
}
|
|
22
|
+
distance = 5;
|
|
23
|
+
enable = false;
|
|
24
|
+
speed = new WobbleSpeed();
|
|
38
25
|
load(data) {
|
|
39
26
|
if (engine.isNull(data)) {
|
|
40
27
|
return;
|
|
41
28
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
if (data.enable !== undefined) {
|
|
46
|
-
this.enable = data.enable;
|
|
47
|
-
}
|
|
29
|
+
engine.loadRangeProperty(this, "distance", data.distance);
|
|
30
|
+
engine.loadProperty(this, "enable", data.enable);
|
|
48
31
|
if (data.speed !== undefined) {
|
|
49
32
|
if (engine.isNumber(data.speed)) {
|
|
50
33
|
this.speed.load({ angle: data.speed });
|
|
@@ -106,10 +89,7 @@
|
|
|
106
89
|
return !particle.destroyed && !particle.spawning && !!particle.options.wobble?.enable;
|
|
107
90
|
}
|
|
108
91
|
loadOptions(options, ...sources) {
|
|
109
|
-
options
|
|
110
|
-
for (const source of sources) {
|
|
111
|
-
options.wobble.load(source?.wobble);
|
|
112
|
-
}
|
|
92
|
+
engine.loadOptionProperty(options, "wobble", Wobble, ...sources);
|
|
113
93
|
}
|
|
114
94
|
update(particle, delta) {
|
|
115
95
|
if (!this.isEnabled(particle)) {
|
|
@@ -120,7 +100,7 @@
|
|
|
120
100
|
}
|
|
121
101
|
|
|
122
102
|
async function loadWobbleUpdater(engine) {
|
|
123
|
-
engine.checkVersion("4.
|
|
103
|
+
engine.checkVersion("4.2.0");
|
|
124
104
|
await engine.pluginManager.register(e => {
|
|
125
105
|
e.pluginManager.addParticleUpdater("wobble", container => {
|
|
126
106
|
return Promise.resolve(new WobbleUpdater(container));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e){e.__tsParticlesInternals=e.__tsParticlesInternals||{},e.__tsParticlesInternals.bundles=e.__tsParticlesInternals.bundles||{},e.__tsParticlesInternals.effects=e.__tsParticlesInternals.effects||{},e.__tsParticlesInternals.engine=e.__tsParticlesInternals.engine||{},e.__tsParticlesInternals.interactions=e.__tsParticlesInternals.interactions||{},e.__tsParticlesInternals.palettes=e.__tsParticlesInternals.palettes||{},e.__tsParticlesInternals.paths=e.__tsParticlesInternals.paths||{},e.__tsParticlesInternals.plugins=e.__tsParticlesInternals.plugins||{},e.__tsParticlesInternals.plugins=e.__tsParticlesInternals.plugins||{},e.__tsParticlesInternals.plugins.emittersShapes=e.__tsParticlesInternals.plugins.emittersShapes||{},e.__tsParticlesInternals.presets=e.__tsParticlesInternals.presets||{},e.__tsParticlesInternals.shapes=e.__tsParticlesInternals.shapes||{},e.__tsParticlesInternals.updaters=e.__tsParticlesInternals.updaters||{},e.__tsParticlesInternals.utils=e.__tsParticlesInternals.utils||{},e.__tsParticlesInternals.canvas=e.__tsParticlesInternals.canvas||{},e.__tsParticlesInternals.canvas=e.__tsParticlesInternals.canvas||{},e.__tsParticlesInternals.canvas.utils=e.__tsParticlesInternals.canvas.utils||{},e.__tsParticlesInternals.path=e.__tsParticlesInternals.path||{},e.__tsParticlesInternals.path=e.__tsParticlesInternals.path||{},e.__tsParticlesInternals.path.utils=e.__tsParticlesInternals.path.utils||{};var s="undefined"!=typeof Proxy?function(e){return new Proxy(e,{get:function(e,s){return s in e||(e[s]={}),e[s]}})}:function(e){return e};e.__tsParticlesInternals.bundles=s(e.__tsParticlesInternals.bundles),e.__tsParticlesInternals.effects=s(e.__tsParticlesInternals.effects),e.__tsParticlesInternals.interactions=s(e.__tsParticlesInternals.interactions),e.__tsParticlesInternals.palettes=s(e.__tsParticlesInternals.palettes),e.__tsParticlesInternals.paths=s(e.__tsParticlesInternals.paths),e.__tsParticlesInternals.plugins=s(e.__tsParticlesInternals.plugins),e.__tsParticlesInternals.plugins.emittersShapes=s(e.__tsParticlesInternals.plugins.emittersShapes),e.__tsParticlesInternals.presets=s(e.__tsParticlesInternals.presets),e.__tsParticlesInternals.shapes=s(e.__tsParticlesInternals.shapes),e.__tsParticlesInternals.updaters=s(e.__tsParticlesInternals.updaters),e.__tsParticlesInternals.utils=s(e.__tsParticlesInternals.utils),e.__tsParticlesInternals.canvas=s(e.__tsParticlesInternals.canvas),e.__tsParticlesInternals.path=s(e.__tsParticlesInternals.path),e.tsparticlesInternalExports=e.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(e,s){"object"==typeof exports&&"undefined"!=typeof module?s(exports,require("@tsparticles/engine")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/engine"],s):s(((e="undefined"!=typeof globalThis?globalThis:e||self).__tsParticlesInternals=e.__tsParticlesInternals||{},e.__tsParticlesInternals.updaters=e.__tsParticlesInternals.updaters||{},e.__tsParticlesInternals.updaters.wobble=e.__tsParticlesInternals.updaters.wobble||{}),e.__tsParticlesInternals.engine)}(this,function(e,s){"use strict";class t{angle
|
|
1
|
+
!function(e){e.__tsParticlesInternals=e.__tsParticlesInternals||{},e.__tsParticlesInternals.bundles=e.__tsParticlesInternals.bundles||{},e.__tsParticlesInternals.effects=e.__tsParticlesInternals.effects||{},e.__tsParticlesInternals.engine=e.__tsParticlesInternals.engine||{},e.__tsParticlesInternals.interactions=e.__tsParticlesInternals.interactions||{},e.__tsParticlesInternals.palettes=e.__tsParticlesInternals.palettes||{},e.__tsParticlesInternals.paths=e.__tsParticlesInternals.paths||{},e.__tsParticlesInternals.plugins=e.__tsParticlesInternals.plugins||{},e.__tsParticlesInternals.plugins=e.__tsParticlesInternals.plugins||{},e.__tsParticlesInternals.plugins.emittersShapes=e.__tsParticlesInternals.plugins.emittersShapes||{},e.__tsParticlesInternals.presets=e.__tsParticlesInternals.presets||{},e.__tsParticlesInternals.shapes=e.__tsParticlesInternals.shapes||{},e.__tsParticlesInternals.updaters=e.__tsParticlesInternals.updaters||{},e.__tsParticlesInternals.utils=e.__tsParticlesInternals.utils||{},e.__tsParticlesInternals.canvas=e.__tsParticlesInternals.canvas||{},e.__tsParticlesInternals.canvas=e.__tsParticlesInternals.canvas||{},e.__tsParticlesInternals.canvas.utils=e.__tsParticlesInternals.canvas.utils||{},e.__tsParticlesInternals.path=e.__tsParticlesInternals.path||{},e.__tsParticlesInternals.path=e.__tsParticlesInternals.path||{},e.__tsParticlesInternals.path.utils=e.__tsParticlesInternals.path.utils||{};var s="undefined"!=typeof Proxy?function(e){return new Proxy(e,{get:function(e,s){return s in e||(e[s]={}),e[s]}})}:function(e){return e};e.__tsParticlesInternals.bundles=s(e.__tsParticlesInternals.bundles),e.__tsParticlesInternals.effects=s(e.__tsParticlesInternals.effects),e.__tsParticlesInternals.interactions=s(e.__tsParticlesInternals.interactions),e.__tsParticlesInternals.palettes=s(e.__tsParticlesInternals.palettes),e.__tsParticlesInternals.paths=s(e.__tsParticlesInternals.paths),e.__tsParticlesInternals.plugins=s(e.__tsParticlesInternals.plugins),e.__tsParticlesInternals.plugins.emittersShapes=s(e.__tsParticlesInternals.plugins.emittersShapes),e.__tsParticlesInternals.presets=s(e.__tsParticlesInternals.presets),e.__tsParticlesInternals.shapes=s(e.__tsParticlesInternals.shapes),e.__tsParticlesInternals.updaters=s(e.__tsParticlesInternals.updaters),e.__tsParticlesInternals.utils=s(e.__tsParticlesInternals.utils),e.__tsParticlesInternals.canvas=s(e.__tsParticlesInternals.canvas),e.__tsParticlesInternals.path=s(e.__tsParticlesInternals.path),e.tsparticlesInternalExports=e.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(e,s){"object"==typeof exports&&"undefined"!=typeof module?s(exports,require("@tsparticles/engine")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/engine"],s):s(((e="undefined"!=typeof globalThis?globalThis:e||self).__tsParticlesInternals=e.__tsParticlesInternals||{},e.__tsParticlesInternals.updaters=e.__tsParticlesInternals.updaters||{},e.__tsParticlesInternals.updaters.wobble=e.__tsParticlesInternals.updaters.wobble||{}),e.__tsParticlesInternals.engine)}(this,function(e,s){"use strict";class t{angle=50;move=10;load(e){s.isNull(e)||(s.loadRangeProperty(this,"angle",e.angle),s.loadRangeProperty(this,"move",e.move))}}class n{distance=5;enable=!1;speed=new t;load(e){if(!s.isNull(e)&&(s.loadRangeProperty(this,"distance",e.distance),s.loadProperty(this,"enable",e.enable),void 0!==e.speed))if(s.isNumber(e.speed))this.speed.load({angle:e.speed});else{const s=e.speed;"min"in s?this.speed.load({angle:s}):this.speed.load(e.speed)}}}class a{#e;constructor(e){this.#e=e}init(e){const t=e.options.wobble;e.wobble=t?.enable?{angle:s.getRandom()*s.doublePI,angleSpeed:s.getRangeValue(t.speed.angle)/360,moveSpeed:s.getRangeValue(t.speed.move)/10}:{angle:0,angleSpeed:0,moveSpeed:0},e.retina.wobbleDistance=s.getRangeValue(t?.distance??0)*this.#e.retina.pixelRatio}isEnabled(e){return!e.destroyed&&!e.spawning&&!!e.options.wobble?.enable}loadOptions(e,...t){s.loadOptionProperty(e,"wobble",n,...t)}update(e,t){this.isEnabled(e)&&function(e,t,n){const{wobble:a}=t.options,{wobble:l}=t;if(!a?.enable||!l)return;const r=e.retina.reduceFactor,i=l.angleSpeed*n.factor*r,_=l.moveSpeed*n.factor*r*(t.retina.wobbleDistance??0)/(s.millisecondsToSeconds/60),c=s.doublePI,{position:o}=t;l.angle+=i,l.angle>c&&(l.angle-=c),o.x+=_*Math.cos(l.angle),o.y+=_*Math.abs(Math.sin(l.angle))}(this.#e,e,t)}}async function l(e){e.checkVersion("4.2.0"),await e.pluginManager.register(e=>{e.pluginManager.addParticleUpdater("wobble",e=>Promise.resolve(new a(e)))})}const r=globalThis;r.__tsParticlesInternals=r.__tsParticlesInternals??{},r.loadWobbleUpdater=l,e.loadWobbleUpdater=l}),Object.assign(globalThis.window||globalThis,{loadWobbleUpdater:(globalThis.__tsParticlesInternals.updaters.wobble||{}).loadWobbleUpdater}),delete(globalThis.window||globalThis).tsparticlesInternalExports;
|
|
@@ -4,7 +4,6 @@ import { WobbleSpeed } from "./WobbleSpeed.js";
|
|
|
4
4
|
export declare class Wobble implements IWobble, IOptionLoader<IWobble> {
|
|
5
5
|
distance: RangeValue;
|
|
6
6
|
enable: boolean;
|
|
7
|
-
speed: WobbleSpeed;
|
|
8
|
-
constructor();
|
|
7
|
+
readonly speed: WobbleSpeed;
|
|
9
8
|
load(data?: RecursivePartial<IWobble>): void;
|
|
10
9
|
}
|