@tsparticles/path-curl-noise 4.0.0-beta.0 → 4.0.0-beta.10

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.
@@ -1 +1 @@
1
- "use strict";(this.webpackChunk_tsparticles_path_curl_noise=this.webpackChunk_tsparticles_path_curl_noise||[]).push([[289],{289(e,s,t){t.d(s,{CurlNoiseGenerator:()=>n});var i=t(303),o=t(226);let p={speed:.2,step:250};class n{options;_container;_res;_simplex;constructor(e){this._container=e,this._res=i.Vector.origin;const s=new o.SimplexNoise;this._simplex=s.noise2d,this.options=(0,i.deepExtend)({},p)}generate(e){let s=e.getPosition(),{speed:t,step:o}=this.options,p=s.x/o,n=s.y/o,r=(this._simplex.noise(p,n+.001)-this._simplex.noise(p,n-.001))/(.001*i.double),h=(this._simplex.noise(p+.001,n)-this._simplex.noise(p-.001,n))/(.001*i.double);return e.velocity.x=0,e.velocity.y=0,this._res.x=t*r,this._res.y=-(t*h),this._res}init(){let e=this._container,s=e.actualOptions.particles.move.path.options;this.options.seed=s.seed,this.options.speed=(s.speed??p.speed)*e.retina.pixelRatio,this.options.step=s.step??p.step,this._simplex.seed(this.options.seed??(0,i.getRandom)())}reset(){}update(){}}}}]);
1
+ "use strict";(this.webpackChunk_tsparticles_path_curl_noise=this.webpackChunk_tsparticles_path_curl_noise||[]).push([[746],{746(e,s,t){t.d(s,{CurlNoiseGenerator:()=>n});var i=t(303),o=t(226);let p={speed:.2,step:250};class n{options;_container;_res;_simplex;constructor(e){this._container=e,this._res=i.Vector.origin;const s=new o.SimplexNoise;this._simplex=s.noise2d,this.options=(0,i.deepExtend)({},p)}generate(e){let s=e.getPosition(),{speed:t,step:o}=this.options,p=s.x/o,n=s.y/o,r=(this._simplex.noise(p,n+.001)-this._simplex.noise(p,n-.001))/(.001*i.double),h=(this._simplex.noise(p+.001,n)-this._simplex.noise(p-.001,n))/(.001*i.double);return e.velocity.x=0,e.velocity.y=0,this._res.x=t*r,this._res.y=-(t*h),this._res}init(){let e=this._container,s=e.actualOptions.particles.move.path.options;this.options.seed=s.seed,this.options.speed=(s.speed??p.speed)*e.retina.pixelRatio,this.options.step=s.step??p.step,this._simplex.seed(this.options.seed??(0,i.getRandom)())}reset(){}update(){}}}}]);
package/README.md CHANGED
@@ -8,6 +8,12 @@
8
8
 
9
9
  [tsParticles](https://github.com/tsparticles/tsparticles) path plugin for curl noise movement.
10
10
 
11
+ ## Quick checklist
12
+
13
+ 1. Install `@tsparticles/engine` (or use the CDN bundle below)
14
+ 2. Call the package loader function(s) before `tsParticles.load(...)`
15
+ 3. Apply the package options in your `tsParticles.load(...)` config
16
+
11
17
  ## How to use it
12
18
 
13
19
  ### CDN / Vanilla JS / jQuery
@@ -72,3 +78,34 @@ import { loadCurlNoisePath } from "@tsparticles/path-curl-noise";
72
78
  await loadCurlNoisePath(tsParticles);
73
79
  })();
