@tsparticles/path-curl-noise 4.0.0-beta.0 → 4.0.0-beta.2
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/653.min.js +1 -0
- package/browser/CurlNoiseGenerator.js +1 -0
- package/browser/index.js +5 -3
- package/cjs/CurlNoiseGenerator.js +1 -0
- package/cjs/index.js +5 -3
- package/dist_browser_CurlNoiseGenerator_js.js +2 -2
- package/esm/CurlNoiseGenerator.js +1 -0
- package/esm/index.js +5 -3
- package/package.json +6 -7
- package/report.html +84 -29
- package/tsparticles.path.curl.noise.js +6 -6
- package/tsparticles.path.curl.noise.min.js +2 -2
- package/289.min.js +0 -1
- package/umd/CurlNoiseGenerator.js +0 -53
- package/umd/ICurlOptions.js +0 -12
- package/umd/index.js +0 -60
package/653.min.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(this.webpackChunk_tsparticles_path_curl_noise=this.webpackChunk_tsparticles_path_curl_noise||[]).push([[653],{653(e,s,t){t.d(s,{CurlNoiseGenerator:()=>n});var i=t(303);t(400);var 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/browser/index.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import {} from "@tsparticles/engine";
|
|
2
|
+
import {} from "@tsparticles/plugin-move";
|
|
1
3
|
export const curlNoisePathName = "curlNoise";
|
|
2
4
|
export async function loadCurlNoisePath(engine) {
|
|
3
|
-
engine.checkVersion("4.0.0-beta.
|
|
4
|
-
await engine.register(async (e) => {
|
|
5
|
+
engine.checkVersion("4.0.0-beta.2");
|
|
6
|
+
await engine.pluginManager.register(async (e) => {
|
|
5
7
|
const { ensureBaseMoverLoaded } = await import("@tsparticles/plugin-move");
|
|
6
8
|
ensureBaseMoverLoaded(e);
|
|
7
|
-
e.addPathGenerator?.(curlNoisePathName, async (container) => {
|
|
9
|
+
e.pluginManager.addPathGenerator?.(curlNoisePathName, async (container) => {
|
|
8
10
|
const { CurlNoiseGenerator } = await import("./CurlNoiseGenerator.js");
|
|
9
11
|
return new CurlNoiseGenerator(container);
|
|
10
12
|
});
|
package/cjs/index.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import {} from "@tsparticles/engine";
|
|
2
|
+
import {} from "@tsparticles/plugin-move";
|
|
1
3
|
export const curlNoisePathName = "curlNoise";
|
|
2
4
|
export async function loadCurlNoisePath(engine) {
|
|
3
|
-
engine.checkVersion("4.0.0-beta.
|
|
4
|
-
await engine.register(async (e) => {
|
|
5
|
+
engine.checkVersion("4.0.0-beta.2");
|
|
6
|
+
await engine.pluginManager.register(async (e) => {
|
|
5
7
|
const { ensureBaseMoverLoaded } = await import("@tsparticles/plugin-move");
|
|
6
8
|
ensureBaseMoverLoaded(e);
|
|
7
|
-
e.addPathGenerator?.(curlNoisePathName, async (container) => {
|
|
9
|
+
e.pluginManager.addPathGenerator?.(curlNoisePathName, async (container) => {
|
|
8
10
|
const { CurlNoiseGenerator } = await import("./CurlNoiseGenerator.js");
|
|
9
11
|
return new CurlNoiseGenerator(container);
|
|
10
12
|
});
|
|
@@ -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.
|
|
7
|
+
* v4.0.0-beta.2
|
|
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
|
|
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_plugin_move__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @tsparticles/plugin-move */ \"@tsparticles/plugin-move\");\n/* harmony import */ var _tsparticles_simplex_noise__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @tsparticles/simplex-noise */ \"@tsparticles/simplex-noise\");\n\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_2__.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
|
|
package/esm/index.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import {} from "@tsparticles/engine";
|
|
2
|
+
import {} from "@tsparticles/plugin-move";
|
|
1
3
|
export const curlNoisePathName = "curlNoise";
|
|
2
4
|
export async function loadCurlNoisePath(engine) {
|
|
3
|
-
engine.checkVersion("4.0.0-beta.
|
|
4
|
-
await engine.register(async (e) => {
|
|
5
|
+
engine.checkVersion("4.0.0-beta.2");
|
|
6
|
+
await engine.pluginManager.register(async (e) => {
|
|
5
7
|
const { ensureBaseMoverLoaded } = await import("@tsparticles/plugin-move");
|
|
6
8
|
ensureBaseMoverLoaded(e);
|
|
7
|
-
e.addPathGenerator?.(curlNoisePathName, async (container) => {
|
|
9
|
+
e.pluginManager.addPathGenerator?.(curlNoisePathName, async (container) => {
|
|
8
10
|
const { CurlNoiseGenerator } = await import("./CurlNoiseGenerator.js");
|
|
9
11
|
return new CurlNoiseGenerator(container);
|
|
10
12
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/path-curl-noise",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.2",
|
|
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
|
-
"
|
|
102
|
-
"default": "./cjs/index.js"
|
|
101
|
+
"default": "./esm/index.js"
|
|
103
102
|
},
|
|
104
103
|
"./package.json": "./package.json"
|
|
105
104
|
},
|
|
106
|
-
"
|
|
107
|
-
"@tsparticles/engine": "4.0.0-beta.
|
|
108
|
-
"@tsparticles/plugin-move": "4.0.0-beta.
|
|
109
|
-
"@tsparticles/simplex-noise": "4.0.0-beta.
|
|
105
|
+
"peerDependencies": {
|
|
106
|
+
"@tsparticles/engine": "4.0.0-beta.1",
|
|
107
|
+
"@tsparticles/plugin-move": "4.0.0-beta.1",
|
|
108
|
+
"@tsparticles/simplex-noise": "4.0.0-beta.1"
|
|
110
109
|
},
|
|
111
110
|
"type": "module"
|
|
112
111
|
}
|