@tsparticles/move-base 3.4.0 → 3.6.0-beta.0
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/cjs/Utils.js +6 -7
- package/cjs/index.js +1 -2
- package/package.json +2 -2
- package/report.html +1 -1
- package/tsparticles.move.base.js +1 -1
- package/tsparticles.move.base.min.js +1 -1
- package/tsparticles.move.base.min.js.LICENSE.txt +1 -1
- package/umd/Utils.js +6 -7
- package/umd/index.js +1 -2
package/cjs/Utils.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.applyDistance = applyDistance;
|
|
4
|
+
exports.move = move;
|
|
5
|
+
exports.spin = spin;
|
|
6
|
+
exports.applyPath = applyPath;
|
|
7
|
+
exports.getProximitySpeedFactor = getProximitySpeedFactor;
|
|
8
|
+
exports.initSpin = initSpin;
|
|
4
9
|
const engine_1 = require("@tsparticles/engine");
|
|
5
10
|
const half = 0.5, minVelocity = 0, identity = 1, moveSpeedFactor = 60, minSpinRadius = 0, spinFactor = 0.01;
|
|
6
11
|
function applyDistance(particle) {
|
|
@@ -33,7 +38,6 @@ function applyDistance(particle) {
|
|
|
33
38
|
}
|
|
34
39
|
}
|
|
35
40
|
}
|
|
36
|
-
exports.applyDistance = applyDistance;
|
|
37
41
|
function move(particle, moveOptions, moveSpeed, maxSpeed, moveDrift, delta) {
|
|
38
42
|
applyPath(particle, delta);
|
|
39
43
|
const gravityOptions = particle.gravity, gravityFactor = gravityOptions?.enable && gravityOptions.inverse ? -identity : identity;
|
|
@@ -65,7 +69,6 @@ function move(particle, moveOptions, moveSpeed, maxSpeed, moveDrift, delta) {
|
|
|
65
69
|
position.y += Math.cos(position.y * Math.sin(position.x));
|
|
66
70
|
}
|
|
67
71
|
}
|
|
68
|
-
exports.move = move;
|
|
69
72
|
function spin(particle, moveSpeed) {
|
|
70
73
|
const container = particle.container;
|
|
71
74
|
if (!particle.spin) {
|
|
@@ -89,7 +92,6 @@ function spin(particle, moveSpeed) {
|
|
|
89
92
|
}
|
|
90
93
|
particle.spin.angle += moveSpeed * spinFactor * (identity - particle.spin.radius / maxCanvasSize);
|
|
91
94
|
}
|
|
92
|
-
exports.spin = spin;
|
|
93
95
|
function applyPath(particle, delta) {
|
|
94
96
|
const particlesOptions = particle.options, pathOptions = particlesOptions.move.path, pathEnabled = pathOptions.enable;
|
|
95
97
|
if (!pathEnabled) {
|
|
@@ -109,11 +111,9 @@ function applyPath(particle, delta) {
|
|
|
109
111
|
}
|
|
110
112
|
particle.lastPathTime -= particle.pathDelay;
|
|
111
113
|
}
|
|
112
|
-
exports.applyPath = applyPath;
|
|
113
114
|
function getProximitySpeedFactor(particle) {
|
|
114
115
|
return particle.slow.inRange ? particle.slow.factor : identity;
|
|
115
116
|
}
|
|
116
|
-
exports.getProximitySpeedFactor = getProximitySpeedFactor;
|
|
117
117
|
function initSpin(particle) {
|
|
118
118
|
const container = particle.container, options = particle.options, spinOptions = options.move.spin;
|
|
119
119
|
if (!spinOptions.enable) {
|
|
@@ -133,4 +133,3 @@ function initSpin(particle) {
|
|
|
133
133
|
acceleration: particle.retina.spinAcceleration,
|
|
134
134
|
};
|
|
135
135
|
}
|
|
136
|
-
exports.initSpin = initSpin;
|
package/cjs/index.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.loadBaseMover =
|
|
3
|
+
exports.loadBaseMover = loadBaseMover;
|
|
4
4
|
const BaseMover_js_1 = require("./BaseMover.js");
|
|
5
5
|
async function loadBaseMover(engine, refresh = true) {
|
|
6
6
|
await engine.addMover("base", () => {
|
|
7
7
|
return Promise.resolve(new BaseMover_js_1.BaseMover());
|
|
8
8
|
}, refresh);
|
|
9
9
|
}
|
|
10
|
-
exports.loadBaseMover = loadBaseMover;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/move-base",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.0-beta.0",
|
|
4
4
|
"description": "tsParticles Base movement",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"./package.json": "./package.json"
|
|
88
88
|
},
|
|
89
89
|
"dependencies": {
|
|
90
|
-
"@tsparticles/engine": "^3.
|
|
90
|
+
"@tsparticles/engine": "^3.6.0-beta.0"
|
|
91
91
|
},
|
|
92
92
|
"publishConfig": {
|
|
93
93
|
"access": "public"
|
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/move-base [
|
|
6
|
+
<title>@tsparticles/move-base [7 Oct 2024 at 10:33]</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/zX6PSjyeaCtd1YnNGX2Pu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8EUBWJIn9zYcoAWWlW9+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>
|
package/tsparticles.move.base.js
CHANGED
|
@@ -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
|
-
* v3.
|
|
7
|
+
* v3.6.0-beta.0
|
|
8
8
|
*/
|
|
9
9
|
/*
|
|
10
10
|
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see tsparticles.move.base.min.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine"],t);else{var i="object"==typeof exports?t(require("@tsparticles/engine")):t(e.window);for(var n in i)("object"==typeof exports?exports:e)[n]=i[n]}}(this,(e=>(()=>{var t={303:t=>{t.exports=e}},i={};function n(e){var o=i[e];if(void 0!==o)return o.exports;var a=i[e]={exports:{}};return t[e](a,a.exports,n),a.exports}n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};
|
|
2
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine"],t);else{var i="object"==typeof exports?t(require("@tsparticles/engine")):t(e.window);for(var n in i)("object"==typeof exports?exports:e)[n]=i[n]}}(this,(e=>(()=>{var t={303:t=>{t.exports=e}},i={};function n(e){var o=i[e];if(void 0!==o)return o.exports;var a=i[e]={exports:{}};return t[e](a,a.exports,n),a.exports}n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};n.r(o),n.d(o,{loadBaseMover:()=>l});var a=n(303);const s=1;function r(e,t,i,n,o,r){!function(e,t){const i=e.options,n=i.move.path;if(!n.enable)return;if(e.lastPathTime<=e.pathDelay)return void(e.lastPathTime+=t.value);const o=e.pathGenerator?.generate(e,t);o&&e.velocity.addTo(o);n.clamp&&(e.velocity.x=(0,a.clamp)(e.velocity.x,-s,s),e.velocity.y=(0,a.clamp)(e.velocity.y,-s,s));e.lastPathTime-=e.pathDelay}(e,r);const c=e.gravity,l=c?.enable&&c.inverse?-s:s;o&&i&&(e.velocity.x+=o*r.factor/(60*i)),c?.enable&&i&&(e.velocity.y+=l*(c.acceleration*r.factor)/(60*i));const p=e.moveDecay;e.velocity.multTo(p);const y=e.velocity.mult(i);c?.enable&&n>0&&(!c.inverse&&y.y>=0&&y.y>=n||c.inverse&&y.y<=0&&y.y<=-n)&&(y.y=l*n,i&&(e.velocity.y=y.y/i));const v=e.options.zIndex,d=(s-e.zIndexFactor)**v.velocityRate;y.multTo(d);const{position:u}=e;u.addTo(y),t.vibrate&&(u.x+=Math.sin(u.x*Math.cos(u.y)),u.y+=Math.cos(u.y*Math.sin(u.x)))}class c{init(e){const t=e.options.move.gravity;e.gravity={enable:t.enable,acceleration:(0,a.getRangeValue)(t.acceleration),inverse:t.inverse},function(e){const t=e.container,i=e.options.move.spin;if(!i.enable)return;const n=i.position??{x:50,y:50},o={x:.01*n.x*t.canvas.size.width,y:.01*n.y*t.canvas.size.height},s=e.getPosition(),r=(0,a.getDistance)(s,o),c=(0,a.getRangeValue)(i.acceleration);e.retina.spinAcceleration=c*t.retina.pixelRatio,e.spin={center:o,direction:e.velocity.x>=0?a.RotateDirection.clockwise:a.RotateDirection.counterClockwise,angle:e.velocity.angle,radius:r,acceleration:e.retina.spinAcceleration}}(e)}isEnabled(e){return!e.destroyed&&e.options.move.enable}move(e,t){const i=e.options,n=i.move;if(!n.enable)return;const o=e.container,c=o.retina.pixelRatio;e.retina.moveSpeed??=(0,a.getRangeValue)(n.speed)*c,e.retina.moveDrift??=(0,a.getRangeValue)(e.options.move.drift)*c;const l=function(e){return e.slow.inRange?e.slow.factor:s}(e),p=e.retina.moveSpeed*o.retina.reduceFactor,y=e.retina.moveDrift,v=(0,a.getRangeMax)(i.size.value)*c,d=p*(n.size?e.getRadius()/v:1)*l*(t.factor||1)/2,u=e.retina.maxSpeed??o.retina.maxSpeed;n.spin.enable?function(e,t){const i=e.container;if(!e.spin)return;const n={x:e.spin.direction===a.RotateDirection.clockwise?Math.cos:Math.sin,y:e.spin.direction===a.RotateDirection.clockwise?Math.sin:Math.cos};e.position.x=e.spin.center.x+e.spin.radius*n.x(e.spin.angle),e.position.y=e.spin.center.y+e.spin.radius*n.y(e.spin.angle),e.spin.radius+=e.spin.acceleration;const o=Math.max(i.canvas.size.width,i.canvas.size.height),r=.5*o;e.spin.radius>r?(e.spin.radius=r,e.spin.acceleration*=-s):e.spin.radius<0&&(e.spin.radius=0,e.spin.acceleration*=-s),e.spin.angle+=.01*t*(s-e.spin.radius/o)}(e,d):r(e,n,d,u,y,t),function(e){const t=e.initialPosition,{dx:i,dy:n}=(0,a.getDistances)(t,e.position),o=Math.abs(i),s=Math.abs(n),{maxDistance:r}=e.retina,c=r.horizontal,l=r.vertical;if(!c&&!l)return;if((c&&o>=c||l&&s>=l)&&!e.misplaced)e.misplaced=!!c&&o>c||!!l&&s>l,c&&(e.velocity.x=.5*e.velocity.y-e.velocity.x),l&&(e.velocity.y=.5*e.velocity.x-e.velocity.y);else if((!c||o<c)&&(!l||s<l)&&e.misplaced)e.misplaced=!1;else if(e.misplaced){const i=e.position,n=e.velocity;c&&(i.x<t.x&&n.x<0||i.x>t.x&&n.x>0)&&(n.x*=-(0,a.getRandom)()),l&&(i.y<t.y&&n.y<0||i.y>t.y&&n.y>0)&&(n.y*=-(0,a.getRandom)())}}(e)}}async function l(e,t=!0){await e.addMover("base",(()=>Promise.resolve(new c)),t)}return o})()));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! tsParticles Base Move v3.
|
|
1
|
+
/*! tsParticles Base Move v3.6.0-beta.0 by Matteo Bruni */
|
package/umd/Utils.js
CHANGED
|
@@ -9,7 +9,12 @@
|
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.applyDistance = applyDistance;
|
|
13
|
+
exports.move = move;
|
|
14
|
+
exports.spin = spin;
|
|
15
|
+
exports.applyPath = applyPath;
|
|
16
|
+
exports.getProximitySpeedFactor = getProximitySpeedFactor;
|
|
17
|
+
exports.initSpin = initSpin;
|
|
13
18
|
const engine_1 = require("@tsparticles/engine");
|
|
14
19
|
const half = 0.5, minVelocity = 0, identity = 1, moveSpeedFactor = 60, minSpinRadius = 0, spinFactor = 0.01;
|
|
15
20
|
function applyDistance(particle) {
|
|
@@ -42,7 +47,6 @@
|
|
|
42
47
|
}
|
|
43
48
|
}
|
|
44
49
|
}
|
|
45
|
-
exports.applyDistance = applyDistance;
|
|
46
50
|
function move(particle, moveOptions, moveSpeed, maxSpeed, moveDrift, delta) {
|
|
47
51
|
applyPath(particle, delta);
|
|
48
52
|
const gravityOptions = particle.gravity, gravityFactor = gravityOptions?.enable && gravityOptions.inverse ? -identity : identity;
|
|
@@ -74,7 +78,6 @@
|
|
|
74
78
|
position.y += Math.cos(position.y * Math.sin(position.x));
|
|
75
79
|
}
|
|
76
80
|
}
|
|
77
|
-
exports.move = move;
|
|
78
81
|
function spin(particle, moveSpeed) {
|
|
79
82
|
const container = particle.container;
|
|
80
83
|
if (!particle.spin) {
|
|
@@ -98,7 +101,6 @@
|
|
|
98
101
|
}
|
|
99
102
|
particle.spin.angle += moveSpeed * spinFactor * (identity - particle.spin.radius / maxCanvasSize);
|
|
100
103
|
}
|
|
101
|
-
exports.spin = spin;
|
|
102
104
|
function applyPath(particle, delta) {
|
|
103
105
|
const particlesOptions = particle.options, pathOptions = particlesOptions.move.path, pathEnabled = pathOptions.enable;
|
|
104
106
|
if (!pathEnabled) {
|
|
@@ -118,11 +120,9 @@
|
|
|
118
120
|
}
|
|
119
121
|
particle.lastPathTime -= particle.pathDelay;
|
|
120
122
|
}
|
|
121
|
-
exports.applyPath = applyPath;
|
|
122
123
|
function getProximitySpeedFactor(particle) {
|
|
123
124
|
return particle.slow.inRange ? particle.slow.factor : identity;
|
|
124
125
|
}
|
|
125
|
-
exports.getProximitySpeedFactor = getProximitySpeedFactor;
|
|
126
126
|
function initSpin(particle) {
|
|
127
127
|
const container = particle.container, options = particle.options, spinOptions = options.move.spin;
|
|
128
128
|
if (!spinOptions.enable) {
|
|
@@ -142,5 +142,4 @@
|
|
|
142
142
|
acceleration: particle.retina.spinAcceleration,
|
|
143
143
|
};
|
|
144
144
|
}
|
|
145
|
-
exports.initSpin = initSpin;
|
|
146
145
|
});
|
package/umd/index.js
CHANGED
|
@@ -9,12 +9,11 @@
|
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.loadBaseMover =
|
|
12
|
+
exports.loadBaseMover = loadBaseMover;
|
|
13
13
|
const BaseMover_js_1 = require("./BaseMover.js");
|
|
14
14
|
async function loadBaseMover(engine, refresh = true) {
|
|
15
15
|
await engine.addMover("base", () => {
|
|
16
16
|
return Promise.resolve(new BaseMover_js_1.BaseMover());
|
|
17
17
|
}, refresh);
|
|
18
18
|
}
|
|
19
|
-
exports.loadBaseMover = loadBaseMover;
|
|
20
19
|
});
|