@tsparticles/path-curl-noise 4.0.0-alpha.2 → 4.0.0-alpha.21
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/934.min.js +1 -0
- package/browser/CurlNoiseGenerator.js +9 -5
- package/browser/index.js +7 -5
- package/cjs/CurlNoiseGenerator.js +9 -5
- package/cjs/index.js +7 -5
- package/dist_browser_CurlNoiseGenerator_js.js +2 -2
- package/esm/CurlNoiseGenerator.js +9 -5
- package/esm/index.js +7 -5
- package/package.json +3 -3
- package/report.html +3 -3
- package/tsparticles.path.curl.noise.js +11 -11
- package/tsparticles.path.curl.noise.min.js +2 -2
- package/types/CurlNoiseGenerator.d.ts +3 -2
- package/types/index.d.ts +1 -1
- package/umd/CurlNoiseGenerator.js +9 -5
- package/umd/index.js +7 -5
- package/720.min.js +0 -2
- package/720.min.js.LICENSE.txt +0 -1
- package/tsparticles.path.curl.noise.min.js.LICENSE.txt +0 -1
package/934.min.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
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(){}}}}]);
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import { Vector, deepExtend, getRandom, } from "@tsparticles/engine";
|
|
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,
|
|
5
5
|
step: 250,
|
|
6
|
-
}
|
|
6
|
+
};
|
|
7
7
|
export class CurlNoiseGenerator {
|
|
8
|
-
|
|
8
|
+
options;
|
|
9
|
+
_container;
|
|
10
|
+
_simplex;
|
|
11
|
+
constructor(container) {
|
|
12
|
+
this._container = container;
|
|
9
13
|
const simplex = new SimplexNoise();
|
|
10
14
|
this._simplex = simplex.noise2d;
|
|
11
15
|
this.options = deepExtend({}, defaultOptions);
|
|
@@ -16,8 +20,8 @@ export class CurlNoiseGenerator {
|
|
|
16
20
|
particle.velocity.y = 0;
|
|
17
21
|
return Vector.create(speed * a, speed * -b);
|
|
18
22
|
}
|
|
19
|
-
init(
|
|
20
|
-
const sourceOptions = container.actualOptions.particles.move.path.options;
|
|
23
|
+
init() {
|
|
24
|
+
const container = this._container, sourceOptions = container.actualOptions.particles.move.path.options;
|
|
21
25
|
this.options.seed = sourceOptions["seed"];
|
|
22
26
|
this.options.speed =
|
|
23
27
|
(sourceOptions["speed"] ?? defaultOptions.speed) * container.retina.pixelRatio;
|
package/browser/index.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export const curlNoisePathName = "curlNoise";
|
|
2
|
-
export function loadCurlNoisePath(engine) {
|
|
3
|
-
engine.checkVersion("4.0.0-alpha.
|
|
4
|
-
engine.register(
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
export async function loadCurlNoisePath(engine) {
|
|
3
|
+
engine.checkVersion("4.0.0-alpha.21");
|
|
4
|
+
await engine.register(e => {
|
|
5
|
+
e.addPathGenerator(curlNoisePathName, async (container) => {
|
|
6
|
+
const { CurlNoiseGenerator } = await import("./CurlNoiseGenerator.js");
|
|
7
|
+
return new CurlNoiseGenerator(container);
|
|
8
|
+
});
|
|
7
9
|
});
|
|
8
10
|
}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import { Vector, deepExtend, getRandom, } from "@tsparticles/engine";
|
|
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,
|
|
5
5
|
step: 250,
|
|
6
|
-
}
|
|
6
|
+
};
|
|
7
7
|
export class CurlNoiseGenerator {
|
|
8
|
-
|
|
8
|
+
options;
|
|
9
|
+
_container;
|
|
10
|
+
_simplex;
|
|
11
|
+
constructor(container) {
|
|
12
|
+
this._container = container;
|
|
9
13
|
const simplex = new SimplexNoise();
|
|
10
14
|
this._simplex = simplex.noise2d;
|
|
11
15
|
this.options = deepExtend({}, defaultOptions);
|
|
@@ -16,8 +20,8 @@ export class CurlNoiseGenerator {
|
|
|
16
20
|
particle.velocity.y = 0;
|
|
17
21
|
return Vector.create(speed * a, speed * -b);
|
|
18
22
|
}
|
|
19
|
-
init(
|
|
20
|
-
const sourceOptions = container.actualOptions.particles.move.path.options;
|
|
23
|
+
init() {
|
|
24
|
+
const container = this._container, sourceOptions = container.actualOptions.particles.move.path.options;
|
|
21
25
|
this.options.seed = sourceOptions["seed"];
|
|
22
26
|
this.options.speed =
|
|
23
27
|
(sourceOptions["speed"] ?? defaultOptions.speed) * container.retina.pixelRatio;
|
package/cjs/index.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export const curlNoisePathName = "curlNoise";
|
|
2
|
-
export function loadCurlNoisePath(engine) {
|
|
3
|
-
engine.checkVersion("4.0.0-alpha.
|
|
4
|
-
engine.register(
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
export async function loadCurlNoisePath(engine) {
|
|
3
|
+
engine.checkVersion("4.0.0-alpha.21");
|
|
4
|
+
await engine.register(e => {
|
|
5
|
+
e.addPathGenerator(curlNoisePathName, async (container) => {
|
|
6
|
+
const { CurlNoiseGenerator } = await import("./CurlNoiseGenerator.js");
|
|
7
|
+
return new CurlNoiseGenerator(container);
|
|
8
|
+
});
|
|
7
9
|
});
|
|
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.21
|
|
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
|
|
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 return _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.Vector.create(speed * a, speed * -b);\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,11 +1,15 @@
|
|
|
1
|
-
import { Vector, deepExtend, getRandom, } from "@tsparticles/engine";
|
|
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,
|
|
5
5
|
step: 250,
|
|
6
|
-
}
|
|
6
|
+
};
|
|
7
7
|
export class CurlNoiseGenerator {
|
|
8
|
-
|
|
8
|
+
options;
|
|
9
|
+
_container;
|
|
10
|
+
_simplex;
|
|
11
|
+
constructor(container) {
|
|
12
|
+
this._container = container;
|
|
9
13
|
const simplex = new SimplexNoise();
|
|
10
14
|
this._simplex = simplex.noise2d;
|
|
11
15
|
this.options = deepExtend({}, defaultOptions);
|
|
@@ -16,8 +20,8 @@ export class CurlNoiseGenerator {
|
|
|
16
20
|
particle.velocity.y = 0;
|
|
17
21
|
return Vector.create(speed * a, speed * -b);
|
|
18
22
|
}
|
|
19
|
-
init(
|
|
20
|
-
const sourceOptions = container.actualOptions.particles.move.path.options;
|
|
23
|
+
init() {
|
|
24
|
+
const container = this._container, sourceOptions = container.actualOptions.particles.move.path.options;
|
|
21
25
|
this.options.seed = sourceOptions["seed"];
|
|
22
26
|
this.options.speed =
|
|
23
27
|
(sourceOptions["speed"] ?? defaultOptions.speed) * container.retina.pixelRatio;
|
package/esm/index.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export const curlNoisePathName = "curlNoise";
|
|
2
|
-
export function loadCurlNoisePath(engine) {
|
|
3
|
-
engine.checkVersion("4.0.0-alpha.
|
|
4
|
-
engine.register(
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
export async function loadCurlNoisePath(engine) {
|
|
3
|
+
engine.checkVersion("4.0.0-alpha.21");
|
|
4
|
+
await engine.register(e => {
|
|
5
|
+
e.addPathGenerator(curlNoisePathName, async (container) => {
|
|
6
|
+
const { CurlNoiseGenerator } = await import("./CurlNoiseGenerator.js");
|
|
7
|
+
return new CurlNoiseGenerator(container);
|
|
8
|
+
});
|
|
7
9
|
});
|
|
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.21",
|
|
4
4
|
"description": "tsParticles curl noise path",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -104,8 +104,8 @@
|
|
|
104
104
|
"./package.json": "./package.json"
|
|
105
105
|
},
|
|
106
106
|
"dependencies": {
|
|
107
|
-
"@tsparticles/engine": "4.0.0-alpha.
|
|
108
|
-
"@tsparticles/simplex-noise": "4.0.0-alpha.
|
|
107
|
+
"@tsparticles/engine": "4.0.0-alpha.21",
|
|
108
|
+
"@tsparticles/simplex-noise": "4.0.0-alpha.21"
|
|
109
109
|
},
|
|
110
110
|
"type": "module"
|
|
111
111
|
}
|