@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
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "../../Utils/Utils.js", "./Constants.js", "../../Utils/TypeUtils.js"], factory);
|
|
7
|
+
define(["require", "exports", "../../Utils/Utils.js", "./Constants.js", "../../Enums/InteractivityDetect.js", "../../Utils/TypeUtils.js"], factory);
|
|
8
8
|
}
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
exports.EventListeners = void 0;
|
|
13
13
|
const Utils_js_1 = require("../../Utils/Utils.js");
|
|
14
14
|
const Constants_js_1 = require("./Constants.js");
|
|
15
|
+
const InteractivityDetect_js_1 = require("../../Enums/InteractivityDetect.js");
|
|
15
16
|
const TypeUtils_js_1 = require("../../Utils/TypeUtils.js");
|
|
16
17
|
const double = 2;
|
|
17
18
|
function manageListener(element, event, handler, add, options) {
|
|
@@ -33,7 +34,7 @@
|
|
|
33
34
|
class EventListeners {
|
|
34
35
|
constructor(container) {
|
|
35
36
|
this.container = container;
|
|
36
|
-
this._doMouseTouchClick =
|
|
37
|
+
this._doMouseTouchClick = e => {
|
|
37
38
|
const container = this.container, options = container.actualOptions;
|
|
38
39
|
if (this._canPush) {
|
|
39
40
|
const mouseInteractivity = container.interactivity.mouse, mousePos = mouseInteractivity.position;
|
|
@@ -43,7 +44,7 @@
|
|
|
43
44
|
mouseInteractivity.clickPosition = { ...mousePos };
|
|
44
45
|
mouseInteractivity.clickTime = new Date().getTime();
|
|
45
46
|
const onClick = options.interactivity.events.onClick;
|
|
46
|
-
(0, Utils_js_1.executeOnSingleOrMultiple)(onClick.mode,
|
|
47
|
+
(0, Utils_js_1.executeOnSingleOrMultiple)(onClick.mode, mode => this.container.handleClickMode(mode));
|
|
47
48
|
}
|
|
48
49
|
if (e.type === "touchend") {
|
|
49
50
|
const touchDelay = 500;
|
|
@@ -51,8 +52,8 @@
|
|
|
51
52
|
}
|
|
52
53
|
};
|
|
53
54
|
this._handleThemeChange = (e) => {
|
|
54
|
-
const mediaEvent = e, container = this.container, options = container.options, defaultThemes = options.defaultThemes, themeName = mediaEvent.matches ? defaultThemes.dark : defaultThemes.light, theme = options.themes.find(
|
|
55
|
-
if (theme
|
|
55
|
+
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);
|
|
56
|
+
if (theme?.default.auto) {
|
|
56
57
|
void container.loadTheme(themeName);
|
|
57
58
|
}
|
|
58
59
|
};
|
|
@@ -62,7 +63,7 @@
|
|
|
62
63
|
if (!options.pauseOnBlur) {
|
|
63
64
|
return;
|
|
64
65
|
}
|
|
65
|
-
if (document
|
|
66
|
+
if (document?.hidden) {
|
|
66
67
|
container.pageHidden = true;
|
|
67
68
|
container.pause();
|
|
68
69
|
}
|
|
@@ -114,14 +115,14 @@
|
|
|
114
115
|
manageListener(interactivityEl, mouseLeaveTmpEvent, handlers.mouseLeave, add);
|
|
115
116
|
manageListener(interactivityEl, Constants_js_1.touchCancelEvent, handlers.touchCancel, add);
|
|
116
117
|
};
|
|
117
|
-
this._manageListeners =
|
|
118
|
+
this._manageListeners = add => {
|
|
118
119
|
const handlers = this._handlers, container = this.container, options = container.actualOptions, detectType = options.interactivity.detectsOn, canvasEl = container.canvas.element;
|
|
119
120
|
let mouseLeaveTmpEvent = Constants_js_1.mouseLeaveEvent;
|
|
120
|
-
if (detectType ===
|
|
121
|
+
if (detectType === InteractivityDetect_js_1.InteractivityDetect.window) {
|
|
121
122
|
container.interactivity.element = window;
|
|
122
123
|
mouseLeaveTmpEvent = Constants_js_1.mouseOutEvent;
|
|
123
124
|
}
|
|
124
|
-
else if (detectType ===
|
|
125
|
+
else if (detectType === InteractivityDetect_js_1.InteractivityDetect.parent && canvasEl) {
|
|
125
126
|
container.interactivity.element = canvasEl.parentElement ?? canvasEl.parentNode;
|
|
126
127
|
}
|
|
127
128
|
else {
|
|
@@ -134,7 +135,7 @@
|
|
|
134
135
|
manageListener(document, Constants_js_1.visibilityChangeEvent, handlers.visibilityChange, add, false);
|
|
135
136
|
}
|
|
136
137
|
};
|
|
137
|
-
this._manageMediaMatch =
|
|
138
|
+
this._manageMediaMatch = add => {
|
|
138
139
|
const handlers = this._handlers, mediaMatch = (0, Utils_js_1.safeMatchMedia)("(prefers-color-scheme: dark)");
|
|
139
140
|
if (!mediaMatch) {
|
|
140
141
|
return;
|
|
@@ -153,7 +154,7 @@
|
|
|
153
154
|
mediaMatch.removeListener(handlers.oldThemeChange);
|
|
154
155
|
}
|
|
155
156
|
};
|
|
156
|
-
this._manageResize =
|
|
157
|
+
this._manageResize = add => {
|
|
157
158
|
const handlers = this._handlers, container = this.container, options = container.actualOptions;
|
|
158
159
|
if (!options.interactivity.events.resize) {
|
|
159
160
|
return;
|
|
@@ -172,7 +173,7 @@
|
|
|
172
173
|
}
|
|
173
174
|
else if (!this._resizeObserver && add && canvasEl) {
|
|
174
175
|
this._resizeObserver = new ResizeObserver((entries) => {
|
|
175
|
-
const entry = entries.find(
|
|
176
|
+
const entry = entries.find(e => e.target === canvasEl);
|
|
176
177
|
if (!entry) {
|
|
177
178
|
return;
|
|
178
179
|
}
|
|
@@ -190,7 +191,7 @@
|
|
|
190
191
|
mouse.clicking = true;
|
|
191
192
|
mouse.downPosition = mouse.position;
|
|
192
193
|
};
|
|
193
|
-
this._mouseTouchClick =
|
|
194
|
+
this._mouseTouchClick = e => {
|
|
194
195
|
const container = this.container, options = container.actualOptions, { mouse } = container.interactivity;
|
|
195
196
|
mouse.inside = true;
|
|
196
197
|
let handled = false;
|
|
@@ -225,7 +226,7 @@
|
|
|
225
226
|
mouse.inside = false;
|
|
226
227
|
mouse.clicking = false;
|
|
227
228
|
};
|
|
228
|
-
this._mouseTouchMove =
|
|
229
|
+
this._mouseTouchMove = e => {
|
|
229
230
|
const container = this.container, options = container.actualOptions, interactivity = container.interactivity, canvasEl = container.canvas.element;
|
|
230
231
|
if (!interactivity?.element) {
|
|
231
232
|
return;
|
|
@@ -244,7 +245,7 @@
|
|
|
244
245
|
};
|
|
245
246
|
}
|
|
246
247
|
}
|
|
247
|
-
else if (options.interactivity.detectsOn ===
|
|
248
|
+
else if (options.interactivity.detectsOn === InteractivityDetect_js_1.InteractivityDetect.parent) {
|
|
248
249
|
const source = mouseEvent.target, target = mouseEvent.currentTarget;
|
|
249
250
|
if (source && target && canvasEl) {
|
|
250
251
|
const sourceRect = source.getBoundingClientRect(), targetRect = target.getBoundingClientRect(), canvasRect = canvasEl.getBoundingClientRect();
|
|
@@ -285,21 +286,21 @@
|
|
|
285
286
|
interactivity.mouse.position = pos;
|
|
286
287
|
interactivity.status = Constants_js_1.mouseMoveEvent;
|
|
287
288
|
};
|
|
288
|
-
this._touchEnd =
|
|
289
|
+
this._touchEnd = e => {
|
|
289
290
|
const evt = e, touches = Array.from(evt.changedTouches);
|
|
290
291
|
for (const touch of touches) {
|
|
291
292
|
this._touches.delete(touch.identifier);
|
|
292
293
|
}
|
|
293
294
|
this._mouseTouchFinish();
|
|
294
295
|
};
|
|
295
|
-
this._touchEndClick =
|
|
296
|
+
this._touchEndClick = e => {
|
|
296
297
|
const evt = e, touches = Array.from(evt.changedTouches);
|
|
297
298
|
for (const touch of touches) {
|
|
298
299
|
this._touches.delete(touch.identifier);
|
|
299
300
|
}
|
|
300
301
|
this._mouseTouchClick(e);
|
|
301
302
|
};
|
|
302
|
-
this._touchStart =
|
|
303
|
+
this._touchStart = e => {
|
|
303
304
|
const evt = e, touches = Array.from(evt.changedTouches);
|
|
304
305
|
for (const touch of touches) {
|
|
305
306
|
this._touches.set(touch.identifier, performance.now());
|
|
@@ -4,15 +4,16 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports"], factory);
|
|
7
|
+
define(["require", "exports", "../../Enums/Types/InteractorType.js"], factory);
|
|
8
8
|
}
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.ExternalInteractorBase = void 0;
|
|
13
|
+
const InteractorType_js_1 = require("../../Enums/Types/InteractorType.js");
|
|
13
14
|
class ExternalInteractorBase {
|
|
14
15
|
constructor(container) {
|
|
15
|
-
this.type =
|
|
16
|
+
this.type = InteractorType_js_1.InteractorType.external;
|
|
16
17
|
this.container = container;
|
|
17
18
|
}
|
|
18
19
|
}
|
|
@@ -4,12 +4,13 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports"], factory);
|
|
7
|
+
define(["require", "exports", "../../Enums/Types/InteractorType.js"], factory);
|
|
8
8
|
}
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.InteractionManager = void 0;
|
|
13
|
+
const InteractorType_js_1 = require("../../Enums/Types/InteractorType.js");
|
|
13
14
|
class InteractionManager {
|
|
14
15
|
constructor(engine, container) {
|
|
15
16
|
this.container = container;
|
|
@@ -36,10 +37,10 @@
|
|
|
36
37
|
this._particleInteractors = [];
|
|
37
38
|
for (const interactor of this._interactors) {
|
|
38
39
|
switch (interactor.type) {
|
|
39
|
-
case
|
|
40
|
+
case InteractorType_js_1.InteractorType.external:
|
|
40
41
|
this._externalInteractors.push(interactor);
|
|
41
42
|
break;
|
|
42
|
-
case
|
|
43
|
+
case InteractorType_js_1.InteractorType.particles:
|
|
43
44
|
this._particleInteractors.push(interactor);
|
|
44
45
|
break;
|
|
45
46
|
}
|
|
@@ -4,15 +4,16 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports"], factory);
|
|
7
|
+
define(["require", "exports", "../../Enums/Types/InteractorType.js"], factory);
|
|
8
8
|
}
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.ParticlesInteractorBase = void 0;
|
|
13
|
+
const InteractorType_js_1 = require("../../Enums/Types/InteractorType.js");
|
|
13
14
|
class ParticlesInteractorBase {
|
|
14
15
|
constructor(container) {
|
|
15
|
-
this.type =
|
|
16
|
+
this.type = InteractorType_js_1.InteractorType.particles;
|
|
16
17
|
this.container = container;
|
|
17
18
|
}
|
|
18
19
|
}
|
package/umd/Core/Utils/Ranges.js
CHANGED
|
@@ -4,12 +4,13 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "../../Utils/NumberUtils.js"], factory);
|
|
7
|
+
define(["require", "exports", "../../Types/RangeType.js", "../../Utils/NumberUtils.js"], factory);
|
|
8
8
|
}
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.Rectangle = exports.Circle = exports.BaseRange = void 0;
|
|
13
|
+
const RangeType_js_1 = require("../../Types/RangeType.js");
|
|
13
14
|
const NumberUtils_js_1 = require("../../Utils/NumberUtils.js");
|
|
14
15
|
const squareExp = 2;
|
|
15
16
|
class BaseRange {
|
|
@@ -24,7 +25,7 @@
|
|
|
24
25
|
exports.BaseRange = BaseRange;
|
|
25
26
|
class Circle extends BaseRange {
|
|
26
27
|
constructor(x, y, radius) {
|
|
27
|
-
super(x, y,
|
|
28
|
+
super(x, y, RangeType_js_1.RangeType.circle);
|
|
28
29
|
this.radius = radius;
|
|
29
30
|
}
|
|
30
31
|
contains(point) {
|
|
@@ -32,11 +33,11 @@
|
|
|
32
33
|
}
|
|
33
34
|
intersects(range) {
|
|
34
35
|
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;
|
|
35
|
-
if (range instanceof Circle || range.type ===
|
|
36
|
+
if (range instanceof Circle || range.type === RangeType_js_1.RangeType.circle) {
|
|
36
37
|
const circleRange = range, rSum = r + circleRange.radius, dist = Math.sqrt(distPos.x ** squareExp + distPos.y ** squareExp);
|
|
37
38
|
return rSum > dist;
|
|
38
39
|
}
|
|
39
|
-
else if (range instanceof Rectangle || range.type ===
|
|
40
|
+
else if (range instanceof Rectangle || range.type === RangeType_js_1.RangeType.rectangle) {
|
|
40
41
|
const rectRange = range, { width, height } = rectRange.size, edges = Math.pow(distPos.x - width, squareExp) + Math.pow(distPos.y - height, squareExp);
|
|
41
42
|
return (edges <= r ** squareExp ||
|
|
42
43
|
(distPos.x <= r + width && distPos.y <= r + height) ||
|
|
@@ -49,7 +50,7 @@
|
|
|
49
50
|
exports.Circle = Circle;
|
|
50
51
|
class Rectangle extends BaseRange {
|
|
51
52
|
constructor(x, y, width, height) {
|
|
52
|
-
super(x, y,
|
|
53
|
+
super(x, y, RangeType_js_1.RangeType.rectangle);
|
|
53
54
|
this.size = {
|
|
54
55
|
height: height,
|
|
55
56
|
width: width,
|
|
@@ -9,4 +9,10 @@
|
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.AnimationStatus = void 0;
|
|
13
|
+
var AnimationStatus;
|
|
14
|
+
(function (AnimationStatus) {
|
|
15
|
+
AnimationStatus["increasing"] = "increasing";
|
|
16
|
+
AnimationStatus["decreasing"] = "decreasing";
|
|
17
|
+
})(AnimationStatus || (exports.AnimationStatus = AnimationStatus = {}));
|
|
12
18
|
});
|
|
@@ -9,4 +9,19 @@
|
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.MoveDirection = void 0;
|
|
13
|
+
var MoveDirection;
|
|
14
|
+
(function (MoveDirection) {
|
|
15
|
+
MoveDirection["bottom"] = "bottom";
|
|
16
|
+
MoveDirection["bottomLeft"] = "bottom-left";
|
|
17
|
+
MoveDirection["bottomRight"] = "bottom-right";
|
|
18
|
+
MoveDirection["left"] = "left";
|
|
19
|
+
MoveDirection["none"] = "none";
|
|
20
|
+
MoveDirection["right"] = "right";
|
|
21
|
+
MoveDirection["top"] = "top";
|
|
22
|
+
MoveDirection["topLeft"] = "top-left";
|
|
23
|
+
MoveDirection["topRight"] = "top-right";
|
|
24
|
+
MoveDirection["outside"] = "outside";
|
|
25
|
+
MoveDirection["inside"] = "inside";
|
|
26
|
+
})(MoveDirection || (exports.MoveDirection = MoveDirection = {}));
|
|
12
27
|
});
|
|
@@ -9,4 +9,12 @@
|
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.OutModeDirection = void 0;
|
|
13
|
+
var OutModeDirection;
|
|
14
|
+
(function (OutModeDirection) {
|
|
15
|
+
OutModeDirection["bottom"] = "bottom";
|
|
16
|
+
OutModeDirection["left"] = "left";
|
|
17
|
+
OutModeDirection["right"] = "right";
|
|
18
|
+
OutModeDirection["top"] = "top";
|
|
19
|
+
})(OutModeDirection || (exports.OutModeDirection = OutModeDirection = {}));
|
|
12
20
|
});
|
|
@@ -9,4 +9,11 @@
|
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.RotateDirection = void 0;
|
|
13
|
+
var RotateDirection;
|
|
14
|
+
(function (RotateDirection) {
|
|
15
|
+
RotateDirection["clockwise"] = "clockwise";
|
|
16
|
+
RotateDirection["counterClockwise"] = "counter-clockwise";
|
|
17
|
+
RotateDirection["random"] = "random";
|
|
18
|
+
})(RotateDirection || (exports.RotateDirection = RotateDirection = {}));
|
|
12
19
|
});
|
|
@@ -9,4 +9,11 @@
|
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.InteractivityDetect = void 0;
|
|
13
|
+
var InteractivityDetect;
|
|
14
|
+
(function (InteractivityDetect) {
|
|
15
|
+
InteractivityDetect["canvas"] = "canvas";
|
|
16
|
+
InteractivityDetect["parent"] = "parent";
|
|
17
|
+
InteractivityDetect["window"] = "window";
|
|
18
|
+
})(InteractivityDetect || (exports.InteractivityDetect = InteractivityDetect = {}));
|
|
12
19
|
});
|
|
@@ -9,4 +9,12 @@
|
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.AnimationMode = void 0;
|
|
13
|
+
var AnimationMode;
|
|
14
|
+
(function (AnimationMode) {
|
|
15
|
+
AnimationMode["auto"] = "auto";
|
|
16
|
+
AnimationMode["increase"] = "increase";
|
|
17
|
+
AnimationMode["decrease"] = "decrease";
|
|
18
|
+
AnimationMode["random"] = "random";
|
|
19
|
+
})(AnimationMode || (exports.AnimationMode = AnimationMode = {}));
|
|
12
20
|
});
|
|
@@ -9,4 +9,11 @@
|
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.CollisionMode = void 0;
|
|
13
|
+
var CollisionMode;
|
|
14
|
+
(function (CollisionMode) {
|
|
15
|
+
CollisionMode["absorb"] = "absorb";
|
|
16
|
+
CollisionMode["bounce"] = "bounce";
|
|
17
|
+
CollisionMode["destroy"] = "destroy";
|
|
18
|
+
})(CollisionMode || (exports.CollisionMode = CollisionMode = {}));
|
|
12
19
|
});
|
|
@@ -9,4 +9,10 @@
|
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.LimitMode = void 0;
|
|
13
|
+
var LimitMode;
|
|
14
|
+
(function (LimitMode) {
|
|
15
|
+
LimitMode["delete"] = "delete";
|
|
16
|
+
LimitMode["wait"] = "wait";
|
|
17
|
+
})(LimitMode || (exports.LimitMode = LimitMode = {}));
|
|
12
18
|
});
|
|
@@ -9,4 +9,13 @@
|
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.OutMode = void 0;
|
|
13
|
+
var OutMode;
|
|
14
|
+
(function (OutMode) {
|
|
15
|
+
OutMode["bounce"] = "bounce";
|
|
16
|
+
OutMode["none"] = "none";
|
|
17
|
+
OutMode["out"] = "out";
|
|
18
|
+
OutMode["destroy"] = "destroy";
|
|
19
|
+
OutMode["split"] = "split";
|
|
20
|
+
})(OutMode || (exports.OutMode = OutMode = {}));
|
|
12
21
|
});
|
|
@@ -9,4 +9,10 @@
|
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.PixelMode = void 0;
|
|
13
|
+
var PixelMode;
|
|
14
|
+
(function (PixelMode) {
|
|
15
|
+
PixelMode["precise"] = "precise";
|
|
16
|
+
PixelMode["percent"] = "percent";
|
|
17
|
+
})(PixelMode || (exports.PixelMode = PixelMode = {}));
|
|
12
18
|
});
|
|
@@ -9,4 +9,10 @@
|
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ResponsiveMode = void 0;
|
|
13
|
+
var ResponsiveMode;
|
|
14
|
+
(function (ResponsiveMode) {
|
|
15
|
+
ResponsiveMode["screen"] = "screen";
|
|
16
|
+
ResponsiveMode["canvas"] = "canvas";
|
|
17
|
+
})(ResponsiveMode || (exports.ResponsiveMode = ResponsiveMode = {}));
|
|
12
18
|
});
|
|
@@ -9,4 +9,11 @@
|
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ThemeMode = void 0;
|
|
13
|
+
var ThemeMode;
|
|
14
|
+
(function (ThemeMode) {
|
|
15
|
+
ThemeMode["any"] = "any";
|
|
16
|
+
ThemeMode["dark"] = "dark";
|
|
17
|
+
ThemeMode["light"] = "light";
|
|
18
|
+
})(ThemeMode || (exports.ThemeMode = ThemeMode = {}));
|
|
12
19
|
});
|
|
@@ -9,4 +9,10 @@
|
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.AlterType = void 0;
|
|
13
|
+
var AlterType;
|
|
14
|
+
(function (AlterType) {
|
|
15
|
+
AlterType["darken"] = "darken";
|
|
16
|
+
AlterType["enlighten"] = "enlighten";
|
|
17
|
+
})(AlterType || (exports.AlterType = AlterType = {}));
|
|
12
18
|
});
|
|
@@ -9,4 +9,11 @@
|
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.DestroyType = void 0;
|
|
13
|
+
var DestroyType;
|
|
14
|
+
(function (DestroyType) {
|
|
15
|
+
DestroyType["none"] = "none";
|
|
16
|
+
DestroyType["max"] = "max";
|
|
17
|
+
DestroyType["min"] = "min";
|
|
18
|
+
})(DestroyType || (exports.DestroyType = DestroyType = {}));
|
|
12
19
|
});
|
|
@@ -9,4 +9,10 @@
|
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.DivType = void 0;
|
|
13
|
+
var DivType;
|
|
14
|
+
(function (DivType) {
|
|
15
|
+
DivType["circle"] = "circle";
|
|
16
|
+
DivType["rectangle"] = "rectangle";
|
|
17
|
+
})(DivType || (exports.DivType = DivType = {}));
|
|
12
18
|
});
|
|
@@ -9,4 +9,35 @@
|
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.EasingType = void 0;
|
|
13
|
+
var EasingType;
|
|
14
|
+
(function (EasingType) {
|
|
15
|
+
EasingType["easeInBack"] = "ease-in-back";
|
|
16
|
+
EasingType["easeInCirc"] = "ease-in-circ";
|
|
17
|
+
EasingType["easeInCubic"] = "ease-in-cubic";
|
|
18
|
+
EasingType["easeInLinear"] = "ease-in-linear";
|
|
19
|
+
EasingType["easeInQuad"] = "ease-in-quad";
|
|
20
|
+
EasingType["easeInQuart"] = "ease-in-quart";
|
|
21
|
+
EasingType["easeInQuint"] = "ease-in-quint";
|
|
22
|
+
EasingType["easeInExpo"] = "ease-in-expo";
|
|
23
|
+
EasingType["easeInSine"] = "ease-in-sine";
|
|
24
|
+
EasingType["easeOutBack"] = "ease-out-back";
|
|
25
|
+
EasingType["easeOutCirc"] = "ease-out-circ";
|
|
26
|
+
EasingType["easeOutCubic"] = "ease-out-cubic";
|
|
27
|
+
EasingType["easeOutLinear"] = "ease-out-linear";
|
|
28
|
+
EasingType["easeOutQuad"] = "ease-out-quad";
|
|
29
|
+
EasingType["easeOutQuart"] = "ease-out-quart";
|
|
30
|
+
EasingType["easeOutQuint"] = "ease-out-quint";
|
|
31
|
+
EasingType["easeOutExpo"] = "ease-out-expo";
|
|
32
|
+
EasingType["easeOutSine"] = "ease-out-sine";
|
|
33
|
+
EasingType["easeInOutBack"] = "ease-in-out-back";
|
|
34
|
+
EasingType["easeInOutCirc"] = "ease-in-out-circ";
|
|
35
|
+
EasingType["easeInOutCubic"] = "ease-in-out-cubic";
|
|
36
|
+
EasingType["easeInOutLinear"] = "ease-in-out-linear";
|
|
37
|
+
EasingType["easeInOutQuad"] = "ease-in-out-quad";
|
|
38
|
+
EasingType["easeInOutQuart"] = "ease-in-out-quart";
|
|
39
|
+
EasingType["easeInOutQuint"] = "ease-in-out-quint";
|
|
40
|
+
EasingType["easeInOutExpo"] = "ease-in-out-expo";
|
|
41
|
+
EasingType["easeInOutSine"] = "ease-in-out-sine";
|
|
42
|
+
})(EasingType || (exports.EasingType = EasingType = {}));
|
|
12
43
|
});
|
|
@@ -9,4 +9,20 @@
|
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.EventType = void 0;
|
|
13
|
+
var EventType;
|
|
14
|
+
(function (EventType) {
|
|
15
|
+
EventType["configAdded"] = "configAdded";
|
|
16
|
+
EventType["containerInit"] = "containerInit";
|
|
17
|
+
EventType["particlesSetup"] = "particlesSetup";
|
|
18
|
+
EventType["containerStarted"] = "containerStarted";
|
|
19
|
+
EventType["containerStopped"] = "containerStopped";
|
|
20
|
+
EventType["containerDestroyed"] = "containerDestroyed";
|
|
21
|
+
EventType["containerPaused"] = "containerPaused";
|
|
22
|
+
EventType["containerPlay"] = "containerPlay";
|
|
23
|
+
EventType["containerBuilt"] = "containerBuilt";
|
|
24
|
+
EventType["particleAdded"] = "particleAdded";
|
|
25
|
+
EventType["particleDestroyed"] = "particleDestroyed";
|
|
26
|
+
EventType["particleRemoved"] = "particleRemoved";
|
|
27
|
+
})(EventType || (exports.EventType = EventType = {}));
|
|
12
28
|
});
|
|
@@ -9,4 +9,11 @@
|
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.GradientType = void 0;
|
|
13
|
+
var GradientType;
|
|
14
|
+
(function (GradientType) {
|
|
15
|
+
GradientType["linear"] = "linear";
|
|
16
|
+
GradientType["radial"] = "radial";
|
|
17
|
+
GradientType["random"] = "random";
|
|
18
|
+
})(GradientType || (exports.GradientType = GradientType = {}));
|
|
12
19
|
});
|
|
@@ -9,4 +9,10 @@
|
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.InteractorType = void 0;
|
|
13
|
+
var InteractorType;
|
|
14
|
+
(function (InteractorType) {
|
|
15
|
+
InteractorType["external"] = "external";
|
|
16
|
+
InteractorType["particles"] = "particles";
|
|
17
|
+
})(InteractorType || (exports.InteractorType = InteractorType = {}));
|
|
12
18
|
});
|
|
@@ -9,4 +9,11 @@
|
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ParticleOutType = void 0;
|
|
13
|
+
var ParticleOutType;
|
|
14
|
+
(function (ParticleOutType) {
|
|
15
|
+
ParticleOutType["normal"] = "normal";
|
|
16
|
+
ParticleOutType["inside"] = "inside";
|
|
17
|
+
ParticleOutType["outside"] = "outside";
|
|
18
|
+
})(ParticleOutType || (exports.ParticleOutType = ParticleOutType = {}));
|
|
12
19
|
});
|
|
@@ -9,4 +9,11 @@
|
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.StartValueType = void 0;
|
|
13
|
+
var StartValueType;
|
|
14
|
+
(function (StartValueType) {
|
|
15
|
+
StartValueType["max"] = "max";
|
|
16
|
+
StartValueType["min"] = "min";
|
|
17
|
+
StartValueType["random"] = "random";
|
|
18
|
+
})(StartValueType || (exports.StartValueType = StartValueType = {}));
|
|
12
19
|
});
|
|
@@ -4,12 +4,14 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "../../Utils/NumberUtils.js"], factory);
|
|
7
|
+
define(["require", "exports", "../../Enums/Modes/AnimationMode.js", "../../Enums/Types/StartValueType.js", "../../Utils/NumberUtils.js"], factory);
|
|
8
8
|
}
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.RangedAnimationOptions = exports.AnimationOptions = void 0;
|
|
13
|
+
const AnimationMode_js_1 = require("../../Enums/Modes/AnimationMode.js");
|
|
14
|
+
const StartValueType_js_1 = require("../../Enums/Types/StartValueType.js");
|
|
13
15
|
const NumberUtils_js_1 = require("../../Utils/NumberUtils.js");
|
|
14
16
|
class AnimationOptions {
|
|
15
17
|
constructor() {
|
|
@@ -48,8 +50,8 @@
|
|
|
48
50
|
class RangedAnimationOptions extends AnimationOptions {
|
|
49
51
|
constructor() {
|
|
50
52
|
super();
|
|
51
|
-
this.mode =
|
|
52
|
-
this.startValue =
|
|
53
|
+
this.mode = AnimationMode_js_1.AnimationMode.auto;
|
|
54
|
+
this.startValue = StartValueType_js_1.StartValueType.random;
|
|
53
55
|
}
|
|
54
56
|
load(data) {
|
|
55
57
|
super.load(data);
|
|
@@ -4,18 +4,19 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports"], factory);
|
|
7
|
+
define(["require", "exports", "../../../../Enums/Types/DivType.js"], factory);
|
|
8
8
|
}
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.DivEvent = void 0;
|
|
13
|
+
const DivType_js_1 = require("../../../../Enums/Types/DivType.js");
|
|
13
14
|
class DivEvent {
|
|
14
15
|
constructor() {
|
|
15
16
|
this.selectors = [];
|
|
16
17
|
this.enable = false;
|
|
17
18
|
this.mode = [];
|
|
18
|
-
this.type =
|
|
19
|
+
this.type = DivType_js_1.DivType.circle;
|
|
19
20
|
}
|
|
20
21
|
load(data) {
|
|
21
22
|
if (!data) {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
this.onClick.load(data.onClick);
|
|
30
30
|
const onDiv = data.onDiv;
|
|
31
31
|
if (onDiv !== undefined) {
|
|
32
|
-
this.onDiv = (0, Utils_js_1.executeOnSingleOrMultiple)(onDiv,
|
|
32
|
+
this.onDiv = (0, Utils_js_1.executeOnSingleOrMultiple)(onDiv, t => {
|
|
33
33
|
const tmp = new DivEvent_js_1.DivEvent();
|
|
34
34
|
tmp.load(t);
|
|
35
35
|
return tmp;
|