@tsparticles/path-curl-noise 4.0.0-alpha.24 → 4.0.0-alpha.26
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/842.min.js +1 -0
- package/browser/CurlNoiseGenerator.js +6 -2
- package/browser/index.js +5 -3
- package/cjs/CurlNoiseGenerator.js +6 -2
- package/cjs/index.js +5 -3
- package/dist_browser_CurlNoiseGenerator_js.js +2 -2
- package/esm/CurlNoiseGenerator.js +6 -2
- package/esm/index.js +5 -3
- package/package.json +4 -3
- package/report.html +1 -1
- package/tsparticles.path.curl.noise.js +46 -6
- package/tsparticles.path.curl.noise.min.js +2 -2
- package/types/CurlNoiseGenerator.d.ts +3 -1
- package/umd/CurlNoiseGenerator.js +5 -1
- package/umd/index.js +6 -4
- package/934.min.js +0 -1
package/842.min.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(this.webpackChunk_tsparticles_path_curl_noise=this.webpackChunk_tsparticles_path_curl_noise||[]).push([[842],{842(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,4 +1,4 @@
|
|
|
1
|
-
import { Vector, deepExtend, double, getRandom
|
|
1
|
+
import { Vector, deepExtend, double, getRandom } from "@tsparticles/engine";
|
|
2
2
|
import { SimplexNoise } from "@tsparticles/simplex-noise";
|
|
3
3
|
const defaultOptions = {
|
|
4
4
|
speed: 0.2,
|
|
@@ -7,9 +7,11 @@ const defaultOptions = {
|
|
|
7
7
|
export class CurlNoiseGenerator {
|
|
8
8
|
options;
|
|
9
9
|
_container;
|
|
10
|
+
_res;
|
|
10
11
|
_simplex;
|
|
11
12
|
constructor(container) {
|
|
12
13
|
this._container = container;
|
|
14
|
+
this._res = Vector.origin;
|
|
13
15
|
const simplex = new SimplexNoise();
|
|
14
16
|
this._simplex = simplex.noise2d;
|
|
15
17
|
this.options = deepExtend({}, defaultOptions);
|
|
@@ -18,7 +20,9 @@ export class CurlNoiseGenerator {
|
|
|
18
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);
|
|
19
21
|
particle.velocity.x = 0;
|
|
20
22
|
particle.velocity.y = 0;
|
|
21
|
-
|
|
23
|
+
this._res.x = speed * a;
|
|
24
|
+
this._res.y = speed * -b;
|
|
25
|
+
return this._res;
|
|
22
26
|
}
|
|
23
27
|
init() {
|
|
24
28
|
const container = this._container, sourceOptions = container.actualOptions.particles.move.path.options;
|
package/browser/index.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export const curlNoisePathName = "curlNoise";
|
|
2
2
|
export async function loadCurlNoisePath(engine) {
|
|
3
|
-
engine.checkVersion("4.0.0-alpha.
|
|
4
|
-
await engine.register(e => {
|
|
5
|
-
|
|
3
|
+
engine.checkVersion("4.0.0-alpha.26");
|
|
4
|
+
await engine.register(async (e) => {
|
|
5
|
+
const { ensureBaseMoverLoaded } = await import("@tsparticles/plugin-move");
|
|
6
|
+
ensureBaseMoverLoaded(e);
|
|
7
|
+
e.addPathGenerator?.(curlNoisePathName, async (container) => {
|
|
6
8
|
const { CurlNoiseGenerator } = await import("./CurlNoiseGenerator.js");
|
|
7
9
|
return new CurlNoiseGenerator(container);
|
|
8
10
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Vector, deepExtend, double, getRandom
|
|
1
|
+
import { Vector, deepExtend, double, getRandom } from "@tsparticles/engine";
|
|
2
2
|
import { SimplexNoise } from "@tsparticles/simplex-noise";
|
|
3
3
|
const defaultOptions = {
|
|
4
4
|
speed: 0.2,
|
|
@@ -7,9 +7,11 @@ const defaultOptions = {
|
|
|
7
7
|
export class CurlNoiseGenerator {
|
|
8
8
|
options;
|
|
9
9
|
_container;
|
|
10
|
+
_res;
|
|
10
11
|
_simplex;
|
|
11
12
|
constructor(container) {
|
|
12
13
|
this._container = container;
|
|
14
|
+
this._res = Vector.origin;
|
|
13
15
|
const simplex = new SimplexNoise();
|
|
14
16
|
this._simplex = simplex.noise2d;
|
|
15
17
|
this.options = deepExtend({}, defaultOptions);
|
|
@@ -18,7 +20,9 @@ export class CurlNoiseGenerator {
|
|
|
18
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);
|
|
19
21
|
particle.velocity.x = 0;
|
|
20
22
|
particle.velocity.y = 0;
|
|
21
|
-
|
|
23
|
+
this._res.x = speed * a;
|
|
24
|
+
this._res.y = speed * -b;
|
|
25
|
+
return this._res;
|
|
22
26
|
}
|
|
23
27
|
init() {
|
|
24
28
|
const container = this._container, sourceOptions = container.actualOptions.particles.move.path.options;
|
package/cjs/index.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export const curlNoisePathName = "curlNoise";
|
|
2
2
|
export async function loadCurlNoisePath(engine) {
|
|
3
|
-
engine.checkVersion("4.0.0-alpha.
|
|
4
|
-
await engine.register(e => {
|
|
5
|
-
|
|
3
|
+
engine.checkVersion("4.0.0-alpha.26");
|
|
4
|
+
await engine.register(async (e) => {
|
|
5
|
+
const { ensureBaseMoverLoaded } = await import("@tsparticles/plugin-move");
|
|
6
|
+
ensureBaseMoverLoaded(e);
|
|
7
|
+
e.addPathGenerator?.(curlNoisePathName, async (container) => {
|
|
6
8
|
const { CurlNoiseGenerator } = await import("./CurlNoiseGenerator.js");
|
|
7
9
|
return new CurlNoiseGenerator(container);
|
|
8
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-alpha.
|
|
7
|
+
* v4.0.0-alpha.26
|
|
8
8
|
*/
|
|
9
9
|
"use strict";
|
|
10
10
|
/*
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
\********************************************/
|
|
24
24
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
25
25
|
|
|
26
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ CurlNoiseGenerator: () => (/* binding */ CurlNoiseGenerator)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_simplex_noise__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @tsparticles/simplex-noise */ \"@tsparticles/simplex-noise\");\n\n\nconst defaultOptions = {\n speed: 0.2,\n step: 250\n};\nclass CurlNoiseGenerator {\n options;\n _container;\n _simplex;\n constructor(container){\n this._container = container;\n const simplex = new _tsparticles_simplex_noise__WEBPACK_IMPORTED_MODULE_1__.SimplexNoise();\n this._simplex = simplex.noise2d;\n this.options = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.deepExtend)({}, defaultOptions);\n }\n generate(particle) {\n 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) / (_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.double * eps), n1b = this._simplex.noise(x + eps, y), n2b = this._simplex.noise(x - eps, y), b = (n1b - n2b) / (_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.double * eps);\n particle.velocity.x = 0;\n particle.velocity.y = 0;\n
|
|
26
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ CurlNoiseGenerator: () => (/* binding */ CurlNoiseGenerator)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_simplex_noise__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @tsparticles/simplex-noise */ \"@tsparticles/simplex-noise\");\n\n\nconst defaultOptions = {\n speed: 0.2,\n step: 250\n};\nclass CurlNoiseGenerator {\n options;\n _container;\n _res;\n _simplex;\n constructor(container){\n this._container = container;\n this._res = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.Vector.origin;\n const simplex = new _tsparticles_simplex_noise__WEBPACK_IMPORTED_MODULE_1__.SimplexNoise();\n this._simplex = simplex.noise2d;\n this.options = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.deepExtend)({}, defaultOptions);\n }\n generate(particle) {\n 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) / (_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.double * eps), n1b = this._simplex.noise(x + eps, y), n2b = this._simplex.noise(x - eps, y), b = (n1b - n2b) / (_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.double * eps);\n particle.velocity.x = 0;\n particle.velocity.y = 0;\n this._res.x = speed * a;\n this._res.y = speed * -b;\n return this._res;\n }\n init() {\n const container = this._container, sourceOptions = container.actualOptions.particles.move.path.options;\n this.options.seed = sourceOptions[\"seed\"];\n this.options.speed = (sourceOptions[\"speed\"] ?? defaultOptions.speed) * container.retina.pixelRatio;\n this.options.step = sourceOptions[\"step\"] ?? defaultOptions.step;\n this._simplex.seed(this.options.seed ?? (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRandom)());\n }\n reset() {}\n update() {}\n}\n\n\n//# sourceURL=webpack://@tsparticles/path-curl-noise/./dist/browser/CurlNoiseGenerator.js?\n}");
|
|
27
27
|
|
|
28
28
|
/***/ }
|
|
29
29
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Vector, deepExtend, double, getRandom
|
|
1
|
+
import { Vector, deepExtend, double, getRandom } from "@tsparticles/engine";
|
|
2
2
|
import { SimplexNoise } from "@tsparticles/simplex-noise";
|
|
3
3
|
const defaultOptions = {
|
|
4
4
|
speed: 0.2,
|
|
@@ -7,9 +7,11 @@ const defaultOptions = {
|
|
|
7
7
|
export class CurlNoiseGenerator {
|
|
8
8
|
options;
|
|
9
9
|
_container;
|
|
10
|
+
_res;
|
|
10
11
|
_simplex;
|
|
11
12
|
constructor(container) {
|
|
12
13
|
this._container = container;
|
|
14
|
+
this._res = Vector.origin;
|
|
13
15
|
const simplex = new SimplexNoise();
|
|
14
16
|
this._simplex = simplex.noise2d;
|
|
15
17
|
this.options = deepExtend({}, defaultOptions);
|
|
@@ -18,7 +20,9 @@ export class CurlNoiseGenerator {
|
|
|
18
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);
|
|
19
21
|
particle.velocity.x = 0;
|
|
20
22
|
particle.velocity.y = 0;
|
|
21
|
-
|
|
23
|
+
this._res.x = speed * a;
|
|
24
|
+
this._res.y = speed * -b;
|
|
25
|
+
return this._res;
|
|
22
26
|
}
|
|
23
27
|
init() {
|
|
24
28
|
const container = this._container, sourceOptions = container.actualOptions.particles.move.path.options;
|
package/esm/index.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export const curlNoisePathName = "curlNoise";
|
|
2
2
|
export async function loadCurlNoisePath(engine) {
|
|
3
|
-
engine.checkVersion("4.0.0-alpha.
|
|
4
|
-
await engine.register(e => {
|
|
5
|
-
|
|
3
|
+
engine.checkVersion("4.0.0-alpha.26");
|
|
4
|
+
await engine.register(async (e) => {
|
|
5
|
+
const { ensureBaseMoverLoaded } = await import("@tsparticles/plugin-move");
|
|
6
|
+
ensureBaseMoverLoaded(e);
|
|
7
|
+
e.addPathGenerator?.(curlNoisePathName, async (container) => {
|
|
6
8
|
const { CurlNoiseGenerator } = await import("./CurlNoiseGenerator.js");
|
|
7
9
|
return new CurlNoiseGenerator(container);
|
|
8
10
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/path-curl-noise",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.26",
|
|
4
4
|
"description": "tsParticles curl noise path",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -104,8 +104,9 @@
|
|
|
104
104
|
"./package.json": "./package.json"
|
|
105
105
|
},
|
|
106
106
|
"dependencies": {
|
|
107
|
-
"@tsparticles/engine": "4.0.0-alpha.
|
|
108
|
-
"@tsparticles/
|
|
107
|
+
"@tsparticles/engine": "4.0.0-alpha.26",
|
|
108
|
+
"@tsparticles/plugin-move": "4.0.0-alpha.26",
|
|
109
|
+
"@tsparticles/simplex-noise": "4.0.0-alpha.26"
|
|
109
110
|
},
|
|
110
111
|
"type": "module"
|
|
111
112
|
}
|
package/report.html
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8"/>
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
6
|
-
<title>@tsparticles/path-curl-noise [
|
|
6
|
+
<title>@tsparticles/path-curl-noise [26 Feb 2026 at 18:09]</title>
|
|
7
7
|
<link rel="shortcut icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAABrVBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+O1foceMD///+J0/qK1Pr7/v8Xdr/9///W8P4UdL7L7P0Scr2r4Pyj3vwad8D5/f/2/f+55f3E6f34+/2H0/ojfMKpzOd0rNgQcb3F3O/j9f7c8v6g3Pz0/P/w+v/q+P7n9v6T1/uQ1vuE0vqLut/y+v+Z2fvt+f+15Pzv9fuc2/vR7v2V2Pvd6/bg9P7I6/285/2y4/yp3/zp8vk8i8kqgMT7/P31+fyv4vxGkcz6/P6/6P3j7vfS5PNnpNUxhcbO7f7F6v3O4vHK3/DA2u631Ouy0eqXweKJud5wqthfoNMMbLvY8f73+v2dxeR8sNtTmdDx9/zX6PSjyeaCtd1YnNGX2PuQveCGt95Nls42h8dLlM3F4vBtAAAAM3RSTlMAAyOx0/sKBvik8opWGBMOAe3l1snDm2E9LSb06eHcu5JpHbarfHZCN9CBb08zzkdNS0kYaptYAAAFV0lEQVRYw92X51/aYBDHHS2O2qqttVbrqNq9m+TJIAYIShBkWwqIiCgoWvfeq7Z2/s29hyQNyUcR7LveGwVyXy6XH8/9rqxglLfUPLxVduUor3h0rfp2TYvpivk37929TkG037hffoX0+peVtZQc1589rigVUdXS/ABSAyEmGIO/1XfvldSK8vs3OqB6u3m0nxmIrvgB0dj7rr7Y9IbuF68hnfFaiHA/sxqm0wciIG43P60qKv9WXWc1RXGh/mFESFABTSBi0sNAKzqet17eCtOb3kZIDwxEEU0oAIJGYxNBDhBND29e0rtXXbcpuPmED9IhEAAQ/AXEaF8EPmnrrKsv0LvWR3fg5sWDNAFZOgAgaKvZDogHNU9MFwnnYROkc56RD5CjAbQX9Ow4g7upCsvYu55aSI/Nj0H1akgKQEUM94dwK65hYRmFU9MIcH/fqJYOZYcnuJSU/waKDgTOEVaVKhwrTRP5XzgSpAITYzom7UvkhFX5VutmxeNnWDjjswTKTyfgluNDGbUpWissXhF3s7mlSml+czWkg3D0l1nNjGNjz3myOQOa1KM/jOS6ebdbAVTCi4gljHSFrviza7tOgRWcS0MOUX9zdNgag5w7rRqA44Lzw0hr1WqES36dFliSJFlh2rXIae3FFcDDgKdxrUIDePr8jGcSClV1u7A9xeN0ModY/pHMxmR1EzRh8TJiwqsHmKW0l4FCEZI+jHio+JdPPE9qwQtTRxku2D8sIeRL2LnxWSllANCQGOIiqVHAz2ye2JR0DcH+HoxDkaADLjgxjKQ+AwCX/g0+DNgdG0ukYCONAe+dbc2IAc6fwt1ARoDSezNHxV2Cmzwv3O6lDMV55edBGwGK9n1+x2F8EDfAGCxug8MhpsMEcTEAWf3rx2vZhe/LAmtIn/6apE6PN0ULKgywD9mmdxbmFl3OvD5AS5fW5zLbv/YHmcsBTjf/afDz3MaZTVCfAP9z6/Bw6ycv8EUBWJIn9zYcoAWWlW9+OzO3vkTy8H+RANLmdrpOuYWdZYEXpo+TlCJrW5EARb7fF+bWdqf3hhyZI1nWJQHgznErZhbjoEsWqi8dQNoE294aldzFurwSABL2XXMf9+H1VQGke9exw5P/AnA5Pv5ngMul7LOvO922iwACu8WkCwLCafvM4CeWPxfA8lNHcWZSoi8EwMAIciKX2Z4SWCMAa3snCZ/G4EA8D6CMLNFsGQhkkz/gQNEBbPCbWsxGUpYVu3z8IyNAknwJkfPMEhLyrdi5RTyUVACkw4GSFRNWJNEW+fgPGwHD8/JxnRuLabN4CGNRkAE23na2+VmEAUmrYymSGjMAYqH84YUIyzgzs3XC7gNgH36Vcc4zKY9o9fgPBXUAiHHwVboBHGLiX6Zcjp1f2wu4tvzZKo0ecPnDtQYDQvJXaBeNzce45Fp28ZQLrEZVuFqgBwOalArKXnW1UzlnSusQKJqKYNuz4tOnI6sZG4zanpemv+7ySU2jbA9h6uhcgpfy6G2PahirDZ6zvq6zDduMVFTKvzw8wgyEdelwY9in3XkEPs3osJuwRQ4qTkfzifndg9Gfc4pdsu82+tTnHZTBa2EAMrqr2t43pguc8tNm7JQVQ2S0ukj2d22dhXYP0/veWtwKrCkNoNimAN5+Xr/oLrxswKbVJjteWrX7eR63o4j9q0GxnaBdWgGA5VStpanIjQmEhV0/nVt5VOFUvix6awJhPcAaTEShgrG+iGyvb5a0Ndb1YGHFPEwoqAinoaykaID1o1pdPNu7XsnCKQ3R+hwWIIhGvORcJUBYXe3Xa3vq/mF/N9V13ugufMkfXn+KHsRD0B8AAAAASUVORK5CYII=" type="image/x-icon" />
|
|
8
8
|
|
|
9
9
|
<script>
|
|
@@ -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-alpha.
|
|
7
|
+
* v4.0.0-alpha.26
|
|
8
8
|
*/
|
|
9
9
|
/*
|
|
10
10
|
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
@@ -16,14 +16,14 @@
|
|
|
16
16
|
*/
|
|
17
17
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
18
18
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
19
|
-
module.exports = factory(require("@tsparticles/engine"), require("@tsparticles/simplex-noise"));
|
|
19
|
+
module.exports = factory(require("@tsparticles/plugin-move"), require("@tsparticles/engine"), require("@tsparticles/simplex-noise"));
|
|
20
20
|
else if(typeof define === 'function' && define.amd)
|
|
21
|
-
define(["@tsparticles/engine", "@tsparticles/simplex-noise"], factory);
|
|
21
|
+
define(["@tsparticles/plugin-move", "@tsparticles/engine", "@tsparticles/simplex-noise"], factory);
|
|
22
22
|
else {
|
|
23
|
-
var a = typeof exports === 'object' ? factory(require("@tsparticles/engine"), require("@tsparticles/simplex-noise")) : factory(root["window"], root["window"]);
|
|
23
|
+
var a = typeof exports === 'object' ? factory(require("@tsparticles/plugin-move"), require("@tsparticles/engine"), require("@tsparticles/simplex-noise")) : factory(root["window"], root["window"], root["window"]);
|
|
24
24
|
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
|
|
25
25
|
}
|
|
26
|
-
})(this, (__WEBPACK_EXTERNAL_MODULE__tsparticles_engine__, __WEBPACK_EXTERNAL_MODULE__tsparticles_simplex_noise__) => {
|
|
26
|
+
})(this, (__WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_move__, __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__, __WEBPACK_EXTERNAL_MODULE__tsparticles_simplex_noise__) => {
|
|
27
27
|
return /******/ (() => { // webpackBootstrap
|
|
28
28
|
/******/ "use strict";
|
|
29
29
|
/******/ var __webpack_modules__ = ({
|
|
@@ -38,6 +38,16 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
|
|
|
38
38
|
|
|
39
39
|
/***/ },
|
|
40
40
|
|
|
41
|
+
/***/ "@tsparticles/plugin-move"
|
|
42
|
+
/*!************************************************************************************************************************************************!*\
|
|
43
|
+
!*** external {"commonjs":"@tsparticles/plugin-move","commonjs2":"@tsparticles/plugin-move","amd":"@tsparticles/plugin-move","root":"window"} ***!
|
|
44
|
+
\************************************************************************************************************************************************/
|
|
45
|
+
(module) {
|
|
46
|
+
|
|
47
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_move__;
|
|
48
|
+
|
|
49
|
+
/***/ },
|
|
50
|
+
|
|
41
51
|
/***/ "@tsparticles/simplex-noise"
|
|
42
52
|
/*!******************************************************************************************************************************************************!*\
|
|
43
53
|
!*** external {"commonjs":"@tsparticles/simplex-noise","commonjs2":"@tsparticles/simplex-noise","amd":"@tsparticles/simplex-noise","root":"window"} ***!
|
|
@@ -54,7 +64,7 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_simplex_noise__;
|
|
|
54
64
|
\*******************************/
|
|
55
65
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
56
66
|
|
|
57
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ curlNoisePathName: () => (/* binding */ curlNoisePathName),\n/* harmony export */ loadCurlNoisePath: () => (/* binding */ loadCurlNoisePath)\n/* harmony export */ });\nconst curlNoisePathName = \"curlNoise\";\nasync function loadCurlNoisePath(engine) {\n engine.checkVersion(\"4.0.0-alpha.
|
|
67
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ curlNoisePathName: () => (/* binding */ curlNoisePathName),\n/* harmony export */ loadCurlNoisePath: () => (/* binding */ loadCurlNoisePath)\n/* harmony export */ });\nconst curlNoisePathName = \"curlNoise\";\nasync function loadCurlNoisePath(engine) {\n engine.checkVersion(\"4.0.0-alpha.26\");\n await engine.register(async (e)=>{\n const { ensureBaseMoverLoaded } = await Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! @tsparticles/plugin-move */ \"@tsparticles/plugin-move\", 19));\n ensureBaseMoverLoaded(e);\n e.addPathGenerator?.(curlNoisePathName, async (container)=>{\n const { CurlNoiseGenerator } = await __webpack_require__.e(/*! import() */ \"dist_browser_CurlNoiseGenerator_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./CurlNoiseGenerator.js */ \"./dist/browser/CurlNoiseGenerator.js\"));\n return new CurlNoiseGenerator(container);\n });\n });\n}\n\n\n//# sourceURL=webpack://@tsparticles/path-curl-noise/./dist/browser/index.js?\n}");
|
|
58
68
|
|
|
59
69
|
/***/ }
|
|
60
70
|
|
|
@@ -94,6 +104,36 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
94
104
|
/******/ __webpack_require__.m = __webpack_modules__;
|
|
95
105
|
/******/
|
|
96
106
|
/************************************************************************/
|
|
107
|
+
/******/ /* webpack/runtime/create fake namespace object */
|
|
108
|
+
/******/ (() => {
|
|
109
|
+
/******/ var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);
|
|
110
|
+
/******/ var leafPrototypes;
|
|
111
|
+
/******/ // create a fake namespace object
|
|
112
|
+
/******/ // mode & 1: value is a module id, require it
|
|
113
|
+
/******/ // mode & 2: merge all properties of value into the ns
|
|
114
|
+
/******/ // mode & 4: return value when already ns object
|
|
115
|
+
/******/ // mode & 16: return value when it's Promise-like
|
|
116
|
+
/******/ // mode & 8|1: behave like require
|
|
117
|
+
/******/ __webpack_require__.t = function(value, mode) {
|
|
118
|
+
/******/ if(mode & 1) value = this(value);
|
|
119
|
+
/******/ if(mode & 8) return value;
|
|
120
|
+
/******/ if(typeof value === 'object' && value) {
|
|
121
|
+
/******/ if((mode & 4) && value.__esModule) return value;
|
|
122
|
+
/******/ if((mode & 16) && typeof value.then === 'function') return value;
|
|
123
|
+
/******/ }
|
|
124
|
+
/******/ var ns = Object.create(null);
|
|
125
|
+
/******/ __webpack_require__.r(ns);
|
|
126
|
+
/******/ var def = {};
|
|
127
|
+
/******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];
|
|
128
|
+
/******/ for(var current = mode & 2 && value; (typeof current == 'object' || typeof current == 'function') && !~leafPrototypes.indexOf(current); current = getProto(current)) {
|
|
129
|
+
/******/ Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));
|
|
130
|
+
/******/ }
|
|
131
|
+
/******/ def['default'] = () => (value);
|
|
132
|
+
/******/ __webpack_require__.d(ns, def);
|
|
133
|
+
/******/ return ns;
|
|
134
|
+
/******/ };
|
|
135
|
+
/******/ })();
|
|
136
|
+
/******/
|
|
97
137
|
/******/ /* webpack/runtime/define property getters */
|
|
98
138
|
/******/ (() => {
|
|
99
139
|
/******/ // define getter functions for harmony exports
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/engine"),require("@tsparticles/simplex-noise"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine","@tsparticles/simplex-noise"],t);else{var r="object"==typeof exports?t(require("@tsparticles/engine"),require("@tsparticles/simplex-noise")):t(e.window,e.window);for(var o in r)("object"==typeof exports?exports:e)[o]=r[o]}}(this,(e,t)=>(()=>{"use strict";var
|
|
2
|
-
(`+i+": "+n+")",a.name="ChunkLoadError",a.type=i,a.request=n,
|
|
1
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/plugin-move"),require("@tsparticles/engine"),require("@tsparticles/simplex-noise"));else if("function"==typeof define&&define.amd)define(["@tsparticles/plugin-move","@tsparticles/engine","@tsparticles/simplex-noise"],t);else{var r="object"==typeof exports?t(require("@tsparticles/plugin-move"),require("@tsparticles/engine"),require("@tsparticles/simplex-noise")):t(e.window,e.window,e.window);for(var o in r)("object"==typeof exports?exports:e)[o]=r[o]}}(this,(e,t,r)=>(()=>{"use strict";var o,i,n,a={303(e){e.exports=t},400(t){t.exports=e},226(e){e.exports=r}},s={};function c(e){var t=s[e];if(void 0!==t)return t.exports;var r=s[e]={exports:{}};return a[e](r,r.exports,c),r.exports}c.m=a,p=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,c.t=function(e,t){if(1&t&&(e=this(e)),8&t||"object"==typeof e&&e&&(4&t&&e.__esModule||16&t&&"function"==typeof e.then))return e;var r=Object.create(null);c.r(r);var o={};l=l||[null,p({}),p([]),p(p)];for(var i=2&t&&e;("object"==typeof i||"function"==typeof i)&&!~l.indexOf(i);i=p(i))Object.getOwnPropertyNames(i).forEach(t=>o[t]=()=>e[t]);return o.default=()=>e,c.d(r,o),r},c.d=(e,t)=>{for(var r in t)c.o(t,r)&&!c.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},c.f={},c.e=e=>Promise.all(Object.keys(c.f).reduce((t,r)=>(c.f[r](e,t),t),[])),c.u=e=>""+e+".min.js",c.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),u={},c.l=(e,t,r,o)=>{if(u[e])return void u[e].push(t);if(void 0!==r)for(var i,n,a=document.getElementsByTagName("script"),s=0;s<a.length;s++){var l=a[s];if(l.getAttribute("src")==e||l.getAttribute("data-webpack")=="@tsparticles/path-curl-noise:"+r){i=l;break}}i||(n=!0,(i=document.createElement("script")).charset="utf-8",c.nc&&i.setAttribute("nonce",c.nc),i.setAttribute("data-webpack","@tsparticles/path-curl-noise:"+r),i.src=e),u[e]=[t];var p=(t,r)=>{i.onerror=i.onload=null,clearTimeout(f);var o=u[e];if(delete u[e],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach(e=>e(r)),t)return t(r)},f=setTimeout(p.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=p.bind(null,i.onerror),i.onload=p.bind(null,i.onload),n&&document.head.appendChild(i)},c.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.g.importScripts&&(f=c.g.location+"");var l,p,u,f,d=c.g.document;if(!f&&d&&(d.currentScript&&"SCRIPT"===d.currentScript.tagName.toUpperCase()&&(f=d.currentScript.src),!f)){var h=d.getElementsByTagName("script");if(h.length)for(var b=h.length-1;b>-1&&(!f||!/^http(s?):/.test(f));)f=h[b--].src}if(!f)throw Error("Automatic publicPath is not supported in this browser");c.p=f=f.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o={562:0},c.f.j=(e,t)=>{var r=c.o(o,e)?o[e]:void 0;if(0!==r)if(r)t.push(r[2]);else{var i=new Promise((t,i)=>r=o[e]=[t,i]);t.push(r[2]=i);var n=c.p+c.u(e),a=Error();c.l(n,t=>{if(c.o(o,e)&&(0!==(r=o[e])&&(o[e]=void 0),r)){var i=t&&("load"===t.type?"missing":t.type),n=t&&t.target&&t.target.src;a.message="Loading chunk "+e+` failed.
|
|
2
|
+
(`+i+": "+n+")",a.name="ChunkLoadError",a.type=i,a.request=n,r[1](a)}},"chunk-"+e,e)}},i=(e,t)=>{var r,i,[n,a,s]=t,l=0;if(n.some(e=>0!==o[e])){for(r in a)c.o(a,r)&&(c.m[r]=a[r]);s&&s(c)}for(e&&e(t);l<n.length;l++)i=n[l],c.o(o,i)&&o[i]&&o[i][0](),o[i]=0},(n=this.webpackChunk_tsparticles_path_curl_noise=this.webpackChunk_tsparticles_path_curl_noise||[]).forEach(i.bind(null,0)),n.push=i.bind(null,n.push.bind(n));var m={};c.r(m),c.d(m,{curlNoisePathName:()=>g,loadCurlNoisePath:()=>v});let g="curlNoise";async function v(e){e.checkVersion("4.0.0-alpha.26"),await e.register(async e=>{let{ensureBaseMoverLoaded:t}=await Promise.resolve().then(c.t.bind(c,400,19));t(e),e.addPathGenerator?.(g,async e=>{let{CurlNoiseGenerator:t}=await c.e(842).then(c.bind(c,842));return new t(e)})})}return m})());
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { type Container, type
|
|
1
|
+
import { type Container, type Particle, Vector } from "@tsparticles/engine";
|
|
2
2
|
import type { ICurlOptions } from "./ICurlOptions.js";
|
|
3
|
+
import { type IMovePathGenerator } from "@tsparticles/plugin-move";
|
|
3
4
|
export declare class CurlNoiseGenerator implements IMovePathGenerator {
|
|
4
5
|
readonly options: ICurlOptions;
|
|
5
6
|
private readonly _container;
|
|
7
|
+
private readonly _res;
|
|
6
8
|
private readonly _simplex;
|
|
7
9
|
constructor(container: Container);
|
|
8
10
|
generate(particle: Particle): Vector;
|
|
@@ -19,9 +19,11 @@
|
|
|
19
19
|
class CurlNoiseGenerator {
|
|
20
20
|
options;
|
|
21
21
|
_container;
|
|
22
|
+
_res;
|
|
22
23
|
_simplex;
|
|
23
24
|
constructor(container) {
|
|
24
25
|
this._container = container;
|
|
26
|
+
this._res = engine_1.Vector.origin;
|
|
25
27
|
const simplex = new simplex_noise_1.SimplexNoise();
|
|
26
28
|
this._simplex = simplex.noise2d;
|
|
27
29
|
this.options = (0, engine_1.deepExtend)({}, defaultOptions);
|
|
@@ -30,7 +32,9 @@
|
|
|
30
32
|
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_1.double * eps), n1b = this._simplex.noise(x + eps, y), n2b = this._simplex.noise(x - eps, y), b = (n1b - n2b) / (engine_1.double * eps);
|
|
31
33
|
particle.velocity.x = 0;
|
|
32
34
|
particle.velocity.y = 0;
|
|
33
|
-
|
|
35
|
+
this._res.x = speed * a;
|
|
36
|
+
this._res.y = speed * -b;
|
|
37
|
+
return this._res;
|
|
34
38
|
}
|
|
35
39
|
init() {
|
|
36
40
|
const container = this._container, sourceOptions = container.actualOptions.particles.move.path.options;
|
package/umd/index.js
CHANGED
|
@@ -47,10 +47,12 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
47
47
|
exports.loadCurlNoisePath = loadCurlNoisePath;
|
|
48
48
|
exports.curlNoisePathName = "curlNoise";
|
|
49
49
|
async function loadCurlNoisePath(engine) {
|
|
50
|
-
engine.checkVersion("4.0.0-alpha.
|
|
51
|
-
await engine.register(e => {
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
engine.checkVersion("4.0.0-alpha.26");
|
|
51
|
+
await engine.register(async (e) => {
|
|
52
|
+
const { ensureBaseMoverLoaded } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("@tsparticles/plugin-move"))) : new Promise((resolve_1, reject_1) => { require(["@tsparticles/plugin-move"], resolve_1, reject_1); }).then(__importStar));
|
|
53
|
+
ensureBaseMoverLoaded(e);
|
|
54
|
+
e.addPathGenerator?.(exports.curlNoisePathName, async (container) => {
|
|
55
|
+
const { CurlNoiseGenerator } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./CurlNoiseGenerator.js"))) : new Promise((resolve_2, reject_2) => { require(["./CurlNoiseGenerator.js"], resolve_2, reject_2); }).then(__importStar));
|
|
54
56
|
return new CurlNoiseGenerator(container);
|
|
55
57
|
});
|
|
56
58
|
});
|
package/934.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(this.webpackChunk_tsparticles_path_curl_noise=this.webpackChunk_tsparticles_path_curl_noise||[]).push([[934],{934(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;_simplex;constructor(e){this._container=e;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,l=(this._simplex.noise(p,n+.001)-this._simplex.noise(p,n-.001))/(.001*i.double),a=(this._simplex.noise(p+.001,n)-this._simplex.noise(p-.001,n))/(.001*i.double);return e.velocity.x=0,e.velocity.y=0,i.Vector.create(t*l,-(t*a))}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(){}}}}]);
|