@tsparticles/path-zig-zag 4.0.4 → 4.1.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/ZigZagPathGenerator.js +9 -9
- package/browser/index.js +1 -1
- package/browser/index.lazy.js +1 -1
- package/cjs/ZigZagPathGenerator.js +9 -9
- package/cjs/index.js +1 -1
- package/cjs/index.lazy.js +1 -1
- package/esm/ZigZagPathGenerator.js +9 -9
- package/esm/index.js +1 -1
- package/esm/index.lazy.js +1 -1
- package/package.json +3 -3
- package/report.html +1 -1
- package/tsparticles.path.zigzag.js +11 -11
- package/tsparticles.path.zigzag.min.js +1 -1
- package/types/ZigZagPathGenerator.d.ts +1 -2
|
@@ -6,15 +6,15 @@ const defaultOptions = {
|
|
|
6
6
|
};
|
|
7
7
|
export class ZigZagPathGenerator {
|
|
8
8
|
options;
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
#container;
|
|
10
|
+
#res;
|
|
11
11
|
constructor(container) {
|
|
12
|
-
this
|
|
13
|
-
this
|
|
12
|
+
this.#container = container;
|
|
13
|
+
this.#res = Vector.origin;
|
|
14
14
|
this.options = deepExtend({}, defaultOptions);
|
|
15
15
|
}
|
|
16
16
|
generate(particle, delta) {
|
|
17
|
-
const
|
|
17
|
+
const options = this.options;
|
|
18
18
|
particle.zigzag ??= {
|
|
19
19
|
counter: getRandom(),
|
|
20
20
|
waveHeight: getRangeValue(options.waveHeight),
|
|
@@ -25,12 +25,12 @@ export class ZigZagPathGenerator {
|
|
|
25
25
|
const zigzagAngle = particle.zigzag.waveHeight * Math.sin(particle.zigzag.counter);
|
|
26
26
|
particle.position.x += zigzagAngle * Math.cos(particle.velocity.angle + halfPI);
|
|
27
27
|
particle.position.y += zigzagAngle * Math.sin(particle.velocity.angle + halfPI);
|
|
28
|
-
this.
|
|
29
|
-
this.
|
|
30
|
-
return this
|
|
28
|
+
this.#res.x = 0;
|
|
29
|
+
this.#res.y = 0;
|
|
30
|
+
return this.#res;
|
|
31
31
|
}
|
|
32
32
|
init() {
|
|
33
|
-
const sourceOptions = this.
|
|
33
|
+
const sourceOptions = this.#container.actualOptions.particles.move.path.options;
|
|
34
34
|
this.options.waveLength = sourceOptions["waveLength"] ?? this.options.waveLength;
|
|
35
35
|
this.options.waveHeight = sourceOptions["waveHeight"] ?? this.options.waveHeight;
|
|
36
36
|
}
|
package/browser/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { ensureBaseMoverLoaded } from "@tsparticles/plugin-move";
|
|
|
2
2
|
import { ZigZagPathGenerator } from "./ZigZagPathGenerator.js";
|
|
3
3
|
export const zigZagPathName = "zigZagPathGenerator";
|
|
4
4
|
export async function loadZigZagPath(engine) {
|
|
5
|
-
engine.checkVersion("4.0
|
|
5
|
+
engine.checkVersion("4.1.0");
|
|
6
6
|
await engine.pluginManager.register((e) => {
|
|
7
7
|
ensureBaseMoverLoaded(e);
|
|
8
8
|
e.pluginManager.addPathGenerator?.(zigZagPathName, container => {
|
package/browser/index.lazy.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export const zigZagPathName = "zigZagPathGenerator";
|
|
2
2
|
export async function loadZigZagPath(engine) {
|
|
3
|
-
engine.checkVersion("4.0
|
|
3
|
+
engine.checkVersion("4.1.0");
|
|
4
4
|
await engine.pluginManager.register(async (e) => {
|
|
5
5
|
const { ensureBaseMoverLoaded } = await import("@tsparticles/plugin-move/lazy");
|
|
6
6
|
ensureBaseMoverLoaded(e);
|
|
@@ -6,15 +6,15 @@ const defaultOptions = {
|
|
|
6
6
|
};
|
|
7
7
|
export class ZigZagPathGenerator {
|
|
8
8
|
options;
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
#container;
|
|
10
|
+
#res;
|
|
11
11
|
constructor(container) {
|
|
12
|
-
this
|
|
13
|
-
this
|
|
12
|
+
this.#container = container;
|
|
13
|
+
this.#res = Vector.origin;
|
|
14
14
|
this.options = deepExtend({}, defaultOptions);
|
|
15
15
|
}
|
|
16
16
|
generate(particle, delta) {
|
|
17
|
-
const
|
|
17
|
+
const options = this.options;
|
|
18
18
|
particle.zigzag ??= {
|
|
19
19
|
counter: getRandom(),
|
|
20
20
|
waveHeight: getRangeValue(options.waveHeight),
|
|
@@ -25,12 +25,12 @@ export class ZigZagPathGenerator {
|
|
|
25
25
|
const zigzagAngle = particle.zigzag.waveHeight * Math.sin(particle.zigzag.counter);
|
|
26
26
|
particle.position.x += zigzagAngle * Math.cos(particle.velocity.angle + halfPI);
|
|
27
27
|
particle.position.y += zigzagAngle * Math.sin(particle.velocity.angle + halfPI);
|
|
28
|
-
this.
|
|
29
|
-
this.
|
|
30
|
-
return this
|
|
28
|
+
this.#res.x = 0;
|
|
29
|
+
this.#res.y = 0;
|
|
30
|
+
return this.#res;
|
|
31
31
|
}
|
|
32
32
|
init() {
|
|
33
|
-
const sourceOptions = this.
|
|
33
|
+
const sourceOptions = this.#container.actualOptions.particles.move.path.options;
|
|
34
34
|
this.options.waveLength = sourceOptions["waveLength"] ?? this.options.waveLength;
|
|
35
35
|
this.options.waveHeight = sourceOptions["waveHeight"] ?? this.options.waveHeight;
|
|
36
36
|
}
|
package/cjs/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { ensureBaseMoverLoaded } from "@tsparticles/plugin-move";
|
|
|
2
2
|
import { ZigZagPathGenerator } from "./ZigZagPathGenerator.js";
|
|
3
3
|
export const zigZagPathName = "zigZagPathGenerator";
|
|
4
4
|
export async function loadZigZagPath(engine) {
|
|
5
|
-
engine.checkVersion("4.0
|
|
5
|
+
engine.checkVersion("4.1.0");
|
|
6
6
|
await engine.pluginManager.register((e) => {
|
|
7
7
|
ensureBaseMoverLoaded(e);
|
|
8
8
|
e.pluginManager.addPathGenerator?.(zigZagPathName, container => {
|
package/cjs/index.lazy.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export const zigZagPathName = "zigZagPathGenerator";
|
|
2
2
|
export async function loadZigZagPath(engine) {
|
|
3
|
-
engine.checkVersion("4.0
|
|
3
|
+
engine.checkVersion("4.1.0");
|
|
4
4
|
await engine.pluginManager.register(async (e) => {
|
|
5
5
|
const { ensureBaseMoverLoaded } = await import("@tsparticles/plugin-move/lazy");
|
|
6
6
|
ensureBaseMoverLoaded(e);
|
|
@@ -6,15 +6,15 @@ const defaultOptions = {
|
|
|
6
6
|
};
|
|
7
7
|
export class ZigZagPathGenerator {
|
|
8
8
|
options;
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
#container;
|
|
10
|
+
#res;
|
|
11
11
|
constructor(container) {
|
|
12
|
-
this
|
|
13
|
-
this
|
|
12
|
+
this.#container = container;
|
|
13
|
+
this.#res = Vector.origin;
|
|
14
14
|
this.options = deepExtend({}, defaultOptions);
|
|
15
15
|
}
|
|
16
16
|
generate(particle, delta) {
|
|
17
|
-
const
|
|
17
|
+
const options = this.options;
|
|
18
18
|
particle.zigzag ??= {
|
|
19
19
|
counter: getRandom(),
|
|
20
20
|
waveHeight: getRangeValue(options.waveHeight),
|
|
@@ -25,12 +25,12 @@ export class ZigZagPathGenerator {
|
|
|
25
25
|
const zigzagAngle = particle.zigzag.waveHeight * Math.sin(particle.zigzag.counter);
|
|
26
26
|
particle.position.x += zigzagAngle * Math.cos(particle.velocity.angle + halfPI);
|
|
27
27
|
particle.position.y += zigzagAngle * Math.sin(particle.velocity.angle + halfPI);
|
|
28
|
-
this.
|
|
29
|
-
this.
|
|
30
|
-
return this
|
|
28
|
+
this.#res.x = 0;
|
|
29
|
+
this.#res.y = 0;
|
|
30
|
+
return this.#res;
|
|
31
31
|
}
|
|
32
32
|
init() {
|
|
33
|
-
const sourceOptions = this.
|
|
33
|
+
const sourceOptions = this.#container.actualOptions.particles.move.path.options;
|
|
34
34
|
this.options.waveLength = sourceOptions["waveLength"] ?? this.options.waveLength;
|
|
35
35
|
this.options.waveHeight = sourceOptions["waveHeight"] ?? this.options.waveHeight;
|
|
36
36
|
}
|
package/esm/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { ensureBaseMoverLoaded } from "@tsparticles/plugin-move";
|
|
|
2
2
|
import { ZigZagPathGenerator } from "./ZigZagPathGenerator.js";
|
|
3
3
|
export const zigZagPathName = "zigZagPathGenerator";
|
|
4
4
|
export async function loadZigZagPath(engine) {
|
|
5
|
-
engine.checkVersion("4.0
|
|
5
|
+
engine.checkVersion("4.1.0");
|
|
6
6
|
await engine.pluginManager.register((e) => {
|
|
7
7
|
ensureBaseMoverLoaded(e);
|
|
8
8
|
e.pluginManager.addPathGenerator?.(zigZagPathName, container => {
|
package/esm/index.lazy.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export const zigZagPathName = "zigZagPathGenerator";
|
|
2
2
|
export async function loadZigZagPath(engine) {
|
|
3
|
-
engine.checkVersion("4.0
|
|
3
|
+
engine.checkVersion("4.1.0");
|
|
4
4
|
await engine.pluginManager.register(async (e) => {
|
|
5
5
|
const { ensureBaseMoverLoaded } = await import("@tsparticles/plugin-move/lazy");
|
|
6
6
|
ensureBaseMoverLoaded(e);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/path-zig-zag",
|
|
3
|
-
"version": "4.0
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "tsParticles zig zag path",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -107,8 +107,8 @@
|
|
|
107
107
|
"./package.json": "./package.json"
|
|
108
108
|
},
|
|
109
109
|
"peerDependencies": {
|
|
110
|
-
"@tsparticles/engine": "4.0
|
|
111
|
-
"@tsparticles/plugin-move": "4.0
|
|
110
|
+
"@tsparticles/engine": "4.1.0",
|
|
111
|
+
"@tsparticles/plugin-move": "4.1.0"
|
|
112
112
|
},
|
|
113
113
|
"publishConfig": {
|
|
114
114
|
"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.path.zigzag.js","children":[{"name":"dist/browser","children":[{"uid":"
|
|
4933
|
+
const data = {"version":2,"tree":{"name":"root","children":[{"name":"tsparticles.path.zigzag.js","children":[{"name":"dist/browser","children":[{"uid":"133e178e-1","name":"ZigZagPathGenerator.js"},{"uid":"133e178e-3","name":"index.js"},{"uid":"133e178e-5","name":"browser.js"}]}]}],"isRoot":true},"nodeParts":{"133e178e-1":{"renderedLength":1693,"gzipLength":0,"brotliLength":0,"metaUid":"133e178e-0"},"133e178e-3":{"renderedLength":421,"gzipLength":0,"brotliLength":0,"metaUid":"133e178e-2"},"133e178e-5":{"renderedLength":171,"gzipLength":0,"brotliLength":0,"metaUid":"133e178e-4"}},"nodeMetas":{"133e178e-0":{"id":"/dist/browser/ZigZagPathGenerator.js","moduleParts":{"tsparticles.path.zigzag.js":"133e178e-1"},"imported":[{"uid":"133e178e-7"}],"importedBy":[{"uid":"133e178e-2"}]},"133e178e-2":{"id":"/dist/browser/index.js","moduleParts":{"tsparticles.path.zigzag.js":"133e178e-3"},"imported":[{"uid":"133e178e-6"},{"uid":"133e178e-0"}],"importedBy":[{"uid":"133e178e-4"}]},"133e178e-4":{"id":"/dist/browser/browser.js","moduleParts":{"tsparticles.path.zigzag.js":"133e178e-5"},"imported":[{"uid":"133e178e-2"}],"importedBy":[],"isEntry":true},"133e178e-6":{"id":"@tsparticles/plugin-move","moduleParts":{},"imported":[],"importedBy":[{"uid":"133e178e-2"}],"isExternal":true},"133e178e-7":{"id":"@tsparticles/engine","moduleParts":{},"imported":[],"importedBy":[{"uid":"133e178e-0"}],"isExternal":true}},"env":{"rollup":"4.60.4"},"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
|
-
/* Path v4.0
|
|
2
|
+
/* Path v4.1.0 */
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tsparticles/plugin-move'), require('@tsparticles/engine')) :
|
|
5
5
|
typeof define === 'function' && define.amd ? define(['exports', '@tsparticles/plugin-move', '@tsparticles/engine'], factory) :
|
|
@@ -13,15 +13,15 @@
|
|
|
13
13
|
};
|
|
14
14
|
class ZigZagPathGenerator {
|
|
15
15
|
options;
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
#container;
|
|
17
|
+
#res;
|
|
18
18
|
constructor(container) {
|
|
19
|
-
this
|
|
20
|
-
this
|
|
19
|
+
this.#container = container;
|
|
20
|
+
this.#res = engine.Vector.origin;
|
|
21
21
|
this.options = engine.deepExtend({}, defaultOptions);
|
|
22
22
|
}
|
|
23
23
|
generate(particle, delta) {
|
|
24
|
-
const
|
|
24
|
+
const options = this.options;
|
|
25
25
|
particle.zigzag ??= {
|
|
26
26
|
counter: engine.getRandom(),
|
|
27
27
|
waveHeight: engine.getRangeValue(options.waveHeight),
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
const zigzagAngle = particle.zigzag.waveHeight * Math.sin(particle.zigzag.counter);
|
|
33
33
|
particle.position.x += zigzagAngle * Math.cos(particle.velocity.angle + halfPI);
|
|
34
34
|
particle.position.y += zigzagAngle * Math.sin(particle.velocity.angle + halfPI);
|
|
35
|
-
this.
|
|
36
|
-
this.
|
|
37
|
-
return this
|
|
35
|
+
this.#res.x = 0;
|
|
36
|
+
this.#res.y = 0;
|
|
37
|
+
return this.#res;
|
|
38
38
|
}
|
|
39
39
|
init() {
|
|
40
|
-
const sourceOptions = this.
|
|
40
|
+
const sourceOptions = this.#container.actualOptions.particles.move.path.options;
|
|
41
41
|
this.options.waveLength = sourceOptions["waveLength"] ?? this.options.waveLength;
|
|
42
42
|
this.options.waveHeight = sourceOptions["waveHeight"] ?? this.options.waveHeight;
|
|
43
43
|
}
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
|
|
50
50
|
const zigZagPathName = "zigZagPathGenerator";
|
|
51
51
|
async function loadZigZagPath(engine) {
|
|
52
|
-
engine.checkVersion("4.0
|
|
52
|
+
engine.checkVersion("4.1.0");
|
|
53
53
|
await engine.pluginManager.register((e) => {
|
|
54
54
|
pluginMove.ensureBaseMoverLoaded(e);
|
|
55
55
|
e.pluginManager.addPathGenerator?.(zigZagPathName, 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 s="undefined"!=typeof Proxy?function(t){return new Proxy(t,{get:function(t,s){return s in t||(t[s]={}),t[s]}})}:function(t){return t};t.__tsParticlesInternals.bundles=s(t.__tsParticlesInternals.bundles),t.__tsParticlesInternals.effects=s(t.__tsParticlesInternals.effects),t.__tsParticlesInternals.interactions=s(t.__tsParticlesInternals.interactions),t.__tsParticlesInternals.palettes=s(t.__tsParticlesInternals.palettes),t.__tsParticlesInternals.paths=s(t.__tsParticlesInternals.paths),t.__tsParticlesInternals.plugins=s(t.__tsParticlesInternals.plugins),t.__tsParticlesInternals.plugins.emittersShapes=s(t.__tsParticlesInternals.plugins.emittersShapes),t.__tsParticlesInternals.presets=s(t.__tsParticlesInternals.presets),t.__tsParticlesInternals.shapes=s(t.__tsParticlesInternals.shapes),t.__tsParticlesInternals.updaters=s(t.__tsParticlesInternals.updaters),t.__tsParticlesInternals.utils=s(t.__tsParticlesInternals.utils),t.__tsParticlesInternals.canvas=s(t.__tsParticlesInternals.canvas),t.__tsParticlesInternals.path=s(t.__tsParticlesInternals.path),t.tsparticlesInternalExports=t.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(t,s){"object"==typeof exports&&"undefined"!=typeof module?s(exports,require("@tsparticles/plugin-move"),require("@tsparticles/engine")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/plugin-move","@tsparticles/engine"],s):s(((t="undefined"!=typeof globalThis?globalThis:t||self).__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.paths=t.__tsParticlesInternals.paths||{},t.__tsParticlesInternals.paths.zigzag=t.__tsParticlesInternals.paths.zigzag||{}),t.__tsParticlesInternals.plugins.move,t.__tsParticlesInternals.engine)}(this,function(t,s,e){"use strict";const a=Math.PI*e.half,n={waveHeight:{min:0,max:3},waveLength:{min:0,max:5}};class r{options;
|
|
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 s="undefined"!=typeof Proxy?function(t){return new Proxy(t,{get:function(t,s){return s in t||(t[s]={}),t[s]}})}:function(t){return t};t.__tsParticlesInternals.bundles=s(t.__tsParticlesInternals.bundles),t.__tsParticlesInternals.effects=s(t.__tsParticlesInternals.effects),t.__tsParticlesInternals.interactions=s(t.__tsParticlesInternals.interactions),t.__tsParticlesInternals.palettes=s(t.__tsParticlesInternals.palettes),t.__tsParticlesInternals.paths=s(t.__tsParticlesInternals.paths),t.__tsParticlesInternals.plugins=s(t.__tsParticlesInternals.plugins),t.__tsParticlesInternals.plugins.emittersShapes=s(t.__tsParticlesInternals.plugins.emittersShapes),t.__tsParticlesInternals.presets=s(t.__tsParticlesInternals.presets),t.__tsParticlesInternals.shapes=s(t.__tsParticlesInternals.shapes),t.__tsParticlesInternals.updaters=s(t.__tsParticlesInternals.updaters),t.__tsParticlesInternals.utils=s(t.__tsParticlesInternals.utils),t.__tsParticlesInternals.canvas=s(t.__tsParticlesInternals.canvas),t.__tsParticlesInternals.path=s(t.__tsParticlesInternals.path),t.tsparticlesInternalExports=t.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(t,s){"object"==typeof exports&&"undefined"!=typeof module?s(exports,require("@tsparticles/plugin-move"),require("@tsparticles/engine")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/plugin-move","@tsparticles/engine"],s):s(((t="undefined"!=typeof globalThis?globalThis:t||self).__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.paths=t.__tsParticlesInternals.paths||{},t.__tsParticlesInternals.paths.zigzag=t.__tsParticlesInternals.paths.zigzag||{}),t.__tsParticlesInternals.plugins.move,t.__tsParticlesInternals.engine)}(this,function(t,s,e){"use strict";const a=Math.PI*e.half,n={waveHeight:{min:0,max:3},waveLength:{min:0,max:5}};class r{options;#t;#s;constructor(t){this.#t=t,this.#s=e.Vector.origin,this.options=e.deepExtend({},n)}generate(t,s){const n=this.options;t.zigzag??={counter:e.getRandom(),waveHeight:e.getRangeValue(n.waveHeight),waveLength:e.getRangeValue(n.waveLength)};const r=.5/t.zigzag.waveLength*s.factor;t.zigzag.counter+=r;const l=t.zigzag.waveHeight*Math.sin(t.zigzag.counter);return t.position.x+=l*Math.cos(t.velocity.angle+a),t.position.y+=l*Math.sin(t.velocity.angle+a),this.#s.x=0,this.#s.y=0,this.#s}init(){const t=this.#t.actualOptions.particles.move.path.options;this.options.waveLength=t.waveLength??this.options.waveLength,this.options.waveHeight=t.waveHeight??this.options.waveHeight}reset(){}update(){}}const l="zigZagPathGenerator";async function i(t){t.checkVersion("4.1.0"),await t.pluginManager.register(t=>{s.ensureBaseMoverLoaded(t),t.pluginManager.addPathGenerator?.(l,t=>Promise.resolve(new r(t)))})}const _=globalThis;_.__tsParticlesInternals=_.__tsParticlesInternals??{},_.loadZigZagPath=i,t.loadZigZagPath=i,t.zigZagPathName=l}),Object.assign(globalThis.window||globalThis,{loadZigZagPath:(globalThis.__tsParticlesInternals.paths.zigzag||{}).loadZigZagPath}),delete(globalThis.window||globalThis).tsparticlesInternalExports;
|
|
@@ -13,9 +13,8 @@ export interface IZigZagOptions {
|
|
|
13
13
|
waveLength: RangeValue;
|
|
14
14
|
}
|
|
15
15
|
export declare class ZigZagPathGenerator implements IMovePathGenerator {
|
|
16
|
+
#private;
|
|
16
17
|
readonly options: IZigZagOptions;
|
|
17
|
-
private readonly _container;
|
|
18
|
-
private readonly _res;
|
|
19
18
|
constructor(container: Container);
|
|
20
19
|
generate(particle: ZigZagParticle, delta: IDelta): Vector;
|
|
21
20
|
init(): void;
|