@tsparticles/updater-out-modes 4.0.0-alpha.25 → 4.0.0-alpha.26
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/710.min.js +1 -0
- package/browser/DestroyOutMode.js +2 -2
- package/browser/NoneOutMode.js +2 -2
- package/browser/OutOutMode.js +9 -8
- package/browser/index.js +1 -1
- package/cjs/DestroyOutMode.js +2 -2
- package/cjs/NoneOutMode.js +2 -2
- package/cjs/OutOutMode.js +9 -8
- package/cjs/index.js +1 -1
- package/dist_browser_OutOfCanvasUpdater_js.js +4 -4
- package/esm/DestroyOutMode.js +2 -2
- package/esm/NoneOutMode.js +2 -2
- package/esm/OutOutMode.js +9 -8
- package/esm/index.js +1 -1
- package/package.json +2 -2
- package/report.html +1 -1
- package/tsparticles.updater.out-modes.js +2 -2
- package/tsparticles.updater.out-modes.min.js +1 -1
- package/umd/DestroyOutMode.js +1 -1
- package/umd/NoneOutMode.js +1 -1
- package/umd/OutOutMode.js +8 -7
- package/umd/index.js +1 -1
- package/408.min.js +0 -1
package/710.min.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(this.webpackChunk_tsparticles_updater_out_modes=this.webpackChunk_tsparticles_updater_out_modes||[]).push([[710],{710(t,i,e){e.d(i,{OutOfCanvasUpdater:()=>u});var o=e(303);class n{container;modes;_particleBouncePlugins;constructor(t){this.container=t,this.modes=[o.OutMode.bounce,o.OutMode.split],this._particleBouncePlugins=t.plugins.filter(t=>void 0!==t.particleBounce)}update(t,i,e,n){if(!this.modes.includes(n))return;let s=this.container,r=!1;for(let o of this._particleBouncePlugins)if(r=o.particleBounce?.(t,e,i)??!1)break;if(r)return;let a=t.getPosition(),d=t.offset,u=t.getRadius(),c=(0,o.calculateBounds)(a,u),l=s.canvas.size;!function(t){if(t.outMode!==o.OutMode.bounce&&t.outMode!==o.OutMode.split||t.direction!==o.OutModeDirection.left&&t.direction!==o.OutModeDirection.right)return;t.bounds.right<0&&t.direction===o.OutModeDirection.left?t.particle.position.x=t.size+t.offset.x:t.bounds.left>t.canvasSize.width&&t.direction===o.OutModeDirection.right&&(t.particle.position.x=t.canvasSize.width-t.size-t.offset.x);let i=t.particle.velocity.x,e=!1;if(t.direction===o.OutModeDirection.right&&t.bounds.right>=t.canvasSize.width&&i>0||t.direction===o.OutModeDirection.left&&t.bounds.left<=0&&i<0){let i=(0,o.getRangeValue)(t.particle.options.bounce.horizontal.value);t.particle.velocity.x*=-i,e=!0}if(!e)return;let n=t.offset.x+t.size;t.bounds.right>=t.canvasSize.width&&t.direction===o.OutModeDirection.right?t.particle.position.x=t.canvasSize.width-n:t.bounds.left<=0&&t.direction===o.OutModeDirection.left&&(t.particle.position.x=n),t.outMode===o.OutMode.split&&t.particle.destroy()}({particle:t,outMode:n,direction:i,bounds:c,canvasSize:l,offset:d,size:u}),function(t){if(t.outMode!==o.OutMode.bounce&&t.outMode!==o.OutMode.split||t.direction!==o.OutModeDirection.bottom&&t.direction!==o.OutModeDirection.top)return;t.bounds.bottom<0&&t.direction===o.OutModeDirection.top?t.particle.position.y=t.size+t.offset.y:t.bounds.top>t.canvasSize.height&&t.direction===o.OutModeDirection.bottom&&(t.particle.position.y=t.canvasSize.height-t.size-t.offset.y);let i=t.particle.velocity.y,e=!1;if(t.direction===o.OutModeDirection.bottom&&t.bounds.bottom>=t.canvasSize.height&&i>0||t.direction===o.OutModeDirection.top&&t.bounds.top<=0&&i<0){let i=(0,o.getRangeValue)(t.particle.options.bounce.vertical.value);t.particle.velocity.y*=-i,e=!0}if(!e)return;let n=t.offset.y+t.size;t.bounds.bottom>=t.canvasSize.height&&t.direction===o.OutModeDirection.bottom?t.particle.position.y=t.canvasSize.height-n:t.bounds.top<=0&&t.direction===o.OutModeDirection.top&&(t.particle.position.y=n),t.outMode===o.OutMode.split&&t.particle.destroy()}({particle:t,outMode:n,direction:i,bounds:c,canvasSize:l,offset:d,size:u})}}class s{container;modes;constructor(t){this.container=t,this.modes=[o.OutMode.destroy]}update(t,i,e,n){if(!this.modes.includes(n))return;let s=this.container;switch(t.outType){case o.ParticleOutType.normal:case o.ParticleOutType.outside:if((0,o.isPointInside)(t.position,s.canvas.size,o.originPoint,t.getRadius(),i))return;break;case o.ParticleOutType.inside:{let{dx:i,dy:e}=(0,o.getDistances)(t.position,t.moveCenter),{x:n,y:s}=t.velocity;if(n<0&&i>t.moveCenter.radius||s<0&&e>t.moveCenter.radius||n>=0&&i<-t.moveCenter.radius||s>=0&&e<-t.moveCenter.radius)return}}s.particles.remove(t,t.group,!0)}}class r{container;modes;constructor(t){this.container=t,this.modes=[o.OutMode.none]}update(t,i,e,n){if(!this.modes.includes(n)||((t.options.move.distance.horizontal&&(i===o.OutModeDirection.left||i===o.OutModeDirection.right))??(t.options.move.distance.vertical&&(i===o.OutModeDirection.top||i===o.OutModeDirection.bottom))))return;let s=t.options.move.gravity,r=this.container,a=r.canvas.size,d=t.getRadius();if(s.enable){let e=t.position;(!s.inverse&&e.y>a.height+d&&i===o.OutModeDirection.bottom||s.inverse&&e.y<-d&&i===o.OutModeDirection.top)&&r.particles.remove(t)}else{if(t.velocity.y>0&&t.position.y<=a.height+d||t.velocity.y<0&&t.position.y>=-d||t.velocity.x>0&&t.position.x<=a.width+d||t.velocity.x<0&&t.position.x>=-d)return;(0,o.isPointInside)(t.position,r.canvas.size,o.originPoint,d,i)||r.particles.remove(t)}}}let a=o.Vector.origin;class d{container;modes;constructor(t){this.container=t,this.modes=[o.OutMode.out]}update(t,i,e,n){if(!this.modes.includes(n))return;let s=this.container;if(t.outType===o.ParticleOutType.inside){let{x:i,y:e}=t.velocity;a.setTo(o.originPoint),a.length=t.moveCenter.radius,a.angle=t.velocity.angle+Math.PI,a.addTo(t.moveCenter);let{dx:n,dy:r}=(0,o.getDistances)(t.position,a);if(i<=0&&n>=0||e<=0&&r>=0||i>=0&&n<=0||e>=0&&r<=0)return;t.position.x=Math.floor((0,o.randomInRangeValue)({min:0,max:s.canvas.size.width})),t.position.y=Math.floor((0,o.randomInRangeValue)({min:0,max:s.canvas.size.height}));let{dx:d,dy:u}=(0,o.getDistances)(t.position,t.moveCenter);t.direction=Math.atan2(-u,-d),t.velocity.angle=t.direction}else{if((0,o.isPointInside)(t.position,s.canvas.size,o.originPoint,t.getRadius(),i))return;switch(t.outType){case o.ParticleOutType.outside:{t.position.x=Math.floor((0,o.randomInRangeValue)({min:-t.moveCenter.radius,max:t.moveCenter.radius}))+t.moveCenter.x,t.position.y=Math.floor((0,o.randomInRangeValue)({min:-t.moveCenter.radius,max:t.moveCenter.radius}))+t.moveCenter.y;let{dx:i,dy:e}=(0,o.getDistances)(t.position,t.moveCenter);t.moveCenter.radius&&(t.direction=Math.atan2(e,i),t.velocity.angle=t.direction);break}case o.ParticleOutType.normal:{let e=t.options.move.warp,n=s.canvas.size,r={bottom:n.height+t.getRadius()+t.offset.y,left:-t.getRadius()-t.offset.x,right:n.width+t.getRadius()+t.offset.x,top:-t.getRadius()-t.offset.y},a=t.getRadius(),d=(0,o.calculateBounds)(t.position,a);i===o.OutModeDirection.right&&d.left>n.width+t.offset.x?(t.position.x=r.left,t.initialPosition.x=t.position.x,e||(t.position.y=(0,o.getRandom)()*n.height,t.initialPosition.y=t.position.y)):i===o.OutModeDirection.left&&d.right<-t.offset.x&&(t.position.x=r.right,t.initialPosition.x=t.position.x,e||(t.position.y=(0,o.getRandom)()*n.height,t.initialPosition.y=t.position.y)),i===o.OutModeDirection.bottom&&d.top>n.height+t.offset.y?(e||(t.position.x=(0,o.getRandom)()*n.width,t.initialPosition.x=t.position.x),t.position.y=r.top,t.initialPosition.y=t.position.y):i===o.OutModeDirection.top&&d.bottom<-t.offset.y&&(e||(t.position.x=(0,o.getRandom)()*n.width,t.initialPosition.x=t.position.x),t.position.y=r.bottom,t.initialPosition.y=t.position.y)}}}}}class u{updaters;container;constructor(t){this.container=t,this.updaters=new Map}init(t){this._addUpdaterIfMissing(t,o.OutMode.bounce,t=>new n(t)),this._addUpdaterIfMissing(t,o.OutMode.out,t=>new d(t)),this._addUpdaterIfMissing(t,o.OutMode.destroy,t=>new s(t)),this._addUpdaterIfMissing(t,o.OutMode.none,t=>new r(t))}isEnabled(t){return!t.destroyed&&!t.spawning}update(t,i){let e=t.options.move.outModes;this._updateOutMode(t,i,e.bottom??e.default,o.OutModeDirection.bottom),this._updateOutMode(t,i,e.left??e.default,o.OutModeDirection.left),this._updateOutMode(t,i,e.right??e.default,o.OutModeDirection.right),this._updateOutMode(t,i,e.top??e.default,o.OutModeDirection.top)}_addUpdaterIfMissing=(t,i,e)=>{let o=t.options.move.outModes;this.updaters.has(i)||o.default!==i&&o.bottom!==i&&o.left!==i&&o.right!==i&&o.top!==i||this.updaters.set(i,e(this.container))};_updateOutMode=(t,i,e,o)=>{for(let n of this.updaters.values())n.update(t,o,i,e)}}}}]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OutMode, ParticleOutType,
|
|
1
|
+
import { OutMode, ParticleOutType, getDistances, isPointInside, originPoint, } from "@tsparticles/engine";
|
|
2
2
|
const minVelocity = 0;
|
|
3
3
|
export class DestroyOutMode {
|
|
4
4
|
container;
|
|
@@ -15,7 +15,7 @@ export class DestroyOutMode {
|
|
|
15
15
|
switch (particle.outType) {
|
|
16
16
|
case ParticleOutType.normal:
|
|
17
17
|
case ParticleOutType.outside:
|
|
18
|
-
if (isPointInside(particle.position, container.canvas.size,
|
|
18
|
+
if (isPointInside(particle.position, container.canvas.size, originPoint, particle.getRadius(), direction)) {
|
|
19
19
|
return;
|
|
20
20
|
}
|
|
21
21
|
break;
|
package/browser/NoneOutMode.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OutMode, OutModeDirection,
|
|
1
|
+
import { OutMode, OutModeDirection, isPointInside, originPoint, } from "@tsparticles/engine";
|
|
2
2
|
const minVelocity = 0;
|
|
3
3
|
export class NoneOutMode {
|
|
4
4
|
container;
|
|
@@ -25,7 +25,7 @@ export class NoneOutMode {
|
|
|
25
25
|
(particle.velocity.x < minVelocity && particle.position.x >= -pRadius)) {
|
|
26
26
|
return;
|
|
27
27
|
}
|
|
28
|
-
if (!isPointInside(particle.position, container.canvas.size,
|
|
28
|
+
if (!isPointInside(particle.position, container.canvas.size, originPoint, pRadius, direction)) {
|
|
29
29
|
container.particles.remove(particle);
|
|
30
30
|
}
|
|
31
31
|
}
|
package/browser/OutOutMode.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { OutMode, OutModeDirection, ParticleOutType, Vector, calculateBounds, getDistances, getRandom, isPointInside, randomInRangeValue, } from "@tsparticles/engine";
|
|
2
|
-
const minVelocity = 0, minDistance = 0;
|
|
1
|
+
import { OutMode, OutModeDirection, ParticleOutType, Vector, calculateBounds, getDistances, getRandom, isPointInside, originPoint, randomInRangeValue, } from "@tsparticles/engine";
|
|
2
|
+
const minVelocity = 0, minDistance = 0, updateVector = Vector.origin;
|
|
3
3
|
export class OutOutMode {
|
|
4
4
|
container;
|
|
5
5
|
modes;
|
|
@@ -14,11 +14,12 @@ export class OutOutMode {
|
|
|
14
14
|
const container = this.container;
|
|
15
15
|
switch (particle.outType) {
|
|
16
16
|
case ParticleOutType.inside: {
|
|
17
|
-
const { x: vx, y: vy } = particle.velocity
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
const { x: vx, y: vy } = particle.velocity;
|
|
18
|
+
updateVector.setTo(originPoint);
|
|
19
|
+
updateVector.length = particle.moveCenter.radius;
|
|
20
|
+
updateVector.angle = particle.velocity.angle + Math.PI;
|
|
21
|
+
updateVector.addTo(particle.moveCenter);
|
|
22
|
+
const { dx, dy } = getDistances(particle.position, updateVector);
|
|
22
23
|
if ((vx <= minVelocity && dx >= minDistance) ||
|
|
23
24
|
(vy <= minVelocity && dy >= minDistance) ||
|
|
24
25
|
(vx >= minVelocity && dx <= minDistance) ||
|
|
@@ -39,7 +40,7 @@ export class OutOutMode {
|
|
|
39
40
|
break;
|
|
40
41
|
}
|
|
41
42
|
default: {
|
|
42
|
-
if (isPointInside(particle.position, container.canvas.size,
|
|
43
|
+
if (isPointInside(particle.position, container.canvas.size, originPoint, particle.getRadius(), direction)) {
|
|
43
44
|
return;
|
|
44
45
|
}
|
|
45
46
|
switch (particle.outType) {
|
package/browser/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadOutModesUpdater(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-alpha.
|
|
2
|
+
engine.checkVersion("4.0.0-alpha.26");
|
|
3
3
|
await engine.register(e => {
|
|
4
4
|
e.addParticleUpdater("outModes", async (container) => {
|
|
5
5
|
const { OutOfCanvasUpdater } = await import("./OutOfCanvasUpdater.js");
|
package/cjs/DestroyOutMode.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OutMode, ParticleOutType,
|
|
1
|
+
import { OutMode, ParticleOutType, getDistances, isPointInside, originPoint, } from "@tsparticles/engine";
|
|
2
2
|
const minVelocity = 0;
|
|
3
3
|
export class DestroyOutMode {
|
|
4
4
|
container;
|
|
@@ -15,7 +15,7 @@ export class DestroyOutMode {
|
|
|
15
15
|
switch (particle.outType) {
|
|
16
16
|
case ParticleOutType.normal:
|
|
17
17
|
case ParticleOutType.outside:
|
|
18
|
-
if (isPointInside(particle.position, container.canvas.size,
|
|
18
|
+
if (isPointInside(particle.position, container.canvas.size, originPoint, particle.getRadius(), direction)) {
|
|
19
19
|
return;
|
|
20
20
|
}
|
|
21
21
|
break;
|
package/cjs/NoneOutMode.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OutMode, OutModeDirection,
|
|
1
|
+
import { OutMode, OutModeDirection, isPointInside, originPoint, } from "@tsparticles/engine";
|
|
2
2
|
const minVelocity = 0;
|
|
3
3
|
export class NoneOutMode {
|
|
4
4
|
container;
|
|
@@ -25,7 +25,7 @@ export class NoneOutMode {
|
|
|
25
25
|
(particle.velocity.x < minVelocity && particle.position.x >= -pRadius)) {
|
|
26
26
|
return;
|
|
27
27
|
}
|
|
28
|
-
if (!isPointInside(particle.position, container.canvas.size,
|
|
28
|
+
if (!isPointInside(particle.position, container.canvas.size, originPoint, pRadius, direction)) {
|
|
29
29
|
container.particles.remove(particle);
|
|
30
30
|
}
|
|
31
31
|
}
|
package/cjs/OutOutMode.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { OutMode, OutModeDirection, ParticleOutType, Vector, calculateBounds, getDistances, getRandom, isPointInside, randomInRangeValue, } from "@tsparticles/engine";
|
|
2
|
-
const minVelocity = 0, minDistance = 0;
|
|
1
|
+
import { OutMode, OutModeDirection, ParticleOutType, Vector, calculateBounds, getDistances, getRandom, isPointInside, originPoint, randomInRangeValue, } from "@tsparticles/engine";
|
|
2
|
+
const minVelocity = 0, minDistance = 0, updateVector = Vector.origin;
|
|
3
3
|
export class OutOutMode {
|
|
4
4
|
container;
|
|
5
5
|
modes;
|
|
@@ -14,11 +14,12 @@ export class OutOutMode {
|
|
|
14
14
|
const container = this.container;
|
|
15
15
|
switch (particle.outType) {
|
|
16
16
|
case ParticleOutType.inside: {
|
|
17
|
-
const { x: vx, y: vy } = particle.velocity
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
const { x: vx, y: vy } = particle.velocity;
|
|
18
|
+
updateVector.setTo(originPoint);
|
|
19
|
+
updateVector.length = particle.moveCenter.radius;
|
|
20
|
+
updateVector.angle = particle.velocity.angle + Math.PI;
|
|
21
|
+
updateVector.addTo(particle.moveCenter);
|
|
22
|
+
const { dx, dy } = getDistances(particle.position, updateVector);
|
|
22
23
|
if ((vx <= minVelocity && dx >= minDistance) ||
|
|
23
24
|
(vy <= minVelocity && dy >= minDistance) ||
|
|
24
25
|
(vx >= minVelocity && dx <= minDistance) ||
|
|
@@ -39,7 +40,7 @@ export class OutOutMode {
|
|
|
39
40
|
break;
|
|
40
41
|
}
|
|
41
42
|
default: {
|
|
42
|
-
if (isPointInside(particle.position, container.canvas.size,
|
|
43
|
+
if (isPointInside(particle.position, container.canvas.size, originPoint, particle.getRadius(), direction)) {
|
|
43
44
|
return;
|
|
44
45
|
}
|
|
45
46
|
switch (particle.outType) {
|
package/cjs/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadOutModesUpdater(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-alpha.
|
|
2
|
+
engine.checkVersion("4.0.0-alpha.26");
|
|
3
3
|
await engine.register(e => {
|
|
4
4
|
e.addParticleUpdater("outModes", async (container) => {
|
|
5
5
|
const { OutOfCanvasUpdater } = await import("./OutOfCanvasUpdater.js");
|
|
@@ -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.26
|
|
8
8
|
*/
|
|
9
9
|
"use strict";
|
|
10
10
|
/*
|
|
@@ -33,7 +33,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
33
33
|
\****************************************/
|
|
34
34
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
35
35
|
|
|
36
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ DestroyOutMode: () => (/* binding */ DestroyOutMode)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nconst minVelocity = 0;\nclass DestroyOutMode {\n container;\n modes;\n constructor(container){\n this.container = container;\n this.modes = [\n _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OutMode.destroy\n ];\n }\n update(particle, direction, _delta, outMode) {\n if (!this.modes.includes(outMode)) {\n return;\n }\n const container = this.container;\n switch(particle.outType){\n case _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.ParticleOutType.normal:\n case _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.ParticleOutType.outside:\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isPointInside)(particle.position, container.canvas.size, _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.
|
|
36
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ DestroyOutMode: () => (/* binding */ DestroyOutMode)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nconst minVelocity = 0;\nclass DestroyOutMode {\n container;\n modes;\n constructor(container){\n this.container = container;\n this.modes = [\n _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OutMode.destroy\n ];\n }\n update(particle, direction, _delta, outMode) {\n if (!this.modes.includes(outMode)) {\n return;\n }\n const container = this.container;\n switch(particle.outType){\n case _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.ParticleOutType.normal:\n case _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.ParticleOutType.outside:\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isPointInside)(particle.position, container.canvas.size, _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.originPoint, particle.getRadius(), direction)) {\n return;\n }\n break;\n case _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.ParticleOutType.inside:\n {\n const { dx, dy } = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getDistances)(particle.position, particle.moveCenter), { x: vx, y: vy } = particle.velocity;\n if (vx < minVelocity && dx > particle.moveCenter.radius || vy < minVelocity && dy > particle.moveCenter.radius || vx >= minVelocity && dx < -particle.moveCenter.radius || vy >= minVelocity && dy < -particle.moveCenter.radius) {\n return;\n }\n break;\n }\n }\n container.particles.remove(particle, particle.group, true);\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/updater-out-modes/./dist/browser/DestroyOutMode.js?\n}");
|
|
37
37
|
|
|
38
38
|
/***/ },
|
|
39
39
|
|
|
@@ -43,7 +43,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
43
43
|
\*************************************/
|
|
44
44
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
45
45
|
|
|
46
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ NoneOutMode: () => (/* binding */ NoneOutMode)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nconst minVelocity = 0;\nclass NoneOutMode {\n container;\n modes;\n constructor(container){\n this.container = container;\n this.modes = [\n _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OutMode.none\n ];\n }\n update(particle, direction, _delta, outMode) {\n if (!this.modes.includes(outMode)) {\n return;\n }\n if ((particle.options.move.distance.horizontal && (direction === _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OutModeDirection.left || direction === _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OutModeDirection.right)) ?? (particle.options.move.distance.vertical && (direction === _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OutModeDirection.top || direction === _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OutModeDirection.bottom))) {\n return;\n }\n const gravityOptions = particle.options.move.gravity, container = this.container, canvasSize = container.canvas.size, pRadius = particle.getRadius();\n if (!gravityOptions.enable) {\n if (particle.velocity.y > minVelocity && particle.position.y <= canvasSize.height + pRadius || particle.velocity.y < minVelocity && particle.position.y >= -pRadius || particle.velocity.x > minVelocity && particle.position.x <= canvasSize.width + pRadius || particle.velocity.x < minVelocity && particle.position.x >= -pRadius) {\n return;\n }\n if (!(0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isPointInside)(particle.position, container.canvas.size, _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.
|
|
46
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ NoneOutMode: () => (/* binding */ NoneOutMode)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nconst minVelocity = 0;\nclass NoneOutMode {\n container;\n modes;\n constructor(container){\n this.container = container;\n this.modes = [\n _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OutMode.none\n ];\n }\n update(particle, direction, _delta, outMode) {\n if (!this.modes.includes(outMode)) {\n return;\n }\n if ((particle.options.move.distance.horizontal && (direction === _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OutModeDirection.left || direction === _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OutModeDirection.right)) ?? (particle.options.move.distance.vertical && (direction === _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OutModeDirection.top || direction === _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OutModeDirection.bottom))) {\n return;\n }\n const gravityOptions = particle.options.move.gravity, container = this.container, canvasSize = container.canvas.size, pRadius = particle.getRadius();\n if (!gravityOptions.enable) {\n if (particle.velocity.y > minVelocity && particle.position.y <= canvasSize.height + pRadius || particle.velocity.y < minVelocity && particle.position.y >= -pRadius || particle.velocity.x > minVelocity && particle.position.x <= canvasSize.width + pRadius || particle.velocity.x < minVelocity && particle.position.x >= -pRadius) {\n return;\n }\n if (!(0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isPointInside)(particle.position, container.canvas.size, _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.originPoint, pRadius, direction)) {\n container.particles.remove(particle);\n }\n } else {\n const position = particle.position;\n if (!gravityOptions.inverse && position.y > canvasSize.height + pRadius && direction === _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OutModeDirection.bottom || gravityOptions.inverse && position.y < -pRadius && direction === _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OutModeDirection.top) {\n container.particles.remove(particle);\n }\n }\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/updater-out-modes/./dist/browser/NoneOutMode.js?\n}");
|
|
47
47
|
|
|
48
48
|
/***/ },
|
|
49
49
|
|
|
@@ -63,7 +63,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
63
63
|
\************************************/
|
|
64
64
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
65
65
|
|
|
66
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ OutOutMode: () => (/* binding */ OutOutMode)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nconst minVelocity = 0, minDistance = 0;\nclass OutOutMode {\n container;\n modes;\n constructor(container){\n this.container = container;\n this.modes = [\n _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OutMode.out\n ];\n }\n update(particle, direction, _delta, outMode) {\n if (!this.modes.includes(outMode)) {\n return;\n }\n const container = this.container;\n switch(particle.outType){\n case _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.ParticleOutType.inside:\n {\n const { x: vx, y: vy } = particle.velocity
|
|
66
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ OutOutMode: () => (/* binding */ OutOutMode)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nconst minVelocity = 0, minDistance = 0, updateVector = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.Vector.origin;\nclass OutOutMode {\n container;\n modes;\n constructor(container){\n this.container = container;\n this.modes = [\n _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OutMode.out\n ];\n }\n update(particle, direction, _delta, outMode) {\n if (!this.modes.includes(outMode)) {\n return;\n }\n const container = this.container;\n switch(particle.outType){\n case _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.ParticleOutType.inside:\n {\n const { x: vx, y: vy } = particle.velocity;\n updateVector.setTo(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.originPoint);\n updateVector.length = particle.moveCenter.radius;\n updateVector.angle = particle.velocity.angle + Math.PI;\n updateVector.addTo(particle.moveCenter);\n const { dx, dy } = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getDistances)(particle.position, updateVector);\n if (vx <= minVelocity && dx >= minDistance || vy <= minVelocity && dy >= minDistance || vx >= minVelocity && dx <= minDistance || vy >= minVelocity && dy <= minDistance) {\n return;\n }\n particle.position.x = Math.floor((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.randomInRangeValue)({\n min: 0,\n max: container.canvas.size.width\n }));\n particle.position.y = Math.floor((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.randomInRangeValue)({\n min: 0,\n max: container.canvas.size.height\n }));\n const { dx: newDx, dy: newDy } = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getDistances)(particle.position, particle.moveCenter);\n particle.direction = Math.atan2(-newDy, -newDx);\n particle.velocity.angle = particle.direction;\n break;\n }\n default:\n {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isPointInside)(particle.position, container.canvas.size, _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.originPoint, particle.getRadius(), direction)) {\n return;\n }\n switch(particle.outType){\n case _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.ParticleOutType.outside:\n {\n particle.position.x = Math.floor((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.randomInRangeValue)({\n min: -particle.moveCenter.radius,\n max: particle.moveCenter.radius\n })) + particle.moveCenter.x;\n particle.position.y = Math.floor((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.randomInRangeValue)({\n min: -particle.moveCenter.radius,\n max: particle.moveCenter.radius\n })) + particle.moveCenter.y;\n const { dx, dy } = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getDistances)(particle.position, particle.moveCenter);\n if (particle.moveCenter.radius) {\n particle.direction = Math.atan2(dy, dx);\n particle.velocity.angle = particle.direction;\n }\n break;\n }\n case _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.ParticleOutType.normal:\n {\n const warp = particle.options.move.warp, canvasSize = container.canvas.size, newPos = {\n bottom: canvasSize.height + particle.getRadius() + particle.offset.y,\n left: -particle.getRadius() - particle.offset.x,\n right: canvasSize.width + particle.getRadius() + particle.offset.x,\n top: -particle.getRadius() - particle.offset.y\n }, sizeValue = particle.getRadius(), nextBounds = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.calculateBounds)(particle.position, sizeValue);\n if (direction === _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OutModeDirection.right && nextBounds.left > canvasSize.width + particle.offset.x) {\n particle.position.x = newPos.left;\n particle.initialPosition.x = particle.position.x;\n if (!warp) {\n particle.position.y = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRandom)() * canvasSize.height;\n particle.initialPosition.y = particle.position.y;\n }\n } else if (direction === _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OutModeDirection.left && nextBounds.right < -particle.offset.x) {\n particle.position.x = newPos.right;\n particle.initialPosition.x = particle.position.x;\n if (!warp) {\n particle.position.y = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRandom)() * canvasSize.height;\n particle.initialPosition.y = particle.position.y;\n }\n }\n if (direction === _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OutModeDirection.bottom && nextBounds.top > canvasSize.height + particle.offset.y) {\n if (!warp) {\n particle.position.x = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRandom)() * canvasSize.width;\n particle.initialPosition.x = particle.position.x;\n }\n particle.position.y = newPos.top;\n particle.initialPosition.y = particle.position.y;\n } else if (direction === _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OutModeDirection.top && nextBounds.bottom < -particle.offset.y) {\n if (!warp) {\n particle.position.x = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRandom)() * canvasSize.width;\n particle.initialPosition.x = particle.position.x;\n }\n particle.position.y = newPos.bottom;\n particle.initialPosition.y = particle.position.y;\n }\n break;\n }\n }\n break;\n }\n }\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/updater-out-modes/./dist/browser/OutOutMode.js?\n}");
|
|
67
67
|
|
|
68
68
|
/***/ },
|
|
69
69
|
|
package/esm/DestroyOutMode.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OutMode, ParticleOutType,
|
|
1
|
+
import { OutMode, ParticleOutType, getDistances, isPointInside, originPoint, } from "@tsparticles/engine";
|
|
2
2
|
const minVelocity = 0;
|
|
3
3
|
export class DestroyOutMode {
|
|
4
4
|
container;
|
|
@@ -15,7 +15,7 @@ export class DestroyOutMode {
|
|
|
15
15
|
switch (particle.outType) {
|
|
16
16
|
case ParticleOutType.normal:
|
|
17
17
|
case ParticleOutType.outside:
|
|
18
|
-
if (isPointInside(particle.position, container.canvas.size,
|
|
18
|
+
if (isPointInside(particle.position, container.canvas.size, originPoint, particle.getRadius(), direction)) {
|
|
19
19
|
return;
|
|
20
20
|
}
|
|
21
21
|
break;
|
package/esm/NoneOutMode.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OutMode, OutModeDirection,
|
|
1
|
+
import { OutMode, OutModeDirection, isPointInside, originPoint, } from "@tsparticles/engine";
|
|
2
2
|
const minVelocity = 0;
|
|
3
3
|
export class NoneOutMode {
|
|
4
4
|
container;
|
|
@@ -25,7 +25,7 @@ export class NoneOutMode {
|
|
|
25
25
|
(particle.velocity.x < minVelocity && particle.position.x >= -pRadius)) {
|
|
26
26
|
return;
|
|
27
27
|
}
|
|
28
|
-
if (!isPointInside(particle.position, container.canvas.size,
|
|
28
|
+
if (!isPointInside(particle.position, container.canvas.size, originPoint, pRadius, direction)) {
|
|
29
29
|
container.particles.remove(particle);
|
|
30
30
|
}
|
|
31
31
|
}
|
package/esm/OutOutMode.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { OutMode, OutModeDirection, ParticleOutType, Vector, calculateBounds, getDistances, getRandom, isPointInside, randomInRangeValue, } from "@tsparticles/engine";
|
|
2
|
-
const minVelocity = 0, minDistance = 0;
|
|
1
|
+
import { OutMode, OutModeDirection, ParticleOutType, Vector, calculateBounds, getDistances, getRandom, isPointInside, originPoint, randomInRangeValue, } from "@tsparticles/engine";
|
|
2
|
+
const minVelocity = 0, minDistance = 0, updateVector = Vector.origin;
|
|
3
3
|
export class OutOutMode {
|
|
4
4
|
container;
|
|
5
5
|
modes;
|
|
@@ -14,11 +14,12 @@ export class OutOutMode {
|
|
|
14
14
|
const container = this.container;
|
|
15
15
|
switch (particle.outType) {
|
|
16
16
|
case ParticleOutType.inside: {
|
|
17
|
-
const { x: vx, y: vy } = particle.velocity
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
const { x: vx, y: vy } = particle.velocity;
|
|
18
|
+
updateVector.setTo(originPoint);
|
|
19
|
+
updateVector.length = particle.moveCenter.radius;
|
|
20
|
+
updateVector.angle = particle.velocity.angle + Math.PI;
|
|
21
|
+
updateVector.addTo(particle.moveCenter);
|
|
22
|
+
const { dx, dy } = getDistances(particle.position, updateVector);
|
|
22
23
|
if ((vx <= minVelocity && dx >= minDistance) ||
|
|
23
24
|
(vy <= minVelocity && dy >= minDistance) ||
|
|
24
25
|
(vx >= minVelocity && dx <= minDistance) ||
|
|
@@ -39,7 +40,7 @@ export class OutOutMode {
|
|
|
39
40
|
break;
|
|
40
41
|
}
|
|
41
42
|
default: {
|
|
42
|
-
if (isPointInside(particle.position, container.canvas.size,
|
|
43
|
+
if (isPointInside(particle.position, container.canvas.size, originPoint, particle.getRadius(), direction)) {
|
|
43
44
|
return;
|
|
44
45
|
}
|
|
45
46
|
switch (particle.outType) {
|
package/esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadOutModesUpdater(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-alpha.
|
|
2
|
+
engine.checkVersion("4.0.0-alpha.26");
|
|
3
3
|
await engine.register(e => {
|
|
4
4
|
e.addParticleUpdater("outModes", async (container) => {
|
|
5
5
|
const { OutOfCanvasUpdater } = await import("./OutOfCanvasUpdater.js");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/updater-out-modes",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.26",
|
|
4
4
|
"description": "tsParticles particles out modes updater",
|
|
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": "4.0.0-alpha.
|
|
90
|
+
"@tsparticles/engine": "4.0.0-alpha.26"
|
|
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/updater-out-modes [
|
|
6
|
+
<title>@tsparticles/updater-out-modes [26 Feb 2026 at 18:04]</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/zX6PSjyeaCtd1YnNGX2PuQveCGt95Nls42h8dLlM3F4vBtAAAAM3RSTlMAAyOx0/sKBvik8opWGBMOAe3l1snDm2E9LSb06eHcu5JpHbarfHZCN9CBb08zzkdNS0kYaptYAAAFV0lEQVRYw92X51/aYBDHHS2O2qqttVbrqNq9m+TJIAYIShBkWwqIiCgoWvfeq7Z2/s29hyQNyUcR7LveGwVyXy6XH8/9rqxglLfUPLxVduUor3h0rfp2TYvpivk37929TkG037hffoX0+peVtZQc1589rigVUdXS/ABSAyEmGIO/1XfvldSK8vs3OqB6u3m0nxmIrvgB0dj7rr7Y9IbuF68hnfFaiHA/sxqm0wciIG43P60qKv9WXWc1RXGh/mFESFABTSBi0sNAKzqet17eCtOb3kZIDwxEEU0oAIJGYxNBDhBND29e0rtXXbcpuPmED9IhEAAQ/AXEaF8EPmnrrKsv0LvWR3fg5sWDNAFZOgAgaKvZDogHNU9MFwnnYROkc56RD5CjAbQX9Ow4g7upCsvYu55aSI/Nj0H1akgKQEUM94dwK65hYRmFU9MIcH/fqJYOZYcnuJSU/waKDgTOEVaVKhwrTRP5XzgSpAITYzom7UvkhFX5VutmxeNnWDjjswTKTyfgluNDGbUpWissXhF3s7mlSml+czWkg3D0l1nNjGNjz3myOQOa1KM/jOS6ebdbAVTCi4gljHSFrviza7tOgRWcS0MOUX9zdNgag5w7rRqA44Lzw0hr1WqES36dFliSJFlh2rXIae3FFcDDgKdxrUIDePr8jGcSClV1u7A9xeN0ModY/pHMxmR1EzRh8TJiwqsHmKW0l4FCEZI+jHio+JdPPE9qwQtTRxku2D8sIeRL2LnxWSllANCQGOIiqVHAz2ye2JR0DcH+HoxDkaADLjgxjKQ+AwCX/g0+DNgdG0ukYCONAe+dbc2IAc6fwt1ARoDSezNHxV2Cmzwv3O6lDMV55edBGwGK9n1+x2F8EDfAGCxug8MhpsMEcTEAWf3rx2vZhe/LAmtIn/6apE6PN0ULKgywD9mmdxbmFl3OvD5AS5fW5zLbv/YHmcsBTjf/afDz3MaZTVCfAP9z6/Bw6ycv8EUBWJIn9zYcoAWWlW9+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>
|
|
@@ -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.26
|
|
8
8
|
*/
|
|
9
9
|
/*
|
|
10
10
|
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
@@ -44,7 +44,7 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
|
|
|
44
44
|
\*******************************/
|
|
45
45
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
46
46
|
|
|
47
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadOutModesUpdater: () => (/* binding */ loadOutModesUpdater)\n/* harmony export */ });\nasync function loadOutModesUpdater(engine) {\n engine.checkVersion(\"4.0.0-alpha.
|
|
47
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadOutModesUpdater: () => (/* binding */ loadOutModesUpdater)\n/* harmony export */ });\nasync function loadOutModesUpdater(engine) {\n engine.checkVersion(\"4.0.0-alpha.26\");\n await engine.register((e)=>{\n e.addParticleUpdater(\"outModes\", async (container)=>{\n const { OutOfCanvasUpdater } = await __webpack_require__.e(/*! import() */ \"dist_browser_OutOfCanvasUpdater_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./OutOfCanvasUpdater.js */ \"./dist/browser/OutOfCanvasUpdater.js\"));\n return new OutOfCanvasUpdater(container);\n });\n });\n}\n\n\n//# sourceURL=webpack://@tsparticles/updater-out-modes/./dist/browser/index.js?\n}");
|
|
48
48
|
|
|
49
49
|
/***/ }
|
|
50
50
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
!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 r="object"==typeof exports?t(require("@tsparticles/engine")):t(e.window);for(var o in r)("object"==typeof exports?exports:e)[o]=r[o]}}(this,e=>(()=>{"use strict";var t,r,o,i={303(t){t.exports=e}},n={};function a(e){var t=n[e];if(void 0!==t)return t.exports;var r=n[e]={exports:{}};return i[e](r,r.exports,a),r.exports}a.m=i,a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce((t,r)=>(a.f[r](e,t),t),[])),a.u=e=>""+e+".min.js",a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s={},a.l=(e,t,r,o)=>{if(s[e])return void s[e].push(t);if(void 0!==r)for(var i,n,p=document.getElementsByTagName("script"),u=0;u<p.length;u++){var c=p[u];if(c.getAttribute("src")==e||c.getAttribute("data-webpack")=="@tsparticles/updater-out-modes:"+r){i=c;break}}i||(n=!0,(i=document.createElement("script")).charset="utf-8",a.nc&&i.setAttribute("nonce",a.nc),i.setAttribute("data-webpack","@tsparticles/updater-out-modes:"+r),i.src=e),s[e]=[t];var l=(t,r)=>{i.onerror=i.onload=null,clearTimeout(d);var o=s[e];if(delete s[e],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach(e=>e(r)),t)return t(r)},d=setTimeout(l.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=l.bind(null,i.onerror),i.onload=l.bind(null,i.onload),n&&document.head.appendChild(i)},a.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.g.importScripts&&(p=a.g.location+"");var s,p,u=a.g.document;if(!p&&u&&(u.currentScript&&"SCRIPT"===u.currentScript.tagName.toUpperCase()&&(p=u.currentScript.src),!p)){var c=u.getElementsByTagName("script");if(c.length)for(var l=c.length-1;l>-1&&(!p||!/^http(s?):/.test(p));)p=c[l--].src}if(!p)throw Error("Automatic publicPath is not supported in this browser");a.p=p=p.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),t={427:0},a.f.j=(e,r)=>{var o=a.o(t,e)?t[e]:void 0;if(0!==o)if(o)r.push(o[2]);else{var i=new Promise((r,i)=>o=t[e]=[r,i]);r.push(o[2]=i);var n=a.p+a.u(e),s=Error();a.l(n,r=>{if(a.o(t,e)&&(0!==(o=t[e])&&(t[e]=void 0),o)){var i=r&&("load"===r.type?"missing":r.type),n=r&&r.target&&r.target.src;s.message="Loading chunk "+e+` failed.
|
|
2
|
-
(`+i+": "+n+")",s.name="ChunkLoadError",s.type=i,s.request=n,o[1](s)}},"chunk-"+e,e)}},r=(e,r)=>{var o,i,[n,s,p]=r,u=0;if(n.some(e=>0!==t[e])){for(o in s)a.o(s,o)&&(a.m[o]=s[o]);p&&p(a)}for(e&&e(r);u<n.length;u++)i=n[u],a.o(t,i)&&t[i]&&t[i][0](),t[i]=0},(o=this.webpackChunk_tsparticles_updater_out_modes=this.webpackChunk_tsparticles_updater_out_modes||[]).forEach(r.bind(null,0)),o.push=r.bind(null,o.push.bind(o));var d={};async function f(e){e.checkVersion("4.0.0-alpha.
|
|
2
|
+
(`+i+": "+n+")",s.name="ChunkLoadError",s.type=i,s.request=n,o[1](s)}},"chunk-"+e,e)}},r=(e,r)=>{var o,i,[n,s,p]=r,u=0;if(n.some(e=>0!==t[e])){for(o in s)a.o(s,o)&&(a.m[o]=s[o]);p&&p(a)}for(e&&e(r);u<n.length;u++)i=n[u],a.o(t,i)&&t[i]&&t[i][0](),t[i]=0},(o=this.webpackChunk_tsparticles_updater_out_modes=this.webpackChunk_tsparticles_updater_out_modes||[]).forEach(r.bind(null,0)),o.push=r.bind(null,o.push.bind(o));var d={};async function f(e){e.checkVersion("4.0.0-alpha.26"),await e.register(e=>{e.addParticleUpdater("outModes",async e=>{let{OutOfCanvasUpdater:t}=await a.e(710).then(a.bind(a,710));return new t(e)})})}return a.r(d),a.d(d,{loadOutModesUpdater:()=>f}),d})());
|
package/umd/DestroyOutMode.js
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
switch (particle.outType) {
|
|
28
28
|
case engine_1.ParticleOutType.normal:
|
|
29
29
|
case engine_1.ParticleOutType.outside:
|
|
30
|
-
if ((0, engine_1.isPointInside)(particle.position, container.canvas.size, engine_1.
|
|
30
|
+
if ((0, engine_1.isPointInside)(particle.position, container.canvas.size, engine_1.originPoint, particle.getRadius(), direction)) {
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
33
33
|
break;
|
package/umd/NoneOutMode.js
CHANGED
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
(particle.velocity.x < minVelocity && particle.position.x >= -pRadius)) {
|
|
38
38
|
return;
|
|
39
39
|
}
|
|
40
|
-
if (!(0, engine_1.isPointInside)(particle.position, container.canvas.size, engine_1.
|
|
40
|
+
if (!(0, engine_1.isPointInside)(particle.position, container.canvas.size, engine_1.originPoint, pRadius, direction)) {
|
|
41
41
|
container.particles.remove(particle);
|
|
42
42
|
}
|
|
43
43
|
}
|
package/umd/OutOutMode.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.OutOutMode = void 0;
|
|
13
13
|
const engine_1 = require("@tsparticles/engine");
|
|
14
|
-
const minVelocity = 0, minDistance = 0;
|
|
14
|
+
const minVelocity = 0, minDistance = 0, updateVector = engine_1.Vector.origin;
|
|
15
15
|
class OutOutMode {
|
|
16
16
|
container;
|
|
17
17
|
modes;
|
|
@@ -26,11 +26,12 @@
|
|
|
26
26
|
const container = this.container;
|
|
27
27
|
switch (particle.outType) {
|
|
28
28
|
case engine_1.ParticleOutType.inside: {
|
|
29
|
-
const { x: vx, y: vy } = particle.velocity
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
const { x: vx, y: vy } = particle.velocity;
|
|
30
|
+
updateVector.setTo(engine_1.originPoint);
|
|
31
|
+
updateVector.length = particle.moveCenter.radius;
|
|
32
|
+
updateVector.angle = particle.velocity.angle + Math.PI;
|
|
33
|
+
updateVector.addTo(particle.moveCenter);
|
|
34
|
+
const { dx, dy } = (0, engine_1.getDistances)(particle.position, updateVector);
|
|
34
35
|
if ((vx <= minVelocity && dx >= minDistance) ||
|
|
35
36
|
(vy <= minVelocity && dy >= minDistance) ||
|
|
36
37
|
(vx >= minVelocity && dx <= minDistance) ||
|
|
@@ -51,7 +52,7 @@
|
|
|
51
52
|
break;
|
|
52
53
|
}
|
|
53
54
|
default: {
|
|
54
|
-
if ((0, engine_1.isPointInside)(particle.position, container.canvas.size, engine_1.
|
|
55
|
+
if ((0, engine_1.isPointInside)(particle.position, container.canvas.size, engine_1.originPoint, particle.getRadius(), direction)) {
|
|
55
56
|
return;
|
|
56
57
|
}
|
|
57
58
|
switch (particle.outType) {
|
package/umd/index.js
CHANGED
|
@@ -45,7 +45,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
45
45
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
46
|
exports.loadOutModesUpdater = loadOutModesUpdater;
|
|
47
47
|
async function loadOutModesUpdater(engine) {
|
|
48
|
-
engine.checkVersion("4.0.0-alpha.
|
|
48
|
+
engine.checkVersion("4.0.0-alpha.26");
|
|
49
49
|
await engine.register(e => {
|
|
50
50
|
e.addParticleUpdater("outModes", async (container) => {
|
|
51
51
|
const { OutOfCanvasUpdater } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./OutOfCanvasUpdater.js"))) : new Promise((resolve_1, reject_1) => { require(["./OutOfCanvasUpdater.js"], resolve_1, reject_1); }).then(__importStar));
|
package/408.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(this.webpackChunk_tsparticles_updater_out_modes=this.webpackChunk_tsparticles_updater_out_modes||[]).push([[408],{408(t,i,e){e.d(i,{OutOfCanvasUpdater:()=>d});var o=e(303);class n{container;modes;_particleBouncePlugins;constructor(t){this.container=t,this.modes=[o.OutMode.bounce,o.OutMode.split],this._particleBouncePlugins=t.plugins.filter(t=>void 0!==t.particleBounce)}update(t,i,e,n){if(!this.modes.includes(n))return;let s=this.container,r=!1;for(let o of this._particleBouncePlugins)if(r=o.particleBounce?.(t,e,i)??!1)break;if(r)return;let a=t.getPosition(),d=t.offset,c=t.getRadius(),u=(0,o.calculateBounds)(a,c),l=s.canvas.size;!function(t){if(t.outMode!==o.OutMode.bounce&&t.outMode!==o.OutMode.split||t.direction!==o.OutModeDirection.left&&t.direction!==o.OutModeDirection.right)return;t.bounds.right<0&&t.direction===o.OutModeDirection.left?t.particle.position.x=t.size+t.offset.x:t.bounds.left>t.canvasSize.width&&t.direction===o.OutModeDirection.right&&(t.particle.position.x=t.canvasSize.width-t.size-t.offset.x);let i=t.particle.velocity.x,e=!1;if(t.direction===o.OutModeDirection.right&&t.bounds.right>=t.canvasSize.width&&i>0||t.direction===o.OutModeDirection.left&&t.bounds.left<=0&&i<0){let i=(0,o.getRangeValue)(t.particle.options.bounce.horizontal.value);t.particle.velocity.x*=-i,e=!0}if(!e)return;let n=t.offset.x+t.size;t.bounds.right>=t.canvasSize.width&&t.direction===o.OutModeDirection.right?t.particle.position.x=t.canvasSize.width-n:t.bounds.left<=0&&t.direction===o.OutModeDirection.left&&(t.particle.position.x=n),t.outMode===o.OutMode.split&&t.particle.destroy()}({particle:t,outMode:n,direction:i,bounds:u,canvasSize:l,offset:d,size:c}),function(t){if(t.outMode!==o.OutMode.bounce&&t.outMode!==o.OutMode.split||t.direction!==o.OutModeDirection.bottom&&t.direction!==o.OutModeDirection.top)return;t.bounds.bottom<0&&t.direction===o.OutModeDirection.top?t.particle.position.y=t.size+t.offset.y:t.bounds.top>t.canvasSize.height&&t.direction===o.OutModeDirection.bottom&&(t.particle.position.y=t.canvasSize.height-t.size-t.offset.y);let i=t.particle.velocity.y,e=!1;if(t.direction===o.OutModeDirection.bottom&&t.bounds.bottom>=t.canvasSize.height&&i>0||t.direction===o.OutModeDirection.top&&t.bounds.top<=0&&i<0){let i=(0,o.getRangeValue)(t.particle.options.bounce.vertical.value);t.particle.velocity.y*=-i,e=!0}if(!e)return;let n=t.offset.y+t.size;t.bounds.bottom>=t.canvasSize.height&&t.direction===o.OutModeDirection.bottom?t.particle.position.y=t.canvasSize.height-n:t.bounds.top<=0&&t.direction===o.OutModeDirection.top&&(t.particle.position.y=n),t.outMode===o.OutMode.split&&t.particle.destroy()}({particle:t,outMode:n,direction:i,bounds:u,canvasSize:l,offset:d,size:c})}}class s{container;modes;constructor(t){this.container=t,this.modes=[o.OutMode.destroy]}update(t,i,e,n){if(!this.modes.includes(n))return;let s=this.container;switch(t.outType){case o.ParticleOutType.normal:case o.ParticleOutType.outside:if((0,o.isPointInside)(t.position,s.canvas.size,o.Vector.origin,t.getRadius(),i))return;break;case o.ParticleOutType.inside:{let{dx:i,dy:e}=(0,o.getDistances)(t.position,t.moveCenter),{x:n,y:s}=t.velocity;if(n<0&&i>t.moveCenter.radius||s<0&&e>t.moveCenter.radius||n>=0&&i<-t.moveCenter.radius||s>=0&&e<-t.moveCenter.radius)return}}s.particles.remove(t,t.group,!0)}}class r{container;modes;constructor(t){this.container=t,this.modes=[o.OutMode.none]}update(t,i,e,n){if(!this.modes.includes(n)||((t.options.move.distance.horizontal&&(i===o.OutModeDirection.left||i===o.OutModeDirection.right))??(t.options.move.distance.vertical&&(i===o.OutModeDirection.top||i===o.OutModeDirection.bottom))))return;let s=t.options.move.gravity,r=this.container,a=r.canvas.size,d=t.getRadius();if(s.enable){let e=t.position;(!s.inverse&&e.y>a.height+d&&i===o.OutModeDirection.bottom||s.inverse&&e.y<-d&&i===o.OutModeDirection.top)&&r.particles.remove(t)}else{if(t.velocity.y>0&&t.position.y<=a.height+d||t.velocity.y<0&&t.position.y>=-d||t.velocity.x>0&&t.position.x<=a.width+d||t.velocity.x<0&&t.position.x>=-d)return;(0,o.isPointInside)(t.position,r.canvas.size,o.Vector.origin,d,i)||r.particles.remove(t)}}}class a{container;modes;constructor(t){this.container=t,this.modes=[o.OutMode.out]}update(t,i,e,n){if(!this.modes.includes(n))return;let s=this.container;if(t.outType===o.ParticleOutType.inside){let{x:i,y:e}=t.velocity,n=o.Vector.origin;n.length=t.moveCenter.radius,n.angle=t.velocity.angle+Math.PI,n.addTo(o.Vector.create(t.moveCenter));let{dx:r,dy:a}=(0,o.getDistances)(t.position,n);if(i<=0&&r>=0||e<=0&&a>=0||i>=0&&r<=0||e>=0&&a<=0)return;t.position.x=Math.floor((0,o.randomInRangeValue)({min:0,max:s.canvas.size.width})),t.position.y=Math.floor((0,o.randomInRangeValue)({min:0,max:s.canvas.size.height}));let{dx:d,dy:c}=(0,o.getDistances)(t.position,t.moveCenter);t.direction=Math.atan2(-c,-d),t.velocity.angle=t.direction}else{if((0,o.isPointInside)(t.position,s.canvas.size,o.Vector.origin,t.getRadius(),i))return;switch(t.outType){case o.ParticleOutType.outside:{t.position.x=Math.floor((0,o.randomInRangeValue)({min:-t.moveCenter.radius,max:t.moveCenter.radius}))+t.moveCenter.x,t.position.y=Math.floor((0,o.randomInRangeValue)({min:-t.moveCenter.radius,max:t.moveCenter.radius}))+t.moveCenter.y;let{dx:i,dy:e}=(0,o.getDistances)(t.position,t.moveCenter);t.moveCenter.radius&&(t.direction=Math.atan2(e,i),t.velocity.angle=t.direction);break}case o.ParticleOutType.normal:{let e=t.options.move.warp,n=s.canvas.size,r={bottom:n.height+t.getRadius()+t.offset.y,left:-t.getRadius()-t.offset.x,right:n.width+t.getRadius()+t.offset.x,top:-t.getRadius()-t.offset.y},a=t.getRadius(),d=(0,o.calculateBounds)(t.position,a);i===o.OutModeDirection.right&&d.left>n.width+t.offset.x?(t.position.x=r.left,t.initialPosition.x=t.position.x,e||(t.position.y=(0,o.getRandom)()*n.height,t.initialPosition.y=t.position.y)):i===o.OutModeDirection.left&&d.right<-t.offset.x&&(t.position.x=r.right,t.initialPosition.x=t.position.x,e||(t.position.y=(0,o.getRandom)()*n.height,t.initialPosition.y=t.position.y)),i===o.OutModeDirection.bottom&&d.top>n.height+t.offset.y?(e||(t.position.x=(0,o.getRandom)()*n.width,t.initialPosition.x=t.position.x),t.position.y=r.top,t.initialPosition.y=t.position.y):i===o.OutModeDirection.top&&d.bottom<-t.offset.y&&(e||(t.position.x=(0,o.getRandom)()*n.width,t.initialPosition.x=t.position.x),t.position.y=r.bottom,t.initialPosition.y=t.position.y)}}}}}class d{updaters;container;constructor(t){this.container=t,this.updaters=new Map}init(t){this._addUpdaterIfMissing(t,o.OutMode.bounce,t=>new n(t)),this._addUpdaterIfMissing(t,o.OutMode.out,t=>new a(t)),this._addUpdaterIfMissing(t,o.OutMode.destroy,t=>new s(t)),this._addUpdaterIfMissing(t,o.OutMode.none,t=>new r(t))}isEnabled(t){return!t.destroyed&&!t.spawning}update(t,i){let e=t.options.move.outModes;this._updateOutMode(t,i,e.bottom??e.default,o.OutModeDirection.bottom),this._updateOutMode(t,i,e.left??e.default,o.OutModeDirection.left),this._updateOutMode(t,i,e.right??e.default,o.OutModeDirection.right),this._updateOutMode(t,i,e.top??e.default,o.OutModeDirection.top)}_addUpdaterIfMissing=(t,i,e)=>{let o=t.options.move.outModes;this.updaters.has(i)||o.default!==i&&o.bottom!==i&&o.left!==i&&o.right!==i&&o.top!==i||this.updaters.set(i,e(this.container))};_updateOutMode=(t,i,e,o)=>{for(let n of this.updaters.values())n.update(t,o,i,e)}}}}]);
|