@tsparticles/path-curl-noise 4.0.5 → 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.
@@ -6,31 +6,31 @@ const defaultOptions = {
6
6
  };
7
7
  export class CurlNoiseGenerator {
8
8
  options;
9
- _container;
10
- _res;
11
- _simplex;
9
+ #container;
10
+ #res;
11
+ #simplex;
12
12
  constructor(container) {
13
- this._container = container;
14
- this._res = Vector.origin;
13
+ this.#container = container;
14
+ this.#res = Vector.origin;
15
15
  const simplex = new SimplexNoise();
16
- this._simplex = simplex.noise2d;
16
+ this.#simplex = simplex.noise2d;
17
17
  this.options = deepExtend({}, defaultOptions);
18
18
  }
19
19
  generate(particle) {
20
- const pos = particle.getPosition(), { speed, step } = this.options, x = pos.x / step, y = pos.y / step, eps = 0.001, n1a = this._simplex.noise(x, y + eps), n2a = this._simplex.noise(x, y - eps), a = (n1a - n2a) / (double * eps), n1b = this._simplex.noise(x + eps, y), n2b = this._simplex.noise(x - eps, y), b = (n1b - n2b) / (double * eps);
20
+ const pos = particle.getPosition(), { speed, step } = this.options, x = pos.x / step, y = pos.y / step, eps = 0.001, n1a = this.#simplex.noise(x, y + eps), n2a = this.#simplex.noise(x, y - eps), a = (n1a - n2a) / (double * eps), n1b = this.#simplex.noise(x + eps, y), n2b = this.#simplex.noise(x - eps, y), b = (n1b - n2b) / (double * eps);
21
21
  particle.velocity.x = 0;
22
22
  particle.velocity.y = 0;
23
- this._res.x = speed * a;
24
- this._res.y = speed * -b;
25
- return this._res;
23
+ this.#res.x = speed * a;
24
+ this.#res.y = speed * -b;
25
+ return this.#res;
26
26
  }
27
27
  init() {
28
- const container = this._container, sourceOptions = container.actualOptions.particles.move.path.options;
28
+ const container = this.#container, sourceOptions = container.actualOptions.particles.move.path.options;
29
29
  this.options.seed = sourceOptions["seed"];
30
30
  this.options.speed =
31
31
  (sourceOptions["speed"] ?? defaultOptions.speed) * container.retina.pixelRatio;
32
32
  this.options.step = sourceOptions["step"] ?? defaultOptions.step;
33
- this._simplex.seed(this.options.seed ?? getRandom());
33
+ this.#simplex.seed(this.options.seed ?? getRandom());
34
34
  }
35
35
  reset() {
36
36
  }
package/browser/index.js CHANGED
@@ -2,7 +2,7 @@ import { ensureBaseMoverLoaded } from "@tsparticles/plugin-move";
2
2
  import { CurlNoiseGenerator } from "./CurlNoiseGenerator.js";
3
3
  export const curlNoisePathName = "curlNoise";
4
4
  export async function loadCurlNoisePath(engine) {
5
- engine.checkVersion("4.0.5");
5
+ engine.checkVersion("4.1.0");
6
6
  await engine.pluginManager.register((e) => {
7
7
  ensureBaseMoverLoaded(e);
8
8
  e.pluginManager.addPathGenerator?.(curlNoisePathName, container => {
@@ -1,6 +1,6 @@
1
1
  export const curlNoisePathName = "curlNoise";
2
2
  export async function loadCurlNoisePath(engine) {
3
- engine.checkVersion("4.0.5");
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,31 +6,31 @@ const defaultOptions = {
6
6
  };
7
7
  export class CurlNoiseGenerator {
8
8
  options;
9
- _container;
10
- _res;
11
- _simplex;
9
+ #container;
10
+ #res;
11
+ #simplex;
12
12
  constructor(container) {
13
- this._container = container;
14
- this._res = Vector.origin;
13
+ this.#container = container;
14
+ this.#res = Vector.origin;
15
15
  const simplex = new SimplexNoise();
16
- this._simplex = simplex.noise2d;
16
+ this.#simplex = simplex.noise2d;
17
17
  this.options = deepExtend({}, defaultOptions);
18
18
  }
19
19
  generate(particle) {
20
- const pos = particle.getPosition(), { speed, step } = this.options, x = pos.x / step, y = pos.y / step, eps = 0.001, n1a = this._simplex.noise(x, y + eps), n2a = this._simplex.noise(x, y - eps), a = (n1a - n2a) / (double * eps), n1b = this._simplex.noise(x + eps, y), n2b = this._simplex.noise(x - eps, y), b = (n1b - n2b) / (double * eps);
20
+ const pos = particle.getPosition(), { speed, step } = this.options, x = pos.x / step, y = pos.y / step, eps = 0.001, n1a = this.#simplex.noise(x, y + eps), n2a = this.#simplex.noise(x, y - eps), a = (n1a - n2a) / (double * eps), n1b = this.#simplex.noise(x + eps, y), n2b = this.#simplex.noise(x - eps, y), b = (n1b - n2b) / (double * eps);
21
21
  particle.velocity.x = 0;
22
22
  particle.velocity.y = 0;
23
- this._res.x = speed * a;
24
- this._res.y = speed * -b;
25
- return this._res;
23
+ this.#res.x = speed * a;
24
+ this.#res.y = speed * -b;
25
+ return this.#res;
26
26
  }
27
27
  init() {
28
- const container = this._container, sourceOptions = container.actualOptions.particles.move.path.options;
28
+ const container = this.#container, sourceOptions = container.actualOptions.particles.move.path.options;
29
29
  this.options.seed = sourceOptions["seed"];
30
30
  this.options.speed =
31
31
  (sourceOptions["speed"] ?? defaultOptions.speed) * container.retina.pixelRatio;
32
32
  this.options.step = sourceOptions["step"] ?? defaultOptions.step;
33
- this._simplex.seed(this.options.seed ?? getRandom());
33
+ this.#simplex.seed(this.options.seed ?? getRandom());
34
34
  }
35
35
  reset() {
36
36
  }
package/cjs/index.js CHANGED
@@ -2,7 +2,7 @@ import { ensureBaseMoverLoaded } from "@tsparticles/plugin-move";
2
2
  import { CurlNoiseGenerator } from "./CurlNoiseGenerator.js";
3
3
  export const curlNoisePathName = "curlNoise";
4
4
  export async function loadCurlNoisePath(engine) {
5
- engine.checkVersion("4.0.5");
5
+ engine.checkVersion("4.1.0");
6
6
  await engine.pluginManager.register((e) => {
7
7
  ensureBaseMoverLoaded(e);
8
8
  e.pluginManager.addPathGenerator?.(curlNoisePathName, container => {
package/cjs/index.lazy.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export const curlNoisePathName = "curlNoise";
2
2
  export async function loadCurlNoisePath(engine) {
3
- engine.checkVersion("4.0.5");
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,31 +6,31 @@ const defaultOptions = {
6
6
  };
7
7
  export class CurlNoiseGenerator {
8
8
  options;
9
- _container;
10
- _res;
11
- _simplex;
9
+ #container;
10
+ #res;
11
+ #simplex;
12
12
  constructor(container) {
13
- this._container = container;
14
- this._res = Vector.origin;
13
+ this.#container = container;
14
+ this.#res = Vector.origin;
15
15
  const simplex = new SimplexNoise();
16
- this._simplex = simplex.noise2d;
16
+ this.#simplex = simplex.noise2d;
17
17
  this.options = deepExtend({}, defaultOptions);
18
18
  }
19
19
  generate(particle) {
20
- const pos = particle.getPosition(), { speed, step } = this.options, x = pos.x / step, y = pos.y / step, eps = 0.001, n1a = this._simplex.noise(x, y + eps), n2a = this._simplex.noise(x, y - eps), a = (n1a - n2a) / (double * eps), n1b = this._simplex.noise(x + eps, y), n2b = this._simplex.noise(x - eps, y), b = (n1b - n2b) / (double * eps);
20
+ const pos = particle.getPosition(), { speed, step } = this.options, x = pos.x / step, y = pos.y / step, eps = 0.001, n1a = this.#simplex.noise(x, y + eps), n2a = this.#simplex.noise(x, y - eps), a = (n1a - n2a) / (double * eps), n1b = this.#simplex.noise(x + eps, y), n2b = this.#simplex.noise(x - eps, y), b = (n1b - n2b) / (double * eps);
21
21
  particle.velocity.x = 0;
22
22
  particle.velocity.y = 0;
23
- this._res.x = speed * a;
24
- this._res.y = speed * -b;
25
- return this._res;
23
+ this.#res.x = speed * a;
24
+ this.#res.y = speed * -b;
25
+ return this.#res;
26
26
  }
27
27
  init() {
28
- const container = this._container, sourceOptions = container.actualOptions.particles.move.path.options;
28
+ const container = this.#container, sourceOptions = container.actualOptions.particles.move.path.options;
29
29
  this.options.seed = sourceOptions["seed"];
30
30
  this.options.speed =
31
31
  (sourceOptions["speed"] ?? defaultOptions.speed) * container.retina.pixelRatio;
32
32
  this.options.step = sourceOptions["step"] ?? defaultOptions.step;
33
- this._simplex.seed(this.options.seed ?? getRandom());
33
+ this.#simplex.seed(this.options.seed ?? getRandom());
34
34
  }
35
35
  reset() {
36
36
  }
package/esm/index.js CHANGED
@@ -2,7 +2,7 @@ import { ensureBaseMoverLoaded } from "@tsparticles/plugin-move";
2
2
  import { CurlNoiseGenerator } from "./CurlNoiseGenerator.js";
3
3
  export const curlNoisePathName = "curlNoise";
4
4
  export async function loadCurlNoisePath(engine) {
5
- engine.checkVersion("4.0.5");
5
+ engine.checkVersion("4.1.0");
6
6
  await engine.pluginManager.register((e) => {
7
7
  ensureBaseMoverLoaded(e);
8
8
  e.pluginManager.addPathGenerator?.(curlNoisePathName, container => {
package/esm/index.lazy.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export const curlNoisePathName = "curlNoise";
2
2
  export async function loadCurlNoisePath(engine) {
3
- engine.checkVersion("4.0.5");
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-curl-noise",
3
- "version": "4.0.5",
3
+ "version": "4.1.0",
4
4
  "description": "tsParticles curl noise path",
5
5
  "homepage": "https://particles.js.org",
6
6
  "repository": {
@@ -110,9 +110,9 @@
110
110
  "./package.json": "./package.json"
111
111
  },
112
112
  "peerDependencies": {
113
- "@tsparticles/engine": "4.0.5",
114
- "@tsparticles/plugin-move": "4.0.5",
115
- "@tsparticles/simplex-noise": "4.0.5"
113
+ "@tsparticles/engine": "4.1.0",
114
+ "@tsparticles/plugin-move": "4.1.0",
115
+ "@tsparticles/simplex-noise": "4.1.0"
116
116
  },
117
117
  "type": "module"
118
118
  }
@@ -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.5 */
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'), require('@tsparticles/simplex-noise')) :
5
5
  typeof define === 'function' && define.amd ? define(['exports', '@tsparticles/plugin-move', '@tsparticles/engine', '@tsparticles/simplex-noise'], factory) :
@@ -12,31 +12,31 @@
12
12
  };
13
13
  class CurlNoiseGenerator {
14
14
  options;
15
- _container;
16
- _res;
17
- _simplex;
15
+ #container;
16
+ #res;
17
+ #simplex;
18
18
  constructor(container) {
19
- this._container = container;
20
- this._res = engine.Vector.origin;
19
+ this.#container = container;
20
+ this.#res = engine.Vector.origin;
21
21
  const simplex = new simplexNoise.SimplexNoise();
22
- this._simplex = simplex.noise2d;
22
+ this.#simplex = simplex.noise2d;
23
23
  this.options = engine.deepExtend({}, defaultOptions);
24
24
  }
25
25
  generate(particle) {
26
- const pos = particle.getPosition(), { speed, step } = this.options, x = pos.x / step, y = pos.y / step, eps = 0.001, n1a = this._simplex.noise(x, y + eps), n2a = this._simplex.noise(x, y - eps), a = (n1a - n2a) / (engine.double * eps), n1b = this._simplex.noise(x + eps, y), n2b = this._simplex.noise(x - eps, y), b = (n1b - n2b) / (engine.double * eps);
26
+ const pos = particle.getPosition(), { speed, step } = this.options, x = pos.x / step, y = pos.y / step, eps = 0.001, n1a = this.#simplex.noise(x, y + eps), n2a = this.#simplex.noise(x, y - eps), a = (n1a - n2a) / (engine.double * eps), n1b = this.#simplex.noise(x + eps, y), n2b = this.#simplex.noise(x - eps, y), b = (n1b - n2b) / (engine.double * eps);
27
27
  particle.velocity.x = 0;
28
28
  particle.velocity.y = 0;
29
- this._res.x = speed * a;
30
- this._res.y = speed * -b;
31
- return this._res;
29
+ this.#res.x = speed * a;
30
+ this.#res.y = speed * -b;
31
+ return this.#res;
32
32
  }
33
33
  init() {
34
- const container = this._container, sourceOptions = container.actualOptions.particles.move.path.options;
34
+ const container = this.#container, sourceOptions = container.actualOptions.particles.move.path.options;
35
35
  this.options.seed = sourceOptions["seed"];
36
36
  this.options.speed =
37
37
  (sourceOptions["speed"] ?? defaultOptions.speed) * container.retina.pixelRatio;
38
38
  this.options.step = sourceOptions["step"] ?? defaultOptions.step;
39
- this._simplex.seed(this.options.seed ?? engine.getRandom());
39
+ this.#simplex.seed(this.options.seed ?? engine.getRandom());
40
40
  }
41
41
  reset() {
42
42
  }
@@ -46,7 +46,7 @@
46
46
 
47
47
  const curlNoisePathName = "curlNoise";
48
48
  async function loadCurlNoisePath(engine) {
49
- engine.checkVersion("4.0.5");
49
+ engine.checkVersion("4.1.0");
50
50
  await engine.pluginManager.register((e) => {
51
51
  pluginMove.ensureBaseMoverLoaded(e);
52
52
  e.pluginManager.addPathGenerator?.(curlNoisePathName, container => {
@@ -1 +1 @@
1
- !function(s){s.__tsParticlesInternals=s.__tsParticlesInternals||{},s.__tsParticlesInternals.bundles=s.__tsParticlesInternals.bundles||{},s.__tsParticlesInternals.effects=s.__tsParticlesInternals.effects||{},s.__tsParticlesInternals.engine=s.__tsParticlesInternals.engine||{},s.__tsParticlesInternals.interactions=s.__tsParticlesInternals.interactions||{},s.__tsParticlesInternals.palettes=s.__tsParticlesInternals.palettes||{},s.__tsParticlesInternals.paths=s.__tsParticlesInternals.paths||{},s.__tsParticlesInternals.plugins=s.__tsParticlesInternals.plugins||{},s.__tsParticlesInternals.plugins=s.__tsParticlesInternals.plugins||{},s.__tsParticlesInternals.plugins.emittersShapes=s.__tsParticlesInternals.plugins.emittersShapes||{},s.__tsParticlesInternals.presets=s.__tsParticlesInternals.presets||{},s.__tsParticlesInternals.shapes=s.__tsParticlesInternals.shapes||{},s.__tsParticlesInternals.updaters=s.__tsParticlesInternals.updaters||{},s.__tsParticlesInternals.utils=s.__tsParticlesInternals.utils||{},s.__tsParticlesInternals.canvas=s.__tsParticlesInternals.canvas||{},s.__tsParticlesInternals.canvas=s.__tsParticlesInternals.canvas||{},s.__tsParticlesInternals.canvas.utils=s.__tsParticlesInternals.canvas.utils||{},s.__tsParticlesInternals.path=s.__tsParticlesInternals.path||{},s.__tsParticlesInternals.path=s.__tsParticlesInternals.path||{},s.__tsParticlesInternals.path.utils=s.__tsParticlesInternals.path.utils||{};var t="undefined"!=typeof Proxy?function(s){return new Proxy(s,{get:function(s,t){return t in s||(s[t]={}),s[t]}})}:function(s){return s};s.__tsParticlesInternals.bundles=t(s.__tsParticlesInternals.bundles),s.__tsParticlesInternals.effects=t(s.__tsParticlesInternals.effects),s.__tsParticlesInternals.interactions=t(s.__tsParticlesInternals.interactions),s.__tsParticlesInternals.palettes=t(s.__tsParticlesInternals.palettes),s.__tsParticlesInternals.paths=t(s.__tsParticlesInternals.paths),s.__tsParticlesInternals.plugins=t(s.__tsParticlesInternals.plugins),s.__tsParticlesInternals.plugins.emittersShapes=t(s.__tsParticlesInternals.plugins.emittersShapes),s.__tsParticlesInternals.presets=t(s.__tsParticlesInternals.presets),s.__tsParticlesInternals.shapes=t(s.__tsParticlesInternals.shapes),s.__tsParticlesInternals.updaters=t(s.__tsParticlesInternals.updaters),s.__tsParticlesInternals.utils=t(s.__tsParticlesInternals.utils),s.__tsParticlesInternals.canvas=t(s.__tsParticlesInternals.canvas),s.__tsParticlesInternals.path=t(s.__tsParticlesInternals.path),s.tsparticlesInternalExports=s.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(s,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@tsparticles/plugin-move"),require("@tsparticles/engine"),require("@tsparticles/simplex-noise")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/plugin-move","@tsparticles/engine","@tsparticles/simplex-noise"],t):t(((s="undefined"!=typeof globalThis?globalThis:s||self).__tsParticlesInternals=s.__tsParticlesInternals||{},s.__tsParticlesInternals.paths=s.__tsParticlesInternals.paths||{},s.__tsParticlesInternals.paths.curlNoise=s.__tsParticlesInternals.paths.curlNoise||{}),s.__tsParticlesInternals.plugins.move,s.__tsParticlesInternals.engine,s.__tsParticlesInternals.simplex.noise)}(this,function(s,t,e,n){"use strict";const a={speed:.2,step:250};class l{options;_container;_res;_simplex;constructor(s){this._container=s,this._res=e.Vector.origin;const t=new n.SimplexNoise;this._simplex=t.noise2d,this.options=e.deepExtend({},a)}generate(s){const t=s.getPosition(),{speed:n,step:a}=this.options,l=t.x/a,r=t.y/a,i=.001,_=(this._simplex.noise(l,r+i)-this._simplex.noise(l,r-i))/(e.double*i),c=(this._simplex.noise(l+i,r)-this._simplex.noise(l-i,r))/(e.double*i);return s.velocity.x=0,s.velocity.y=0,this._res.x=n*_,this._res.y=n*-c,this._res}init(){const s=this._container,t=s.actualOptions.particles.move.path.options;this.options.seed=t.seed,this.options.speed=(t.speed??a.speed)*s.retina.pixelRatio,this.options.step=t.step??a.step,this._simplex.seed(this.options.seed??e.getRandom())}reset(){}update(){}}const r="curlNoise";async function i(s){s.checkVersion("4.0.5"),await s.pluginManager.register(s=>{t.ensureBaseMoverLoaded(s),s.pluginManager.addPathGenerator?.(r,s=>Promise.resolve(new l(s)))})}const _=globalThis;_.__tsParticlesInternals=_.__tsParticlesInternals??{},_.loadCurlNoisePath=i,s.curlNoisePathName=r,s.loadCurlNoisePath=i}),Object.assign(globalThis.window||globalThis,{loadCurlNoisePath:(globalThis.__tsParticlesInternals.paths.curlNoise||{}).loadCurlNoisePath}),delete(globalThis.window||globalThis).tsparticlesInternalExports;
1
+ !function(s){s.__tsParticlesInternals=s.__tsParticlesInternals||{},s.__tsParticlesInternals.bundles=s.__tsParticlesInternals.bundles||{},s.__tsParticlesInternals.effects=s.__tsParticlesInternals.effects||{},s.__tsParticlesInternals.engine=s.__tsParticlesInternals.engine||{},s.__tsParticlesInternals.interactions=s.__tsParticlesInternals.interactions||{},s.__tsParticlesInternals.palettes=s.__tsParticlesInternals.palettes||{},s.__tsParticlesInternals.paths=s.__tsParticlesInternals.paths||{},s.__tsParticlesInternals.plugins=s.__tsParticlesInternals.plugins||{},s.__tsParticlesInternals.plugins=s.__tsParticlesInternals.plugins||{},s.__tsParticlesInternals.plugins.emittersShapes=s.__tsParticlesInternals.plugins.emittersShapes||{},s.__tsParticlesInternals.presets=s.__tsParticlesInternals.presets||{},s.__tsParticlesInternals.shapes=s.__tsParticlesInternals.shapes||{},s.__tsParticlesInternals.updaters=s.__tsParticlesInternals.updaters||{},s.__tsParticlesInternals.utils=s.__tsParticlesInternals.utils||{},s.__tsParticlesInternals.canvas=s.__tsParticlesInternals.canvas||{},s.__tsParticlesInternals.canvas=s.__tsParticlesInternals.canvas||{},s.__tsParticlesInternals.canvas.utils=s.__tsParticlesInternals.canvas.utils||{},s.__tsParticlesInternals.path=s.__tsParticlesInternals.path||{},s.__tsParticlesInternals.path=s.__tsParticlesInternals.path||{},s.__tsParticlesInternals.path.utils=s.__tsParticlesInternals.path.utils||{};var t="undefined"!=typeof Proxy?function(s){return new Proxy(s,{get:function(s,t){return t in s||(s[t]={}),s[t]}})}:function(s){return s};s.__tsParticlesInternals.bundles=t(s.__tsParticlesInternals.bundles),s.__tsParticlesInternals.effects=t(s.__tsParticlesInternals.effects),s.__tsParticlesInternals.interactions=t(s.__tsParticlesInternals.interactions),s.__tsParticlesInternals.palettes=t(s.__tsParticlesInternals.palettes),s.__tsParticlesInternals.paths=t(s.__tsParticlesInternals.paths),s.__tsParticlesInternals.plugins=t(s.__tsParticlesInternals.plugins),s.__tsParticlesInternals.plugins.emittersShapes=t(s.__tsParticlesInternals.plugins.emittersShapes),s.__tsParticlesInternals.presets=t(s.__tsParticlesInternals.presets),s.__tsParticlesInternals.shapes=t(s.__tsParticlesInternals.shapes),s.__tsParticlesInternals.updaters=t(s.__tsParticlesInternals.updaters),s.__tsParticlesInternals.utils=t(s.__tsParticlesInternals.utils),s.__tsParticlesInternals.canvas=t(s.__tsParticlesInternals.canvas),s.__tsParticlesInternals.path=t(s.__tsParticlesInternals.path),s.tsparticlesInternalExports=s.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(s,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@tsparticles/plugin-move"),require("@tsparticles/engine"),require("@tsparticles/simplex-noise")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/plugin-move","@tsparticles/engine","@tsparticles/simplex-noise"],t):t(((s="undefined"!=typeof globalThis?globalThis:s||self).__tsParticlesInternals=s.__tsParticlesInternals||{},s.__tsParticlesInternals.paths=s.__tsParticlesInternals.paths||{},s.__tsParticlesInternals.paths.curlNoise=s.__tsParticlesInternals.paths.curlNoise||{}),s.__tsParticlesInternals.plugins.move,s.__tsParticlesInternals.engine,s.__tsParticlesInternals.simplex.noise)}(this,function(s,t,e,n){"use strict";const a={speed:.2,step:250};class l{options;#s;#t;#e;constructor(s){this.#s=s,this.#t=e.Vector.origin;const t=new n.SimplexNoise;this.#e=t.noise2d,this.options=e.deepExtend({},a)}generate(s){const t=s.getPosition(),{speed:n,step:a}=this.options,l=t.x/a,r=t.y/a,i=.001,_=(this.#e.noise(l,r+i)-this.#e.noise(l,r-i))/(e.double*i),c=(this.#e.noise(l+i,r)-this.#e.noise(l-i,r))/(e.double*i);return s.velocity.x=0,s.velocity.y=0,this.#t.x=n*_,this.#t.y=n*-c,this.#t}init(){const s=this.#s,t=s.actualOptions.particles.move.path.options;this.options.seed=t.seed,this.options.speed=(t.speed??a.speed)*s.retina.pixelRatio,this.options.step=t.step??a.step,this.#e.seed(this.options.seed??e.getRandom())}reset(){}update(){}}const r="curlNoise";async function i(s){s.checkVersion("4.1.0"),await s.pluginManager.register(s=>{t.ensureBaseMoverLoaded(s),s.pluginManager.addPathGenerator?.(r,s=>Promise.resolve(new l(s)))})}const _=globalThis;_.__tsParticlesInternals=_.__tsParticlesInternals??{},_.loadCurlNoisePath=i,s.curlNoisePathName=r,s.loadCurlNoisePath=i}),Object.assign(globalThis.window||globalThis,{loadCurlNoisePath:(globalThis.__tsParticlesInternals.paths.curlNoise||{}).loadCurlNoisePath}),delete(globalThis.window||globalThis).tsparticlesInternalExports;
@@ -2,10 +2,8 @@ import { type Container, type Particle, Vector } from "@tsparticles/engine";
2
2
  import type { ICurlOptions } from "./ICurlOptions.js";
3
3
  import { type IMovePathGenerator } from "@tsparticles/plugin-move";
4
4
  export declare class CurlNoiseGenerator implements IMovePathGenerator {
5
+ #private;
5
6
  readonly options: ICurlOptions;
6
- private readonly _container;
7
- private readonly _res;
8
- private readonly _simplex;
9
7
  constructor(container: Container);
10
8
  generate(particle: Particle): Vector;
11
9
  init(): void;