@tsparticles/updater-out-modes 3.2.2 → 3.4.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/BounceOutMode.js +7 -6
- package/browser/DestroyOutMode.js +6 -7
- package/browser/NoneOutMode.js +7 -8
- package/browser/OutOfCanvasUpdater.js +17 -16
- package/browser/OutOutMode.js +10 -11
- package/browser/Utils.js +19 -19
- package/browser/index.js +3 -3
- package/cjs/BounceOutMode.js +8 -30
- package/cjs/DestroyOutMode.js +5 -6
- package/cjs/NoneOutMode.js +6 -7
- package/cjs/OutOfCanvasUpdater.js +21 -43
- package/cjs/OutOutMode.js +9 -10
- package/cjs/Utils.js +18 -18
- package/cjs/index.js +3 -26
- package/esm/BounceOutMode.js +7 -6
- package/esm/DestroyOutMode.js +6 -7
- package/esm/NoneOutMode.js +7 -8
- package/esm/OutOfCanvasUpdater.js +17 -16
- package/esm/OutOutMode.js +10 -11
- package/esm/Utils.js +19 -19
- package/esm/index.js +3 -3
- package/package.json +2 -2
- package/report.html +1 -1
- package/tsparticles.updater.out-modes.js +62 -200
- package/tsparticles.updater.out-modes.min.js +1 -1
- package/tsparticles.updater.out-modes.min.js.LICENSE.txt +1 -1
- package/types/BounceOutMode.d.ts +1 -1
- package/types/DestroyOutMode.d.ts +1 -1
- package/types/IOutModeManager.d.ts +1 -1
- package/types/NoneOutMode.d.ts +1 -1
- package/types/OutOfCanvasUpdater.d.ts +2 -2
- package/types/OutOutMode.d.ts +1 -1
- package/umd/BounceOutMode.js +9 -32
- package/umd/DestroyOutMode.js +5 -6
- package/umd/NoneOutMode.js +6 -7
- package/umd/OutOfCanvasUpdater.js +22 -45
- package/umd/OutOutMode.js +9 -10
- package/umd/Utils.js +18 -18
- package/umd/index.js +4 -28
- package/103.min.js +0 -2
- package/103.min.js.LICENSE.txt +0 -1
- package/388.min.js +0 -2
- package/388.min.js.LICENSE.txt +0 -1
- package/53.min.js +0 -2
- package/53.min.js.LICENSE.txt +0 -1
- package/569.min.js +0 -2
- package/569.min.js.LICENSE.txt +0 -1
- package/886.min.js +0 -2
- package/886.min.js.LICENSE.txt +0 -1
- package/920.min.js +0 -2
- package/920.min.js.LICENSE.txt +0 -1
- package/dist_browser_BounceOutMode_js.js +0 -30
- package/dist_browser_DestroyOutMode_js.js +0 -30
- package/dist_browser_NoneOutMode_js.js +0 -30
- package/dist_browser_OutOfCanvasUpdater_js.js +0 -30
- package/dist_browser_OutOutMode_js.js +0 -30
- package/dist_browser_Utils_js.js +0 -30
|
@@ -1,39 +1,20 @@
|
|
|
1
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
2
|
-
if (k2 === undefined) k2 = k;
|
|
3
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
4
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
5
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
6
|
-
}
|
|
7
|
-
Object.defineProperty(o, k2, desc);
|
|
8
|
-
}) : (function(o, m, k, k2) {
|
|
9
|
-
if (k2 === undefined) k2 = k;
|
|
10
|
-
o[k2] = m[k];
|
|
11
|
-
}));
|
|
12
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
13
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
14
|
-
}) : function(o, v) {
|
|
15
|
-
o["default"] = v;
|
|
16
|
-
});
|
|
17
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
18
|
-
if (mod && mod.__esModule) return mod;
|
|
19
|
-
var result = {};
|
|
20
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
21
|
-
__setModuleDefault(result, mod);
|
|
22
|
-
return result;
|
|
23
|
-
};
|
|
24
1
|
(function (factory) {
|
|
25
2
|
if (typeof module === "object" && typeof module.exports === "object") {
|
|
26
3
|
var v = factory(require, exports);
|
|
27
4
|
if (v !== undefined) module.exports = v;
|
|
28
5
|
}
|
|
29
6
|
else if (typeof define === "function" && define.amd) {
|
|
30
|
-
define(["require", "exports"], factory);
|
|
7
|
+
define(["require", "exports", "@tsparticles/engine", "./BounceOutMode.js", "./DestroyOutMode.js", "./NoneOutMode.js", "./OutOutMode.js"], factory);
|
|
31
8
|
}
|
|
32
9
|
})(function (require, exports) {
|
|
33
10
|
"use strict";
|
|
34
|
-
var __syncRequire = typeof module === "object" && typeof module.exports === "object";
|
|
35
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
12
|
exports.OutOfCanvasUpdater = void 0;
|
|
13
|
+
const engine_1 = require("@tsparticles/engine");
|
|
14
|
+
const BounceOutMode_js_1 = require("./BounceOutMode.js");
|
|
15
|
+
const DestroyOutMode_js_1 = require("./DestroyOutMode.js");
|
|
16
|
+
const NoneOutMode_js_1 = require("./NoneOutMode.js");
|
|
17
|
+
const OutOutMode_js_1 = require("./OutOutMode.js");
|
|
37
18
|
const checkOutMode = (outModes, outMode) => {
|
|
38
19
|
return (outModes.default === outMode ||
|
|
39
20
|
outModes.bottom === outMode ||
|
|
@@ -43,43 +24,39 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
43
24
|
};
|
|
44
25
|
class OutOfCanvasUpdater {
|
|
45
26
|
constructor(container) {
|
|
46
|
-
this._updateOutMode =
|
|
27
|
+
this._updateOutMode = (particle, delta, outMode, direction) => {
|
|
47
28
|
for (const updater of this.updaters) {
|
|
48
|
-
|
|
29
|
+
updater.update(particle, direction, delta, outMode);
|
|
49
30
|
}
|
|
50
31
|
};
|
|
51
32
|
this.container = container;
|
|
52
33
|
this.updaters = [];
|
|
53
34
|
}
|
|
54
|
-
|
|
35
|
+
init(particle) {
|
|
55
36
|
this.updaters = [];
|
|
56
37
|
const outModes = particle.options.move.outModes;
|
|
57
|
-
if (checkOutMode(outModes,
|
|
58
|
-
|
|
59
|
-
this.updaters.push(new BounceOutMode(this.container));
|
|
38
|
+
if (checkOutMode(outModes, engine_1.OutMode.bounce)) {
|
|
39
|
+
this.updaters.push(new BounceOutMode_js_1.BounceOutMode(this.container));
|
|
60
40
|
}
|
|
61
|
-
else if (checkOutMode(outModes,
|
|
62
|
-
|
|
63
|
-
this.updaters.push(new OutOutMode(this.container));
|
|
41
|
+
else if (checkOutMode(outModes, engine_1.OutMode.out)) {
|
|
42
|
+
this.updaters.push(new OutOutMode_js_1.OutOutMode(this.container));
|
|
64
43
|
}
|
|
65
|
-
else if (checkOutMode(outModes,
|
|
66
|
-
|
|
67
|
-
this.updaters.push(new DestroyOutMode(this.container));
|
|
44
|
+
else if (checkOutMode(outModes, engine_1.OutMode.destroy)) {
|
|
45
|
+
this.updaters.push(new DestroyOutMode_js_1.DestroyOutMode(this.container));
|
|
68
46
|
}
|
|
69
|
-
else if (checkOutMode(outModes,
|
|
70
|
-
|
|
71
|
-
this.updaters.push(new NoneOutMode(this.container));
|
|
47
|
+
else if (checkOutMode(outModes, engine_1.OutMode.none)) {
|
|
48
|
+
this.updaters.push(new NoneOutMode_js_1.NoneOutMode(this.container));
|
|
72
49
|
}
|
|
73
50
|
}
|
|
74
51
|
isEnabled(particle) {
|
|
75
52
|
return !particle.destroyed && !particle.spawning;
|
|
76
53
|
}
|
|
77
|
-
|
|
54
|
+
update(particle, delta) {
|
|
78
55
|
const outModes = particle.options.move.outModes;
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
56
|
+
this._updateOutMode(particle, delta, outModes.bottom ?? outModes.default, engine_1.OutModeDirection.bottom);
|
|
57
|
+
this._updateOutMode(particle, delta, outModes.left ?? outModes.default, engine_1.OutModeDirection.left);
|
|
58
|
+
this._updateOutMode(particle, delta, outModes.right ?? outModes.default, engine_1.OutModeDirection.right);
|
|
59
|
+
this._updateOutMode(particle, delta, outModes.top ?? outModes.default, engine_1.OutModeDirection.top);
|
|
83
60
|
}
|
|
84
61
|
}
|
|
85
62
|
exports.OutOfCanvasUpdater = OutOfCanvasUpdater;
|
package/umd/OutOutMode.js
CHANGED
|
@@ -15,15 +15,15 @@
|
|
|
15
15
|
class OutOutMode {
|
|
16
16
|
constructor(container) {
|
|
17
17
|
this.container = container;
|
|
18
|
-
this.modes = [
|
|
18
|
+
this.modes = [engine_1.OutMode.out];
|
|
19
19
|
}
|
|
20
|
-
|
|
20
|
+
update(particle, direction, delta, outMode) {
|
|
21
21
|
if (!this.modes.includes(outMode)) {
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
24
|
const container = this.container;
|
|
25
25
|
switch (particle.outType) {
|
|
26
|
-
case
|
|
26
|
+
case engine_1.ParticleOutType.inside: {
|
|
27
27
|
const { x: vx, y: vy } = particle.velocity;
|
|
28
28
|
const circVec = engine_1.Vector.origin;
|
|
29
29
|
circVec.length = particle.moveCenter.radius;
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
return;
|
|
55
55
|
}
|
|
56
56
|
switch (particle.outType) {
|
|
57
|
-
case
|
|
57
|
+
case engine_1.ParticleOutType.outside: {
|
|
58
58
|
particle.position.x =
|
|
59
59
|
Math.floor((0, engine_1.randomInRange)({
|
|
60
60
|
min: -particle.moveCenter.radius,
|
|
@@ -72,14 +72,14 @@
|
|
|
72
72
|
}
|
|
73
73
|
break;
|
|
74
74
|
}
|
|
75
|
-
case
|
|
75
|
+
case engine_1.ParticleOutType.normal: {
|
|
76
76
|
const warp = particle.options.move.warp, canvasSize = container.canvas.size, newPos = {
|
|
77
77
|
bottom: canvasSize.height + particle.getRadius() + particle.offset.y,
|
|
78
78
|
left: -particle.getRadius() - particle.offset.x,
|
|
79
79
|
right: canvasSize.width + particle.getRadius() + particle.offset.x,
|
|
80
80
|
top: -particle.getRadius() - particle.offset.y,
|
|
81
81
|
}, sizeValue = particle.getRadius(), nextBounds = (0, engine_1.calculateBounds)(particle.position, sizeValue);
|
|
82
|
-
if (direction ===
|
|
82
|
+
if (direction === engine_1.OutModeDirection.right &&
|
|
83
83
|
nextBounds.left > canvasSize.width + particle.offset.x) {
|
|
84
84
|
particle.position.x = newPos.left;
|
|
85
85
|
particle.initialPosition.x = particle.position.x;
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
particle.initialPosition.y = particle.position.y;
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
-
else if (direction ===
|
|
91
|
+
else if (direction === engine_1.OutModeDirection.left && nextBounds.right < -particle.offset.x) {
|
|
92
92
|
particle.position.x = newPos.right;
|
|
93
93
|
particle.initialPosition.x = particle.position.x;
|
|
94
94
|
if (!warp) {
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
particle.initialPosition.y = particle.position.y;
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
if (direction ===
|
|
99
|
+
if (direction === engine_1.OutModeDirection.bottom &&
|
|
100
100
|
nextBounds.top > canvasSize.height + particle.offset.y) {
|
|
101
101
|
if (!warp) {
|
|
102
102
|
particle.position.x = (0, engine_1.getRandom)() * canvasSize.width;
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
particle.position.y = newPos.top;
|
|
106
106
|
particle.initialPosition.y = particle.position.y;
|
|
107
107
|
}
|
|
108
|
-
else if (direction ===
|
|
108
|
+
else if (direction === engine_1.OutModeDirection.top && nextBounds.bottom < -particle.offset.y) {
|
|
109
109
|
if (!warp) {
|
|
110
110
|
particle.position.x = (0, engine_1.getRandom)() * canvasSize.width;
|
|
111
111
|
particle.initialPosition.x = particle.position.x;
|
|
@@ -119,7 +119,6 @@
|
|
|
119
119
|
break;
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
|
-
await Promise.resolve();
|
|
123
122
|
}
|
|
124
123
|
}
|
|
125
124
|
exports.OutOutMode = OutOutMode;
|
package/umd/Utils.js
CHANGED
|
@@ -13,22 +13,22 @@
|
|
|
13
13
|
const engine_1 = require("@tsparticles/engine");
|
|
14
14
|
const minVelocity = 0, boundsMin = 0;
|
|
15
15
|
function bounceHorizontal(data) {
|
|
16
|
-
if ((data.outMode !==
|
|
17
|
-
(data.direction !==
|
|
16
|
+
if ((data.outMode !== engine_1.OutMode.bounce && data.outMode !== engine_1.OutMode.split) ||
|
|
17
|
+
(data.direction !== engine_1.OutModeDirection.left && data.direction !== engine_1.OutModeDirection.right)) {
|
|
18
18
|
return;
|
|
19
19
|
}
|
|
20
|
-
if (data.bounds.right < boundsMin && data.direction ===
|
|
20
|
+
if (data.bounds.right < boundsMin && data.direction === engine_1.OutModeDirection.left) {
|
|
21
21
|
data.particle.position.x = data.size + data.offset.x;
|
|
22
22
|
}
|
|
23
|
-
else if (data.bounds.left > data.canvasSize.width && data.direction ===
|
|
23
|
+
else if (data.bounds.left > data.canvasSize.width && data.direction === engine_1.OutModeDirection.right) {
|
|
24
24
|
data.particle.position.x = data.canvasSize.width - data.size - data.offset.x;
|
|
25
25
|
}
|
|
26
26
|
const velocity = data.particle.velocity.x;
|
|
27
27
|
let bounced = false;
|
|
28
|
-
if ((data.direction ===
|
|
28
|
+
if ((data.direction === engine_1.OutModeDirection.right &&
|
|
29
29
|
data.bounds.right >= data.canvasSize.width &&
|
|
30
30
|
velocity > minVelocity) ||
|
|
31
|
-
(data.direction ===
|
|
31
|
+
(data.direction === engine_1.OutModeDirection.left && data.bounds.left <= boundsMin && velocity < minVelocity)) {
|
|
32
32
|
const newVelocity = (0, engine_1.getRangeValue)(data.particle.options.bounce.horizontal.value);
|
|
33
33
|
data.particle.velocity.x *= -newVelocity;
|
|
34
34
|
bounced = true;
|
|
@@ -37,34 +37,34 @@
|
|
|
37
37
|
return;
|
|
38
38
|
}
|
|
39
39
|
const minPos = data.offset.x + data.size;
|
|
40
|
-
if (data.bounds.right >= data.canvasSize.width && data.direction ===
|
|
40
|
+
if (data.bounds.right >= data.canvasSize.width && data.direction === engine_1.OutModeDirection.right) {
|
|
41
41
|
data.particle.position.x = data.canvasSize.width - minPos;
|
|
42
42
|
}
|
|
43
|
-
else if (data.bounds.left <= boundsMin && data.direction ===
|
|
43
|
+
else if (data.bounds.left <= boundsMin && data.direction === engine_1.OutModeDirection.left) {
|
|
44
44
|
data.particle.position.x = minPos;
|
|
45
45
|
}
|
|
46
|
-
if (data.outMode ===
|
|
46
|
+
if (data.outMode === engine_1.OutMode.split) {
|
|
47
47
|
data.particle.destroy();
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
exports.bounceHorizontal = bounceHorizontal;
|
|
51
51
|
function bounceVertical(data) {
|
|
52
|
-
if ((data.outMode !==
|
|
53
|
-
(data.direction !==
|
|
52
|
+
if ((data.outMode !== engine_1.OutMode.bounce && data.outMode !== engine_1.OutMode.split) ||
|
|
53
|
+
(data.direction !== engine_1.OutModeDirection.bottom && data.direction !== engine_1.OutModeDirection.top)) {
|
|
54
54
|
return;
|
|
55
55
|
}
|
|
56
|
-
if (data.bounds.bottom < boundsMin && data.direction ===
|
|
56
|
+
if (data.bounds.bottom < boundsMin && data.direction === engine_1.OutModeDirection.top) {
|
|
57
57
|
data.particle.position.y = data.size + data.offset.y;
|
|
58
58
|
}
|
|
59
|
-
else if (data.bounds.top > data.canvasSize.height && data.direction ===
|
|
59
|
+
else if (data.bounds.top > data.canvasSize.height && data.direction === engine_1.OutModeDirection.bottom) {
|
|
60
60
|
data.particle.position.y = data.canvasSize.height - data.size - data.offset.y;
|
|
61
61
|
}
|
|
62
62
|
const velocity = data.particle.velocity.y;
|
|
63
63
|
let bounced = false;
|
|
64
|
-
if ((data.direction ===
|
|
64
|
+
if ((data.direction === engine_1.OutModeDirection.bottom &&
|
|
65
65
|
data.bounds.bottom >= data.canvasSize.height &&
|
|
66
66
|
velocity > minVelocity) ||
|
|
67
|
-
(data.direction ===
|
|
67
|
+
(data.direction === engine_1.OutModeDirection.top && data.bounds.top <= boundsMin && velocity < minVelocity)) {
|
|
68
68
|
const newVelocity = (0, engine_1.getRangeValue)(data.particle.options.bounce.vertical.value);
|
|
69
69
|
data.particle.velocity.y *= -newVelocity;
|
|
70
70
|
bounced = true;
|
|
@@ -73,13 +73,13 @@
|
|
|
73
73
|
return;
|
|
74
74
|
}
|
|
75
75
|
const minPos = data.offset.y + data.size;
|
|
76
|
-
if (data.bounds.bottom >= data.canvasSize.height && data.direction ===
|
|
76
|
+
if (data.bounds.bottom >= data.canvasSize.height && data.direction === engine_1.OutModeDirection.bottom) {
|
|
77
77
|
data.particle.position.y = data.canvasSize.height - minPos;
|
|
78
78
|
}
|
|
79
|
-
else if (data.bounds.top <= boundsMin && data.direction ===
|
|
79
|
+
else if (data.bounds.top <= boundsMin && data.direction === engine_1.OutModeDirection.top) {
|
|
80
80
|
data.particle.position.y = minPos;
|
|
81
81
|
}
|
|
82
|
-
if (data.outMode ===
|
|
82
|
+
if (data.outMode === engine_1.OutMode.split) {
|
|
83
83
|
data.particle.destroy();
|
|
84
84
|
}
|
|
85
85
|
}
|
package/umd/index.js
CHANGED
|
@@ -1,43 +1,19 @@
|
|
|
1
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
2
|
-
if (k2 === undefined) k2 = k;
|
|
3
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
4
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
5
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
6
|
-
}
|
|
7
|
-
Object.defineProperty(o, k2, desc);
|
|
8
|
-
}) : (function(o, m, k, k2) {
|
|
9
|
-
if (k2 === undefined) k2 = k;
|
|
10
|
-
o[k2] = m[k];
|
|
11
|
-
}));
|
|
12
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
13
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
14
|
-
}) : function(o, v) {
|
|
15
|
-
o["default"] = v;
|
|
16
|
-
});
|
|
17
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
18
|
-
if (mod && mod.__esModule) return mod;
|
|
19
|
-
var result = {};
|
|
20
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
21
|
-
__setModuleDefault(result, mod);
|
|
22
|
-
return result;
|
|
23
|
-
};
|
|
24
1
|
(function (factory) {
|
|
25
2
|
if (typeof module === "object" && typeof module.exports === "object") {
|
|
26
3
|
var v = factory(require, exports);
|
|
27
4
|
if (v !== undefined) module.exports = v;
|
|
28
5
|
}
|
|
29
6
|
else if (typeof define === "function" && define.amd) {
|
|
30
|
-
define(["require", "exports"], factory);
|
|
7
|
+
define(["require", "exports", "./OutOfCanvasUpdater.js"], factory);
|
|
31
8
|
}
|
|
32
9
|
})(function (require, exports) {
|
|
33
10
|
"use strict";
|
|
34
|
-
var __syncRequire = typeof module === "object" && typeof module.exports === "object";
|
|
35
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
12
|
exports.loadOutModesUpdater = void 0;
|
|
13
|
+
const OutOfCanvasUpdater_js_1 = require("./OutOfCanvasUpdater.js");
|
|
37
14
|
async function loadOutModesUpdater(engine, refresh = true) {
|
|
38
|
-
await engine.addParticleUpdater("outModes",
|
|
39
|
-
|
|
40
|
-
return new OutOfCanvasUpdater(container);
|
|
15
|
+
await engine.addParticleUpdater("outModes", container => {
|
|
16
|
+
return Promise.resolve(new OutOfCanvasUpdater_js_1.OutOfCanvasUpdater(container));
|
|
41
17
|
}, refresh);
|
|
42
18
|
}
|
|
43
19
|
exports.loadOutModesUpdater = loadOutModesUpdater;
|
package/103.min.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see 103.min.js.LICENSE.txt */
|
|
2
|
-
(this.webpackChunk_tsparticles_updater_out_modes=this.webpackChunk_tsparticles_updater_out_modes||[]).push([[103],{103:(t,i,o)=>{o.d(i,{bounceHorizontal:()=>s,bounceVertical:()=>r});var e=o(533);const n=0,c=0;function s(t){if("bounce"!==t.outMode&&"split"!==t.outMode||"left"!==t.direction&&"right"!==t.direction)return;t.bounds.right<c&&"left"===t.direction?t.particle.position.x=t.size+t.offset.x:t.bounds.left>t.canvasSize.width&&"right"===t.direction&&(t.particle.position.x=t.canvasSize.width-t.size-t.offset.x);const i=t.particle.velocity.x;let o=!1;if("right"===t.direction&&t.bounds.right>=t.canvasSize.width&&i>n||"left"===t.direction&&t.bounds.left<=c&&i<n){const i=(0,e.getRangeValue)(t.particle.options.bounce.horizontal.value);t.particle.velocity.x*=-i,o=!0}if(!o)return;const s=t.offset.x+t.size;t.bounds.right>=t.canvasSize.width&&"right"===t.direction?t.particle.position.x=t.canvasSize.width-s:t.bounds.left<=c&&"left"===t.direction&&(t.particle.position.x=s),"split"===t.outMode&&t.particle.destroy()}function r(t){if("bounce"!==t.outMode&&"split"!==t.outMode||"bottom"!==t.direction&&"top"!==t.direction)return;t.bounds.bottom<c&&"top"===t.direction?t.particle.position.y=t.size+t.offset.y:t.bounds.top>t.canvasSize.height&&"bottom"===t.direction&&(t.particle.position.y=t.canvasSize.height-t.size-t.offset.y);const i=t.particle.velocity.y;let o=!1;if("bottom"===t.direction&&t.bounds.bottom>=t.canvasSize.height&&i>n||"top"===t.direction&&t.bounds.top<=c&&i<n){const i=(0,e.getRangeValue)(t.particle.options.bounce.vertical.value);t.particle.velocity.y*=-i,o=!0}if(!o)return;const s=t.offset.y+t.size;t.bounds.bottom>=t.canvasSize.height&&"bottom"===t.direction?t.particle.position.y=t.canvasSize.height-s:t.bounds.top<=c&&"top"===t.direction&&(t.particle.position.y=s),"split"===t.outMode&&t.particle.destroy()}}}]);
|
package/103.min.js.LICENSE.txt
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! tsParticles Out Modes Updater v3.2.2 by Matteo Bruni */
|
package/388.min.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see 388.min.js.LICENSE.txt */
|
|
2
|
-
(this.webpackChunk_tsparticles_updater_out_modes=this.webpackChunk_tsparticles_updater_out_modes||[]).push([[388],{388:(t,i,e)=>{e.d(i,{NoneOutMode:()=>s});var o=e(533);class s{constructor(t){this.container=t,this.modes=["none"]}async update(t,i,e,s){if(!this.modes.includes(s))return;if((t.options.move.distance.horizontal&&("left"===i||"right"===i))??(t.options.move.distance.vertical&&("top"===i||"bottom"===i)))return;const n=t.options.move.gravity,r=this.container,a=r.canvas.size,c=t.getRadius();if(n.enable){const e=t.position;(!n.inverse&&e.y>a.height+c&&"bottom"===i||n.inverse&&e.y<-c&&"top"===i)&&r.particles.remove(t)}else{if(t.velocity.y>0&&t.position.y<=a.height+c||t.velocity.y<0&&t.position.y>=-c||t.velocity.x>0&&t.position.x<=a.width+c||t.velocity.x<0&&t.position.x>=-c)return;(0,o.isPointInside)(t.position,r.canvas.size,o.Vector.origin,c,i)||r.particles.remove(t)}await Promise.resolve()}}}}]);
|
package/388.min.js.LICENSE.txt
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! tsParticles Out Modes Updater v3.2.2 by Matteo Bruni */
|
package/53.min.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see 53.min.js.LICENSE.txt */
|
|
2
|
-
(this.webpackChunk_tsparticles_updater_out_modes=this.webpackChunk_tsparticles_updater_out_modes||[]).push([[53],{53:(t,e,s)=>{s.d(e,{OutOfCanvasUpdater:()=>o});const a=(t,e)=>t.default===e||t.bottom===e||t.left===e||t.right===e||t.top===e;class o{constructor(t){this._updateOutMode=async(t,e,s,a)=>{for(const o of this.updaters)await o.update(t,a,e,s)},this.container=t,this.updaters=[]}async init(t){this.updaters=[];const e=t.options.move.outModes;if(a(e,"bounce")){const{BounceOutMode:t}=await s.e(569).then(s.bind(s,569));this.updaters.push(new t(this.container))}else if(a(e,"out")){const{OutOutMode:t}=await s.e(886).then(s.bind(s,886));this.updaters.push(new t(this.container))}else if(a(e,"destroy")){const{DestroyOutMode:t}=await s.e(920).then(s.bind(s,920));this.updaters.push(new t(this.container))}else if(a(e,"none")){const{NoneOutMode:t}=await s.e(388).then(s.bind(s,388));this.updaters.push(new t(this.container))}}isEnabled(t){return!t.destroyed&&!t.spawning}async update(t,e){const s=t.options.move.outModes;await this._updateOutMode(t,e,s.bottom??s.default,"bottom"),await this._updateOutMode(t,e,s.left??s.default,"left"),await this._updateOutMode(t,e,s.right??s.default,"right"),await this._updateOutMode(t,e,s.top??s.default,"top")}}}}]);
|
package/53.min.js.LICENSE.txt
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! tsParticles Out Modes Updater v3.2.2 by Matteo Bruni */
|
package/569.min.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see 569.min.js.LICENSE.txt */
|
|
2
|
-
(this.webpackChunk_tsparticles_updater_out_modes=this.webpackChunk_tsparticles_updater_out_modes||[]).push([[569],{569:(e,t,o)=>{o.d(t,{BounceOutMode:()=>i});var s=o(533);class i{constructor(e){this.container=e,this.modes=["bounce","split"]}async update(e,t,i,n){if(!this.modes.includes(n))return;const a=this.container;let c=!1;for(const[,o]of a.plugins)if(void 0!==o.particleBounce&&(c=await o.particleBounce(e,i,t)),c)break;if(c)return;const u=e.getPosition(),r=e.offset,d=e.getRadius(),l=(0,s.calculateBounds)(u,d),p=a.canvas.size,{bounceHorizontal:f,bounceVertical:h}=await o.e(103).then(o.bind(o,103));f({particle:e,outMode:n,direction:t,bounds:l,canvasSize:p,offset:r,size:d}),h({particle:e,outMode:n,direction:t,bounds:l,canvasSize:p,offset:r,size:d})}}}}]);
|
package/569.min.js.LICENSE.txt
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! tsParticles Out Modes Updater v3.2.2 by Matteo Bruni */
|
package/886.min.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see 886.min.js.LICENSE.txt */
|
|
2
|
-
(this.webpackChunk_tsparticles_updater_out_modes=this.webpackChunk_tsparticles_updater_out_modes||[]).push([[886],{886:(t,i,o)=>{o.d(i,{OutOutMode:()=>n});var e=o(533);class n{constructor(t){this.container=t,this.modes=["out"]}async update(t,i,o,n){if(!this.modes.includes(n))return;const s=this.container;switch(t.outType){case"inside":{const{x:i,y:o}=t.velocity,n=e.Vector.origin;n.length=t.moveCenter.radius,n.angle=t.velocity.angle+Math.PI,n.addTo(e.Vector.create(t.moveCenter));const{dx:a,dy:r}=(0,e.getDistances)(t.position,n);if(i<=0&&a>=0||o<=0&&r>=0||i>=0&&a<=0||o>=0&&r<=0)return;t.position.x=Math.floor((0,e.randomInRange)({min:0,max:s.canvas.size.width})),t.position.y=Math.floor((0,e.randomInRange)({min:0,max:s.canvas.size.height}));const{dx:d,dy:c}=(0,e.getDistances)(t.position,t.moveCenter);t.direction=Math.atan2(-c,-d),t.velocity.angle=t.direction;break}default:if((0,e.isPointInside)(t.position,s.canvas.size,e.Vector.origin,t.getRadius(),i))return;switch(t.outType){case"outside":{t.position.x=Math.floor((0,e.randomInRange)({min:-t.moveCenter.radius,max:t.moveCenter.radius}))+t.moveCenter.x,t.position.y=Math.floor((0,e.randomInRange)({min:-t.moveCenter.radius,max:t.moveCenter.radius}))+t.moveCenter.y;const{dx:i,dy:o}=(0,e.getDistances)(t.position,t.moveCenter);t.moveCenter.radius&&(t.direction=Math.atan2(o,i),t.velocity.angle=t.direction);break}case"normal":{const o=t.options.move.warp,n=s.canvas.size,a={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(),d=(0,e.calculateBounds)(t.position,r);"right"===i&&d.left>n.width+t.offset.x?(t.position.x=a.left,t.initialPosition.x=t.position.x,o||(t.position.y=(0,e.getRandom)()*n.height,t.initialPosition.y=t.position.y)):"left"===i&&d.right<-t.offset.x&&(t.position.x=a.right,t.initialPosition.x=t.position.x,o||(t.position.y=(0,e.getRandom)()*n.height,t.initialPosition.y=t.position.y)),"bottom"===i&&d.top>n.height+t.offset.y?(o||(t.position.x=(0,e.getRandom)()*n.width,t.initialPosition.x=t.position.x),t.position.y=a.top,t.initialPosition.y=t.position.y):"top"===i&&d.bottom<-t.offset.y&&(o||(t.position.x=(0,e.getRandom)()*n.width,t.initialPosition.x=t.position.x),t.position.y=a.bottom,t.initialPosition.y=t.position.y);break}}}await Promise.resolve()}}}}]);
|
package/886.min.js.LICENSE.txt
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! tsParticles Out Modes Updater v3.2.2 by Matteo Bruni */
|
package/920.min.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see 920.min.js.LICENSE.txt */
|
|
2
|
-
(this.webpackChunk_tsparticles_updater_out_modes=this.webpackChunk_tsparticles_updater_out_modes||[]).push([[920],{920:(e,s,t)=>{t.d(s,{DestroyOutMode:()=>o});var i=t(533);class o{constructor(e){this.container=e,this.modes=["destroy"]}async update(e,s,t,o){if(!this.modes.includes(o))return;const r=this.container;switch(e.outType){case"normal":case"outside":if((0,i.isPointInside)(e.position,r.canvas.size,i.Vector.origin,e.getRadius(),s))return;break;case"inside":{const{dx:s,dy:t}=(0,i.getDistances)(e.position,e.moveCenter),{x:o,y:r}=e.velocity;if(o<0&&s>e.moveCenter.radius||r<0&&t>e.moveCenter.radius||o>=0&&s<-e.moveCenter.radius||r>=0&&t<-e.moveCenter.radius)return;break}}r.particles.remove(e,void 0,!0),await Promise.resolve()}}}}]);
|
package/920.min.js.LICENSE.txt
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! tsParticles Out Modes Updater v3.2.2 by Matteo Bruni */
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Author : Matteo Bruni
|
|
3
|
-
* MIT license: https://opensource.org/licenses/MIT
|
|
4
|
-
* Demo / Generator : https://particles.js.org/
|
|
5
|
-
* GitHub : https://www.github.com/matteobruni/tsparticles
|
|
6
|
-
* How to use? : Check the GitHub README
|
|
7
|
-
* v3.2.2
|
|
8
|
-
*/
|
|
9
|
-
"use strict";
|
|
10
|
-
/*
|
|
11
|
-
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
12
|
-
* This devtool is neither made for production nor for readable output files.
|
|
13
|
-
* It uses "eval()" calls to create a separate source file in the browser devtools.
|
|
14
|
-
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
|
|
15
|
-
* or disable the default devtool with "devtool: false".
|
|
16
|
-
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
|
|
17
|
-
*/
|
|
18
|
-
(this["webpackChunk_tsparticles_updater_out_modes"] = this["webpackChunk_tsparticles_updater_out_modes"] || []).push([["dist_browser_BounceOutMode_js"],{
|
|
19
|
-
|
|
20
|
-
/***/ "./dist/browser/BounceOutMode.js":
|
|
21
|
-
/*!***************************************!*\
|
|
22
|
-
!*** ./dist/browser/BounceOutMode.js ***!
|
|
23
|
-
\***************************************/
|
|
24
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
25
|
-
|
|
26
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ BounceOutMode: () => (/* binding */ BounceOutMode)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n\nclass BounceOutMode {\n constructor(container) {\n this.container = container;\n this.modes = [\"bounce\", \"split\"];\n }\n async update(particle, direction, delta, outMode) {\n if (!this.modes.includes(outMode)) {\n return;\n }\n const container = this.container;\n let handled = false;\n for (const [, plugin] of container.plugins) {\n if (plugin.particleBounce !== undefined) {\n handled = await plugin.particleBounce(particle, delta, direction);\n }\n if (handled) {\n break;\n }\n }\n if (handled) {\n return;\n }\n const pos = particle.getPosition(),\n offset = particle.offset,\n size = particle.getRadius(),\n bounds = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.calculateBounds)(pos, size),\n canvasSize = container.canvas.size,\n {\n bounceHorizontal,\n bounceVertical\n } = await __webpack_require__.e(/*! import() */ \"dist_browser_Utils_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./Utils.js */ \"./dist/browser/Utils.js\"));\n bounceHorizontal({\n particle,\n outMode,\n direction,\n bounds,\n canvasSize,\n offset,\n size\n });\n bounceVertical({\n particle,\n outMode,\n direction,\n bounds,\n canvasSize,\n offset,\n size\n });\n }\n}\n\n//# sourceURL=webpack://@tsparticles/updater-out-modes/./dist/browser/BounceOutMode.js?");
|
|
27
|
-
|
|
28
|
-
/***/ })
|
|
29
|
-
|
|
30
|
-
}]);
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Author : Matteo Bruni
|
|
3
|
-
* MIT license: https://opensource.org/licenses/MIT
|
|
4
|
-
* Demo / Generator : https://particles.js.org/
|
|
5
|
-
* GitHub : https://www.github.com/matteobruni/tsparticles
|
|
6
|
-
* How to use? : Check the GitHub README
|
|
7
|
-
* v3.2.2
|
|
8
|
-
*/
|
|
9
|
-
"use strict";
|
|
10
|
-
/*
|
|
11
|
-
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
12
|
-
* This devtool is neither made for production nor for readable output files.
|
|
13
|
-
* It uses "eval()" calls to create a separate source file in the browser devtools.
|
|
14
|
-
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
|
|
15
|
-
* or disable the default devtool with "devtool: false".
|
|
16
|
-
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
|
|
17
|
-
*/
|
|
18
|
-
(this["webpackChunk_tsparticles_updater_out_modes"] = this["webpackChunk_tsparticles_updater_out_modes"] || []).push([["dist_browser_DestroyOutMode_js"],{
|
|
19
|
-
|
|
20
|
-
/***/ "./dist/browser/DestroyOutMode.js":
|
|
21
|
-
/*!****************************************!*\
|
|
22
|
-
!*** ./dist/browser/DestroyOutMode.js ***!
|
|
23
|
-
\****************************************/
|
|
24
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
25
|
-
|
|
26
|
-
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/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n\nconst minVelocity = 0;\nclass DestroyOutMode {\n constructor(container) {\n this.container = container;\n this.modes = [\"destroy\"];\n }\n async 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 \"normal\":\n case \"outside\":\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isPointInside)(particle.position, container.canvas.size, _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.Vector.origin, particle.getRadius(), direction)) {\n return;\n }\n break;\n case \"inside\":\n {\n const {\n dx,\n dy\n } = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getDistances)(particle.position, particle.moveCenter),\n {\n x: vx,\n y: vy\n } = 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, undefined, true);\n await Promise.resolve();\n }\n}\n\n//# sourceURL=webpack://@tsparticles/updater-out-modes/./dist/browser/DestroyOutMode.js?");
|
|
27
|
-
|
|
28
|
-
/***/ })
|
|
29
|
-
|
|
30
|
-
}]);
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Author : Matteo Bruni
|
|
3
|
-
* MIT license: https://opensource.org/licenses/MIT
|
|
4
|
-
* Demo / Generator : https://particles.js.org/
|
|
5
|
-
* GitHub : https://www.github.com/matteobruni/tsparticles
|
|
6
|
-
* How to use? : Check the GitHub README
|
|
7
|
-
* v3.2.2
|
|
8
|
-
*/
|
|
9
|
-
"use strict";
|
|
10
|
-
/*
|
|
11
|
-
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
12
|
-
* This devtool is neither made for production nor for readable output files.
|
|
13
|
-
* It uses "eval()" calls to create a separate source file in the browser devtools.
|
|
14
|
-
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
|
|
15
|
-
* or disable the default devtool with "devtool: false".
|
|
16
|
-
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
|
|
17
|
-
*/
|
|
18
|
-
(this["webpackChunk_tsparticles_updater_out_modes"] = this["webpackChunk_tsparticles_updater_out_modes"] || []).push([["dist_browser_NoneOutMode_js"],{
|
|
19
|
-
|
|
20
|
-
/***/ "./dist/browser/NoneOutMode.js":
|
|
21
|
-
/*!*************************************!*\
|
|
22
|
-
!*** ./dist/browser/NoneOutMode.js ***!
|
|
23
|
-
\*************************************/
|
|
24
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
25
|
-
|
|
26
|
-
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/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n\nconst minVelocity = 0;\nclass NoneOutMode {\n constructor(container) {\n this.container = container;\n this.modes = [\"none\"];\n }\n async update(particle, direction, delta, outMode) {\n if (!this.modes.includes(outMode)) {\n return;\n }\n if ((particle.options.move.distance.horizontal && (direction === \"left\" || direction === \"right\")) ?? (particle.options.move.distance.vertical && (direction === \"top\" || direction === \"bottom\"))) {\n return;\n }\n const gravityOptions = particle.options.move.gravity,\n container = this.container,\n canvasSize = container.canvas.size,\n 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__.Vector.origin, 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 === \"bottom\" || gravityOptions.inverse && position.y < -pRadius && direction === \"top\") {\n container.particles.remove(particle);\n }\n }\n await Promise.resolve();\n }\n}\n\n//# sourceURL=webpack://@tsparticles/updater-out-modes/./dist/browser/NoneOutMode.js?");
|
|
27
|
-
|
|
28
|
-
/***/ })
|
|
29
|
-
|
|
30
|
-
}]);
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Author : Matteo Bruni
|
|
3
|
-
* MIT license: https://opensource.org/licenses/MIT
|
|
4
|
-
* Demo / Generator : https://particles.js.org/
|
|
5
|
-
* GitHub : https://www.github.com/matteobruni/tsparticles
|
|
6
|
-
* How to use? : Check the GitHub README
|
|
7
|
-
* v3.2.2
|
|
8
|
-
*/
|
|
9
|
-
"use strict";
|
|
10
|
-
/*
|
|
11
|
-
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
12
|
-
* This devtool is neither made for production nor for readable output files.
|
|
13
|
-
* It uses "eval()" calls to create a separate source file in the browser devtools.
|
|
14
|
-
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
|
|
15
|
-
* or disable the default devtool with "devtool: false".
|
|
16
|
-
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
|
|
17
|
-
*/
|
|
18
|
-
(this["webpackChunk_tsparticles_updater_out_modes"] = this["webpackChunk_tsparticles_updater_out_modes"] || []).push([["dist_browser_OutOfCanvasUpdater_js"],{
|
|
19
|
-
|
|
20
|
-
/***/ "./dist/browser/OutOfCanvasUpdater.js":
|
|
21
|
-
/*!********************************************!*\
|
|
22
|
-
!*** ./dist/browser/OutOfCanvasUpdater.js ***!
|
|
23
|
-
\********************************************/
|
|
24
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
25
|
-
|
|
26
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ OutOfCanvasUpdater: () => (/* binding */ OutOfCanvasUpdater)\n/* harmony export */ });\nconst checkOutMode = (outModes, outMode) => {\n return outModes.default === outMode || outModes.bottom === outMode || outModes.left === outMode || outModes.right === outMode || outModes.top === outMode;\n};\nclass OutOfCanvasUpdater {\n constructor(container) {\n this._updateOutMode = async (particle, delta, outMode, direction) => {\n for (const updater of this.updaters) {\n await updater.update(particle, direction, delta, outMode);\n }\n };\n this.container = container;\n this.updaters = [];\n }\n async init(particle) {\n this.updaters = [];\n const outModes = particle.options.move.outModes;\n if (checkOutMode(outModes, \"bounce\")) {\n const {\n BounceOutMode\n } = await __webpack_require__.e(/*! import() */ \"dist_browser_BounceOutMode_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./BounceOutMode.js */ \"./dist/browser/BounceOutMode.js\"));\n this.updaters.push(new BounceOutMode(this.container));\n } else if (checkOutMode(outModes, \"out\")) {\n const {\n OutOutMode\n } = await __webpack_require__.e(/*! import() */ \"dist_browser_OutOutMode_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./OutOutMode.js */ \"./dist/browser/OutOutMode.js\"));\n this.updaters.push(new OutOutMode(this.container));\n } else if (checkOutMode(outModes, \"destroy\")) {\n const {\n DestroyOutMode\n } = await __webpack_require__.e(/*! import() */ \"dist_browser_DestroyOutMode_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./DestroyOutMode.js */ \"./dist/browser/DestroyOutMode.js\"));\n this.updaters.push(new DestroyOutMode(this.container));\n } else if (checkOutMode(outModes, \"none\")) {\n const {\n NoneOutMode\n } = await __webpack_require__.e(/*! import() */ \"dist_browser_NoneOutMode_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./NoneOutMode.js */ \"./dist/browser/NoneOutMode.js\"));\n this.updaters.push(new NoneOutMode(this.container));\n }\n }\n isEnabled(particle) {\n return !particle.destroyed && !particle.spawning;\n }\n async update(particle, delta) {\n const outModes = particle.options.move.outModes;\n await this._updateOutMode(particle, delta, outModes.bottom ?? outModes.default, \"bottom\");\n await this._updateOutMode(particle, delta, outModes.left ?? outModes.default, \"left\");\n await this._updateOutMode(particle, delta, outModes.right ?? outModes.default, \"right\");\n await this._updateOutMode(particle, delta, outModes.top ?? outModes.default, \"top\");\n }\n}\n\n//# sourceURL=webpack://@tsparticles/updater-out-modes/./dist/browser/OutOfCanvasUpdater.js?");
|
|
27
|
-
|
|
28
|
-
/***/ })
|
|
29
|
-
|
|
30
|
-
}]);
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Author : Matteo Bruni
|
|
3
|
-
* MIT license: https://opensource.org/licenses/MIT
|
|
4
|
-
* Demo / Generator : https://particles.js.org/
|
|
5
|
-
* GitHub : https://www.github.com/matteobruni/tsparticles
|
|
6
|
-
* How to use? : Check the GitHub README
|
|
7
|
-
* v3.2.2
|
|
8
|
-
*/
|
|
9
|
-
"use strict";
|
|
10
|
-
/*
|
|
11
|
-
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
12
|
-
* This devtool is neither made for production nor for readable output files.
|
|
13
|
-
* It uses "eval()" calls to create a separate source file in the browser devtools.
|
|
14
|
-
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
|
|
15
|
-
* or disable the default devtool with "devtool: false".
|
|
16
|
-
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
|
|
17
|
-
*/
|
|
18
|
-
(this["webpackChunk_tsparticles_updater_out_modes"] = this["webpackChunk_tsparticles_updater_out_modes"] || []).push([["dist_browser_OutOutMode_js"],{
|
|
19
|
-
|
|
20
|
-
/***/ "./dist/browser/OutOutMode.js":
|
|
21
|
-
/*!************************************!*\
|
|
22
|
-
!*** ./dist/browser/OutOutMode.js ***!
|
|
23
|
-
\************************************/
|
|
24
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
25
|
-
|
|
26
|
-
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/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n\nconst minVelocity = 0,\n minDistance = 0;\nclass OutOutMode {\n constructor(container) {\n this.container = container;\n this.modes = [\"out\"];\n }\n async 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 \"inside\":\n {\n const {\n x: vx,\n y: vy\n } = particle.velocity;\n const circVec = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.Vector.origin;\n circVec.length = particle.moveCenter.radius;\n circVec.angle = particle.velocity.angle + Math.PI;\n circVec.addTo(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.Vector.create(particle.moveCenter));\n const {\n dx,\n dy\n } = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getDistances)(particle.position, circVec);\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__.randomInRange)({\n min: 0,\n max: container.canvas.size.width\n }));\n particle.position.y = Math.floor((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.randomInRange)({\n min: 0,\n max: container.canvas.size.height\n }));\n const {\n dx: newDx,\n dy: newDy\n } = (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__.Vector.origin, particle.getRadius(), direction)) {\n return;\n }\n switch (particle.outType) {\n case \"outside\":\n {\n particle.position.x = Math.floor((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.randomInRange)({\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__.randomInRange)({\n min: -particle.moveCenter.radius,\n max: particle.moveCenter.radius\n })) + particle.moveCenter.y;\n const {\n dx,\n dy\n } = (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 \"normal\":\n {\n const warp = particle.options.move.warp,\n canvasSize = container.canvas.size,\n 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 },\n sizeValue = particle.getRadius(),\n nextBounds = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.calculateBounds)(particle.position, sizeValue);\n if (direction === \"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 === \"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 === \"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 === \"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 await Promise.resolve();\n }\n}\n\n//# sourceURL=webpack://@tsparticles/updater-out-modes/./dist/browser/OutOutMode.js?");
|
|
27
|
-
|
|
28
|
-
/***/ })
|
|
29
|
-
|
|
30
|
-
}]);
|
package/dist_browser_Utils_js.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Author : Matteo Bruni
|
|
3
|
-
* MIT license: https://opensource.org/licenses/MIT
|
|
4
|
-
* Demo / Generator : https://particles.js.org/
|
|
5
|
-
* GitHub : https://www.github.com/matteobruni/tsparticles
|
|
6
|
-
* How to use? : Check the GitHub README
|
|
7
|
-
* v3.2.2
|
|
8
|
-
*/
|
|
9
|
-
"use strict";
|
|
10
|
-
/*
|
|
11
|
-
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
12
|
-
* This devtool is neither made for production nor for readable output files.
|
|
13
|
-
* It uses "eval()" calls to create a separate source file in the browser devtools.
|
|
14
|
-
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
|
|
15
|
-
* or disable the default devtool with "devtool: false".
|
|
16
|
-
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
|
|
17
|
-
*/
|
|
18
|
-
(this["webpackChunk_tsparticles_updater_out_modes"] = this["webpackChunk_tsparticles_updater_out_modes"] || []).push([["dist_browser_Utils_js"],{
|
|
19
|
-
|
|
20
|
-
/***/ "./dist/browser/Utils.js":
|
|
21
|
-
/*!*******************************!*\
|
|
22
|
-
!*** ./dist/browser/Utils.js ***!
|
|
23
|
-
\*******************************/
|
|
24
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
25
|
-
|
|
26
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ bounceHorizontal: () => (/* binding */ bounceHorizontal),\n/* harmony export */ bounceVertical: () => (/* binding */ bounceVertical)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n\nconst minVelocity = 0,\n boundsMin = 0;\nfunction bounceHorizontal(data) {\n if (data.outMode !== \"bounce\" && data.outMode !== \"split\" || data.direction !== \"left\" && data.direction !== \"right\") {\n return;\n }\n if (data.bounds.right < boundsMin && data.direction === \"left\") {\n data.particle.position.x = data.size + data.offset.x;\n } else if (data.bounds.left > data.canvasSize.width && data.direction === \"right\") {\n data.particle.position.x = data.canvasSize.width - data.size - data.offset.x;\n }\n const velocity = data.particle.velocity.x;\n let bounced = false;\n if (data.direction === \"right\" && data.bounds.right >= data.canvasSize.width && velocity > minVelocity || data.direction === \"left\" && data.bounds.left <= boundsMin && velocity < minVelocity) {\n const newVelocity = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(data.particle.options.bounce.horizontal.value);\n data.particle.velocity.x *= -newVelocity;\n bounced = true;\n }\n if (!bounced) {\n return;\n }\n const minPos = data.offset.x + data.size;\n if (data.bounds.right >= data.canvasSize.width && data.direction === \"right\") {\n data.particle.position.x = data.canvasSize.width - minPos;\n } else if (data.bounds.left <= boundsMin && data.direction === \"left\") {\n data.particle.position.x = minPos;\n }\n if (data.outMode === \"split\") {\n data.particle.destroy();\n }\n}\nfunction bounceVertical(data) {\n if (data.outMode !== \"bounce\" && data.outMode !== \"split\" || data.direction !== \"bottom\" && data.direction !== \"top\") {\n return;\n }\n if (data.bounds.bottom < boundsMin && data.direction === \"top\") {\n data.particle.position.y = data.size + data.offset.y;\n } else if (data.bounds.top > data.canvasSize.height && data.direction === \"bottom\") {\n data.particle.position.y = data.canvasSize.height - data.size - data.offset.y;\n }\n const velocity = data.particle.velocity.y;\n let bounced = false;\n if (data.direction === \"bottom\" && data.bounds.bottom >= data.canvasSize.height && velocity > minVelocity || data.direction === \"top\" && data.bounds.top <= boundsMin && velocity < minVelocity) {\n const newVelocity = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(data.particle.options.bounce.vertical.value);\n data.particle.velocity.y *= -newVelocity;\n bounced = true;\n }\n if (!bounced) {\n return;\n }\n const minPos = data.offset.y + data.size;\n if (data.bounds.bottom >= data.canvasSize.height && data.direction === \"bottom\") {\n data.particle.position.y = data.canvasSize.height - minPos;\n } else if (data.bounds.top <= boundsMin && data.direction === \"top\") {\n data.particle.position.y = minPos;\n }\n if (data.outMode === \"split\") {\n data.particle.destroy();\n }\n}\n\n//# sourceURL=webpack://@tsparticles/updater-out-modes/./dist/browser/Utils.js?");
|
|
27
|
-
|
|
28
|
-
/***/ })
|
|
29
|
-
|
|
30
|
-
}]);
|