@tsparticles/updater-out-modes 4.1.3 → 4.2.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/browser/DestroyOutMode.js +1 -2
- package/browser/NoneOutMode.js +1 -2
- package/browser/OutOfCanvasUpdater.js +4 -4
- package/browser/OutOutMode.js +2 -2
- package/browser/Utils.js +2 -2
- package/browser/index.js +1 -1
- package/browser/index.lazy.js +1 -1
- package/cjs/DestroyOutMode.js +1 -2
- package/cjs/NoneOutMode.js +1 -2
- package/cjs/OutOfCanvasUpdater.js +4 -4
- package/cjs/OutOutMode.js +2 -2
- package/cjs/Utils.js +2 -2
- package/cjs/index.js +1 -1
- package/cjs/index.lazy.js +1 -1
- package/esm/DestroyOutMode.js +1 -2
- package/esm/NoneOutMode.js +1 -2
- package/esm/OutOfCanvasUpdater.js +4 -4
- package/esm/OutOutMode.js +2 -2
- package/esm/Utils.js +2 -2
- package/esm/index.js +1 -1
- package/esm/index.lazy.js +1 -1
- package/package.json +2 -2
- package/report.html +1 -1
- package/tsparticles.updater.out-modes.js +24 -26
- package/tsparticles.updater.out-modes.min.js +1 -1
package/browser/NoneOutMode.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { OutMode, OutModeDirection, isPointInside, originPoint, } from "@tsparticles/engine";
|
|
2
|
-
const minVelocity = 0;
|
|
1
|
+
import { OutMode, OutModeDirection, isPointInside, minVelocity, originPoint, } from "@tsparticles/engine";
|
|
3
2
|
export class NoneOutMode {
|
|
4
3
|
modes;
|
|
5
4
|
#container;
|
|
@@ -34,15 +34,15 @@ export class OutOfCanvasUpdater {
|
|
|
34
34
|
this.#updateOutMode(particle, delta, outModes.right ?? outModes.default, OutModeDirection.right);
|
|
35
35
|
this.#updateOutMode(particle, delta, outModes.top ?? outModes.default, OutModeDirection.top);
|
|
36
36
|
}
|
|
37
|
-
#addUpdaterIfMissing
|
|
37
|
+
#addUpdaterIfMissing(particle, outMode, getUpdater) {
|
|
38
38
|
const outModes = particle.options.move.outModes;
|
|
39
39
|
if (!this.updaters.has(outMode) && checkOutMode(outModes, outMode)) {
|
|
40
40
|
this.updaters.set(outMode, getUpdater(this.#container));
|
|
41
41
|
}
|
|
42
|
-
}
|
|
43
|
-
#updateOutMode
|
|
42
|
+
}
|
|
43
|
+
#updateOutMode(particle, delta, outMode, direction) {
|
|
44
44
|
for (const updater of this.updaters.values()) {
|
|
45
45
|
updater.update(particle, direction, delta, outMode);
|
|
46
46
|
}
|
|
47
|
-
}
|
|
47
|
+
}
|
|
48
48
|
}
|
package/browser/OutOutMode.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { OutMode, OutModeDirection, ParticleOutType, Vector, calculateBounds, getDistances, getRandom, originPoint, randomInRangeValue, } from "@tsparticles/engine";
|
|
2
|
-
const
|
|
1
|
+
import { OutMode, OutModeDirection, ParticleOutType, Vector, calculateBounds, getDistances, getRandom, minDistance, minVelocity, originPoint, randomInRangeValue, } from "@tsparticles/engine";
|
|
2
|
+
const updateVector = Vector.origin;
|
|
3
3
|
export class OutOutMode {
|
|
4
4
|
modes;
|
|
5
5
|
#container;
|
package/browser/Utils.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { OutMode, OutModeDirection, getRangeValue } from "@tsparticles/engine";
|
|
2
|
-
const
|
|
1
|
+
import { OutMode, OutModeDirection, getRangeValue, minVelocity } from "@tsparticles/engine";
|
|
2
|
+
const boundsMin = 0;
|
|
3
3
|
export function bounceHorizontal(data) {
|
|
4
4
|
if ((data.outMode !== OutMode.bounce && data.outMode !== OutMode.split) ||
|
|
5
5
|
(data.direction !== OutModeDirection.left && data.direction !== OutModeDirection.right)) {
|
package/browser/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OutOfCanvasUpdater } from "./OutOfCanvasUpdater.js";
|
|
2
2
|
export async function loadOutModesUpdater(engine) {
|
|
3
|
-
engine.checkVersion("4.
|
|
3
|
+
engine.checkVersion("4.2.0");
|
|
4
4
|
await engine.pluginManager.register(e => {
|
|
5
5
|
e.pluginManager.addParticleUpdater("outModes", container => {
|
|
6
6
|
return Promise.resolve(new OutOfCanvasUpdater(container));
|
package/browser/index.lazy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadOutModesUpdater(engine) {
|
|
2
|
-
engine.checkVersion("4.
|
|
2
|
+
engine.checkVersion("4.2.0");
|
|
3
3
|
await engine.pluginManager.register(e => {
|
|
4
4
|
e.pluginManager.addParticleUpdater("outModes", async (container) => {
|
|
5
5
|
const { OutOfCanvasUpdater } = await import("./OutOfCanvasUpdater.js");
|
package/cjs/DestroyOutMode.js
CHANGED
package/cjs/NoneOutMode.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { OutMode, OutModeDirection, isPointInside, originPoint, } from "@tsparticles/engine";
|
|
2
|
-
const minVelocity = 0;
|
|
1
|
+
import { OutMode, OutModeDirection, isPointInside, minVelocity, originPoint, } from "@tsparticles/engine";
|
|
3
2
|
export class NoneOutMode {
|
|
4
3
|
modes;
|
|
5
4
|
#container;
|
|
@@ -34,15 +34,15 @@ export class OutOfCanvasUpdater {
|
|
|
34
34
|
this.#updateOutMode(particle, delta, outModes.right ?? outModes.default, OutModeDirection.right);
|
|
35
35
|
this.#updateOutMode(particle, delta, outModes.top ?? outModes.default, OutModeDirection.top);
|
|
36
36
|
}
|
|
37
|
-
#addUpdaterIfMissing
|
|
37
|
+
#addUpdaterIfMissing(particle, outMode, getUpdater) {
|
|
38
38
|
const outModes = particle.options.move.outModes;
|
|
39
39
|
if (!this.updaters.has(outMode) && checkOutMode(outModes, outMode)) {
|
|
40
40
|
this.updaters.set(outMode, getUpdater(this.#container));
|
|
41
41
|
}
|
|
42
|
-
}
|
|
43
|
-
#updateOutMode
|
|
42
|
+
}
|
|
43
|
+
#updateOutMode(particle, delta, outMode, direction) {
|
|
44
44
|
for (const updater of this.updaters.values()) {
|
|
45
45
|
updater.update(particle, direction, delta, outMode);
|
|
46
46
|
}
|
|
47
|
-
}
|
|
47
|
+
}
|
|
48
48
|
}
|
package/cjs/OutOutMode.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { OutMode, OutModeDirection, ParticleOutType, Vector, calculateBounds, getDistances, getRandom, originPoint, randomInRangeValue, } from "@tsparticles/engine";
|
|
2
|
-
const
|
|
1
|
+
import { OutMode, OutModeDirection, ParticleOutType, Vector, calculateBounds, getDistances, getRandom, minDistance, minVelocity, originPoint, randomInRangeValue, } from "@tsparticles/engine";
|
|
2
|
+
const updateVector = Vector.origin;
|
|
3
3
|
export class OutOutMode {
|
|
4
4
|
modes;
|
|
5
5
|
#container;
|
package/cjs/Utils.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { OutMode, OutModeDirection, getRangeValue } from "@tsparticles/engine";
|
|
2
|
-
const
|
|
1
|
+
import { OutMode, OutModeDirection, getRangeValue, minVelocity } from "@tsparticles/engine";
|
|
2
|
+
const boundsMin = 0;
|
|
3
3
|
export function bounceHorizontal(data) {
|
|
4
4
|
if ((data.outMode !== OutMode.bounce && data.outMode !== OutMode.split) ||
|
|
5
5
|
(data.direction !== OutModeDirection.left && data.direction !== OutModeDirection.right)) {
|
package/cjs/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OutOfCanvasUpdater } from "./OutOfCanvasUpdater.js";
|
|
2
2
|
export async function loadOutModesUpdater(engine) {
|
|
3
|
-
engine.checkVersion("4.
|
|
3
|
+
engine.checkVersion("4.2.0");
|
|
4
4
|
await engine.pluginManager.register(e => {
|
|
5
5
|
e.pluginManager.addParticleUpdater("outModes", container => {
|
|
6
6
|
return Promise.resolve(new OutOfCanvasUpdater(container));
|
package/cjs/index.lazy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadOutModesUpdater(engine) {
|
|
2
|
-
engine.checkVersion("4.
|
|
2
|
+
engine.checkVersion("4.2.0");
|
|
3
3
|
await engine.pluginManager.register(e => {
|
|
4
4
|
e.pluginManager.addParticleUpdater("outModes", async (container) => {
|
|
5
5
|
const { OutOfCanvasUpdater } = await import("./OutOfCanvasUpdater.js");
|
package/esm/DestroyOutMode.js
CHANGED
package/esm/NoneOutMode.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { OutMode, OutModeDirection, isPointInside, originPoint, } from "@tsparticles/engine";
|
|
2
|
-
const minVelocity = 0;
|
|
1
|
+
import { OutMode, OutModeDirection, isPointInside, minVelocity, originPoint, } from "@tsparticles/engine";
|
|
3
2
|
export class NoneOutMode {
|
|
4
3
|
modes;
|
|
5
4
|
#container;
|
|
@@ -34,15 +34,15 @@ export class OutOfCanvasUpdater {
|
|
|
34
34
|
this.#updateOutMode(particle, delta, outModes.right ?? outModes.default, OutModeDirection.right);
|
|
35
35
|
this.#updateOutMode(particle, delta, outModes.top ?? outModes.default, OutModeDirection.top);
|
|
36
36
|
}
|
|
37
|
-
#addUpdaterIfMissing
|
|
37
|
+
#addUpdaterIfMissing(particle, outMode, getUpdater) {
|
|
38
38
|
const outModes = particle.options.move.outModes;
|
|
39
39
|
if (!this.updaters.has(outMode) && checkOutMode(outModes, outMode)) {
|
|
40
40
|
this.updaters.set(outMode, getUpdater(this.#container));
|
|
41
41
|
}
|
|
42
|
-
}
|
|
43
|
-
#updateOutMode
|
|
42
|
+
}
|
|
43
|
+
#updateOutMode(particle, delta, outMode, direction) {
|
|
44
44
|
for (const updater of this.updaters.values()) {
|
|
45
45
|
updater.update(particle, direction, delta, outMode);
|
|
46
46
|
}
|
|
47
|
-
}
|
|
47
|
+
}
|
|
48
48
|
}
|
package/esm/OutOutMode.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { OutMode, OutModeDirection, ParticleOutType, Vector, calculateBounds, getDistances, getRandom, originPoint, randomInRangeValue, } from "@tsparticles/engine";
|
|
2
|
-
const
|
|
1
|
+
import { OutMode, OutModeDirection, ParticleOutType, Vector, calculateBounds, getDistances, getRandom, minDistance, minVelocity, originPoint, randomInRangeValue, } from "@tsparticles/engine";
|
|
2
|
+
const updateVector = Vector.origin;
|
|
3
3
|
export class OutOutMode {
|
|
4
4
|
modes;
|
|
5
5
|
#container;
|
package/esm/Utils.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { OutMode, OutModeDirection, getRangeValue } from "@tsparticles/engine";
|
|
2
|
-
const
|
|
1
|
+
import { OutMode, OutModeDirection, getRangeValue, minVelocity } from "@tsparticles/engine";
|
|
2
|
+
const boundsMin = 0;
|
|
3
3
|
export function bounceHorizontal(data) {
|
|
4
4
|
if ((data.outMode !== OutMode.bounce && data.outMode !== OutMode.split) ||
|
|
5
5
|
(data.direction !== OutModeDirection.left && data.direction !== OutModeDirection.right)) {
|
package/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OutOfCanvasUpdater } from "./OutOfCanvasUpdater.js";
|
|
2
2
|
export async function loadOutModesUpdater(engine) {
|
|
3
|
-
engine.checkVersion("4.
|
|
3
|
+
engine.checkVersion("4.2.0");
|
|
4
4
|
await engine.pluginManager.register(e => {
|
|
5
5
|
e.pluginManager.addParticleUpdater("outModes", container => {
|
|
6
6
|
return Promise.resolve(new OutOfCanvasUpdater(container));
|
package/esm/index.lazy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadOutModesUpdater(engine) {
|
|
2
|
-
engine.checkVersion("4.
|
|
2
|
+
engine.checkVersion("4.2.0");
|
|
3
3
|
await engine.pluginManager.register(e => {
|
|
4
4
|
e.pluginManager.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.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"description": "tsParticles particles out modes updater",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"./package.json": "./package.json"
|
|
94
94
|
},
|
|
95
95
|
"peerDependencies": {
|
|
96
|
-
"@tsparticles/engine": "4.
|
|
96
|
+
"@tsparticles/engine": "4.2.0"
|
|
97
97
|
},
|
|
98
98
|
"publishConfig": {
|
|
99
99
|
"access": "public"
|
package/report.html
CHANGED
|
@@ -4930,7 +4930,7 @@ var drawChart = (function (exports) {
|
|
|
4930
4930
|
</script>
|
|
4931
4931
|
<script>
|
|
4932
4932
|
/*<!--*/
|
|
4933
|
-
const data = {"version":2,"tree":{"name":"root","children":[{"name":"tsparticles.updater.out-modes.js","children":[{"name":"dist/browser","children":[{"uid":"
|
|
4933
|
+
const data = {"version":2,"tree":{"name":"root","children":[{"name":"tsparticles.updater.out-modes.js","children":[{"name":"dist/browser","children":[{"uid":"b4cef556-1","name":"Utils.js"},{"uid":"b4cef556-3","name":"BounceOutMode.js"},{"uid":"b4cef556-5","name":"DestroyOutMode.js"},{"uid":"b4cef556-7","name":"NoneOutMode.js"},{"uid":"b4cef556-9","name":"OutOutMode.js"},{"uid":"b4cef556-11","name":"OutOfCanvasUpdater.js"},{"uid":"b4cef556-13","name":"index.js"},{"uid":"b4cef556-15","name":"browser.js"}]}]}],"isRoot":true},"nodeParts":{"b4cef556-1":{"renderedLength":3413,"gzipLength":0,"brotliLength":0,"metaUid":"b4cef556-0"},"b4cef556-3":{"renderedLength":1417,"gzipLength":0,"brotliLength":0,"metaUid":"b4cef556-2"},"b4cef556-5":{"renderedLength":1298,"gzipLength":0,"brotliLength":0,"metaUid":"b4cef556-4"},"b4cef556-7":{"renderedLength":2069,"gzipLength":0,"brotliLength":0,"metaUid":"b4cef556-6"},"b4cef556-9":{"renderedLength":6804,"gzipLength":0,"brotliLength":0,"metaUid":"b4cef556-8"},"b4cef556-11":{"renderedLength":2183,"gzipLength":0,"brotliLength":0,"metaUid":"b4cef556-10"},"b4cef556-13":{"renderedLength":320,"gzipLength":0,"brotliLength":0,"metaUid":"b4cef556-12"},"b4cef556-15":{"renderedLength":181,"gzipLength":0,"brotliLength":0,"metaUid":"b4cef556-14"}},"nodeMetas":{"b4cef556-0":{"id":"/dist/browser/Utils.js","moduleParts":{"tsparticles.updater.out-modes.js":"b4cef556-1"},"imported":[{"uid":"b4cef556-16"}],"importedBy":[{"uid":"b4cef556-2"}]},"b4cef556-2":{"id":"/dist/browser/BounceOutMode.js","moduleParts":{"tsparticles.updater.out-modes.js":"b4cef556-3"},"imported":[{"uid":"b4cef556-16"},{"uid":"b4cef556-0"}],"importedBy":[{"uid":"b4cef556-10"}]},"b4cef556-4":{"id":"/dist/browser/DestroyOutMode.js","moduleParts":{"tsparticles.updater.out-modes.js":"b4cef556-5"},"imported":[{"uid":"b4cef556-16"}],"importedBy":[{"uid":"b4cef556-10"}]},"b4cef556-6":{"id":"/dist/browser/NoneOutMode.js","moduleParts":{"tsparticles.updater.out-modes.js":"b4cef556-7"},"imported":[{"uid":"b4cef556-16"}],"importedBy":[{"uid":"b4cef556-10"}]},"b4cef556-8":{"id":"/dist/browser/OutOutMode.js","moduleParts":{"tsparticles.updater.out-modes.js":"b4cef556-9"},"imported":[{"uid":"b4cef556-16"}],"importedBy":[{"uid":"b4cef556-10"}]},"b4cef556-10":{"id":"/dist/browser/OutOfCanvasUpdater.js","moduleParts":{"tsparticles.updater.out-modes.js":"b4cef556-11"},"imported":[{"uid":"b4cef556-16"},{"uid":"b4cef556-2"},{"uid":"b4cef556-4"},{"uid":"b4cef556-6"},{"uid":"b4cef556-8"}],"importedBy":[{"uid":"b4cef556-12"}]},"b4cef556-12":{"id":"/dist/browser/index.js","moduleParts":{"tsparticles.updater.out-modes.js":"b4cef556-13"},"imported":[{"uid":"b4cef556-10"}],"importedBy":[{"uid":"b4cef556-14"}]},"b4cef556-14":{"id":"/dist/browser/browser.js","moduleParts":{"tsparticles.updater.out-modes.js":"b4cef556-15"},"imported":[{"uid":"b4cef556-12"}],"importedBy":[],"isEntry":true},"b4cef556-16":{"id":"@tsparticles/engine","moduleParts":{},"imported":[],"importedBy":[{"uid":"b4cef556-10"},{"uid":"b4cef556-2"},{"uid":"b4cef556-4"},{"uid":"b4cef556-6"},{"uid":"b4cef556-8"},{"uid":"b4cef556-0"}],"isExternal":true}},"env":{"rollup":"4.62.0"},"options":{"gzip":false,"brotli":false,"sourcemap":false}};
|
|
4934
4934
|
|
|
4935
4935
|
const run = () => {
|
|
4936
4936
|
const width = window.innerWidth;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
(function(g){g.__tsParticlesInternals=g.__tsParticlesInternals||{};g.__tsParticlesInternals.bundles=g.__tsParticlesInternals.bundles||{};g.__tsParticlesInternals.effects=g.__tsParticlesInternals.effects||{};g.__tsParticlesInternals.engine=g.__tsParticlesInternals.engine||{};g.__tsParticlesInternals.interactions=g.__tsParticlesInternals.interactions||{};g.__tsParticlesInternals.palettes=g.__tsParticlesInternals.palettes||{};g.__tsParticlesInternals.paths=g.__tsParticlesInternals.paths||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins.emittersShapes=g.__tsParticlesInternals.plugins.emittersShapes||{};g.__tsParticlesInternals.presets=g.__tsParticlesInternals.presets||{};g.__tsParticlesInternals.shapes=g.__tsParticlesInternals.shapes||{};g.__tsParticlesInternals.updaters=g.__tsParticlesInternals.updaters||{};g.__tsParticlesInternals.utils=g.__tsParticlesInternals.utils||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas.utils=g.__tsParticlesInternals.canvas.utils||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path.utils=g.__tsParticlesInternals.path.utils||{};var __tsProxyFactory=typeof Proxy!=="undefined"?function(obj){return new Proxy(obj,{get:function(target,key){if(!(key in target)){target[key]={};}return target[key];}});}:function(obj){return obj;};g.__tsParticlesInternals.bundles=__tsProxyFactory(g.__tsParticlesInternals.bundles);g.__tsParticlesInternals.effects=__tsProxyFactory(g.__tsParticlesInternals.effects);g.__tsParticlesInternals.interactions=__tsProxyFactory(g.__tsParticlesInternals.interactions);g.__tsParticlesInternals.palettes=__tsProxyFactory(g.__tsParticlesInternals.palettes);g.__tsParticlesInternals.paths=__tsProxyFactory(g.__tsParticlesInternals.paths);g.__tsParticlesInternals.plugins=__tsProxyFactory(g.__tsParticlesInternals.plugins);g.__tsParticlesInternals.plugins.emittersShapes=__tsProxyFactory(g.__tsParticlesInternals.plugins.emittersShapes);g.__tsParticlesInternals.presets=__tsProxyFactory(g.__tsParticlesInternals.presets);g.__tsParticlesInternals.shapes=__tsProxyFactory(g.__tsParticlesInternals.shapes);g.__tsParticlesInternals.updaters=__tsProxyFactory(g.__tsParticlesInternals.updaters);g.__tsParticlesInternals.utils=__tsProxyFactory(g.__tsParticlesInternals.utils);g.__tsParticlesInternals.canvas=__tsProxyFactory(g.__tsParticlesInternals.canvas);g.__tsParticlesInternals.path=__tsProxyFactory(g.__tsParticlesInternals.path);g.tsparticlesInternalExports=g.tsparticlesInternalExports||{};})(typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:this);
|
|
2
|
-
/* Updater v4.
|
|
2
|
+
/* Updater v4.2.0 */
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tsparticles/engine')) :
|
|
5
5
|
typeof define === 'function' && define.amd ? define(['exports', '@tsparticles/engine'], factory) :
|
|
6
6
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.__tsParticlesInternals = global.__tsParticlesInternals || {}, global.__tsParticlesInternals.updaters = global.__tsParticlesInternals.updaters || {}, global.__tsParticlesInternals.updaters.outModes = global.__tsParticlesInternals.updaters.outModes || {}), global.__tsParticlesInternals.engine));
|
|
7
7
|
})(this, (function (exports, engine) { 'use strict';
|
|
8
8
|
|
|
9
|
-
const
|
|
9
|
+
const boundsMin = 0;
|
|
10
10
|
function bounceHorizontal(data) {
|
|
11
11
|
if ((data.outMode !== engine.OutMode.bounce && data.outMode !== engine.OutMode.split) ||
|
|
12
12
|
(data.direction !== engine.OutModeDirection.left && data.direction !== engine.OutModeDirection.right)) {
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
const velocity = data.particle.velocity.x;
|
|
22
22
|
let bounced = false;
|
|
23
23
|
if (data.outOfCanvas &&
|
|
24
|
-
((data.direction === engine.OutModeDirection.right && velocity > minVelocity
|
|
25
|
-
(data.direction === engine.OutModeDirection.left && velocity < minVelocity
|
|
24
|
+
((data.direction === engine.OutModeDirection.right && velocity > engine.minVelocity) ||
|
|
25
|
+
(data.direction === engine.OutModeDirection.left && velocity < engine.minVelocity))) {
|
|
26
26
|
const newVelocity = engine.getRangeValue(data.particle.options.bounce.horizontal.value);
|
|
27
27
|
data.particle.velocity.x *= -newVelocity;
|
|
28
28
|
bounced = true;
|
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
const velocity = data.particle.velocity.y;
|
|
56
56
|
let bounced = false;
|
|
57
57
|
if (data.outOfCanvas &&
|
|
58
|
-
((data.direction === engine.OutModeDirection.bottom && velocity > minVelocity
|
|
59
|
-
(data.direction === engine.OutModeDirection.top && velocity < minVelocity
|
|
58
|
+
((data.direction === engine.OutModeDirection.bottom && velocity > engine.minVelocity) ||
|
|
59
|
+
(data.direction === engine.OutModeDirection.top && velocity < engine.minVelocity))) {
|
|
60
60
|
const newVelocity = engine.getRangeValue(data.particle.options.bounce.vertical.value);
|
|
61
61
|
data.particle.velocity.y *= -newVelocity;
|
|
62
62
|
bounced = true;
|
|
@@ -109,7 +109,6 @@
|
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
const minVelocity$2 = 0;
|
|
113
112
|
class DestroyOutMode {
|
|
114
113
|
modes;
|
|
115
114
|
constructor(_container) {
|
|
@@ -128,10 +127,10 @@
|
|
|
128
127
|
break;
|
|
129
128
|
case engine.ParticleOutType.inside: {
|
|
130
129
|
const { dx, dy } = engine.getDistances(particle.position, particle.moveCenter), { x: vx, y: vy } = particle.velocity;
|
|
131
|
-
if ((vx < minVelocity
|
|
132
|
-
(vy < minVelocity
|
|
133
|
-
(vx >= minVelocity
|
|
134
|
-
(vy >= minVelocity
|
|
130
|
+
if ((vx < engine.minVelocity && dx > particle.moveCenter.radius) ||
|
|
131
|
+
(vy < engine.minVelocity && dy > particle.moveCenter.radius) ||
|
|
132
|
+
(vx >= engine.minVelocity && dx < -particle.moveCenter.radius) ||
|
|
133
|
+
(vy >= engine.minVelocity && dy < -particle.moveCenter.radius)) {
|
|
135
134
|
return;
|
|
136
135
|
}
|
|
137
136
|
break;
|
|
@@ -141,7 +140,6 @@
|
|
|
141
140
|
}
|
|
142
141
|
}
|
|
143
142
|
|
|
144
|
-
const minVelocity$1 = 0;
|
|
145
143
|
class NoneOutMode {
|
|
146
144
|
modes;
|
|
147
145
|
#container;
|
|
@@ -161,10 +159,10 @@
|
|
|
161
159
|
}
|
|
162
160
|
const gravityOptions = particle.options.move.gravity, container = this.#container, canvasSize = container.canvas.size, pRadius = particle.getRadius();
|
|
163
161
|
if (!gravityOptions.enable) {
|
|
164
|
-
if ((particle.velocity.y > minVelocity
|
|
165
|
-
(particle.velocity.y < minVelocity
|
|
166
|
-
(particle.velocity.x > minVelocity
|
|
167
|
-
(particle.velocity.x < minVelocity
|
|
162
|
+
if ((particle.velocity.y > engine.minVelocity && particle.position.y <= canvasSize.height + pRadius) ||
|
|
163
|
+
(particle.velocity.y < engine.minVelocity && particle.position.y >= -pRadius) ||
|
|
164
|
+
(particle.velocity.x > engine.minVelocity && particle.position.x <= canvasSize.width + pRadius) ||
|
|
165
|
+
(particle.velocity.x < engine.minVelocity && particle.position.x >= -pRadius)) {
|
|
168
166
|
return;
|
|
169
167
|
}
|
|
170
168
|
if (!engine.isPointInside(particle.position, container.canvas.size, engine.originPoint, pRadius, direction)) {
|
|
@@ -183,7 +181,7 @@
|
|
|
183
181
|
}
|
|
184
182
|
}
|
|
185
183
|
|
|
186
|
-
const
|
|
184
|
+
const updateVector = engine.Vector.origin;
|
|
187
185
|
class OutOutMode {
|
|
188
186
|
modes;
|
|
189
187
|
#container;
|
|
@@ -204,10 +202,10 @@
|
|
|
204
202
|
updateVector.angle = particle.velocity.angle + Math.PI;
|
|
205
203
|
updateVector.addTo(particle.moveCenter);
|
|
206
204
|
const { dx, dy } = engine.getDistances(particle.position, updateVector);
|
|
207
|
-
if ((vx <= minVelocity && dx >= minDistance) ||
|
|
208
|
-
(vy <= minVelocity && dy >= minDistance) ||
|
|
209
|
-
(vx >= minVelocity && dx <= minDistance) ||
|
|
210
|
-
(vy >= minVelocity && dy <= minDistance)) {
|
|
205
|
+
if ((vx <= engine.minVelocity && dx >= engine.minDistance) ||
|
|
206
|
+
(vy <= engine.minVelocity && dy >= engine.minDistance) ||
|
|
207
|
+
(vx >= engine.minVelocity && dx <= engine.minDistance) ||
|
|
208
|
+
(vy >= engine.minVelocity && dy <= engine.minDistance)) {
|
|
211
209
|
return;
|
|
212
210
|
}
|
|
213
211
|
particle.position.x = Math.floor(engine.randomInRangeValue({
|
|
@@ -331,21 +329,21 @@
|
|
|
331
329
|
this.#updateOutMode(particle, delta, outModes.right ?? outModes.default, engine.OutModeDirection.right);
|
|
332
330
|
this.#updateOutMode(particle, delta, outModes.top ?? outModes.default, engine.OutModeDirection.top);
|
|
333
331
|
}
|
|
334
|
-
#addUpdaterIfMissing
|
|
332
|
+
#addUpdaterIfMissing(particle, outMode, getUpdater) {
|
|
335
333
|
const outModes = particle.options.move.outModes;
|
|
336
334
|
if (!this.updaters.has(outMode) && checkOutMode(outModes, outMode)) {
|
|
337
335
|
this.updaters.set(outMode, getUpdater(this.#container));
|
|
338
336
|
}
|
|
339
|
-
}
|
|
340
|
-
#updateOutMode
|
|
337
|
+
}
|
|
338
|
+
#updateOutMode(particle, delta, outMode, direction) {
|
|
341
339
|
for (const updater of this.updaters.values()) {
|
|
342
340
|
updater.update(particle, direction, delta, outMode);
|
|
343
341
|
}
|
|
344
|
-
}
|
|
342
|
+
}
|
|
345
343
|
}
|
|
346
344
|
|
|
347
345
|
async function loadOutModesUpdater(engine) {
|
|
348
|
-
engine.checkVersion("4.
|
|
346
|
+
engine.checkVersion("4.2.0");
|
|
349
347
|
await engine.pluginManager.register(e => {
|
|
350
348
|
e.pluginManager.addParticleUpdater("outModes", container => {
|
|
351
349
|
return Promise.resolve(new OutOfCanvasUpdater(container));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t){t.__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.bundles=t.__tsParticlesInternals.bundles||{},t.__tsParticlesInternals.effects=t.__tsParticlesInternals.effects||{},t.__tsParticlesInternals.engine=t.__tsParticlesInternals.engine||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},t.__tsParticlesInternals.palettes=t.__tsParticlesInternals.palettes||{},t.__tsParticlesInternals.paths=t.__tsParticlesInternals.paths||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins.emittersShapes=t.__tsParticlesInternals.plugins.emittersShapes||{},t.__tsParticlesInternals.presets=t.__tsParticlesInternals.presets||{},t.__tsParticlesInternals.shapes=t.__tsParticlesInternals.shapes||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.utils=t.__tsParticlesInternals.utils||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas.utils=t.__tsParticlesInternals.canvas.utils||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path.utils=t.__tsParticlesInternals.path.utils||{};var e="undefined"!=typeof Proxy?function(t){return new Proxy(t,{get:function(t,e){return e in t||(t[e]={}),t[e]}})}:function(t){return t};t.__tsParticlesInternals.bundles=e(t.__tsParticlesInternals.bundles),t.__tsParticlesInternals.effects=e(t.__tsParticlesInternals.effects),t.__tsParticlesInternals.interactions=e(t.__tsParticlesInternals.interactions),t.__tsParticlesInternals.palettes=e(t.__tsParticlesInternals.palettes),t.__tsParticlesInternals.paths=e(t.__tsParticlesInternals.paths),t.__tsParticlesInternals.plugins=e(t.__tsParticlesInternals.plugins),t.__tsParticlesInternals.plugins.emittersShapes=e(t.__tsParticlesInternals.plugins.emittersShapes),t.__tsParticlesInternals.presets=e(t.__tsParticlesInternals.presets),t.__tsParticlesInternals.shapes=e(t.__tsParticlesInternals.shapes),t.__tsParticlesInternals.updaters=e(t.__tsParticlesInternals.updaters),t.__tsParticlesInternals.utils=e(t.__tsParticlesInternals.utils),t.__tsParticlesInternals.canvas=e(t.__tsParticlesInternals.canvas),t.__tsParticlesInternals.path=e(t.__tsParticlesInternals.path),t.tsparticlesInternalExports=t.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@tsparticles/engine")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/engine"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.updaters.outModes=t.__tsParticlesInternals.updaters.outModes||{}),t.__tsParticlesInternals.engine)}(this,function(t,e){"use strict";class s{modes;#t;#e;constructor(t){this.#t=t,this.modes=[e.OutMode.bounce,e.OutMode.split],this.#e=t.plugins.filter(t=>void 0!==t.particleBounce)}update(t,s,i,n){if(!this.modes.includes(n))return;const o=this.#t;let a=!1;for(const e of this.#e)if(a=e.particleBounce?.(t,i,s)??!1,a)break;if(a)return;const r=t.getPosition(),l=t.offset,c=t.getRadius(),d=e.calculateBounds(r,c),u=o.canvas.size,p=!t.isInsideCanvasForOutMode(n,s);!function(t){if(t.outMode!==e.OutMode.bounce&&t.outMode!==e.OutMode.split||t.direction!==e.OutModeDirection.left&&t.direction!==e.OutModeDirection.right)return;t.bounds.right<0&&t.direction===e.OutModeDirection.left?t.particle.position.x=t.size+t.offset.x:t.bounds.left>t.canvasSize.width&&t.direction===e.OutModeDirection.right&&(t.particle.position.x=t.canvasSize.width-t.size-t.offset.x);const s=t.particle.velocity.x;let i=!1;if(t.outOfCanvas&&(t.direction===e.OutModeDirection.right&&s>0||t.direction===e.OutModeDirection.left&&s<0)){const s=e.getRangeValue(t.particle.options.bounce.horizontal.value);t.particle.velocity.x*=-s,i=!0}if(!i)return;const n=t.offset.x+t.size;t.outOfCanvas&&t.direction===e.OutModeDirection.right?t.particle.position.x=t.canvasSize.width-n:t.outOfCanvas&&t.direction===e.OutModeDirection.left&&(t.particle.position.x=n),t.outMode===e.OutMode.split&&t.particle.destroy()}({particle:t,outMode:n,direction:s,bounds:d,canvasSize:u,offset:l,outOfCanvas:p,size:c}),function(t){if(t.outMode!==e.OutMode.bounce&&t.outMode!==e.OutMode.split||t.direction!==e.OutModeDirection.bottom&&t.direction!==e.OutModeDirection.top)return;t.bounds.bottom<0&&t.direction===e.OutModeDirection.top?t.particle.position.y=t.size+t.offset.y:t.bounds.top>t.canvasSize.height&&t.direction===e.OutModeDirection.bottom&&(t.particle.position.y=t.canvasSize.height-t.size-t.offset.y);const s=t.particle.velocity.y;let i=!1;if(t.outOfCanvas&&(t.direction===e.OutModeDirection.bottom&&s>0||t.direction===e.OutModeDirection.top&&s<0)){const s=e.getRangeValue(t.particle.options.bounce.vertical.value);t.particle.velocity.y*=-s,i=!0}if(!i)return;const n=t.offset.y+t.size;t.outOfCanvas&&t.direction===e.OutModeDirection.bottom?t.particle.position.y=t.canvasSize.height-n:t.outOfCanvas&&t.direction===e.OutModeDirection.top&&(t.particle.position.y=n),t.outMode===e.OutMode.split&&t.particle.destroy()}({particle:t,outMode:n,direction:s,bounds:d,canvasSize:u,offset:l,outOfCanvas:p,size:c})}}class i{modes;constructor(t){this.modes=[e.OutMode.destroy]}update(t,s,i,n){if(this.modes.includes(n)){switch(t.outType){case e.ParticleOutType.normal:case e.ParticleOutType.outside:if(t.isInsideCanvasForOutMode(n,s))return;break;case e.ParticleOutType.inside:{const{dx:s,dy:i}=e.getDistances(t.position,t.moveCenter),{x:n,y:o}=t.velocity;if(n<0&&s>t.moveCenter.radius||o<0&&i>t.moveCenter.radius||n>=0&&s<-t.moveCenter.radius||o>=0&&i<-t.moveCenter.radius)return;break}}t.destroy(!0)}}}class n{modes;#t;constructor(t){this.#t=t,this.modes=[e.OutMode.none]}update(t,s,i,n){if(!this.modes.includes(n))return;if((t.options.move.distance.horizontal&&(s===e.OutModeDirection.left||s===e.OutModeDirection.right))??(t.options.move.distance.vertical&&(s===e.OutModeDirection.top||s===e.OutModeDirection.bottom)))return;const o=t.options.move.gravity,a=this.#t,r=a.canvas.size,l=t.getRadius();if(o.enable){const i=t.position;(!o.inverse&&i.y>r.height+l&&s===e.OutModeDirection.bottom||o.inverse&&i.y<-l&&s===e.OutModeDirection.top)&&t.destroy()}else{if(t.velocity.y>0&&t.position.y<=r.height+l||t.velocity.y<0&&t.position.y>=-l||t.velocity.x>0&&t.position.x<=r.width+l||t.velocity.x<0&&t.position.x>=-l)return;e.isPointInside(t.position,a.canvas.size,e.originPoint,l,s)||t.destroy()}}}const o=e.Vector.origin;class a{modes;#t;constructor(t){this.#t=t,this.modes=[e.OutMode.out]}update(t,s,i,n){if(!this.modes.includes(n))return;const a=this.#t;switch(t.outType){case e.ParticleOutType.inside:{const{x:s,y:i}=t.velocity;o.setTo(e.originPoint),o.length=t.moveCenter.radius,o.angle=t.velocity.angle+Math.PI,o.addTo(t.moveCenter);const{dx:n,dy:r}=e.getDistances(t.position,o);if(s<=0&&n>=0||i<=0&&r>=0||s>=0&&n<=0||i>=0&&r<=0)return;t.position.x=Math.floor(e.randomInRangeValue({min:0,max:a.canvas.size.width})),t.position.y=Math.floor(e.randomInRangeValue({min:0,max:a.canvas.size.height}));const{dx:l,dy:c}=e.getDistances(t.position,t.moveCenter);t.direction=Math.atan2(-c,-l),t.velocity.angle=t.direction,t.justWarped=!0;break}default:if(t.isInsideCanvasForOutMode(n,s))return;switch(t.outType){case e.ParticleOutType.outside:{t.position.x=Math.floor(e.randomInRangeValue({min:-t.moveCenter.radius,max:t.moveCenter.radius}))+t.moveCenter.x,t.position.y=Math.floor(e.randomInRangeValue({min:-t.moveCenter.radius,max:t.moveCenter.radius}))+t.moveCenter.y;const{dx:s,dy:i}=e.getDistances(t.position,t.moveCenter);t.moveCenter.radius&&(t.direction=Math.atan2(i,s),t.velocity.angle=t.direction),t.justWarped=!0;break}case e.ParticleOutType.normal:{const i=t.options.move.warp,n=a.canvas.size,o={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},r=t.getRadius(),l=e.calculateBounds(t.position,r);s===e.OutModeDirection.right&&l.left>n.width+t.offset.x?(t.position.x=o.left,t.initialPosition.x=t.position.x,i||(t.position.y=e.getRandom()*n.height,t.initialPosition.y=t.position.y),t.justWarped=!0):s===e.OutModeDirection.left&&l.right<-t.offset.x&&(t.position.x=o.right,t.initialPosition.x=t.position.x,i||(t.position.y=e.getRandom()*n.height,t.initialPosition.y=t.position.y),t.justWarped=!0),s===e.OutModeDirection.bottom&&l.top>n.height+t.offset.y?(i||(t.position.x=e.getRandom()*n.width,t.initialPosition.x=t.position.x),t.position.y=o.top,t.initialPosition.y=t.position.y,t.justWarped=!0):s===e.OutModeDirection.top&&l.bottom<-t.offset.y&&(i||(t.position.x=e.getRandom()*n.width,t.initialPosition.x=t.position.x),t.position.y=o.bottom,t.initialPosition.y=t.position.y,t.justWarped=!0);break}}}}}class r{updaters;#t;constructor(t){this.#t=t,this.updaters=new Map}init(t){this.#s(t,e.OutMode.bounce,t=>new s(t)),this.#s(t,e.OutMode.out,t=>new a(t)),this.#s(t,e.OutMode.destroy,t=>new i(t)),this.#s(t,e.OutMode.none,t=>new n(t))}isEnabled(t){return!t.destroyed&&!t.spawning}update(t,s){const i=t.options.move.outModes;t.justWarped=!1,this.#i(t,s,i.bottom??i.default,e.OutModeDirection.bottom),this.#i(t,s,i.left??i.default,e.OutModeDirection.left),this.#i(t,s,i.right??i.default,e.OutModeDirection.right),this.#i(t,s,i.top??i.default,e.OutModeDirection.top)}#s=(t,e,s)=>{const i=t.options.move.outModes;!this.updaters.has(e)&&((t,e)=>t.default===e||t.bottom===e||t.left===e||t.right===e||t.top===e)(i,e)&&this.updaters.set(e,s(this.#t))};#i=(t,e,s,i)=>{for(const n of this.updaters.values())n.update(t,i,e,s)}}async function l(t){t.checkVersion("4.1.3"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("outModes",t=>Promise.resolve(new r(t)))})}const c=globalThis;c.__tsParticlesInternals=c.__tsParticlesInternals??{},c.loadOutModesUpdater=l,t.loadOutModesUpdater=l}),Object.assign(globalThis.window||globalThis,{loadOutModesUpdater:(globalThis.__tsParticlesInternals.updaters.outModes||{}).loadOutModesUpdater}),delete(globalThis.window||globalThis).tsparticlesInternalExports;
|
|
1
|
+
!function(t){t.__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.bundles=t.__tsParticlesInternals.bundles||{},t.__tsParticlesInternals.effects=t.__tsParticlesInternals.effects||{},t.__tsParticlesInternals.engine=t.__tsParticlesInternals.engine||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},t.__tsParticlesInternals.palettes=t.__tsParticlesInternals.palettes||{},t.__tsParticlesInternals.paths=t.__tsParticlesInternals.paths||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins.emittersShapes=t.__tsParticlesInternals.plugins.emittersShapes||{},t.__tsParticlesInternals.presets=t.__tsParticlesInternals.presets||{},t.__tsParticlesInternals.shapes=t.__tsParticlesInternals.shapes||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.utils=t.__tsParticlesInternals.utils||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas.utils=t.__tsParticlesInternals.canvas.utils||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path.utils=t.__tsParticlesInternals.path.utils||{};var e="undefined"!=typeof Proxy?function(t){return new Proxy(t,{get:function(t,e){return e in t||(t[e]={}),t[e]}})}:function(t){return t};t.__tsParticlesInternals.bundles=e(t.__tsParticlesInternals.bundles),t.__tsParticlesInternals.effects=e(t.__tsParticlesInternals.effects),t.__tsParticlesInternals.interactions=e(t.__tsParticlesInternals.interactions),t.__tsParticlesInternals.palettes=e(t.__tsParticlesInternals.palettes),t.__tsParticlesInternals.paths=e(t.__tsParticlesInternals.paths),t.__tsParticlesInternals.plugins=e(t.__tsParticlesInternals.plugins),t.__tsParticlesInternals.plugins.emittersShapes=e(t.__tsParticlesInternals.plugins.emittersShapes),t.__tsParticlesInternals.presets=e(t.__tsParticlesInternals.presets),t.__tsParticlesInternals.shapes=e(t.__tsParticlesInternals.shapes),t.__tsParticlesInternals.updaters=e(t.__tsParticlesInternals.updaters),t.__tsParticlesInternals.utils=e(t.__tsParticlesInternals.utils),t.__tsParticlesInternals.canvas=e(t.__tsParticlesInternals.canvas),t.__tsParticlesInternals.path=e(t.__tsParticlesInternals.path),t.tsparticlesInternalExports=t.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@tsparticles/engine")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/engine"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.updaters.outModes=t.__tsParticlesInternals.updaters.outModes||{}),t.__tsParticlesInternals.engine)}(this,function(t,e){"use strict";class i{modes;#t;#e;constructor(t){this.#t=t,this.modes=[e.OutMode.bounce,e.OutMode.split],this.#e=t.plugins.filter(t=>void 0!==t.particleBounce)}update(t,i,s,n){if(!this.modes.includes(n))return;const o=this.#t;let a=!1;for(const e of this.#e)if(a=e.particleBounce?.(t,s,i)??!1,a)break;if(a)return;const r=t.getPosition(),l=t.offset,c=t.getRadius(),d=e.calculateBounds(r,c),u=o.canvas.size,p=!t.isInsideCanvasForOutMode(n,i);!function(t){if(t.outMode!==e.OutMode.bounce&&t.outMode!==e.OutMode.split||t.direction!==e.OutModeDirection.left&&t.direction!==e.OutModeDirection.right)return;t.bounds.right<0&&t.direction===e.OutModeDirection.left?t.particle.position.x=t.size+t.offset.x:t.bounds.left>t.canvasSize.width&&t.direction===e.OutModeDirection.right&&(t.particle.position.x=t.canvasSize.width-t.size-t.offset.x);const i=t.particle.velocity.x;let s=!1;if(t.outOfCanvas&&(t.direction===e.OutModeDirection.right&&i>e.minVelocity||t.direction===e.OutModeDirection.left&&i<e.minVelocity)){const i=e.getRangeValue(t.particle.options.bounce.horizontal.value);t.particle.velocity.x*=-i,s=!0}if(!s)return;const n=t.offset.x+t.size;t.outOfCanvas&&t.direction===e.OutModeDirection.right?t.particle.position.x=t.canvasSize.width-n:t.outOfCanvas&&t.direction===e.OutModeDirection.left&&(t.particle.position.x=n),t.outMode===e.OutMode.split&&t.particle.destroy()}({particle:t,outMode:n,direction:i,bounds:d,canvasSize:u,offset:l,outOfCanvas:p,size:c}),function(t){if(t.outMode!==e.OutMode.bounce&&t.outMode!==e.OutMode.split||t.direction!==e.OutModeDirection.bottom&&t.direction!==e.OutModeDirection.top)return;t.bounds.bottom<0&&t.direction===e.OutModeDirection.top?t.particle.position.y=t.size+t.offset.y:t.bounds.top>t.canvasSize.height&&t.direction===e.OutModeDirection.bottom&&(t.particle.position.y=t.canvasSize.height-t.size-t.offset.y);const i=t.particle.velocity.y;let s=!1;if(t.outOfCanvas&&(t.direction===e.OutModeDirection.bottom&&i>e.minVelocity||t.direction===e.OutModeDirection.top&&i<e.minVelocity)){const i=e.getRangeValue(t.particle.options.bounce.vertical.value);t.particle.velocity.y*=-i,s=!0}if(!s)return;const n=t.offset.y+t.size;t.outOfCanvas&&t.direction===e.OutModeDirection.bottom?t.particle.position.y=t.canvasSize.height-n:t.outOfCanvas&&t.direction===e.OutModeDirection.top&&(t.particle.position.y=n),t.outMode===e.OutMode.split&&t.particle.destroy()}({particle:t,outMode:n,direction:i,bounds:d,canvasSize:u,offset:l,outOfCanvas:p,size:c})}}class s{modes;constructor(t){this.modes=[e.OutMode.destroy]}update(t,i,s,n){if(this.modes.includes(n)){switch(t.outType){case e.ParticleOutType.normal:case e.ParticleOutType.outside:if(t.isInsideCanvasForOutMode(n,i))return;break;case e.ParticleOutType.inside:{const{dx:i,dy:s}=e.getDistances(t.position,t.moveCenter),{x:n,y:o}=t.velocity;if(n<e.minVelocity&&i>t.moveCenter.radius||o<e.minVelocity&&s>t.moveCenter.radius||n>=e.minVelocity&&i<-t.moveCenter.radius||o>=e.minVelocity&&s<-t.moveCenter.radius)return;break}}t.destroy(!0)}}}class n{modes;#t;constructor(t){this.#t=t,this.modes=[e.OutMode.none]}update(t,i,s,n){if(!this.modes.includes(n))return;if((t.options.move.distance.horizontal&&(i===e.OutModeDirection.left||i===e.OutModeDirection.right))??(t.options.move.distance.vertical&&(i===e.OutModeDirection.top||i===e.OutModeDirection.bottom)))return;const o=t.options.move.gravity,a=this.#t,r=a.canvas.size,l=t.getRadius();if(o.enable){const s=t.position;(!o.inverse&&s.y>r.height+l&&i===e.OutModeDirection.bottom||o.inverse&&s.y<-l&&i===e.OutModeDirection.top)&&t.destroy()}else{if(t.velocity.y>e.minVelocity&&t.position.y<=r.height+l||t.velocity.y<e.minVelocity&&t.position.y>=-l||t.velocity.x>e.minVelocity&&t.position.x<=r.width+l||t.velocity.x<e.minVelocity&&t.position.x>=-l)return;e.isPointInside(t.position,a.canvas.size,e.originPoint,l,i)||t.destroy()}}}const o=e.Vector.origin;class a{modes;#t;constructor(t){this.#t=t,this.modes=[e.OutMode.out]}update(t,i,s,n){if(!this.modes.includes(n))return;const a=this.#t;switch(t.outType){case e.ParticleOutType.inside:{const{x:i,y:s}=t.velocity;o.setTo(e.originPoint),o.length=t.moveCenter.radius,o.angle=t.velocity.angle+Math.PI,o.addTo(t.moveCenter);const{dx:n,dy:r}=e.getDistances(t.position,o);if(i<=e.minVelocity&&n>=e.minDistance||s<=e.minVelocity&&r>=e.minDistance||i>=e.minVelocity&&n<=e.minDistance||s>=e.minVelocity&&r<=e.minDistance)return;t.position.x=Math.floor(e.randomInRangeValue({min:0,max:a.canvas.size.width})),t.position.y=Math.floor(e.randomInRangeValue({min:0,max:a.canvas.size.height}));const{dx:l,dy:c}=e.getDistances(t.position,t.moveCenter);t.direction=Math.atan2(-c,-l),t.velocity.angle=t.direction,t.justWarped=!0;break}default:if(t.isInsideCanvasForOutMode(n,i))return;switch(t.outType){case e.ParticleOutType.outside:{t.position.x=Math.floor(e.randomInRangeValue({min:-t.moveCenter.radius,max:t.moveCenter.radius}))+t.moveCenter.x,t.position.y=Math.floor(e.randomInRangeValue({min:-t.moveCenter.radius,max:t.moveCenter.radius}))+t.moveCenter.y;const{dx:i,dy:s}=e.getDistances(t.position,t.moveCenter);t.moveCenter.radius&&(t.direction=Math.atan2(s,i),t.velocity.angle=t.direction),t.justWarped=!0;break}case e.ParticleOutType.normal:{const s=t.options.move.warp,n=a.canvas.size,o={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},r=t.getRadius(),l=e.calculateBounds(t.position,r);i===e.OutModeDirection.right&&l.left>n.width+t.offset.x?(t.position.x=o.left,t.initialPosition.x=t.position.x,s||(t.position.y=e.getRandom()*n.height,t.initialPosition.y=t.position.y),t.justWarped=!0):i===e.OutModeDirection.left&&l.right<-t.offset.x&&(t.position.x=o.right,t.initialPosition.x=t.position.x,s||(t.position.y=e.getRandom()*n.height,t.initialPosition.y=t.position.y),t.justWarped=!0),i===e.OutModeDirection.bottom&&l.top>n.height+t.offset.y?(s||(t.position.x=e.getRandom()*n.width,t.initialPosition.x=t.position.x),t.position.y=o.top,t.initialPosition.y=t.position.y,t.justWarped=!0):i===e.OutModeDirection.top&&l.bottom<-t.offset.y&&(s||(t.position.x=e.getRandom()*n.width,t.initialPosition.x=t.position.x),t.position.y=o.bottom,t.initialPosition.y=t.position.y,t.justWarped=!0);break}}}}}class r{updaters;#t;constructor(t){this.#t=t,this.updaters=new Map}init(t){this.#i(t,e.OutMode.bounce,t=>new i(t)),this.#i(t,e.OutMode.out,t=>new a(t)),this.#i(t,e.OutMode.destroy,t=>new s(t)),this.#i(t,e.OutMode.none,t=>new n(t))}isEnabled(t){return!t.destroyed&&!t.spawning}update(t,i){const s=t.options.move.outModes;t.justWarped=!1,this.#s(t,i,s.bottom??s.default,e.OutModeDirection.bottom),this.#s(t,i,s.left??s.default,e.OutModeDirection.left),this.#s(t,i,s.right??s.default,e.OutModeDirection.right),this.#s(t,i,s.top??s.default,e.OutModeDirection.top)}#i(t,e,i){const s=t.options.move.outModes;!this.updaters.has(e)&&((t,e)=>t.default===e||t.bottom===e||t.left===e||t.right===e||t.top===e)(s,e)&&this.updaters.set(e,i(this.#t))}#s(t,e,i,s){for(const n of this.updaters.values())n.update(t,s,e,i)}}async function l(t){t.checkVersion("4.2.0"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("outModes",t=>Promise.resolve(new r(t)))})}const c=globalThis;c.__tsParticlesInternals=c.__tsParticlesInternals??{},c.loadOutModesUpdater=l,t.loadOutModesUpdater=l}),Object.assign(globalThis.window||globalThis,{loadOutModesUpdater:(globalThis.__tsParticlesInternals.updaters.outModes||{}).loadOutModesUpdater}),delete(globalThis.window||globalThis).tsparticlesInternalExports;
|