@tsparticles/path-levy 4.0.0-alpha.8 → 4.0.0-beta.1
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/844.min.js +1 -0
- package/browser/LevyPathGenerator.js +7 -1
- package/browser/index.js +5 -3
- package/cjs/LevyPathGenerator.js +7 -1
- package/cjs/index.js +5 -3
- package/dist_browser_LevyPathGenerator_js.js +2 -2
- package/esm/LevyPathGenerator.js +7 -1
- package/esm/index.js +5 -3
- package/package.json +3 -2
- package/report.html +84 -29
- package/tsparticles.path.levy.js +75 -23
- package/tsparticles.path.levy.min.js +2 -2
- package/types/LevyPathGenerator.d.ts +3 -1
- package/umd/LevyPathGenerator.js +7 -1
- package/umd/index.js +6 -4
- package/138.min.js +0 -2
- package/138.min.js.LICENSE.txt +0 -1
- package/tsparticles.path.levy.min.js.LICENSE.txt +0 -1
package/844.min.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(this.webpackChunk_tsparticles_path_levy=this.webpackChunk_tsparticles_path_levy||[]).push([[844],{844(t,e,a){a.d(e,{LevyPathGenerator:()=>i});var s=a(303);class i{options;_container;_res;constructor(t){this._container=t,this._res=s.Vector.origin,this.options={alpha:1.5,scale:1,maxStep:10}}generate(t){t.levy??={angle:(0,s.getRandom)()*Math.PI*2,baseSpeed:t.velocity.length};let e=this.options,a=t.levy;a.angle+=((0,s.getRandom)()-.5)*.2;let i=Math.max((0,s.getRandom)(),1e-6),o=(e.scale??1)/Math.pow(i,1/(e.alpha??1.5));void 0!==e.maxStep&&(o=Math.min(o,e.maxStep));let n=a.baseSpeed*o;return t.velocity.x=0,t.velocity.y=0,this._res.length=n,this._res.angle=a.angle,this._res}init(){let t=this._container.actualOptions.particles.move.path.options;this.options.alpha=t.alpha??this.options.alpha,this.options.scale=t.scale??this.options.scale,this.options.maxStep=t.maxStep??this.options.maxStep}reset(t){delete t.levy}update(){}}}}]);
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { Vector, getRandom } from "@tsparticles/engine";
|
|
2
2
|
const defaultScale = 1, defaultLevyAlpha = 1.5;
|
|
3
3
|
export class LevyPathGenerator {
|
|
4
|
+
options;
|
|
5
|
+
_container;
|
|
6
|
+
_res;
|
|
4
7
|
constructor(container) {
|
|
5
8
|
this._container = container;
|
|
9
|
+
this._res = Vector.origin;
|
|
6
10
|
this.options = {
|
|
7
11
|
alpha: defaultLevyAlpha,
|
|
8
12
|
scale: defaultScale,
|
|
@@ -24,7 +28,9 @@ export class LevyPathGenerator {
|
|
|
24
28
|
const speed = l.baseSpeed * step;
|
|
25
29
|
p.velocity.x = 0;
|
|
26
30
|
p.velocity.y = 0;
|
|
27
|
-
|
|
31
|
+
this._res.length = speed;
|
|
32
|
+
this._res.angle = l.angle;
|
|
33
|
+
return this._res;
|
|
28
34
|
}
|
|
29
35
|
init() {
|
|
30
36
|
const source = this._container.actualOptions.particles.move.path.options;
|
package/browser/index.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export const levyPathName = "levyPathGenerator";
|
|
2
2
|
export async function loadLevyPath(engine) {
|
|
3
|
-
engine.checkVersion("4.0.0-
|
|
4
|
-
await engine.register(e => {
|
|
5
|
-
|
|
3
|
+
engine.checkVersion("4.0.0-beta.1");
|
|
4
|
+
await engine.pluginManager.register(async (e) => {
|
|
5
|
+
const { ensureBaseMoverLoaded } = await import("@tsparticles/plugin-move");
|
|
6
|
+
ensureBaseMoverLoaded(e);
|
|
7
|
+
e.pluginManager.addPathGenerator?.(levyPathName, async (container) => {
|
|
6
8
|
const { LevyPathGenerator } = await import("./LevyPathGenerator.js");
|
|
7
9
|
return new LevyPathGenerator(container);
|
|
8
10
|
});
|
package/cjs/LevyPathGenerator.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { Vector, getRandom } from "@tsparticles/engine";
|
|
2
2
|
const defaultScale = 1, defaultLevyAlpha = 1.5;
|
|
3
3
|
export class LevyPathGenerator {
|
|
4
|
+
options;
|
|
5
|
+
_container;
|
|
6
|
+
_res;
|
|
4
7
|
constructor(container) {
|
|
5
8
|
this._container = container;
|
|
9
|
+
this._res = Vector.origin;
|
|
6
10
|
this.options = {
|
|
7
11
|
alpha: defaultLevyAlpha,
|
|
8
12
|
scale: defaultScale,
|
|
@@ -24,7 +28,9 @@ export class LevyPathGenerator {
|
|
|
24
28
|
const speed = l.baseSpeed * step;
|
|
25
29
|
p.velocity.x = 0;
|
|
26
30
|
p.velocity.y = 0;
|
|
27
|
-
|
|
31
|
+
this._res.length = speed;
|
|
32
|
+
this._res.angle = l.angle;
|
|
33
|
+
return this._res;
|
|
28
34
|
}
|
|
29
35
|
init() {
|
|
30
36
|
const source = this._container.actualOptions.particles.move.path.options;
|
package/cjs/index.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export const levyPathName = "levyPathGenerator";
|
|
2
2
|
export async function loadLevyPath(engine) {
|
|
3
|
-
engine.checkVersion("4.0.0-
|
|
4
|
-
await engine.register(e => {
|
|
5
|
-
|
|
3
|
+
engine.checkVersion("4.0.0-beta.1");
|
|
4
|
+
await engine.pluginManager.register(async (e) => {
|
|
5
|
+
const { ensureBaseMoverLoaded } = await import("@tsparticles/plugin-move");
|
|
6
|
+
ensureBaseMoverLoaded(e);
|
|
7
|
+
e.pluginManager.addPathGenerator?.(levyPathName, async (container) => {
|
|
6
8
|
const { LevyPathGenerator } = await import("./LevyPathGenerator.js");
|
|
7
9
|
return new LevyPathGenerator(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-
|
|
7
|
+
* v4.0.0-beta.1
|
|
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 */ LevyPathGenerator: () => (/* binding */ LevyPathGenerator)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nconst defaultScale = 1
|
|
26
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ LevyPathGenerator: () => (/* binding */ LevyPathGenerator)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nconst defaultScale = 1, defaultLevyAlpha = 1.5;\nclass LevyPathGenerator {\n options;\n _container;\n _res;\n constructor(container){\n this._container = container;\n this._res = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.Vector.origin;\n this.options = {\n alpha: defaultLevyAlpha,\n scale: defaultScale,\n maxStep: 10\n };\n }\n generate(p) {\n p.levy ??= {\n angle: (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRandom)() * Math.PI * 2,\n baseSpeed: p.velocity.length\n };\n const opts = this.options, l = p.levy;\n l.angle += ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRandom)() - 0.5) * 0.2;\n const u = Math.max((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRandom)(), 1e-6), scale = opts.scale ?? defaultScale, levyAlpha = opts.alpha ?? defaultLevyAlpha;\n let step = scale / Math.pow(u, 1 / levyAlpha);\n if (opts.maxStep !== undefined) {\n step = Math.min(step, opts.maxStep);\n }\n const speed = l.baseSpeed * step;\n p.velocity.x = 0;\n p.velocity.y = 0;\n this._res.length = speed;\n this._res.angle = l.angle;\n return this._res;\n }\n init() {\n const source = this._container.actualOptions.particles.move.path.options;\n this.options.alpha = source[\"alpha\"] ?? this.options.alpha;\n this.options.scale = source[\"scale\"] ?? this.options.scale;\n this.options.maxStep = source[\"maxStep\"] ?? this.options.maxStep;\n }\n reset(p) {\n delete p.levy;\n }\n update() {}\n}\n\n\n//# sourceURL=webpack://@tsparticles/path-levy/./dist/browser/LevyPathGenerator.js?\n}");
|
|
27
27
|
|
|
28
28
|
/***/ }
|
|
29
29
|
|
package/esm/LevyPathGenerator.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { Vector, getRandom } from "@tsparticles/engine";
|
|
2
2
|
const defaultScale = 1, defaultLevyAlpha = 1.5;
|
|
3
3
|
export class LevyPathGenerator {
|
|
4
|
+
options;
|
|
5
|
+
_container;
|
|
6
|
+
_res;
|
|
4
7
|
constructor(container) {
|
|
5
8
|
this._container = container;
|
|
9
|
+
this._res = Vector.origin;
|
|
6
10
|
this.options = {
|
|
7
11
|
alpha: defaultLevyAlpha,
|
|
8
12
|
scale: defaultScale,
|
|
@@ -24,7 +28,9 @@ export class LevyPathGenerator {
|
|
|
24
28
|
const speed = l.baseSpeed * step;
|
|
25
29
|
p.velocity.x = 0;
|
|
26
30
|
p.velocity.y = 0;
|
|
27
|
-
|
|
31
|
+
this._res.length = speed;
|
|
32
|
+
this._res.angle = l.angle;
|
|
33
|
+
return this._res;
|
|
28
34
|
}
|
|
29
35
|
init() {
|
|
30
36
|
const source = this._container.actualOptions.particles.move.path.options;
|
package/esm/index.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export const levyPathName = "levyPathGenerator";
|
|
2
2
|
export async function loadLevyPath(engine) {
|
|
3
|
-
engine.checkVersion("4.0.0-
|
|
4
|
-
await engine.register(e => {
|
|
5
|
-
|
|
3
|
+
engine.checkVersion("4.0.0-beta.1");
|
|
4
|
+
await engine.pluginManager.register(async (e) => {
|
|
5
|
+
const { ensureBaseMoverLoaded } = await import("@tsparticles/plugin-move");
|
|
6
|
+
ensureBaseMoverLoaded(e);
|
|
7
|
+
e.pluginManager.addPathGenerator?.(levyPathName, async (container) => {
|
|
6
8
|
const { LevyPathGenerator } = await import("./LevyPathGenerator.js");
|
|
7
9
|
return new LevyPathGenerator(container);
|
|
8
10
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/path-levy",
|
|
3
|
-
"version": "4.0.0-
|
|
3
|
+
"version": "4.0.0-beta.1",
|
|
4
4
|
"description": "tsParticles levy path",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -104,7 +104,8 @@
|
|
|
104
104
|
"./package.json": "./package.json"
|
|
105
105
|
},
|
|
106
106
|
"dependencies": {
|
|
107
|
-
"@tsparticles/engine": "4.0.0-
|
|
107
|
+
"@tsparticles/engine": "4.0.0-beta.1",
|
|
108
|
+
"@tsparticles/plugin-move": "4.0.0-beta.1"
|
|
108
109
|
},
|
|
109
110
|
"type": "module"
|
|
110
111
|
}
|