74
80
  ```
81
+
82
+ ## Option mapping
83
+
84
+ - Primary options key: `particles.move.path`
85
+ - Path generator name: `"curlNoise"`
86
+
87
+ ```json
88
+ {
89
+ "particles": {
90
+ "move": {
91
+ "enable": true,
92
+ "path": {
93
+ "enable": true,
94
+ "generator": "curlNoise",
95
+ "options": {}
96
+ }
97
+ }
98
+ }
99
+ }
100
+ ```
101
+
102
+ ## Common pitfalls
103
+
104
+ - Calling `tsParticles.load(...)` before `loadCurlNoisePath(...)`
105
+ - Verify required peer packages before enabling advanced options
106
+ - Change one option group at a time to isolate regressions quickly
107
+
108
+ ## Related docs
109
+
110
+ - All packages catalog: <https://github.com/tsparticles/tsparticles>
111
+ - Main docs: <https://particles.js.org/docs/>
package/browser/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  export const curlNoisePathName = "curlNoise";
2
2
  export async function loadCurlNoisePath(engine) {
3
- engine.checkVersion("4.0.0-beta.0");
4
- await engine.register(async (e) => {
3
+ engine.checkVersion("4.0.0-beta.10");
4
+ await engine.pluginManager.register(async (e) => {
5
5
  const { ensureBaseMoverLoaded } = await import("@tsparticles/plugin-move");
6
6
  ensureBaseMoverLoaded(e);
7
- e.addPathGenerator?.(curlNoisePathName, async (container) => {
7
+ e.pluginManager.addPathGenerator?.(curlNoisePathName, async (container) => {
8
8
  const { CurlNoiseGenerator } = await import("./CurlNoiseGenerator.js");
9
9
  return new CurlNoiseGenerator(container);
10
10
  });
package/cjs/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  export const curlNoisePathName = "curlNoise";
2
2
  export async function loadCurlNoisePath(engine) {
3
- engine.checkVersion("4.0.0-beta.0");
4
- await engine.register(async (e) => {
3
+ engine.checkVersion("4.0.0-beta.10");
4
+ await engine.pluginManager.register(async (e) => {
5
5
  const { ensureBaseMoverLoaded } = await import("@tsparticles/plugin-move");
6
6
  ensureBaseMoverLoaded(e);
7
- e.addPathGenerator?.(curlNoisePathName, async (container) => {
7
+ e.pluginManager.addPathGenerator?.(curlNoisePathName, async (container) => {
8
8
  const { CurlNoiseGenerator } = await import("./CurlNoiseGenerator.js");
9
9
  return new CurlNoiseGenerator(container);
10
10
  });
@@ -4,7 +4,7 @@
4
4
  * Demo / Generator : https://particles.js.org/
5
5
  * GitHub : https://www.github.com/matteobruni/tsparticles
6
6
  * How to use? : Check the GitHub README
7
- * v4.0.0-beta.0
7
+ * v4.0.0-beta.10
8
8
  */
9
9
  "use strict";
10
10
  /*
package/esm/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  export const curlNoisePathName = "curlNoise";
2
2
  export async function loadCurlNoisePath(engine) {
3
- engine.checkVersion("4.0.0-beta.0");
4
- await engine.register(async (e) => {
3
+ engine.checkVersion("4.0.0-beta.10");
4
+ await engine.pluginManager.register(async (e) => {
5
5
  const { ensureBaseMoverLoaded } = await import("@tsparticles/plugin-move");
6
6
  ensureBaseMoverLoaded(e);
7
- e.addPathGenerator?.(curlNoisePathName, async (container) => {
7
+ e.pluginManager.addPathGenerator?.(curlNoisePathName, async (container) => {
8
8
  const { CurlNoiseGenerator } = await import("./CurlNoiseGenerator.js");
9
9
  return new CurlNoiseGenerator(container);
10
10
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsparticles/path-curl-noise",
3
- "version": "4.0.0-beta.0",
3
+ "version": "4.0.0-beta.10",
4
4
  "description": "tsParticles curl noise path",
5
5
  "homepage": "https://particles.js.org",
6
6
  "repository": {
@@ -98,15 +98,14 @@
98
98
  "browser": "./browser/index.js",
99
99
  "import": "./esm/index.js",
100
100
  "require": "./cjs/index.js",
101
- "umd": "./umd/index.js",
102
- "default": "./cjs/index.js"
101
+ "default": "./esm/index.js"
103
102
  },
104
103
  "./package.json": "./package.json"
105
104
  },
106
- "dependencies": {
107
- "@tsparticles/engine": "4.0.0-beta.0",
108
- "@tsparticles/plugin-move": "4.0.0-beta.0",
109
- "@tsparticles/simplex-noise": "4.0.0-beta.0"
105
+ "peerDependencies": {
106
+ "@tsparticles/engine": "4.0.0-beta.10",
107
+ "@tsparticles/plugin-move": "4.0.0-beta.10",
108
+ "@tsparticles/simplex-noise": "4.0.0-beta.10"
110
109
  },
111
110
  "type": "module"
112
111
  }