@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
|
@@ -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
|
/*
|
|
10
10
|
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
@@ -28,16 +28,6 @@ return /******/ (() => { // webpackBootstrap
|
|
|
28
28
|
/******/ "use strict";
|
|
29
29
|
/******/ var __webpack_modules__ = ({
|
|
30
30
|
|
|
31
|
-
/***/ "./dist/browser/index.js"
|
|
32
|
-
/*!*******************************!*\
|
|
33
|
-
!*** ./dist/browser/index.js ***!
|
|
34
|
-
\*******************************/
|
|
35
|
-
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
36
|
-
|
|
37
|
-
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\";\nfunction loadCurlNoisePath(engine) {\n engine.checkVersion(\"4.0.0-alpha.2\");\n engine.register(async e => {\n const {\n CurlNoiseGenerator\n } = await __webpack_require__.e(/*! import() */ \"dist_browser_CurlNoiseGenerator_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./CurlNoiseGenerator.js */ \"./dist/browser/CurlNoiseGenerator.js\"));\n e.addPathGenerator(curlNoisePathName, new CurlNoiseGenerator());\n });\n}\n\n//# sourceURL=webpack://@tsparticles/path-curl-noise/./dist/browser/index.js?\n}");
|
|
38
|
-
|
|
39
|
-
/***/ },
|
|
40
|
-
|
|
41
31
|
/***/ "@tsparticles/engine"
|
|
42
32
|
/*!*********************************************************************************************************************************!*\
|
|
43
33
|
!*** external {"commonjs":"@tsparticles/engine","commonjs2":"@tsparticles/engine","amd":"@tsparticles/engine","root":"window"} ***!
|
|
@@ -56,6 +46,16 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
|
|
|
56
46
|
|
|
57
47
|
module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_simplex_noise__;
|
|
58
48
|
|
|
49
|
+
/***/ },
|
|
50
|
+
|
|
51
|
+
/***/ "./dist/browser/index.js"
|
|
52
|
+
/*!*******************************!*\
|
|
53
|
+
!*** ./dist/browser/index.js ***!
|
|
54
|
+
\*******************************/
|
|
55
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
56
|
+
|
|
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.21\");\n await engine.register((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
|
+
|
|
59
59
|
/***/ }
|
|
60
60
|
|
|
61
61
|
/******/ });
|
|
@@ -1,2 +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 r,o,i,n={303(t){t.exports=e},226(e){e.exports=t}},a={};function s(e){var t=a[e];if(void 0!==t)return t.exports;var r=a[e]={exports:{}};return n[e](r,r.exports,s),r.exports}s.m=n,s.d=(e,t)=>{for(var r in t)s.o(t,r)&&!s.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},s.f={},s.e=e=>Promise.all(Object.keys(s.f).reduce((t,r)=>(s.f[r](e,t),t),[])),s.u=e=>""+e+".min.js",s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),c={},s.l=(e,t,r,o)=>{if(c[e])return void c[e].push(t);if(void 0!==r)for(var i,n,a=document.getElementsByTagName("script"),l=0;l<a.length;l++){var p=a[l];if(p.getAttribute("src")==e||p.getAttribute("data-webpack")=="@tsparticles/path-curl-noise:"+r){i=p;break}}i||(n=!0,(i=document.createElement("script")).charset="utf-8",s.nc&&i.setAttribute("nonce",s.nc),i.setAttribute("data-webpack","@tsparticles/path-curl-noise:"+r),i.src=e),c[e]=[t];var u=(t,r)=>{i.onerror=i.onload=null,clearTimeout(d);var o=c[e];if(delete c[e],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach(e=>e(r)),t)return t(r)},d=setTimeout(u.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=u.bind(null,i.onerror),i.onload=u.bind(null,i.onload),n&&document.head.appendChild(i)},s.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.g.importScripts&&(l=s.g.location+"");var c,l,p=s.g.document;if(!l&&p&&(p.currentScript&&"SCRIPT"===p.currentScript.tagName.toUpperCase()&&(l=p.currentScript.src),!l)){var u=p.getElementsByTagName("script");if(u.length)for(var d=u.length-1;d>-1&&(!l||!/^http(s?):/.test(l));)l=u[d--].src}if(!l)throw Error("Automatic publicPath is not supported in this browser");s.p=l=l.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r={562:0},s.f.j=(e,t)=>{var o=s.o(r,e)?r[e]:void 0;if(0!==o)if(o)t.push(o[2]);else{var i=new Promise((t,i)=>o=r[e]=[t,i]);t.push(o[2]=i);var n=s.p+s.u(e),a=Error();s.l(n,t=>{if(s.o(r,e)&&(0!==(o=r[e])&&(r[e]=void 0),o)){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,o[1](a)}},"chunk-"+e,e)}},o=(e,t)=>{var o,i,[n,a,c]=t,l=0;if(n.some(e=>0!==r[e])){for(o in a)s.o(a,o)&&(s.m[o]=a[o]);c&&c(s)}for(e&&e(t);l<n.length;l++)i=n[l],s.o(r,i)&&r[i]&&r[i][0](),r[i]=0},(i=this.webpackChunk_tsparticles_path_curl_noise=this.webpackChunk_tsparticles_path_curl_noise||[]).forEach(o.bind(null,0)),i.push=o.bind(null,i.push.bind(i));var f={};s.r(f),s.d(f,{curlNoisePathName:()=>h,loadCurlNoisePath:()=>b});let h="curlNoise";async function b(e){e.checkVersion("4.0.0-alpha.21"),await e.register(e=>{e.addPathGenerator(h,async e=>{let{CurlNoiseGenerator:t}=await s.e(934).then(s.bind(s,934));return new t(e)})})}return f})());
|
|
@@ -2,10 +2,11 @@ import { type Container, type IMovePathGenerator, type Particle, Vector } from "
|
|
|
2
2
|
import type { ICurlOptions } from "./ICurlOptions.js";
|
|
3
3
|
export declare class CurlNoiseGenerator implements IMovePathGenerator {
|
|
4
4
|
readonly options: ICurlOptions;
|
|
5
|
+
private readonly _container;
|
|
5
6
|
private readonly _simplex;
|
|
6
|
-
constructor();
|
|
7
|
+
constructor(container: Container);
|
|
7
8
|
generate(particle: Particle): Vector;
|
|
8
|
-
init(
|
|
9
|
+
init(): void;
|
|
9
10
|
reset(): void;
|
|
10
11
|
update(): void;
|
|
11
12
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -15,21 +15,25 @@
|
|
|
15
15
|
const defaultOptions = {
|
|
16
16
|
speed: 0.2,
|
|
17
17
|
step: 250,
|
|
18
|
-
}
|
|
18
|
+
};
|
|
19
19
|
class CurlNoiseGenerator {
|
|
20
|
-
|
|
20
|
+
options;
|
|
21
|
+
_container;
|
|
22
|
+
_simplex;
|
|
23
|
+
constructor(container) {
|
|
24
|
+
this._container = container;
|
|
21
25
|
const simplex = new simplex_noise_1.SimplexNoise();
|
|
22
26
|
this._simplex = simplex.noise2d;
|
|
23
27
|
this.options = (0, engine_1.deepExtend)({}, defaultOptions);
|
|
24
28
|
}
|
|
25
29
|
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) / (double * eps), n1b = this._simplex.noise(x + eps, y), n2b = this._simplex.noise(x - eps, y), b = (n1b - n2b) / (double * eps);
|
|
30
|
+
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);
|
|
27
31
|
particle.velocity.x = 0;
|
|
28
32
|
particle.velocity.y = 0;
|
|
29
33
|
return engine_1.Vector.create(speed * a, speed * -b);
|
|
30
34
|
}
|
|
31
|
-
init(
|
|
32
|
-
const sourceOptions = container.actualOptions.particles.move.path.options;
|
|
35
|
+
init() {
|
|
36
|
+
const container = this._container, sourceOptions = container.actualOptions.particles.move.path.options;
|
|
33
37
|
this.options.seed = sourceOptions["seed"];
|
|
34
38
|
this.options.speed =
|
|
35
39
|
(sourceOptions["speed"] ?? defaultOptions.speed) * container.retina.pixelRatio;
|
package/umd/index.js
CHANGED
|
@@ -46,11 +46,13 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
46
46
|
exports.curlNoisePathName = void 0;
|
|
47
47
|
exports.loadCurlNoisePath = loadCurlNoisePath;
|
|
48
48
|
exports.curlNoisePathName = "curlNoise";
|
|
49
|
-
function loadCurlNoisePath(engine) {
|
|
50
|
-
engine.checkVersion("4.0.0-alpha.
|
|
51
|
-
engine.register(
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
async function loadCurlNoisePath(engine) {
|
|
50
|
+
engine.checkVersion("4.0.0-alpha.21");
|
|
51
|
+
await engine.register(e => {
|
|
52
|
+
e.addPathGenerator(exports.curlNoisePathName, async (container) => {
|
|
53
|
+
const { CurlNoiseGenerator } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./CurlNoiseGenerator.js"))) : new Promise((resolve_1, reject_1) => { require(["./CurlNoiseGenerator.js"], resolve_1, reject_1); }).then(__importStar));
|
|
54
|
+
return new CurlNoiseGenerator(container);
|
|
55
|
+
});
|
|
54
56
|
});
|
|
55
57
|
}
|
|
56
58
|
});
|
package/720.min.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see 720.min.js.LICENSE.txt */
|
|
2
|
-
(this.webpackChunk_tsparticles_path_curl_noise=this.webpackChunk_tsparticles_path_curl_noise||[]).push([[720],{720(e,s,t){t.d(s,{CurlNoiseGenerator:()=>n});var i=t(303),o=t(226);const p={speed:.2,step:250};class n{constructor(){const e=new o.SimplexNoise;this._simplex=e.noise2d,this.options=(0,i.deepExtend)({},p)}generate(e){const s=e.getPosition(),{speed:t,step:o}=this.options,p=s.x/o,n=s.y/o,h=.001,a=(this._simplex.noise(p,n+h)-this._simplex.noise(p,n-h))/.002,c=(this._simplex.noise(p+h,n)-this._simplex.noise(p-h,n))/.002;return e.velocity.x=0,e.velocity.y=0,i.Vector.create(t*a,t*-c)}init(e){const 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/720.min.js.LICENSE.txt
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! tsParticles Curl Noise Path v4.0.0-alpha.2 by Matteo Bruni */
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! tsParticles Curl Noise Path v4.0.0-alpha.2 by Matteo Bruni */
|