@tsparticles/engine 3.3.0 → 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/README.md +0 -4
- package/browser/Core/Canvas.js +27 -22
- package/browser/Core/Container.js +55 -42
- package/browser/Core/Engine.js +82 -74
- package/browser/Core/Particle.js +29 -15
- package/browser/Core/Particles.js +23 -24
- package/browser/Core/Utils/EventListeners.js +18 -17
- package/browser/Core/Utils/ExternalInteractorBase.js +2 -1
- package/browser/Core/Utils/InteractionManager.js +3 -2
- package/browser/Core/Utils/ParticlesInteractorBase.js +2 -1
- package/browser/Core/Utils/QuadTree.js +1 -1
- package/browser/Core/Utils/Ranges.js +5 -4
- package/browser/Enums/AnimationStatus.js +5 -1
- package/browser/Enums/Directions/MoveDirection.js +14 -1
- package/browser/Enums/Directions/OutModeDirection.js +7 -1
- package/browser/Enums/Directions/RotateDirection.js +6 -1
- package/browser/Enums/InteractivityDetect.js +6 -1
- package/browser/Enums/Modes/AnimationMode.js +7 -1
- package/browser/Enums/Modes/CollisionMode.js +6 -1
- package/browser/Enums/Modes/LimitMode.js +5 -1
- package/browser/Enums/Modes/OutMode.js +8 -1
- package/browser/Enums/Modes/PixelMode.js +5 -1
- package/browser/Enums/Modes/ResponsiveMode.js +5 -1
- package/browser/Enums/Modes/ThemeMode.js +6 -1
- package/browser/Enums/Types/AlterType.js +5 -1
- package/browser/Enums/Types/DestroyType.js +6 -1
- package/browser/Enums/Types/DivType.js +5 -1
- package/browser/Enums/Types/EasingType.js +30 -1
- package/browser/Enums/Types/EventType.js +15 -1
- package/browser/Enums/Types/GradientType.js +6 -1
- package/browser/Enums/Types/InteractorType.js +5 -1
- package/browser/Enums/Types/ParticleOutType.js +6 -1
- package/browser/Enums/Types/StartValueType.js +6 -1
- package/browser/Options/Classes/AnimationOptions.js +4 -2
- package/browser/Options/Classes/Interactivity/Events/DivEvent.js +2 -1
- package/browser/Options/Classes/Interactivity/Events/Events.js +1 -1
- package/browser/Options/Classes/Interactivity/Interactivity.js +2 -1
- package/browser/Options/Classes/ManualParticle.js +2 -1
- package/browser/Options/Classes/Options.js +14 -12
- package/browser/Options/Classes/Particles/Collisions/Collisions.js +2 -1
- package/browser/Options/Classes/Particles/Move/Move.js +2 -1
- package/browser/Options/Classes/Particles/Move/MoveCenter.js +2 -1
- package/browser/Options/Classes/Particles/Move/OutModes.js +2 -1
- package/browser/Options/Classes/Particles/Number/ParticlesNumberLimit.js +2 -1
- package/browser/Options/Classes/Particles/Opacity/OpacityAnimation.js +2 -1
- package/browser/Options/Classes/Particles/ParticlesOptions.js +1 -1
- package/browser/Options/Classes/Particles/Size/SizeAnimation.js +2 -1
- package/browser/Options/Classes/Responsive.js +5 -4
- package/browser/Options/Classes/Theme/ThemeDefault.js +2 -1
- package/browser/Types/RangeType.js +5 -1
- package/browser/Utils/CanvasUtils.js +13 -7
- package/browser/Utils/ColorUtils.js +17 -9
- package/browser/Utils/EventDispatcher.js +1 -1
- package/browser/Utils/HslColorManager.js +11 -4
- package/browser/Utils/NumberUtils.js +11 -10
- package/browser/Utils/RgbColorManager.js +11 -4
- package/browser/Utils/Utils.js +37 -31
- package/cjs/Core/Canvas.js +27 -22
- package/cjs/Core/Container.js +55 -42
- package/cjs/Core/Engine.js +82 -74
- package/cjs/Core/Particle.js +29 -15
- package/cjs/Core/Particles.js +23 -24
- package/cjs/Core/Utils/EventListeners.js +18 -17
- package/cjs/Core/Utils/ExternalInteractorBase.js +2 -1
- package/cjs/Core/Utils/InteractionManager.js +3 -2
- package/cjs/Core/Utils/ParticlesInteractorBase.js +2 -1
- package/cjs/Core/Utils/QuadTree.js +1 -1
- package/cjs/Core/Utils/Ranges.js +5 -4
- package/cjs/Enums/AnimationStatus.js +6 -0
- package/cjs/Enums/Directions/MoveDirection.js +15 -0
- package/cjs/Enums/Directions/OutModeDirection.js +8 -0
- package/cjs/Enums/Directions/RotateDirection.js +7 -0
- package/cjs/Enums/InteractivityDetect.js +7 -0
- package/cjs/Enums/Modes/AnimationMode.js +8 -0
- package/cjs/Enums/Modes/CollisionMode.js +7 -0
- package/cjs/Enums/Modes/LimitMode.js +6 -0
- package/cjs/Enums/Modes/OutMode.js +9 -0
- package/cjs/Enums/Modes/PixelMode.js +6 -0
- package/cjs/Enums/Modes/ResponsiveMode.js +6 -0
- package/cjs/Enums/Modes/ThemeMode.js +7 -0
- package/cjs/Enums/Types/AlterType.js +6 -0
- package/cjs/Enums/Types/DestroyType.js +7 -0
- package/cjs/Enums/Types/DivType.js +6 -0
- package/cjs/Enums/Types/EasingType.js +31 -0
- package/cjs/Enums/Types/EventType.js +16 -0
- package/cjs/Enums/Types/GradientType.js +7 -0
- package/cjs/Enums/Types/InteractorType.js +6 -0
- package/cjs/Enums/Types/ParticleOutType.js +7 -0
- package/cjs/Enums/Types/StartValueType.js +7 -0
- package/cjs/Options/Classes/AnimationOptions.js +4 -2
- package/cjs/Options/Classes/Interactivity/Events/DivEvent.js +2 -1
- package/cjs/Options/Classes/Interactivity/Events/Events.js +1 -1
- package/cjs/Options/Classes/Interactivity/Interactivity.js +2 -1
- package/cjs/Options/Classes/ManualParticle.js +2 -1
- package/cjs/Options/Classes/Options.js +14 -12
- package/cjs/Options/Classes/Particles/Collisions/Collisions.js +2 -1
- package/cjs/Options/Classes/Particles/Move/Move.js +2 -1
- package/cjs/Options/Classes/Particles/Move/MoveCenter.js +2 -1
- package/cjs/Options/Classes/Particles/Move/OutModes.js +2 -1
- package/cjs/Options/Classes/Particles/Number/ParticlesNumberLimit.js +2 -1
- package/cjs/Options/Classes/Particles/Opacity/OpacityAnimation.js +2 -1
- package/cjs/Options/Classes/Particles/ParticlesOptions.js +1 -1
- package/cjs/Options/Classes/Particles/Size/SizeAnimation.js +2 -1
- package/cjs/Options/Classes/Responsive.js +5 -4
- package/cjs/Options/Classes/Theme/ThemeDefault.js +2 -1
- package/cjs/Types/RangeType.js +6 -0
- package/cjs/Utils/CanvasUtils.js +13 -7
- package/cjs/Utils/ColorUtils.js +17 -9
- package/cjs/Utils/EventDispatcher.js +1 -1
- package/cjs/Utils/HslColorManager.js +11 -4
- package/cjs/Utils/NumberUtils.js +11 -10
- package/cjs/Utils/RgbColorManager.js +11 -4
- package/cjs/Utils/Utils.js +37 -31
- package/esm/Core/Canvas.js +27 -22
- package/esm/Core/Container.js +55 -42
- package/esm/Core/Engine.js +82 -74
- package/esm/Core/Particle.js +29 -15
- package/esm/Core/Particles.js +23 -24
- package/esm/Core/Utils/EventListeners.js +18 -17
- package/esm/Core/Utils/ExternalInteractorBase.js +2 -1
- package/esm/Core/Utils/InteractionManager.js +3 -2
- package/esm/Core/Utils/ParticlesInteractorBase.js +2 -1
- package/esm/Core/Utils/QuadTree.js +1 -1
- package/esm/Core/Utils/Ranges.js +5 -4
- package/esm/Enums/AnimationStatus.js +5 -1
- package/esm/Enums/Directions/MoveDirection.js +14 -1
- package/esm/Enums/Directions/OutModeDirection.js +7 -1
- package/esm/Enums/Directions/RotateDirection.js +6 -1
- package/esm/Enums/InteractivityDetect.js +6 -1
- package/esm/Enums/Modes/AnimationMode.js +7 -1
- package/esm/Enums/Modes/CollisionMode.js +6 -1
- package/esm/Enums/Modes/LimitMode.js +5 -1
- package/esm/Enums/Modes/OutMode.js +8 -1
- package/esm/Enums/Modes/PixelMode.js +5 -1
- package/esm/Enums/Modes/ResponsiveMode.js +5 -1
- package/esm/Enums/Modes/ThemeMode.js +6 -1
- package/esm/Enums/Types/AlterType.js +5 -1
- package/esm/Enums/Types/DestroyType.js +6 -1
- package/esm/Enums/Types/DivType.js +5 -1
- package/esm/Enums/Types/EasingType.js +30 -1
- package/esm/Enums/Types/EventType.js +15 -1
- package/esm/Enums/Types/GradientType.js +6 -1
- package/esm/Enums/Types/InteractorType.js +5 -1
- package/esm/Enums/Types/ParticleOutType.js +6 -1
- package/esm/Enums/Types/StartValueType.js +6 -1
- package/esm/Options/Classes/AnimationOptions.js +4 -2
- package/esm/Options/Classes/Interactivity/Events/DivEvent.js +2 -1
- package/esm/Options/Classes/Interactivity/Events/Events.js +1 -1
- package/esm/Options/Classes/Interactivity/Interactivity.js +2 -1
- package/esm/Options/Classes/ManualParticle.js +2 -1
- package/esm/Options/Classes/Options.js +14 -12
- package/esm/Options/Classes/Particles/Collisions/Collisions.js +2 -1
- package/esm/Options/Classes/Particles/Move/Move.js +2 -1
- package/esm/Options/Classes/Particles/Move/MoveCenter.js +2 -1
- package/esm/Options/Classes/Particles/Move/OutModes.js +2 -1
- package/esm/Options/Classes/Particles/Number/ParticlesNumberLimit.js +2 -1
- package/esm/Options/Classes/Particles/Opacity/OpacityAnimation.js +2 -1
- package/esm/Options/Classes/Particles/ParticlesOptions.js +1 -1
- package/esm/Options/Classes/Particles/Size/SizeAnimation.js +2 -1
- package/esm/Options/Classes/Responsive.js +5 -4
- package/esm/Options/Classes/Theme/ThemeDefault.js +2 -1
- package/esm/Types/RangeType.js +5 -1
- package/esm/Utils/CanvasUtils.js +13 -7
- package/esm/Utils/ColorUtils.js +17 -9
- package/esm/Utils/EventDispatcher.js +1 -1
- package/esm/Utils/HslColorManager.js +11 -4
- package/esm/Utils/NumberUtils.js +11 -10
- package/esm/Utils/RgbColorManager.js +11 -4
- package/esm/Utils/Utils.js +37 -31
- package/package.json +1 -1
- package/report.html +1 -1
- package/tsparticles.engine.js +327 -225
- package/tsparticles.engine.min.js +1 -1
- package/tsparticles.engine.min.js.LICENSE.txt +1 -1
- package/types/Core/Container.d.ts +4 -2
- package/types/Core/Engine.d.ts +6 -5
- package/types/Core/Interfaces/IPlugin.d.ts +3 -4
- package/types/Core/Interfaces/IShapeDrawer.d.ts +1 -0
- package/types/Core/Particle.d.ts +1 -0
- package/types/Enums/AnimationStatus.d.ts +1 -1
- package/types/Enums/Directions/MoveDirection.d.ts +1 -1
- package/types/Enums/Directions/OutModeDirection.d.ts +1 -1
- package/types/Enums/Directions/RotateDirection.d.ts +1 -1
- package/types/Enums/InteractivityDetect.d.ts +1 -1
- package/types/Enums/Modes/AnimationMode.d.ts +1 -1
- package/types/Enums/Modes/CollisionMode.d.ts +1 -1
- package/types/Enums/Modes/LimitMode.d.ts +1 -1
- package/types/Enums/Modes/OutMode.d.ts +1 -1
- package/types/Enums/Modes/PixelMode.d.ts +1 -1
- package/types/Enums/Modes/ResponsiveMode.d.ts +1 -1
- package/types/Enums/Modes/ThemeMode.d.ts +1 -1
- package/types/Enums/Types/AlterType.d.ts +1 -1
- package/types/Enums/Types/DestroyType.d.ts +1 -1
- package/types/Enums/Types/DivType.d.ts +1 -1
- package/types/Enums/Types/EasingType.d.ts +1 -1
- package/types/Enums/Types/EventType.d.ts +1 -1
- package/types/Enums/Types/GradientType.d.ts +1 -1
- package/types/Enums/Types/InteractorType.d.ts +1 -1
- package/types/Enums/Types/ParticleOutType.d.ts +1 -1
- package/types/Enums/Types/StartValueType.d.ts +1 -1
- package/types/Options/Classes/Options.d.ts +2 -1
- package/types/Options/Classes/Responsive.d.ts +2 -2
- package/types/Options/Classes/Theme/Theme.d.ts +2 -2
- package/types/Options/Interfaces/IResponsive.d.ts +2 -3
- package/types/Options/Interfaces/Theme/ITheme.d.ts +2 -3
- package/types/Types/RangeType.d.ts +1 -1
- package/umd/Core/Canvas.js +27 -22
- package/umd/Core/Container.js +56 -43
- package/umd/Core/Engine.js +83 -99
- package/umd/Core/Particle.js +30 -16
- package/umd/Core/Particles.js +24 -25
- package/umd/Core/Utils/EventListeners.js +19 -18
- package/umd/Core/Utils/ExternalInteractorBase.js +3 -2
- package/umd/Core/Utils/InteractionManager.js +4 -3
- package/umd/Core/Utils/ParticlesInteractorBase.js +3 -2
- package/umd/Core/Utils/QuadTree.js +1 -1
- package/umd/Core/Utils/Ranges.js +6 -5
- package/umd/Enums/AnimationStatus.js +6 -0
- package/umd/Enums/Directions/MoveDirection.js +15 -0
- package/umd/Enums/Directions/OutModeDirection.js +8 -0
- package/umd/Enums/Directions/RotateDirection.js +7 -0
- package/umd/Enums/InteractivityDetect.js +7 -0
- package/umd/Enums/Modes/AnimationMode.js +8 -0
- package/umd/Enums/Modes/CollisionMode.js +7 -0
- package/umd/Enums/Modes/LimitMode.js +6 -0
- package/umd/Enums/Modes/OutMode.js +9 -0
- package/umd/Enums/Modes/PixelMode.js +6 -0
- package/umd/Enums/Modes/ResponsiveMode.js +6 -0
- package/umd/Enums/Modes/ThemeMode.js +7 -0
- package/umd/Enums/Types/AlterType.js +6 -0
- package/umd/Enums/Types/DestroyType.js +7 -0
- package/umd/Enums/Types/DivType.js +6 -0
- package/umd/Enums/Types/EasingType.js +31 -0
- package/umd/Enums/Types/EventType.js +16 -0
- package/umd/Enums/Types/GradientType.js +7 -0
- package/umd/Enums/Types/InteractorType.js +6 -0
- package/umd/Enums/Types/ParticleOutType.js +7 -0
- package/umd/Enums/Types/StartValueType.js +7 -0
- package/umd/Options/Classes/AnimationOptions.js +5 -3
- package/umd/Options/Classes/Interactivity/Events/DivEvent.js +3 -2
- package/umd/Options/Classes/Interactivity/Events/Events.js +1 -1
- package/umd/Options/Classes/Interactivity/Interactivity.js +3 -2
- package/umd/Options/Classes/ManualParticle.js +3 -2
- package/umd/Options/Classes/Options.js +15 -13
- package/umd/Options/Classes/Particles/Collisions/Collisions.js +3 -2
- package/umd/Options/Classes/Particles/Move/Move.js +3 -2
- package/umd/Options/Classes/Particles/Move/MoveCenter.js +3 -2
- package/umd/Options/Classes/Particles/Move/OutModes.js +3 -2
- package/umd/Options/Classes/Particles/Number/ParticlesNumberLimit.js +3 -2
- package/umd/Options/Classes/Particles/Opacity/OpacityAnimation.js +3 -2
- package/umd/Options/Classes/Particles/ParticlesOptions.js +1 -1
- package/umd/Options/Classes/Particles/Size/SizeAnimation.js +3 -2
- package/umd/Options/Classes/Responsive.js +6 -5
- package/umd/Options/Classes/Theme/ThemeDefault.js +3 -2
- package/umd/Types/RangeType.js +6 -0
- package/umd/Utils/CanvasUtils.js +14 -8
- package/umd/Utils/ColorUtils.js +18 -10
- package/umd/Utils/EventDispatcher.js +1 -1
- package/umd/Utils/HslColorManager.js +11 -4
- package/umd/Utils/NumberUtils.js +12 -11
- package/umd/Utils/RgbColorManager.js +11 -4
- package/umd/Utils/Utils.js +38 -32
- package/174.min.js +0 -2
- package/174.min.js.LICENSE.txt +0 -1
- package/dist_browser_Core_Container_js.js +0 -102
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.InteractionManager = void 0;
|
|
4
|
+
const InteractorType_js_1 = require("../../Enums/Types/InteractorType.js");
|
|
4
5
|
class InteractionManager {
|
|
5
6
|
constructor(engine, container) {
|
|
6
7
|
this.container = container;
|
|
@@ -27,10 +28,10 @@ class InteractionManager {
|
|
|
27
28
|
this._particleInteractors = [];
|
|
28
29
|
for (const interactor of this._interactors) {
|
|
29
30
|
switch (interactor.type) {
|
|
30
|
-
case
|
|
31
|
+
case InteractorType_js_1.InteractorType.external:
|
|
31
32
|
this._externalInteractors.push(interactor);
|
|
32
33
|
break;
|
|
33
|
-
case
|
|
34
|
+
case InteractorType_js_1.InteractorType.particles:
|
|
34
35
|
this._particleInteractors.push(interactor);
|
|
35
36
|
break;
|
|
36
37
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ParticlesInteractorBase = void 0;
|
|
4
|
+
const InteractorType_js_1 = require("../../Enums/Types/InteractorType.js");
|
|
4
5
|
class ParticlesInteractorBase {
|
|
5
6
|
constructor(container) {
|
|
6
|
-
this.type =
|
|
7
|
+
this.type = InteractorType_js_1.InteractorType.particles;
|
|
7
8
|
this.container = container;
|
|
8
9
|
}
|
|
9
10
|
}
|
package/cjs/Core/Utils/Ranges.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Rectangle = exports.Circle = exports.BaseRange = void 0;
|
|
4
|
+
const RangeType_js_1 = require("../../Types/RangeType.js");
|
|
4
5
|
const NumberUtils_js_1 = require("../../Utils/NumberUtils.js");
|
|
5
6
|
const squareExp = 2;
|
|
6
7
|
class BaseRange {
|
|
@@ -15,7 +16,7 @@ class BaseRange {
|
|
|
15
16
|
exports.BaseRange = BaseRange;
|
|
16
17
|
class Circle extends BaseRange {
|
|
17
18
|
constructor(x, y, radius) {
|
|
18
|
-
super(x, y,
|
|
19
|
+
super(x, y, RangeType_js_1.RangeType.circle);
|
|
19
20
|
this.radius = radius;
|
|
20
21
|
}
|
|
21
22
|
contains(point) {
|
|
@@ -23,11 +24,11 @@ class Circle extends BaseRange {
|
|
|
23
24
|
}
|
|
24
25
|
intersects(range) {
|
|
25
26
|
const pos1 = this.position, pos2 = range.position, distPos = { x: Math.abs(pos2.x - pos1.x), y: Math.abs(pos2.y - pos1.y) }, r = this.radius;
|
|
26
|
-
if (range instanceof Circle || range.type ===
|
|
27
|
+
if (range instanceof Circle || range.type === RangeType_js_1.RangeType.circle) {
|
|
27
28
|
const circleRange = range, rSum = r + circleRange.radius, dist = Math.sqrt(distPos.x ** squareExp + distPos.y ** squareExp);
|
|
28
29
|
return rSum > dist;
|
|
29
30
|
}
|
|
30
|
-
else if (range instanceof Rectangle || range.type ===
|
|
31
|
+
else if (range instanceof Rectangle || range.type === RangeType_js_1.RangeType.rectangle) {
|
|
31
32
|
const rectRange = range, { width, height } = rectRange.size, edges = Math.pow(distPos.x - width, squareExp) + Math.pow(distPos.y - height, squareExp);
|
|
32
33
|
return (edges <= r ** squareExp ||
|
|
33
34
|
(distPos.x <= r + width && distPos.y <= r + height) ||
|
|
@@ -40,7 +41,7 @@ class Circle extends BaseRange {
|
|
|
40
41
|
exports.Circle = Circle;
|
|
41
42
|
class Rectangle extends BaseRange {
|
|
42
43
|
constructor(x, y, width, height) {
|
|
43
|
-
super(x, y,
|
|
44
|
+
super(x, y, RangeType_js_1.RangeType.rectangle);
|
|
44
45
|
this.size = {
|
|
45
46
|
height: height,
|
|
46
47
|
width: width,
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AnimationStatus = void 0;
|
|
4
|
+
var AnimationStatus;
|
|
5
|
+
(function (AnimationStatus) {
|
|
6
|
+
AnimationStatus["increasing"] = "increasing";
|
|
7
|
+
AnimationStatus["decreasing"] = "decreasing";
|
|
8
|
+
})(AnimationStatus || (exports.AnimationStatus = AnimationStatus = {}));
|
|
@@ -1,2 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MoveDirection = void 0;
|
|
4
|
+
var MoveDirection;
|
|
5
|
+
(function (MoveDirection) {
|
|
6
|
+
MoveDirection["bottom"] = "bottom";
|
|
7
|
+
MoveDirection["bottomLeft"] = "bottom-left";
|
|
8
|
+
MoveDirection["bottomRight"] = "bottom-right";
|
|
9
|
+
MoveDirection["left"] = "left";
|
|
10
|
+
MoveDirection["none"] = "none";
|
|
11
|
+
MoveDirection["right"] = "right";
|
|
12
|
+
MoveDirection["top"] = "top";
|
|
13
|
+
MoveDirection["topLeft"] = "top-left";
|
|
14
|
+
MoveDirection["topRight"] = "top-right";
|
|
15
|
+
MoveDirection["outside"] = "outside";
|
|
16
|
+
MoveDirection["inside"] = "inside";
|
|
17
|
+
})(MoveDirection || (exports.MoveDirection = MoveDirection = {}));
|
|
@@ -1,2 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OutModeDirection = void 0;
|
|
4
|
+
var OutModeDirection;
|
|
5
|
+
(function (OutModeDirection) {
|
|
6
|
+
OutModeDirection["bottom"] = "bottom";
|
|
7
|
+
OutModeDirection["left"] = "left";
|
|
8
|
+
OutModeDirection["right"] = "right";
|
|
9
|
+
OutModeDirection["top"] = "top";
|
|
10
|
+
})(OutModeDirection || (exports.OutModeDirection = OutModeDirection = {}));
|
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RotateDirection = void 0;
|
|
4
|
+
var RotateDirection;
|
|
5
|
+
(function (RotateDirection) {
|
|
6
|
+
RotateDirection["clockwise"] = "clockwise";
|
|
7
|
+
RotateDirection["counterClockwise"] = "counter-clockwise";
|
|
8
|
+
RotateDirection["random"] = "random";
|
|
9
|
+
})(RotateDirection || (exports.RotateDirection = RotateDirection = {}));
|
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InteractivityDetect = void 0;
|
|
4
|
+
var InteractivityDetect;
|
|
5
|
+
(function (InteractivityDetect) {
|
|
6
|
+
InteractivityDetect["canvas"] = "canvas";
|
|
7
|
+
InteractivityDetect["parent"] = "parent";
|
|
8
|
+
InteractivityDetect["window"] = "window";
|
|
9
|
+
})(InteractivityDetect || (exports.InteractivityDetect = InteractivityDetect = {}));
|
|
@@ -1,2 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AnimationMode = void 0;
|
|
4
|
+
var AnimationMode;
|
|
5
|
+
(function (AnimationMode) {
|
|
6
|
+
AnimationMode["auto"] = "auto";
|
|
7
|
+
AnimationMode["increase"] = "increase";
|
|
8
|
+
AnimationMode["decrease"] = "decrease";
|
|
9
|
+
AnimationMode["random"] = "random";
|
|
10
|
+
})(AnimationMode || (exports.AnimationMode = AnimationMode = {}));
|
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CollisionMode = void 0;
|
|
4
|
+
var CollisionMode;
|
|
5
|
+
(function (CollisionMode) {
|
|
6
|
+
CollisionMode["absorb"] = "absorb";
|
|
7
|
+
CollisionMode["bounce"] = "bounce";
|
|
8
|
+
CollisionMode["destroy"] = "destroy";
|
|
9
|
+
})(CollisionMode || (exports.CollisionMode = CollisionMode = {}));
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LimitMode = void 0;
|
|
4
|
+
var LimitMode;
|
|
5
|
+
(function (LimitMode) {
|
|
6
|
+
LimitMode["delete"] = "delete";
|
|
7
|
+
LimitMode["wait"] = "wait";
|
|
8
|
+
})(LimitMode || (exports.LimitMode = LimitMode = {}));
|
|
@@ -1,2 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OutMode = void 0;
|
|
4
|
+
var OutMode;
|
|
5
|
+
(function (OutMode) {
|
|
6
|
+
OutMode["bounce"] = "bounce";
|
|
7
|
+
OutMode["none"] = "none";
|
|
8
|
+
OutMode["out"] = "out";
|
|
9
|
+
OutMode["destroy"] = "destroy";
|
|
10
|
+
OutMode["split"] = "split";
|
|
11
|
+
})(OutMode || (exports.OutMode = OutMode = {}));
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PixelMode = void 0;
|
|
4
|
+
var PixelMode;
|
|
5
|
+
(function (PixelMode) {
|
|
6
|
+
PixelMode["precise"] = "precise";
|
|
7
|
+
PixelMode["percent"] = "percent";
|
|
8
|
+
})(PixelMode || (exports.PixelMode = PixelMode = {}));
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ResponsiveMode = void 0;
|
|
4
|
+
var ResponsiveMode;
|
|
5
|
+
(function (ResponsiveMode) {
|
|
6
|
+
ResponsiveMode["screen"] = "screen";
|
|
7
|
+
ResponsiveMode["canvas"] = "canvas";
|
|
8
|
+
})(ResponsiveMode || (exports.ResponsiveMode = ResponsiveMode = {}));
|
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ThemeMode = void 0;
|
|
4
|
+
var ThemeMode;
|
|
5
|
+
(function (ThemeMode) {
|
|
6
|
+
ThemeMode["any"] = "any";
|
|
7
|
+
ThemeMode["dark"] = "dark";
|
|
8
|
+
ThemeMode["light"] = "light";
|
|
9
|
+
})(ThemeMode || (exports.ThemeMode = ThemeMode = {}));
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AlterType = void 0;
|
|
4
|
+
var AlterType;
|
|
5
|
+
(function (AlterType) {
|
|
6
|
+
AlterType["darken"] = "darken";
|
|
7
|
+
AlterType["enlighten"] = "enlighten";
|
|
8
|
+
})(AlterType || (exports.AlterType = AlterType = {}));
|
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DestroyType = void 0;
|
|
4
|
+
var DestroyType;
|
|
5
|
+
(function (DestroyType) {
|
|
6
|
+
DestroyType["none"] = "none";
|
|
7
|
+
DestroyType["max"] = "max";
|
|
8
|
+
DestroyType["min"] = "min";
|
|
9
|
+
})(DestroyType || (exports.DestroyType = DestroyType = {}));
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DivType = void 0;
|
|
4
|
+
var DivType;
|
|
5
|
+
(function (DivType) {
|
|
6
|
+
DivType["circle"] = "circle";
|
|
7
|
+
DivType["rectangle"] = "rectangle";
|
|
8
|
+
})(DivType || (exports.DivType = DivType = {}));
|
|
@@ -1,2 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EasingType = void 0;
|
|
4
|
+
var EasingType;
|
|
5
|
+
(function (EasingType) {
|
|
6
|
+
EasingType["easeInBack"] = "ease-in-back";
|
|
7
|
+
EasingType["easeInCirc"] = "ease-in-circ";
|
|
8
|
+
EasingType["easeInCubic"] = "ease-in-cubic";
|
|
9
|
+
EasingType["easeInLinear"] = "ease-in-linear";
|
|
10
|
+
EasingType["easeInQuad"] = "ease-in-quad";
|
|
11
|
+
EasingType["easeInQuart"] = "ease-in-quart";
|
|
12
|
+
EasingType["easeInQuint"] = "ease-in-quint";
|
|
13
|
+
EasingType["easeInExpo"] = "ease-in-expo";
|
|
14
|
+
EasingType["easeInSine"] = "ease-in-sine";
|
|
15
|
+
EasingType["easeOutBack"] = "ease-out-back";
|
|
16
|
+
EasingType["easeOutCirc"] = "ease-out-circ";
|
|
17
|
+
EasingType["easeOutCubic"] = "ease-out-cubic";
|
|
18
|
+
EasingType["easeOutLinear"] = "ease-out-linear";
|
|
19
|
+
EasingType["easeOutQuad"] = "ease-out-quad";
|
|
20
|
+
EasingType["easeOutQuart"] = "ease-out-quart";
|
|
21
|
+
EasingType["easeOutQuint"] = "ease-out-quint";
|
|
22
|
+
EasingType["easeOutExpo"] = "ease-out-expo";
|
|
23
|
+
EasingType["easeOutSine"] = "ease-out-sine";
|
|
24
|
+
EasingType["easeInOutBack"] = "ease-in-out-back";
|
|
25
|
+
EasingType["easeInOutCirc"] = "ease-in-out-circ";
|
|
26
|
+
EasingType["easeInOutCubic"] = "ease-in-out-cubic";
|
|
27
|
+
EasingType["easeInOutLinear"] = "ease-in-out-linear";
|
|
28
|
+
EasingType["easeInOutQuad"] = "ease-in-out-quad";
|
|
29
|
+
EasingType["easeInOutQuart"] = "ease-in-out-quart";
|
|
30
|
+
EasingType["easeInOutQuint"] = "ease-in-out-quint";
|
|
31
|
+
EasingType["easeInOutExpo"] = "ease-in-out-expo";
|
|
32
|
+
EasingType["easeInOutSine"] = "ease-in-out-sine";
|
|
33
|
+
})(EasingType || (exports.EasingType = EasingType = {}));
|
|
@@ -1,2 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EventType = void 0;
|
|
4
|
+
var EventType;
|
|
5
|
+
(function (EventType) {
|
|
6
|
+
EventType["configAdded"] = "configAdded";
|
|
7
|
+
EventType["containerInit"] = "containerInit";
|
|
8
|
+
EventType["particlesSetup"] = "particlesSetup";
|
|
9
|
+
EventType["containerStarted"] = "containerStarted";
|
|
10
|
+
EventType["containerStopped"] = "containerStopped";
|
|
11
|
+
EventType["containerDestroyed"] = "containerDestroyed";
|
|
12
|
+
EventType["containerPaused"] = "containerPaused";
|
|
13
|
+
EventType["containerPlay"] = "containerPlay";
|
|
14
|
+
EventType["containerBuilt"] = "containerBuilt";
|
|
15
|
+
EventType["particleAdded"] = "particleAdded";
|
|
16
|
+
EventType["particleDestroyed"] = "particleDestroyed";
|
|
17
|
+
EventType["particleRemoved"] = "particleRemoved";
|
|
18
|
+
})(EventType || (exports.EventType = EventType = {}));
|
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GradientType = void 0;
|
|
4
|
+
var GradientType;
|
|
5
|
+
(function (GradientType) {
|
|
6
|
+
GradientType["linear"] = "linear";
|
|
7
|
+
GradientType["radial"] = "radial";
|
|
8
|
+
GradientType["random"] = "random";
|
|
9
|
+
})(GradientType || (exports.GradientType = GradientType = {}));
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InteractorType = void 0;
|
|
4
|
+
var InteractorType;
|
|
5
|
+
(function (InteractorType) {
|
|
6
|
+
InteractorType["external"] = "external";
|
|
7
|
+
InteractorType["particles"] = "particles";
|
|
8
|
+
})(InteractorType || (exports.InteractorType = InteractorType = {}));
|
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ParticleOutType = void 0;
|
|
4
|
+
var ParticleOutType;
|
|
5
|
+
(function (ParticleOutType) {
|
|
6
|
+
ParticleOutType["normal"] = "normal";
|
|
7
|
+
ParticleOutType["inside"] = "inside";
|
|
8
|
+
ParticleOutType["outside"] = "outside";
|
|
9
|
+
})(ParticleOutType || (exports.ParticleOutType = ParticleOutType = {}));
|
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StartValueType = void 0;
|
|
4
|
+
var StartValueType;
|
|
5
|
+
(function (StartValueType) {
|
|
6
|
+
StartValueType["max"] = "max";
|
|
7
|
+
StartValueType["min"] = "min";
|
|
8
|
+
StartValueType["random"] = "random";
|
|
9
|
+
})(StartValueType || (exports.StartValueType = StartValueType = {}));
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RangedAnimationOptions = exports.AnimationOptions = void 0;
|
|
4
|
+
const AnimationMode_js_1 = require("../../Enums/Modes/AnimationMode.js");
|
|
5
|
+
const StartValueType_js_1 = require("../../Enums/Types/StartValueType.js");
|
|
4
6
|
const NumberUtils_js_1 = require("../../Utils/NumberUtils.js");
|
|
5
7
|
class AnimationOptions {
|
|
6
8
|
constructor() {
|
|
@@ -39,8 +41,8 @@ exports.AnimationOptions = AnimationOptions;
|
|
|
39
41
|
class RangedAnimationOptions extends AnimationOptions {
|
|
40
42
|
constructor() {
|
|
41
43
|
super();
|
|
42
|
-
this.mode =
|
|
43
|
-
this.startValue =
|
|
44
|
+
this.mode = AnimationMode_js_1.AnimationMode.auto;
|
|
45
|
+
this.startValue = StartValueType_js_1.StartValueType.random;
|
|
44
46
|
}
|
|
45
47
|
load(data) {
|
|
46
48
|
super.load(data);
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DivEvent = void 0;
|
|
4
|
+
const DivType_js_1 = require("../../../../Enums/Types/DivType.js");
|
|
4
5
|
class DivEvent {
|
|
5
6
|
constructor() {
|
|
6
7
|
this.selectors = [];
|
|
7
8
|
this.enable = false;
|
|
8
9
|
this.mode = [];
|
|
9
|
-
this.type =
|
|
10
|
+
this.type = DivType_js_1.DivType.circle;
|
|
10
11
|
}
|
|
11
12
|
load(data) {
|
|
12
13
|
if (!data) {
|
|
@@ -20,7 +20,7 @@ class Events {
|
|
|
20
20
|
this.onClick.load(data.onClick);
|
|
21
21
|
const onDiv = data.onDiv;
|
|
22
22
|
if (onDiv !== undefined) {
|
|
23
|
-
this.onDiv = (0, Utils_js_1.executeOnSingleOrMultiple)(onDiv,
|
|
23
|
+
this.onDiv = (0, Utils_js_1.executeOnSingleOrMultiple)(onDiv, t => {
|
|
24
24
|
const tmp = new DivEvent_js_1.DivEvent();
|
|
25
25
|
tmp.load(t);
|
|
26
26
|
return tmp;
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Interactivity = void 0;
|
|
4
4
|
const Events_js_1 = require("./Events/Events.js");
|
|
5
|
+
const InteractivityDetect_js_1 = require("../../../Enums/InteractivityDetect.js");
|
|
5
6
|
const Modes_js_1 = require("./Modes/Modes.js");
|
|
6
7
|
class Interactivity {
|
|
7
8
|
constructor(engine, container) {
|
|
8
|
-
this.detectsOn =
|
|
9
|
+
this.detectsOn = InteractivityDetect_js_1.InteractivityDetect.window;
|
|
9
10
|
this.events = new Events_js_1.Events();
|
|
10
11
|
this.modes = new Modes_js_1.Modes(engine, container);
|
|
11
12
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ManualParticle = void 0;
|
|
4
|
+
const PixelMode_js_1 = require("../../Enums/Modes/PixelMode.js");
|
|
4
5
|
const Utils_js_1 = require("../../Utils/Utils.js");
|
|
5
6
|
const defaultPosition = 50;
|
|
6
7
|
class ManualParticle {
|
|
@@ -12,7 +13,7 @@ class ManualParticle {
|
|
|
12
13
|
this.position = {
|
|
13
14
|
x: data.position.x ?? defaultPosition,
|
|
14
15
|
y: data.position.y ?? defaultPosition,
|
|
15
|
-
mode: data.position.mode ??
|
|
16
|
+
mode: data.position.mode ?? PixelMode_js_1.PixelMode.percent,
|
|
16
17
|
};
|
|
17
18
|
}
|
|
18
19
|
if (data.options) {
|
|
@@ -8,17 +8,19 @@ const FullScreen_js_1 = require("./FullScreen/FullScreen.js");
|
|
|
8
8
|
const Interactivity_js_1 = require("./Interactivity/Interactivity.js");
|
|
9
9
|
const ManualParticle_js_1 = require("./ManualParticle.js");
|
|
10
10
|
const Responsive_js_1 = require("./Responsive.js");
|
|
11
|
+
const ResponsiveMode_js_1 = require("../../Enums/Modes/ResponsiveMode.js");
|
|
11
12
|
const Theme_js_1 = require("./Theme/Theme.js");
|
|
13
|
+
const ThemeMode_js_1 = require("../../Enums/Modes/ThemeMode.js");
|
|
12
14
|
const TypeUtils_js_1 = require("../../Utils/TypeUtils.js");
|
|
13
15
|
const OptionsUtils_js_1 = require("../../Utils/OptionsUtils.js");
|
|
14
16
|
const NumberUtils_js_1 = require("../../Utils/NumberUtils.js");
|
|
15
17
|
class Options {
|
|
16
18
|
constructor(engine, container) {
|
|
17
|
-
this._findDefaultTheme =
|
|
18
|
-
return (this.themes.find(
|
|
19
|
-
this.themes.find(
|
|
19
|
+
this._findDefaultTheme = mode => {
|
|
20
|
+
return (this.themes.find(theme => theme.default.value && theme.default.mode === mode) ??
|
|
21
|
+
this.themes.find(theme => theme.default.value && theme.default.mode === ThemeMode_js_1.ThemeMode.any));
|
|
20
22
|
};
|
|
21
|
-
this._importPreset =
|
|
23
|
+
this._importPreset = preset => {
|
|
22
24
|
this.load(this._engine.getPreset(preset));
|
|
23
25
|
};
|
|
24
26
|
this._engine = engine;
|
|
@@ -49,7 +51,7 @@ class Options {
|
|
|
49
51
|
return;
|
|
50
52
|
}
|
|
51
53
|
if (data.preset !== undefined) {
|
|
52
|
-
(0, Utils_js_1.executeOnSingleOrMultiple)(data.preset,
|
|
54
|
+
(0, Utils_js_1.executeOnSingleOrMultiple)(data.preset, preset => this._importPreset(preset));
|
|
53
55
|
}
|
|
54
56
|
if (data.autoPlay !== undefined) {
|
|
55
57
|
this.autoPlay = data.autoPlay;
|
|
@@ -97,7 +99,7 @@ class Options {
|
|
|
97
99
|
this.backgroundMask.load(data.backgroundMask);
|
|
98
100
|
this.interactivity.load(data.interactivity);
|
|
99
101
|
if (data.manualParticles) {
|
|
100
|
-
this.manualParticles = data.manualParticles.map(
|
|
102
|
+
this.manualParticles = data.manualParticles.map(t => {
|
|
101
103
|
const tmp = new ManualParticle_js_1.ManualParticle();
|
|
102
104
|
tmp.load(t);
|
|
103
105
|
return tmp;
|
|
@@ -127,7 +129,7 @@ class Options {
|
|
|
127
129
|
this.responsive.sort((a, b) => a.maxWidth - b.maxWidth);
|
|
128
130
|
if (data.themes !== undefined) {
|
|
129
131
|
for (const theme of data.themes) {
|
|
130
|
-
const existingTheme = this.themes.find(
|
|
132
|
+
const existingTheme = this.themes.find(t => t.name === theme.name);
|
|
131
133
|
if (!existingTheme) {
|
|
132
134
|
const optTheme = new Theme_js_1.Theme();
|
|
133
135
|
optTheme.load(theme);
|
|
@@ -138,24 +140,24 @@ class Options {
|
|
|
138
140
|
}
|
|
139
141
|
}
|
|
140
142
|
}
|
|
141
|
-
this.defaultThemes.dark = this._findDefaultTheme(
|
|
142
|
-
this.defaultThemes.light = this._findDefaultTheme(
|
|
143
|
+
this.defaultThemes.dark = this._findDefaultTheme(ThemeMode_js_1.ThemeMode.dark)?.name;
|
|
144
|
+
this.defaultThemes.light = this._findDefaultTheme(ThemeMode_js_1.ThemeMode.light)?.name;
|
|
143
145
|
}
|
|
144
146
|
setResponsive(width, pxRatio, defaultOptions) {
|
|
145
147
|
this.load(defaultOptions);
|
|
146
|
-
const responsiveOptions = this.responsive.find(
|
|
148
|
+
const responsiveOptions = this.responsive.find(t => t.mode === ResponsiveMode_js_1.ResponsiveMode.screen && screen ? t.maxWidth > screen.availWidth : t.maxWidth * pxRatio > width);
|
|
147
149
|
this.load(responsiveOptions?.options);
|
|
148
150
|
return responsiveOptions?.maxWidth;
|
|
149
151
|
}
|
|
150
152
|
setTheme(name) {
|
|
151
153
|
if (name) {
|
|
152
|
-
const chosenTheme = this.themes.find(
|
|
154
|
+
const chosenTheme = this.themes.find(theme => theme.name === name);
|
|
153
155
|
if (chosenTheme) {
|
|
154
156
|
this.load(chosenTheme.options);
|
|
155
157
|
}
|
|
156
158
|
}
|
|
157
159
|
else {
|
|
158
|
-
const mediaMatch = (0, Utils_js_1.safeMatchMedia)("(prefers-color-scheme: dark)"), clientDarkMode = mediaMatch
|
|
160
|
+
const mediaMatch = (0, Utils_js_1.safeMatchMedia)("(prefers-color-scheme: dark)"), clientDarkMode = mediaMatch?.matches, defaultTheme = this._findDefaultTheme(clientDarkMode ? ThemeMode_js_1.ThemeMode.dark : ThemeMode_js_1.ThemeMode.light);
|
|
159
161
|
if (defaultTheme) {
|
|
160
162
|
this.load(defaultTheme.options);
|
|
161
163
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Collisions = void 0;
|
|
4
|
+
const CollisionMode_js_1 = require("../../../../Enums/Modes/CollisionMode.js");
|
|
4
5
|
const CollisionsAbsorb_js_1 = require("./CollisionsAbsorb.js");
|
|
5
6
|
const CollisionsOverlap_js_1 = require("./CollisionsOverlap.js");
|
|
6
7
|
const ParticlesBounce_js_1 = require("../Bounce/ParticlesBounce.js");
|
|
@@ -11,7 +12,7 @@ class Collisions {
|
|
|
11
12
|
this.bounce = new ParticlesBounce_js_1.ParticlesBounce();
|
|
12
13
|
this.enable = false;
|
|
13
14
|
this.maxSpeed = 50;
|
|
14
|
-
this.mode =
|
|
15
|
+
this.mode = CollisionMode_js_1.CollisionMode.bounce;
|
|
15
16
|
this.overlap = new CollisionsOverlap_js_1.CollisionsOverlap();
|
|
16
17
|
}
|
|
17
18
|
load(data) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Move = void 0;
|
|
4
|
+
const MoveDirection_js_1 = require("../../../../Enums/Directions/MoveDirection.js");
|
|
4
5
|
const TypeUtils_js_1 = require("../../../../Utils/TypeUtils.js");
|
|
5
6
|
const MoveAngle_js_1 = require("./MoveAngle.js");
|
|
6
7
|
const MoveAttract_js_1 = require("./MoveAttract.js");
|
|
@@ -18,7 +19,7 @@ class Move {
|
|
|
18
19
|
this.center = new MoveCenter_js_1.MoveCenter();
|
|
19
20
|
this.decay = 0;
|
|
20
21
|
this.distance = {};
|
|
21
|
-
this.direction =
|
|
22
|
+
this.direction = MoveDirection_js_1.MoveDirection.none;
|
|
22
23
|
this.drift = 0;
|
|
23
24
|
this.enable = false;
|
|
24
25
|
this.gravity = new MoveGravity_js_1.MoveGravity();
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MoveCenter = void 0;
|
|
4
|
+
const PixelMode_js_1 = require("../../../../Enums/Modes/PixelMode.js");
|
|
4
5
|
class MoveCenter {
|
|
5
6
|
constructor() {
|
|
6
7
|
this.x = 50;
|
|
7
8
|
this.y = 50;
|
|
8
|
-
this.mode =
|
|
9
|
+
this.mode = PixelMode_js_1.PixelMode.percent;
|
|
9
10
|
this.radius = 0;
|
|
10
11
|
}
|
|
11
12
|
load(data) {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.OutModes = void 0;
|
|
4
|
+
const OutMode_js_1 = require("../../../../Enums/Modes/OutMode.js");
|
|
4
5
|
class OutModes {
|
|
5
6
|
constructor() {
|
|
6
|
-
this.default =
|
|
7
|
+
this.default = OutMode_js_1.OutMode.out;
|
|
7
8
|
}
|
|
8
9
|
load(data) {
|
|
9
10
|
if (!data) {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ParticlesNumberLimit = void 0;
|
|
4
|
+
const LimitMode_js_1 = require("../../../../Enums/Modes/LimitMode.js");
|
|
4
5
|
class ParticlesNumberLimit {
|
|
5
6
|
constructor() {
|
|
6
|
-
this.mode =
|
|
7
|
+
this.mode = LimitMode_js_1.LimitMode.delete;
|
|
7
8
|
this.value = 0;
|
|
8
9
|
}
|
|
9
10
|
load(data) {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.OpacityAnimation = void 0;
|
|
4
|
+
const DestroyType_js_1 = require("../../../../Enums/Types/DestroyType.js");
|
|
4
5
|
const AnimationOptions_js_1 = require("../../AnimationOptions.js");
|
|
5
6
|
class OpacityAnimation extends AnimationOptions_js_1.RangedAnimationOptions {
|
|
6
7
|
constructor() {
|
|
7
8
|
super();
|
|
8
|
-
this.destroy =
|
|
9
|
+
this.destroy = DestroyType_js_1.DestroyType.none;
|
|
9
10
|
this.speed = 2;
|
|
10
11
|
}
|
|
11
12
|
load(data) {
|
|
@@ -68,7 +68,7 @@ class ParticlesOptions {
|
|
|
68
68
|
}
|
|
69
69
|
const strokeToLoad = data.stroke;
|
|
70
70
|
if (strokeToLoad) {
|
|
71
|
-
this.stroke = (0, Utils_js_1.executeOnSingleOrMultiple)(strokeToLoad,
|
|
71
|
+
this.stroke = (0, Utils_js_1.executeOnSingleOrMultiple)(strokeToLoad, t => {
|
|
72
72
|
const tmp = new Stroke_js_1.Stroke();
|
|
73
73
|
tmp.load(t);
|
|
74
74
|
return tmp;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SizeAnimation = void 0;
|
|
4
|
+
const DestroyType_js_1 = require("../../../../Enums/Types/DestroyType.js");
|
|
4
5
|
const AnimationOptions_js_1 = require("../../AnimationOptions.js");
|
|
5
6
|
class SizeAnimation extends AnimationOptions_js_1.RangedAnimationOptions {
|
|
6
7
|
constructor() {
|
|
7
8
|
super();
|
|
8
|
-
this.destroy =
|
|
9
|
+
this.destroy = DestroyType_js_1.DestroyType.none;
|
|
9
10
|
this.speed = 5;
|
|
10
11
|
}
|
|
11
12
|
load(data) {
|