@tsparticles/engine 3.3.0 → 3.5.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 +57 -44
- 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 +28 -14
- 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 +57 -44
- 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 +24 -19
- package/cjs/Utils/ColorUtils.js +37 -30
- package/cjs/Utils/EventDispatcher.js +1 -1
- package/cjs/Utils/HslColorManager.js +11 -4
- package/cjs/Utils/NumberUtils.js +54 -38
- package/cjs/Utils/OptionsUtils.js +2 -3
- package/cjs/Utils/RgbColorManager.js +11 -4
- package/cjs/Utils/TypeUtils.js +6 -7
- package/cjs/Utils/Utils.js +66 -61
- package/cjs/init.js +1 -2
- package/esm/Core/Canvas.js +27 -22
- package/esm/Core/Container.js +57 -44
- 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 +28 -14
- 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/types/Utils/NumberUtils.d.ts +3 -0
- package/umd/Core/Canvas.js +27 -22
- package/umd/Core/Container.js +58 -45
- 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 +25 -20
- package/umd/Utils/ColorUtils.js +38 -31
- package/umd/Utils/EventDispatcher.js +1 -1
- package/umd/Utils/HslColorManager.js +11 -4
- package/umd/Utils/NumberUtils.js +55 -39
- package/umd/Utils/OptionsUtils.js +2 -3
- package/umd/Utils/RgbColorManager.js +11 -4
- package/umd/Utils/TypeUtils.js +6 -7
- package/umd/Utils/Utils.js +67 -62
- package/umd/init.js +1 -2
- package/174.min.js +0 -2
- package/174.min.js.LICENSE.txt +0 -1
- package/dist_browser_Core_Container_js.js +0 -102
package/cjs/Core/Particles.js
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Particles = void 0;
|
|
4
4
|
const Utils_js_1 = require("../Utils/Utils.js");
|
|
5
|
+
const EventType_js_1 = require("../Enums/Types/EventType.js");
|
|
5
6
|
const InteractionManager_js_1 = require("./Utils/InteractionManager.js");
|
|
7
|
+
const LimitMode_js_1 = require("../Enums/Modes/LimitMode.js");
|
|
6
8
|
const Particle_js_1 = require("./Particle.js");
|
|
7
9
|
const Point_js_1 = require("./Utils/Point.js");
|
|
8
10
|
const QuadTree_js_1 = require("./Utils/QuadTree.js");
|
|
@@ -16,9 +18,7 @@ const qTreeRectangle = (canvasSize) => {
|
|
|
16
18
|
class Particles {
|
|
17
19
|
constructor(engine, container) {
|
|
18
20
|
this._addToPool = (...particles) => {
|
|
19
|
-
|
|
20
|
-
this._pool.push(particle);
|
|
21
|
-
}
|
|
21
|
+
this._pool.push(...particles);
|
|
22
22
|
};
|
|
23
23
|
this._applyDensity = (options, manualCount, group) => {
|
|
24
24
|
const numberOptions = options.number;
|
|
@@ -31,7 +31,7 @@ class Particles {
|
|
|
31
31
|
}
|
|
32
32
|
return;
|
|
33
33
|
}
|
|
34
|
-
const densityFactor = this._initDensityFactor(numberOptions.density), optParticlesNumber = numberOptions.value, minLimit = 0, optParticlesLimit = numberOptions.limit.value > minLimit ? numberOptions.limit.value : optParticlesNumber, particlesNumber = Math.min(optParticlesNumber, optParticlesLimit) * densityFactor + manualCount, particlesCount = Math.min(this.count, this.filter(
|
|
34
|
+
const densityFactor = this._initDensityFactor(numberOptions.density), optParticlesNumber = numberOptions.value, minLimit = 0, optParticlesLimit = numberOptions.limit.value > minLimit ? numberOptions.limit.value : optParticlesNumber, particlesNumber = Math.min(optParticlesNumber, optParticlesLimit) * densityFactor + manualCount, particlesCount = Math.min(this.count, this.filter(t => t.group === group).length);
|
|
35
35
|
if (group === undefined) {
|
|
36
36
|
this._limit = numberOptions.limit.value * densityFactor;
|
|
37
37
|
}
|
|
@@ -45,7 +45,7 @@ class Particles {
|
|
|
45
45
|
this.removeQuantity(particlesCount - particlesNumber, group);
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
|
-
this._initDensityFactor =
|
|
48
|
+
this._initDensityFactor = densityOptions => {
|
|
49
49
|
const container = this._container, defaultFactor = 1;
|
|
50
50
|
if (!container.canvas.element || !densityOptions.enable) {
|
|
51
51
|
return defaultFactor;
|
|
@@ -70,7 +70,7 @@ class Particles {
|
|
|
70
70
|
this._array.push(particle);
|
|
71
71
|
this._zArray.push(particle);
|
|
72
72
|
this._nextId++;
|
|
73
|
-
this._engine.dispatchEvent(
|
|
73
|
+
this._engine.dispatchEvent(EventType_js_1.EventType.particleAdded, {
|
|
74
74
|
container: this._container,
|
|
75
75
|
data: {
|
|
76
76
|
particle,
|
|
@@ -91,7 +91,7 @@ class Particles {
|
|
|
91
91
|
this._array.splice(index, deleteCount);
|
|
92
92
|
this._zArray.splice(zIdx, deleteCount);
|
|
93
93
|
particle.destroy(override);
|
|
94
|
-
this._engine.dispatchEvent(
|
|
94
|
+
this._engine.dispatchEvent(EventType_js_1.EventType.particleRemoved, {
|
|
95
95
|
container: this._container,
|
|
96
96
|
data: {
|
|
97
97
|
particle,
|
|
@@ -122,23 +122,24 @@ class Particles {
|
|
|
122
122
|
}
|
|
123
123
|
addManualParticles() {
|
|
124
124
|
const container = this._container, options = container.actualOptions;
|
|
125
|
-
|
|
126
|
-
this.addParticle(particle.position ? (0, Utils_js_1.getPosition)(particle.position, container.canvas.size) : undefined, particle.options);
|
|
127
|
-
}
|
|
125
|
+
options.manualParticles.forEach(p => this.addParticle(p.position ? (0, Utils_js_1.getPosition)(p.position, container.canvas.size) : undefined, p.options));
|
|
128
126
|
}
|
|
129
127
|
addParticle(position, overrideOptions, group, initializer) {
|
|
130
|
-
const
|
|
128
|
+
const limitMode = this._container.actualOptions.particles.number.limit.mode, limit = group === undefined ? this._limit : this._groupLimits.get(group) ?? this._limit, currentCount = this.count, minLimit = 0;
|
|
131
129
|
if (limit > minLimit) {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
if (currentCount >= limit) {
|
|
140
|
-
return;
|
|
130
|
+
switch (limitMode) {
|
|
131
|
+
case LimitMode_js_1.LimitMode.delete: {
|
|
132
|
+
const countOffset = 1, minCount = 0, countToRemove = currentCount + countOffset - limit;
|
|
133
|
+
if (countToRemove > minCount) {
|
|
134
|
+
this.removeQuantity(countToRemove);
|
|
135
|
+
}
|
|
136
|
+
break;
|
|
141
137
|
}
|
|
138
|
+
case LimitMode_js_1.LimitMode.wait:
|
|
139
|
+
if (currentCount >= limit) {
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
break;
|
|
142
143
|
}
|
|
143
144
|
}
|
|
144
145
|
return this._pushParticle(position, overrideOptions, group, initializer);
|
|
@@ -184,9 +185,7 @@ class Particles {
|
|
|
184
185
|
await this.initPlugins();
|
|
185
186
|
let handled = false;
|
|
186
187
|
for (const [, plugin] of container.plugins) {
|
|
187
|
-
|
|
188
|
-
handled = plugin.particlesInitialization();
|
|
189
|
-
}
|
|
188
|
+
handled = plugin.particlesInitialization?.() ?? handled;
|
|
190
189
|
if (handled) {
|
|
191
190
|
break;
|
|
192
191
|
}
|
|
@@ -301,7 +300,7 @@ class Particles {
|
|
|
301
300
|
this._array = this.filter(checkDelete);
|
|
302
301
|
this._zArray = this._zArray.filter(checkDelete);
|
|
303
302
|
for (const particle of particlesToDelete) {
|
|
304
|
-
this._engine.dispatchEvent(
|
|
303
|
+
this._engine.dispatchEvent(EventType_js_1.EventType.particleRemoved, {
|
|
305
304
|
container: this._container,
|
|
306
305
|
data: {
|
|
307
306
|
particle,
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.EventListeners = void 0;
|
|
4
4
|
const Utils_js_1 = require("../../Utils/Utils.js");
|
|
5
5
|
const Constants_js_1 = require("./Constants.js");
|
|
6
|
+
const InteractivityDetect_js_1 = require("../../Enums/InteractivityDetect.js");
|
|
6
7
|
const TypeUtils_js_1 = require("../../Utils/TypeUtils.js");
|
|
7
8
|
const double = 2;
|
|
8
9
|
function manageListener(element, event, handler, add, options) {
|
|
@@ -24,7 +25,7 @@ function manageListener(element, event, handler, add, options) {
|
|
|
24
25
|
class EventListeners {
|
|
25
26
|
constructor(container) {
|
|
26
27
|
this.container = container;
|
|
27
|
-
this._doMouseTouchClick =
|
|
28
|
+
this._doMouseTouchClick = e => {
|
|
28
29
|
const container = this.container, options = container.actualOptions;
|
|
29
30
|
if (this._canPush) {
|
|
30
31
|
const mouseInteractivity = container.interactivity.mouse, mousePos = mouseInteractivity.position;
|
|
@@ -34,7 +35,7 @@ class EventListeners {
|
|
|
34
35
|
mouseInteractivity.clickPosition = { ...mousePos };
|
|
35
36
|
mouseInteractivity.clickTime = new Date().getTime();
|
|
36
37
|
const onClick = options.interactivity.events.onClick;
|
|
37
|
-
(0, Utils_js_1.executeOnSingleOrMultiple)(onClick.mode,
|
|
38
|
+
(0, Utils_js_1.executeOnSingleOrMultiple)(onClick.mode, mode => this.container.handleClickMode(mode));
|
|
38
39
|
}
|
|
39
40
|
if (e.type === "touchend") {
|
|
40
41
|
const touchDelay = 500;
|
|
@@ -42,8 +43,8 @@ class EventListeners {
|
|
|
42
43
|
}
|
|
43
44
|
};
|
|
44
45
|
this._handleThemeChange = (e) => {
|
|
45
|
-
const mediaEvent = e, container = this.container, options = container.options, defaultThemes = options.defaultThemes, themeName = mediaEvent.matches ? defaultThemes.dark : defaultThemes.light, theme = options.themes.find(
|
|
46
|
-
if (theme
|
|
46
|
+
const mediaEvent = e, container = this.container, options = container.options, defaultThemes = options.defaultThemes, themeName = mediaEvent.matches ? defaultThemes.dark : defaultThemes.light, theme = options.themes.find(theme => theme.name === themeName);
|
|
47
|
+
if (theme?.default.auto) {
|
|
47
48
|
void container.loadTheme(themeName);
|
|
48
49
|
}
|
|
49
50
|
};
|
|
@@ -53,7 +54,7 @@ class EventListeners {
|
|
|
53
54
|
if (!options.pauseOnBlur) {
|
|
54
55
|
return;
|
|
55
56
|
}
|
|
56
|
-
if (document
|
|
57
|
+
if (document?.hidden) {
|
|
57
58
|
container.pageHidden = true;
|
|
58
59
|
container.pause();
|
|
59
60
|
}
|
|
@@ -105,14 +106,14 @@ class EventListeners {
|
|
|
105
106
|
manageListener(interactivityEl, mouseLeaveTmpEvent, handlers.mouseLeave, add);
|
|
106
107
|
manageListener(interactivityEl, Constants_js_1.touchCancelEvent, handlers.touchCancel, add);
|
|
107
108
|
};
|
|
108
|
-
this._manageListeners =
|
|
109
|
+
this._manageListeners = add => {
|
|
109
110
|
const handlers = this._handlers, container = this.container, options = container.actualOptions, detectType = options.interactivity.detectsOn, canvasEl = container.canvas.element;
|
|
110
111
|
let mouseLeaveTmpEvent = Constants_js_1.mouseLeaveEvent;
|
|
111
|
-
if (detectType ===
|
|
112
|
+
if (detectType === InteractivityDetect_js_1.InteractivityDetect.window) {
|
|
112
113
|
container.interactivity.element = window;
|
|
113
114
|
mouseLeaveTmpEvent = Constants_js_1.mouseOutEvent;
|
|
114
115
|
}
|
|
115
|
-
else if (detectType ===
|
|
116
|
+
else if (detectType === InteractivityDetect_js_1.InteractivityDetect.parent && canvasEl) {
|
|
116
117
|
container.interactivity.element = canvasEl.parentElement ?? canvasEl.parentNode;
|
|
117
118
|
}
|
|
118
119
|
else {
|
|
@@ -125,7 +126,7 @@ class EventListeners {
|
|
|
125
126
|
manageListener(document, Constants_js_1.visibilityChangeEvent, handlers.visibilityChange, add, false);
|
|
126
127
|
}
|
|
127
128
|
};
|
|
128
|
-
this._manageMediaMatch =
|
|
129
|
+
this._manageMediaMatch = add => {
|
|
129
130
|
const handlers = this._handlers, mediaMatch = (0, Utils_js_1.safeMatchMedia)("(prefers-color-scheme: dark)");
|
|
130
131
|
if (!mediaMatch) {
|
|
131
132
|
return;
|
|
@@ -144,7 +145,7 @@ class EventListeners {
|
|
|
144
145
|
mediaMatch.removeListener(handlers.oldThemeChange);
|
|
145
146
|
}
|
|
146
147
|
};
|
|
147
|
-
this._manageResize =
|
|
148
|
+
this._manageResize = add => {
|
|
148
149
|
const handlers = this._handlers, container = this.container, options = container.actualOptions;
|
|
149
150
|
if (!options.interactivity.events.resize) {
|
|
150
151
|
return;
|
|
@@ -163,7 +164,7 @@ class EventListeners {
|
|
|
163
164
|
}
|
|
164
165
|
else if (!this._resizeObserver && add && canvasEl) {
|
|
165
166
|
this._resizeObserver = new ResizeObserver((entries) => {
|
|
166
|
-
const entry = entries.find(
|
|
167
|
+
const entry = entries.find(e => e.target === canvasEl);
|
|
167
168
|
if (!entry) {
|
|
168
169
|
return;
|
|
169
170
|
}
|
|
@@ -181,7 +182,7 @@ class EventListeners {
|
|
|
181
182
|
mouse.clicking = true;
|
|
182
183
|
mouse.downPosition = mouse.position;
|
|
183
184
|
};
|
|
184
|
-
this._mouseTouchClick =
|
|
185
|
+
this._mouseTouchClick = e => {
|
|
185
186
|
const container = this.container, options = container.actualOptions, { mouse } = container.interactivity;
|
|
186
187
|
mouse.inside = true;
|
|
187
188
|
let handled = false;
|
|
@@ -216,7 +217,7 @@ class EventListeners {
|
|
|
216
217
|
mouse.inside = false;
|
|
217
218
|
mouse.clicking = false;
|
|
218
219
|
};
|
|
219
|
-
this._mouseTouchMove =
|
|
220
|
+
this._mouseTouchMove = e => {
|
|
220
221
|
const container = this.container, options = container.actualOptions, interactivity = container.interactivity, canvasEl = container.canvas.element;
|
|
221
222
|
if (!interactivity?.element) {
|
|
222
223
|
return;
|
|
@@ -235,7 +236,7 @@ class EventListeners {
|
|
|
235
236
|
};
|
|
236
237
|
}
|
|
237
238
|
}
|
|
238
|
-
else if (options.interactivity.detectsOn ===
|
|
239
|
+
else if (options.interactivity.detectsOn === InteractivityDetect_js_1.InteractivityDetect.parent) {
|
|
239
240
|
const source = mouseEvent.target, target = mouseEvent.currentTarget;
|
|
240
241
|
if (source && target && canvasEl) {
|
|
241
242
|
const sourceRect = source.getBoundingClientRect(), targetRect = target.getBoundingClientRect(), canvasRect = canvasEl.getBoundingClientRect();
|
|
@@ -276,21 +277,21 @@ class EventListeners {
|
|
|
276
277
|
interactivity.mouse.position = pos;
|
|
277
278
|
interactivity.status = Constants_js_1.mouseMoveEvent;
|
|
278
279
|
};
|
|
279
|
-
this._touchEnd =
|
|
280
|
+
this._touchEnd = e => {
|
|
280
281
|
const evt = e, touches = Array.from(evt.changedTouches);
|
|
281
282
|
for (const touch of touches) {
|
|
282
283
|
this._touches.delete(touch.identifier);
|
|
283
284
|
}
|
|
284
285
|
this._mouseTouchFinish();
|
|
285
286
|
};
|
|
286
|
-
this._touchEndClick =
|
|
287
|
+
this._touchEndClick = e => {
|
|
287
288
|
const evt = e, touches = Array.from(evt.changedTouches);
|
|
288
289
|
for (const touch of touches) {
|
|
289
290
|
this._touches.delete(touch.identifier);
|
|
290
291
|
}
|
|
291
292
|
this._mouseTouchClick(e);
|
|
292
293
|
};
|
|
293
|
-
this._touchStart =
|
|
294
|
+
this._touchStart = e => {
|
|
294
295
|
const evt = e, touches = Array.from(evt.changedTouches);
|
|
295
296
|
for (const touch of touches) {
|
|
296
297
|
this._touches.set(touch.identifier, performance.now());
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ExternalInteractorBase = void 0;
|
|
4
|
+
const InteractorType_js_1 = require("../../Enums/Types/InteractorType.js");
|
|
4
5
|
class ExternalInteractorBase {
|
|
5
6
|
constructor(container) {
|
|
6
|
-
this.type =
|
|
7
|
+
this.type = InteractorType_js_1.InteractorType.external;
|
|
7
8
|
this.container = container;
|
|
8
9
|
}
|
|
9
10
|
}
|
|
@@ -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);
|