@tsparticles/engine 3.0.0-beta.2 → 3.0.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/Core/Canvas.js +2 -2
- package/browser/Core/Container.js +39 -24
- package/browser/Core/Engine.js +26 -53
- package/browser/Core/Particle.js +88 -53
- package/browser/Core/Particles.js +51 -26
- package/browser/Core/Retina.js +0 -2
- package/browser/Core/Utils/QuadTree.js +1 -1
- package/browser/Options/Classes/BackgroundMask/BackgroundMask.js +1 -2
- package/browser/Options/Classes/ColorAnimation.js +4 -24
- package/browser/Options/Classes/Particles/Bounce/ParticlesBounceFactor.js +0 -1
- package/browser/Options/Classes/Particles/Effect/Effect.js +32 -0
- package/browser/Options/Classes/Particles/Number/ParticlesNumber.js +3 -5
- package/browser/Options/Classes/Particles/Number/ParticlesNumberLimit.js +17 -0
- package/browser/Options/Classes/Particles/Opacity/Opacity.js +2 -3
- package/browser/Options/Classes/Particles/ParticlesOptions.js +3 -0
- package/browser/Options/Classes/Particles/Size/Size.js +2 -3
- package/browser/Options/Classes/ValueWithRandom.js +1 -10
- package/browser/Utils/CanvasUtils.js +29 -21
- package/browser/Utils/ColorUtils.js +24 -38
- package/browser/Utils/NumberUtils.js +7 -16
- package/browser/Utils/Utils.js +13 -7
- package/browser/export-types.js +4 -2
- package/browser/exports.js +2 -3
- package/cjs/Core/Canvas.js +2 -2
- package/cjs/Core/Container.js +39 -24
- package/cjs/Core/Engine.js +25 -52
- package/cjs/Core/Particle.js +87 -52
- package/cjs/Core/Particles.js +51 -26
- package/cjs/Core/Retina.js +0 -2
- package/cjs/Core/Utils/QuadTree.js +1 -1
- package/cjs/Options/Classes/BackgroundMask/BackgroundMask.js +1 -2
- package/cjs/Options/Classes/ColorAnimation.js +4 -24
- package/cjs/Options/Classes/Particles/Bounce/ParticlesBounceFactor.js +0 -1
- package/cjs/Options/Classes/Particles/Effect/Effect.js +36 -0
- package/cjs/Options/Classes/Particles/Number/ParticlesNumber.js +3 -5
- package/cjs/Options/Classes/Particles/Number/ParticlesNumberLimit.js +21 -0
- package/cjs/Options/Classes/Particles/Opacity/Opacity.js +1 -2
- package/cjs/Options/Classes/Particles/ParticlesOptions.js +3 -0
- package/cjs/Options/Classes/Particles/Size/Size.js +2 -3
- package/cjs/Options/Classes/ValueWithRandom.js +1 -10
- package/cjs/Utils/CanvasUtils.js +32 -24
- package/cjs/Utils/ColorUtils.js +24 -38
- package/cjs/Utils/NumberUtils.js +8 -18
- package/cjs/Utils/Utils.js +14 -7
- package/cjs/export-types.js +4 -2
- package/cjs/exports.js +2 -3
- package/esm/Core/Canvas.js +2 -2
- package/esm/Core/Container.js +39 -24
- package/esm/Core/Engine.js +26 -53
- package/esm/Core/Particle.js +88 -53
- package/esm/Core/Particles.js +51 -26
- package/esm/Core/Retina.js +0 -2
- package/esm/Core/Utils/QuadTree.js +1 -1
- package/esm/Options/Classes/BackgroundMask/BackgroundMask.js +1 -2
- package/esm/Options/Classes/ColorAnimation.js +4 -24
- package/esm/Options/Classes/Particles/Bounce/ParticlesBounceFactor.js +0 -1
- package/esm/Options/Classes/Particles/Effect/Effect.js +32 -0
- package/esm/Options/Classes/Particles/Number/ParticlesNumber.js +3 -5
- package/esm/Options/Classes/Particles/Number/ParticlesNumberLimit.js +17 -0
- package/esm/Options/Classes/Particles/Opacity/Opacity.js +2 -3
- package/esm/Options/Classes/Particles/ParticlesOptions.js +3 -0
- package/esm/Options/Classes/Particles/Size/Size.js +2 -3
- package/esm/Options/Classes/ValueWithRandom.js +1 -10
- package/esm/Utils/CanvasUtils.js +29 -21
- package/esm/Utils/ColorUtils.js +24 -38
- package/esm/Utils/NumberUtils.js +7 -16
- package/esm/Utils/Utils.js +13 -7
- package/esm/export-types.js +4 -2
- package/esm/exports.js +2 -3
- package/package.json +1 -1
- package/report.html +4 -22
- package/tsparticles.engine.js +461 -347
- package/tsparticles.engine.min.js +1 -1
- package/tsparticles.engine.min.js.LICENSE.txt +1 -1
- package/types/Core/Canvas.d.ts +0 -1
- package/types/Core/Container.d.ts +9 -8
- package/types/Core/Engine.d.ts +9 -5
- package/types/Core/Interfaces/IContainerPlugin.d.ts +2 -3
- package/types/Core/Interfaces/IEffectDrawer.d.ts +10 -0
- package/types/Core/Interfaces/IExternalInteractor.d.ts +3 -4
- package/types/Core/Interfaces/IInteractor.d.ts +3 -3
- package/types/Core/Interfaces/IParticleRetinaProps.d.ts +0 -1
- package/types/Core/Interfaces/IParticlesInteractor.d.ts +3 -3
- package/types/Core/Interfaces/IShapeDrawData.d.ts +10 -0
- package/types/Core/Interfaces/IShapeDrawer.d.ts +11 -9
- package/types/Core/Particle.d.ts +7 -5
- package/types/Core/Particles.d.ts +10 -7
- package/types/Core/Retina.d.ts +0 -1
- package/types/Core/Utils/ExternalInteractorBase.d.ts +4 -4
- package/types/Core/Utils/InteractionManager.d.ts +1 -2
- package/types/Core/Utils/ParticlesInteractorBase.d.ts +5 -5
- package/types/Enums/Modes/LimitMode.d.ts +4 -0
- package/types/Enums/Types/EasingType.d.ts +3 -0
- package/types/Enums/Types/EventType.d.ts +1 -0
- package/types/Options/Classes/BackgroundMask/BackgroundMask.d.ts +1 -1
- package/types/Options/Classes/ColorAnimation.d.ts +2 -7
- package/types/Options/Classes/Interactivity/Events/ClickEvent.d.ts +1 -2
- package/types/Options/Classes/Interactivity/Events/DivEvent.d.ts +1 -2
- package/types/Options/Classes/Interactivity/Events/Events.d.ts +3 -3
- package/types/Options/Classes/Interactivity/Events/HoverEvent.d.ts +2 -3
- package/types/Options/Classes/Interactivity/Interactivity.d.ts +2 -2
- package/types/Options/Classes/Options.d.ts +6 -6
- package/types/Options/Classes/Particles/Bounce/ParticlesBounce.d.ts +2 -2
- package/types/Options/Classes/Particles/Collisions/Collisions.d.ts +3 -3
- package/types/Options/Classes/Particles/Effect/Effect.d.ts +13 -0
- package/types/Options/Classes/Particles/Move/Move.d.ts +8 -8
- package/types/Options/Classes/Particles/Move/MoveTrail.d.ts +1 -1
- package/types/Options/Classes/Particles/Number/ParticlesNumber.d.ts +3 -2
- package/types/Options/Classes/Particles/Number/ParticlesNumberLimit.d.ts +10 -0
- package/types/Options/Classes/Particles/Opacity/Opacity.d.ts +3 -3
- package/types/Options/Classes/Particles/ParticlesOptions.d.ts +12 -10
- package/types/Options/Classes/Particles/Size/Size.d.ts +3 -3
- package/types/Options/Classes/Theme/Theme.d.ts +1 -1
- package/types/Options/Classes/ValueWithRandom.d.ts +2 -4
- package/types/Options/Interfaces/IValueWithRandom.d.ts +0 -2
- package/types/Options/Interfaces/Interactivity/Events/IClickEvent.d.ts +1 -2
- package/types/Options/Interfaces/Interactivity/Events/IDivEvent.d.ts +1 -2
- package/types/Options/Interfaces/Interactivity/Events/IHoverEvent.d.ts +1 -2
- package/types/Options/Interfaces/Particles/Effect/IEffect.d.ts +8 -0
- package/types/Options/Interfaces/Particles/IParticlesOptions.d.ts +2 -0
- package/types/Options/Interfaces/Particles/Number/IParticlesNumber.d.ts +2 -1
- package/types/Options/Interfaces/Particles/Number/IParticlesNumberLimit.d.ts +5 -0
- package/types/Types/CustomEventArgs.d.ts +1 -1
- package/types/Utils/CanvasUtils.d.ts +12 -3
- package/types/Utils/ColorUtils.d.ts +2 -2
- package/types/Utils/NumberUtils.d.ts +0 -2
- package/types/Utils/Utils.d.ts +6 -6
- package/types/export-types.d.ts +5 -2
- package/types/exports.d.ts +2 -3
- package/umd/Core/Canvas.js +2 -2
- package/umd/Core/Container.js +40 -25
- package/umd/Core/Engine.js +25 -52
- package/umd/Core/Particle.js +87 -52
- package/umd/Core/Particles.js +51 -26
- package/umd/Core/Retina.js +0 -2
- package/umd/Core/Utils/QuadTree.js +1 -1
- package/umd/Options/Classes/BackgroundMask/BackgroundMask.js +1 -2
- package/umd/Options/Classes/ColorAnimation.js +5 -25
- package/umd/Options/Classes/Particles/Bounce/ParticlesBounceFactor.js +0 -1
- package/umd/Options/Classes/Particles/Effect/Effect.js +46 -0
- package/umd/Options/Classes/Particles/Number/ParticlesNumber.js +4 -6
- package/umd/Options/Classes/{Random.js → Particles/Number/ParticlesNumberLimit.js} +9 -9
- package/umd/Options/Classes/Particles/Opacity/Opacity.js +1 -2
- package/umd/Options/Classes/Particles/ParticlesOptions.js +4 -1
- package/umd/Options/Classes/Particles/Size/Size.js +3 -4
- package/umd/Options/Classes/ValueWithRandom.js +2 -11
- package/umd/Utils/CanvasUtils.js +32 -24
- package/umd/Utils/ColorUtils.js +24 -38
- package/umd/Utils/NumberUtils.js +9 -19
- package/umd/Utils/Utils.js +14 -7
- package/umd/export-types.js +5 -3
- package/umd/exports.js +3 -4
- package/browser/Options/Classes/Random.js +0 -17
- package/cjs/Options/Classes/Random.js +0 -21
- package/cjs/Types/ShapeDrawerFunctions.js +0 -2
- package/esm/Options/Classes/Random.js +0 -17
- package/esm/Options/Interfaces/IRandom.js +0 -1
- package/esm/Types/ShapeDrawerFunctions.js +0 -1
- package/types/Core/Interfaces/IParticle.d.ts +0 -48
- package/types/Enums/Modes/ClickMode.d.ts +0 -9
- package/types/Enums/Modes/DivMode.d.ts +0 -5
- package/types/Enums/Modes/HoverMode.d.ts +0 -11
- package/types/Options/Classes/Random.d.ts +0 -9
- package/types/Options/Interfaces/IRandom.d.ts +0 -4
- package/types/Types/ShapeDrawerFunctions.d.ts +0 -10
- package/umd/Types/ShapeDrawerFunctions.js +0 -12
- /package/browser/Core/Interfaces/{IParticle.js → IEffectDrawer.js} +0 -0
- /package/browser/{Enums/Modes/ClickMode.js → Core/Interfaces/IShapeDrawData.js} +0 -0
- /package/browser/Enums/Modes/{DivMode.js → LimitMode.js} +0 -0
- /package/browser/{Enums/Modes/HoverMode.js → Options/Interfaces/Particles/Effect/IEffect.js} +0 -0
- /package/browser/Options/Interfaces/{IRandom.js → Particles/Number/IParticlesNumberLimit.js} +0 -0
- /package/cjs/Core/Interfaces/{IParticle.js → IEffectDrawer.js} +0 -0
- /package/cjs/{Enums/Modes/ClickMode.js → Core/Interfaces/IShapeDrawData.js} +0 -0
- /package/cjs/Enums/Modes/{DivMode.js → LimitMode.js} +0 -0
- /package/cjs/{Enums/Modes/HoverMode.js → Options/Interfaces/Particles/Effect/IEffect.js} +0 -0
- /package/cjs/Options/Interfaces/{IRandom.js → Particles/Number/IParticlesNumberLimit.js} +0 -0
- /package/{browser/Types/ShapeDrawerFunctions.js → esm/Core/Interfaces/IEffectDrawer.js} +0 -0
- /package/esm/Core/Interfaces/{IParticle.js → IShapeDrawData.js} +0 -0
- /package/esm/Enums/Modes/{ClickMode.js → LimitMode.js} +0 -0
- /package/esm/{Enums/Modes/DivMode.js → Options/Interfaces/Particles/Effect/IEffect.js} +0 -0
- /package/esm/{Enums/Modes/HoverMode.js → Options/Interfaces/Particles/Number/IParticlesNumberLimit.js} +0 -0
- /package/umd/Core/Interfaces/{IParticle.js → IEffectDrawer.js} +0 -0
- /package/umd/{Enums/Modes/ClickMode.js → Core/Interfaces/IShapeDrawData.js} +0 -0
- /package/umd/Enums/Modes/{DivMode.js → LimitMode.js} +0 -0
- /package/umd/{Enums/Modes/HoverMode.js → Options/Interfaces/Particles/Effect/IEffect.js} +0 -0
- /package/umd/Options/Interfaces/{IRandom.js → Particles/Number/IParticlesNumberLimit.js} +0 -0
package/umd/Core/Particle.js
CHANGED
|
@@ -19,7 +19,27 @@
|
|
|
19
19
|
const CanvasUtils_js_1 = require("../Utils/CanvasUtils.js");
|
|
20
20
|
const Constants_js_1 = require("./Utils/Constants.js");
|
|
21
21
|
const OptionsUtils_js_1 = require("../Utils/OptionsUtils.js");
|
|
22
|
-
|
|
22
|
+
function loadEffectData(effect, effectOptions, id, reduceDuplicates) {
|
|
23
|
+
const effectData = effectOptions.options[effect];
|
|
24
|
+
if (!effectData) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
return (0, Utils_js_1.deepExtend)({
|
|
28
|
+
close: effectOptions.close,
|
|
29
|
+
fill: effectOptions.fill,
|
|
30
|
+
}, (0, Utils_js_1.itemFromSingleOrMultiple)(effectData, id, reduceDuplicates));
|
|
31
|
+
}
|
|
32
|
+
function loadShapeData(shape, shapeOptions, id, reduceDuplicates) {
|
|
33
|
+
const shapeData = shapeOptions.options[shape];
|
|
34
|
+
if (!shapeData) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
return (0, Utils_js_1.deepExtend)({
|
|
38
|
+
close: shapeOptions.close,
|
|
39
|
+
fill: shapeOptions.fill,
|
|
40
|
+
}, (0, Utils_js_1.itemFromSingleOrMultiple)(shapeData, id, reduceDuplicates));
|
|
41
|
+
}
|
|
42
|
+
function fixOutMode(data) {
|
|
23
43
|
if (!(0, Utils_js_1.isInArray)(data.outMode, data.checkModes)) {
|
|
24
44
|
return;
|
|
25
45
|
}
|
|
@@ -30,7 +50,7 @@
|
|
|
30
50
|
else if (data.coord < diameter) {
|
|
31
51
|
data.setCb(data.radius);
|
|
32
52
|
}
|
|
33
|
-
}
|
|
53
|
+
}
|
|
34
54
|
class Particle {
|
|
35
55
|
constructor(engine, id, container, position, overrideOptions, group) {
|
|
36
56
|
this.container = container;
|
|
@@ -78,8 +98,8 @@
|
|
|
78
98
|
return res;
|
|
79
99
|
}
|
|
80
100
|
const rad = (Math.PI / 180) * (0, NumberUtils_js_1.getRangeValue)(moveOptions.angle.value), radOffset = (Math.PI / 180) * (0, NumberUtils_js_1.getRangeValue)(moveOptions.angle.offset), range = {
|
|
81
|
-
left: radOffset - rad
|
|
82
|
-
right: radOffset + rad
|
|
101
|
+
left: radOffset - rad * 0.5,
|
|
102
|
+
right: radOffset + rad * 0.5,
|
|
83
103
|
};
|
|
84
104
|
if (!moveOptions.straight) {
|
|
85
105
|
res.angle += (0, NumberUtils_js_1.randomInRange)((0, NumberUtils_js_1.setRangeValue)(range.left, range.right));
|
|
@@ -108,7 +128,7 @@
|
|
|
108
128
|
if (!color || !this.roll || (!this.backColor && !this.roll.alter)) {
|
|
109
129
|
return color;
|
|
110
130
|
}
|
|
111
|
-
const backFactor = this.roll.horizontal && this.roll.vertical ? 2 : 1, backSum = this.roll.horizontal ? Math.PI
|
|
131
|
+
const backFactor = this.roll.horizontal && this.roll.vertical ? 2 : 1, backSum = this.roll.horizontal ? Math.PI * 0.5 : 0, rolled = Math.floor(((this.roll.angle ?? 0) + backSum) / (Math.PI / backFactor)) % 2;
|
|
112
132
|
if (!rolled) {
|
|
113
133
|
return color;
|
|
114
134
|
}
|
|
@@ -141,16 +161,6 @@
|
|
|
141
161
|
}
|
|
142
162
|
this.offset = Vector_js_1.Vector.origin;
|
|
143
163
|
};
|
|
144
|
-
this._loadShapeData = (shapeOptions, reduceDuplicates) => {
|
|
145
|
-
const shapeData = shapeOptions.options[this.shape];
|
|
146
|
-
if (!shapeData) {
|
|
147
|
-
return;
|
|
148
|
-
}
|
|
149
|
-
return (0, Utils_js_1.deepExtend)({
|
|
150
|
-
close: shapeOptions.close,
|
|
151
|
-
fill: shapeOptions.fill,
|
|
152
|
-
}, (0, Utils_js_1.itemFromSingleOrMultiple)(shapeData, this.id, reduceDuplicates));
|
|
153
|
-
};
|
|
154
164
|
this._engine = engine;
|
|
155
165
|
this.init(id, position, overrideOptions, group);
|
|
156
166
|
}
|
|
@@ -163,18 +173,12 @@
|
|
|
163
173
|
this.slow.inRange = false;
|
|
164
174
|
const container = this.container, pathGenerator = this.pathGenerator;
|
|
165
175
|
for (const [, plugin] of container.plugins) {
|
|
166
|
-
|
|
167
|
-
plugin.particleDestroyed(this, override);
|
|
168
|
-
}
|
|
176
|
+
plugin.particleDestroyed && plugin.particleDestroyed(this, override);
|
|
169
177
|
}
|
|
170
178
|
for (const updater of container.particles.updaters) {
|
|
171
|
-
|
|
172
|
-
updater.particleDestroyed(this, override);
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
if (pathGenerator) {
|
|
176
|
-
pathGenerator.reset(this);
|
|
179
|
+
updater.particleDestroyed && updater.particleDestroyed(this, override);
|
|
177
180
|
}
|
|
181
|
+
pathGenerator && pathGenerator.reset(this);
|
|
178
182
|
}
|
|
179
183
|
draw(delta) {
|
|
180
184
|
const container = this.container, canvas = container.canvas;
|
|
@@ -187,7 +191,7 @@
|
|
|
187
191
|
return this._getRollColor(this.bubble.color ?? (0, ColorUtils_js_1.getHslFromAnimation)(this.color));
|
|
188
192
|
}
|
|
189
193
|
getMass() {
|
|
190
|
-
return
|
|
194
|
+
return this.getRadius() ** 2 * Math.PI * 0.5;
|
|
191
195
|
}
|
|
192
196
|
getPosition() {
|
|
193
197
|
return {
|
|
@@ -206,9 +210,11 @@
|
|
|
206
210
|
const container = this.container, engine = this._engine;
|
|
207
211
|
this.id = id;
|
|
208
212
|
this.group = group;
|
|
209
|
-
this.
|
|
213
|
+
this.effectClose = true;
|
|
214
|
+
this.effectFill = true;
|
|
215
|
+
this.shapeClose = true;
|
|
216
|
+
this.shapeFill = true;
|
|
210
217
|
this.pathRotation = false;
|
|
211
|
-
this.close = true;
|
|
212
218
|
this.lastPathTime = 0;
|
|
213
219
|
this.destroyed = false;
|
|
214
220
|
this.unbreakable = false;
|
|
@@ -219,18 +225,33 @@
|
|
|
219
225
|
};
|
|
220
226
|
this.outType = "normal";
|
|
221
227
|
this.ignoresResizeRatio = true;
|
|
222
|
-
const pxRatio = container.retina.pixelRatio, mainOptions = container.actualOptions, particlesOptions = (0, OptionsUtils_js_1.loadParticlesOptions)(this._engine, container, mainOptions.particles), shapeType = particlesOptions.shape.type, { reduceDuplicates } = particlesOptions;
|
|
228
|
+
const pxRatio = container.retina.pixelRatio, mainOptions = container.actualOptions, particlesOptions = (0, OptionsUtils_js_1.loadParticlesOptions)(this._engine, container, mainOptions.particles), effectType = particlesOptions.effect.type, shapeType = particlesOptions.shape.type, { reduceDuplicates } = particlesOptions;
|
|
229
|
+
this.effect = (0, Utils_js_1.itemFromSingleOrMultiple)(effectType, this.id, reduceDuplicates);
|
|
223
230
|
this.shape = (0, Utils_js_1.itemFromSingleOrMultiple)(shapeType, this.id, reduceDuplicates);
|
|
224
|
-
const shapeOptions = particlesOptions.shape;
|
|
225
|
-
if (overrideOptions
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
231
|
+
const effectOptions = particlesOptions.effect, shapeOptions = particlesOptions.shape;
|
|
232
|
+
if (overrideOptions) {
|
|
233
|
+
if (overrideOptions.effect && overrideOptions.effect.type) {
|
|
234
|
+
const overrideEffectType = overrideOptions.effect.type, effect = (0, Utils_js_1.itemFromSingleOrMultiple)(overrideEffectType, this.id, reduceDuplicates);
|
|
235
|
+
if (effect) {
|
|
236
|
+
this.effect = effect;
|
|
237
|
+
effectOptions.load(overrideOptions.effect);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
if (overrideOptions.shape && overrideOptions.shape.type) {
|
|
241
|
+
const overrideShapeType = overrideOptions.shape.type, shape = (0, Utils_js_1.itemFromSingleOrMultiple)(overrideShapeType, this.id, reduceDuplicates);
|
|
242
|
+
if (shape) {
|
|
243
|
+
this.shape = shape;
|
|
244
|
+
shapeOptions.load(overrideOptions.shape);
|
|
245
|
+
}
|
|
230
246
|
}
|
|
231
247
|
}
|
|
232
|
-
this.
|
|
248
|
+
this.effectData = loadEffectData(this.effect, effectOptions, this.id, reduceDuplicates);
|
|
249
|
+
this.shapeData = loadShapeData(this.shape, shapeOptions, this.id, reduceDuplicates);
|
|
233
250
|
particlesOptions.load(overrideOptions);
|
|
251
|
+
const effectData = this.effectData;
|
|
252
|
+
if (effectData) {
|
|
253
|
+
particlesOptions.load(effectData.particles);
|
|
254
|
+
}
|
|
234
255
|
const shapeData = this.shapeData;
|
|
235
256
|
if (shapeData) {
|
|
236
257
|
particlesOptions.load(shapeData.particles);
|
|
@@ -239,11 +260,13 @@
|
|
|
239
260
|
interactivity.load(container.actualOptions.interactivity);
|
|
240
261
|
interactivity.load(particlesOptions.interactivity);
|
|
241
262
|
this.interactivity = interactivity;
|
|
242
|
-
this.
|
|
243
|
-
this.
|
|
263
|
+
this.effectFill = effectData?.fill ?? particlesOptions.effect.fill;
|
|
264
|
+
this.effectClose = effectData?.close ?? particlesOptions.effect.close;
|
|
265
|
+
this.shapeFill = shapeData?.fill ?? particlesOptions.shape.fill;
|
|
266
|
+
this.shapeClose = shapeData?.close ?? particlesOptions.shape.close;
|
|
244
267
|
this.options = particlesOptions;
|
|
245
268
|
const pathOptions = this.options.move.path;
|
|
246
|
-
this.pathDelay = (0, NumberUtils_js_1.
|
|
269
|
+
this.pathDelay = (0, NumberUtils_js_1.getRangeValue)(pathOptions.delay.value) * 1000;
|
|
247
270
|
if (pathOptions.generator) {
|
|
248
271
|
this.pathGenerator = this._engine.getPathGenerator(pathOptions.generator);
|
|
249
272
|
if (this.pathGenerator && container.addPath(pathOptions.generator, this.pathGenerator)) {
|
|
@@ -264,34 +287,46 @@
|
|
|
264
287
|
this.velocity = this.initialVelocity.copy();
|
|
265
288
|
this.moveDecay = 1 - (0, NumberUtils_js_1.getRangeValue)(this.options.move.decay);
|
|
266
289
|
const particles = container.particles;
|
|
267
|
-
particles.
|
|
268
|
-
particles.lastZIndex = this.position.z;
|
|
290
|
+
particles.setLastZIndex(this.position.z);
|
|
269
291
|
this.zIndexFactor = this.position.z / container.zLayers;
|
|
270
292
|
this.sides = 24;
|
|
271
|
-
let
|
|
272
|
-
if (!
|
|
273
|
-
|
|
274
|
-
if (
|
|
275
|
-
container.
|
|
293
|
+
let effectDrawer = container.effectDrawers.get(this.effect);
|
|
294
|
+
if (!effectDrawer) {
|
|
295
|
+
effectDrawer = this._engine.getEffectDrawer(this.effect);
|
|
296
|
+
if (effectDrawer) {
|
|
297
|
+
container.effectDrawers.set(this.effect, effectDrawer);
|
|
276
298
|
}
|
|
277
299
|
}
|
|
278
|
-
if (
|
|
279
|
-
|
|
300
|
+
if (effectDrawer && effectDrawer.loadEffect) {
|
|
301
|
+
effectDrawer.loadEffect(this);
|
|
280
302
|
}
|
|
281
|
-
|
|
303
|
+
let shapeDrawer = container.shapeDrawers.get(this.shape);
|
|
304
|
+
if (!shapeDrawer) {
|
|
305
|
+
shapeDrawer = this._engine.getShapeDrawer(this.shape);
|
|
306
|
+
if (shapeDrawer) {
|
|
307
|
+
container.shapeDrawers.set(this.shape, shapeDrawer);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
if (shapeDrawer && shapeDrawer.loadShape) {
|
|
311
|
+
shapeDrawer.loadShape(this);
|
|
312
|
+
}
|
|
313
|
+
const sideCountFunc = shapeDrawer?.getSidesCount;
|
|
282
314
|
if (sideCountFunc) {
|
|
283
315
|
this.sides = sideCountFunc(this);
|
|
284
316
|
}
|
|
285
317
|
this.spawning = false;
|
|
286
318
|
this.shadowColor = (0, ColorUtils_js_1.rangeColorToRgb)(this.options.shadow.color);
|
|
287
|
-
for (const updater of
|
|
319
|
+
for (const updater of particles.updaters) {
|
|
288
320
|
updater.init(this);
|
|
289
321
|
}
|
|
290
|
-
for (const mover of
|
|
322
|
+
for (const mover of particles.movers) {
|
|
291
323
|
mover.init && mover.init(this);
|
|
292
324
|
}
|
|
293
|
-
if (
|
|
294
|
-
|
|
325
|
+
if (effectDrawer && effectDrawer.particleInit) {
|
|
326
|
+
effectDrawer.particleInit(container, this);
|
|
327
|
+
}
|
|
328
|
+
if (shapeDrawer && shapeDrawer.particleInit) {
|
|
329
|
+
shapeDrawer.particleInit(container, this);
|
|
295
330
|
}
|
|
296
331
|
for (const [, plugin] of container.plugins) {
|
|
297
332
|
plugin.particleCreated && plugin.particleCreated(this);
|
package/umd/Core/Particles.js
CHANGED
|
@@ -19,16 +19,29 @@
|
|
|
19
19
|
const Constants_js_1 = require("./Utils/Constants.js");
|
|
20
20
|
const qTreeCapacity = 4;
|
|
21
21
|
const qTreeRectangle = (canvasSize) => {
|
|
22
|
-
|
|
22
|
+
const { height, width } = canvasSize, posOffset = -0.25, sizeFactor = 1.5;
|
|
23
|
+
return new Rectangle_js_1.Rectangle(posOffset * width, posOffset * height, sizeFactor * width, sizeFactor * height);
|
|
23
24
|
};
|
|
24
25
|
class Particles {
|
|
25
26
|
constructor(engine, container) {
|
|
26
27
|
this._applyDensity = (options, manualCount, group) => {
|
|
28
|
+
const numberOptions = options.number;
|
|
27
29
|
if (!options.number.density?.enable) {
|
|
30
|
+
if (group === undefined) {
|
|
31
|
+
this._limit = numberOptions.limit.value;
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
this._groupLimits.set(group, numberOptions.limit.value);
|
|
35
|
+
}
|
|
28
36
|
return;
|
|
29
37
|
}
|
|
30
|
-
const
|
|
31
|
-
|
|
38
|
+
const densityFactor = this._initDensityFactor(numberOptions.density), optParticlesNumber = numberOptions.value, optParticlesLimit = numberOptions.limit.value > 0 ? numberOptions.limit.value : optParticlesNumber, particlesNumber = Math.min(optParticlesNumber, optParticlesLimit) * densityFactor + manualCount, particlesCount = Math.min(this.count, this.filter((t) => t.group === group).length);
|
|
39
|
+
if (group === undefined) {
|
|
40
|
+
this._limit = numberOptions.limit.value * densityFactor;
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
this._groupLimits.set(group, numberOptions.limit.value * densityFactor);
|
|
44
|
+
}
|
|
32
45
|
if (particlesCount < particlesNumber) {
|
|
33
46
|
this.push(Math.abs(particlesNumber - particlesCount), undefined, options, group);
|
|
34
47
|
}
|
|
@@ -46,7 +59,7 @@
|
|
|
46
59
|
};
|
|
47
60
|
this._pushParticle = (position, overrideOptions, group, initializer) => {
|
|
48
61
|
try {
|
|
49
|
-
let particle = this.
|
|
62
|
+
let particle = this._pool.pop();
|
|
50
63
|
if (particle) {
|
|
51
64
|
particle.init(this._nextId, position, overrideOptions, group);
|
|
52
65
|
}
|
|
@@ -85,7 +98,7 @@
|
|
|
85
98
|
const zIdx = this._zArray.indexOf(particle);
|
|
86
99
|
this._array.splice(index, 1);
|
|
87
100
|
this._zArray.splice(zIdx, 1);
|
|
88
|
-
this.
|
|
101
|
+
this._pool.push(particle);
|
|
89
102
|
this._engine.dispatchEvent("particleRemoved", {
|
|
90
103
|
container: this._container,
|
|
91
104
|
data: {
|
|
@@ -99,10 +112,11 @@
|
|
|
99
112
|
this._nextId = 0;
|
|
100
113
|
this._array = [];
|
|
101
114
|
this._zArray = [];
|
|
102
|
-
this.
|
|
103
|
-
this.
|
|
104
|
-
this.
|
|
105
|
-
this.
|
|
115
|
+
this._pool = [];
|
|
116
|
+
this._limit = 0;
|
|
117
|
+
this._groupLimits = new Map();
|
|
118
|
+
this._needsSort = false;
|
|
119
|
+
this._lastZIndex = 0;
|
|
106
120
|
this._interactionManager = new InteractionManager_js_1.InteractionManager(engine, container);
|
|
107
121
|
const canvasSize = container.canvas.size;
|
|
108
122
|
this.quadTree = new QuadTree_js_1.QuadTree(qTreeRectangle(canvasSize), qTreeCapacity);
|
|
@@ -119,17 +133,21 @@
|
|
|
119
133
|
}
|
|
120
134
|
}
|
|
121
135
|
addParticle(position, overrideOptions, group, initializer) {
|
|
122
|
-
this.
|
|
123
|
-
const container = this._container, options = container.actualOptions, limit = options.particles.number.limit;
|
|
136
|
+
const limitOptions = this._container.actualOptions.particles.number.limit, limit = group === undefined ? this._limit : this._groupLimits.get(group) ?? this._limit, currentCount = this.count;
|
|
124
137
|
if (limit > 0) {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
138
|
+
if (limitOptions.mode === "delete") {
|
|
139
|
+
const countToRemove = currentCount + 1 - limit;
|
|
140
|
+
if (countToRemove > 0) {
|
|
141
|
+
this.removeQuantity(countToRemove);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
else if (limitOptions.mode === "wait") {
|
|
145
|
+
if (currentCount >= limit) {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
128
148
|
}
|
|
129
149
|
}
|
|
130
|
-
|
|
131
|
-
this.pushing = false;
|
|
132
|
-
return res;
|
|
150
|
+
return this._pushParticle(position, overrideOptions, group, initializer);
|
|
133
151
|
}
|
|
134
152
|
clear() {
|
|
135
153
|
this._array = [];
|
|
@@ -166,8 +184,8 @@
|
|
|
166
184
|
}
|
|
167
185
|
init() {
|
|
168
186
|
const container = this._container, options = container.actualOptions;
|
|
169
|
-
this.
|
|
170
|
-
this.
|
|
187
|
+
this._lastZIndex = 0;
|
|
188
|
+
this._needsSort = false;
|
|
171
189
|
let handled = false;
|
|
172
190
|
this.updaters = this._engine.getUpdaters(container, true);
|
|
173
191
|
this._interactionManager.init();
|
|
@@ -229,6 +247,13 @@
|
|
|
229
247
|
}
|
|
230
248
|
this._applyDensity(options.particles, options.manualParticles.length);
|
|
231
249
|
}
|
|
250
|
+
setLastZIndex(zIndex) {
|
|
251
|
+
this._lastZIndex = zIndex;
|
|
252
|
+
this._needsSort = this._needsSort || this._lastZIndex < zIndex;
|
|
253
|
+
}
|
|
254
|
+
setResizeFactor(factor) {
|
|
255
|
+
this._resizeFactor = factor;
|
|
256
|
+
}
|
|
232
257
|
async update(delta) {
|
|
233
258
|
const container = this._container, particlesToDelete = new Set();
|
|
234
259
|
this.quadTree = new QuadTree_js_1.QuadTree(qTreeRectangle(container.canvas.size), qTreeCapacity);
|
|
@@ -236,10 +261,10 @@
|
|
|
236
261
|
pathGenerator.update();
|
|
237
262
|
}
|
|
238
263
|
for (const [, plugin] of container.plugins) {
|
|
239
|
-
plugin.update && plugin.update(delta);
|
|
264
|
+
plugin.update && (await plugin.update(delta));
|
|
240
265
|
}
|
|
266
|
+
const resizeFactor = this._resizeFactor;
|
|
241
267
|
for (const particle of this._array) {
|
|
242
|
-
const resizeFactor = container.canvas.resizeFactor;
|
|
243
268
|
if (resizeFactor && !particle.ignoresResizeRatio) {
|
|
244
269
|
particle.position.x *= resizeFactor.width;
|
|
245
270
|
particle.position.y *= resizeFactor.height;
|
|
@@ -267,7 +292,7 @@
|
|
|
267
292
|
const checkDelete = (p) => !particlesToDelete.has(p);
|
|
268
293
|
this._array = this.filter(checkDelete);
|
|
269
294
|
this._zArray = this._zArray.filter(checkDelete);
|
|
270
|
-
this.
|
|
295
|
+
this._pool.push(...particlesToDelete);
|
|
271
296
|
}
|
|
272
297
|
await this._interactionManager.externalInteract(delta);
|
|
273
298
|
for (const particle of this._array) {
|
|
@@ -278,12 +303,12 @@
|
|
|
278
303
|
await this._interactionManager.particlesInteract(particle, delta);
|
|
279
304
|
}
|
|
280
305
|
}
|
|
281
|
-
delete
|
|
282
|
-
if (this.
|
|
306
|
+
delete this._resizeFactor;
|
|
307
|
+
if (this._needsSort) {
|
|
283
308
|
const zArray = this._zArray;
|
|
284
309
|
zArray.sort((a, b) => b.position.z - a.position.z || a.id - b.id);
|
|
285
|
-
this.
|
|
286
|
-
this.
|
|
310
|
+
this._lastZIndex = zArray[zArray.length - 1].position.z;
|
|
311
|
+
this._needsSort = false;
|
|
287
312
|
}
|
|
288
313
|
}
|
|
289
314
|
}
|
package/umd/Core/Retina.js
CHANGED
|
@@ -29,13 +29,11 @@
|
|
|
29
29
|
canvas.size.height = element.offsetHeight * ratio;
|
|
30
30
|
}
|
|
31
31
|
const particles = options.particles, moveOptions = particles.move;
|
|
32
|
-
this.attractDistance = (0, NumberUtils_js_1.getRangeValue)(moveOptions.attract.distance) * ratio;
|
|
33
32
|
this.maxSpeed = (0, NumberUtils_js_1.getRangeValue)(moveOptions.gravity.maxSpeed) * ratio;
|
|
34
33
|
this.sizeAnimationSpeed = (0, NumberUtils_js_1.getRangeValue)(particles.size.animation.speed) * ratio;
|
|
35
34
|
}
|
|
36
35
|
initParticle(particle) {
|
|
37
36
|
const options = particle.options, ratio = this.pixelRatio, moveOptions = options.move, moveDistance = moveOptions.distance, props = particle.retina;
|
|
38
|
-
props.attractDistance = (0, NumberUtils_js_1.getRangeValue)(moveOptions.attract.distance) * ratio;
|
|
39
37
|
props.moveDrift = (0, NumberUtils_js_1.getRangeValue)(moveOptions.drift) * ratio;
|
|
40
38
|
props.moveSpeed = (0, NumberUtils_js_1.getRangeValue)(moveOptions.speed) * ratio;
|
|
41
39
|
props.sizeAnimationSpeed = (0, NumberUtils_js_1.getRangeValue)(options.size.animation.speed) * ratio;
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
this._subdivide = () => {
|
|
21
21
|
const { x, y } = this.rectangle.position, { width, height } = this.rectangle.size, { capacity } = this;
|
|
22
22
|
for (let i = 0; i < 4; i++) {
|
|
23
|
-
this._subs.push(new QuadTree(new Rectangle_js_1.Rectangle(x +
|
|
23
|
+
this._subs.push(new QuadTree(new Rectangle_js_1.Rectangle(x + width * 0.5 * (i % 2), y + height * 0.5 * (Math.round(i * 0.5) - (i % 2)), width * 0.5, height * 0.5), capacity));
|
|
24
24
|
}
|
|
25
25
|
this._divided = true;
|
|
26
26
|
};
|
|
@@ -26,8 +26,7 @@
|
|
|
26
26
|
this.composite = data.composite;
|
|
27
27
|
}
|
|
28
28
|
if (data.cover !== undefined) {
|
|
29
|
-
const cover = data.cover;
|
|
30
|
-
const color = ((0, Utils_js_1.isString)(data.cover) ? { color: data.cover } : data.cover);
|
|
29
|
+
const cover = data.cover, color = ((0, Utils_js_1.isString)(data.cover) ? { color: data.cover } : data.cover);
|
|
31
30
|
this.cover.load(cover.color !== undefined ? cover : { color: color });
|
|
32
31
|
}
|
|
33
32
|
if (data.enable !== undefined) {
|
|
@@ -4,48 +4,28 @@
|
|
|
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", "./AnimationOptions.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.ColorAnimation = void 0;
|
|
13
|
+
const AnimationOptions_js_1 = require("./AnimationOptions.js");
|
|
13
14
|
const NumberUtils_js_1 = require("../../Utils/NumberUtils.js");
|
|
14
|
-
class ColorAnimation {
|
|
15
|
+
class ColorAnimation extends AnimationOptions_js_1.AnimationOptions {
|
|
15
16
|
constructor() {
|
|
16
|
-
|
|
17
|
-
this.enable = false;
|
|
17
|
+
super();
|
|
18
18
|
this.offset = 0;
|
|
19
|
-
this.speed = 1;
|
|
20
|
-
this.delay = 0;
|
|
21
|
-
this.decay = 0;
|
|
22
19
|
this.sync = true;
|
|
23
20
|
}
|
|
24
21
|
load(data) {
|
|
22
|
+
super.load(data);
|
|
25
23
|
if (!data) {
|
|
26
24
|
return;
|
|
27
25
|
}
|
|
28
|
-
if (data.count !== undefined) {
|
|
29
|
-
this.count = (0, NumberUtils_js_1.setRangeValue)(data.count);
|
|
30
|
-
}
|
|
31
|
-
if (data.enable !== undefined) {
|
|
32
|
-
this.enable = data.enable;
|
|
33
|
-
}
|
|
34
26
|
if (data.offset !== undefined) {
|
|
35
27
|
this.offset = (0, NumberUtils_js_1.setRangeValue)(data.offset);
|
|
36
28
|
}
|
|
37
|
-
if (data.speed !== undefined) {
|
|
38
|
-
this.speed = (0, NumberUtils_js_1.setRangeValue)(data.speed);
|
|
39
|
-
}
|
|
40
|
-
if (data.decay !== undefined) {
|
|
41
|
-
this.decay = (0, NumberUtils_js_1.setRangeValue)(data.decay);
|
|
42
|
-
}
|
|
43
|
-
if (data.delay !== undefined) {
|
|
44
|
-
this.delay = (0, NumberUtils_js_1.setRangeValue)(data.delay);
|
|
45
|
-
}
|
|
46
|
-
if (data.sync !== undefined) {
|
|
47
|
-
this.sync = data.sync;
|
|
48
|
-
}
|
|
49
29
|
}
|
|
50
30
|
}
|
|
51
31
|
exports.ColorAnimation = ColorAnimation;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
(function (factory) {
|
|
2
|
+
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
|
+
var v = factory(require, exports);
|
|
4
|
+
if (v !== undefined) module.exports = v;
|
|
5
|
+
}
|
|
6
|
+
else if (typeof define === "function" && define.amd) {
|
|
7
|
+
define(["require", "exports", "../../../../Utils/Utils.js"], factory);
|
|
8
|
+
}
|
|
9
|
+
})(function (require, exports) {
|
|
10
|
+
"use strict";
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.Effect = void 0;
|
|
13
|
+
const Utils_js_1 = require("../../../../Utils/Utils.js");
|
|
14
|
+
class Effect {
|
|
15
|
+
constructor() {
|
|
16
|
+
this.close = true;
|
|
17
|
+
this.fill = true;
|
|
18
|
+
this.options = {};
|
|
19
|
+
this.type = [];
|
|
20
|
+
}
|
|
21
|
+
load(data) {
|
|
22
|
+
if (!data) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const options = data.options;
|
|
26
|
+
if (options !== undefined) {
|
|
27
|
+
for (const effect in options) {
|
|
28
|
+
const item = options[effect];
|
|
29
|
+
if (item) {
|
|
30
|
+
this.options[effect] = (0, Utils_js_1.deepExtend)(this.options[effect] ?? {}, item);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
if (data.close !== undefined) {
|
|
35
|
+
this.close = data.close;
|
|
36
|
+
}
|
|
37
|
+
if (data.fill !== undefined) {
|
|
38
|
+
this.fill = data.fill;
|
|
39
|
+
}
|
|
40
|
+
if (data.type !== undefined) {
|
|
41
|
+
this.type = data.type;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.Effect = Effect;
|
|
46
|
+
});
|
|
@@ -4,17 +4,18 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "./ParticlesDensity.js"], factory);
|
|
7
|
+
define(["require", "exports", "./ParticlesDensity.js", "./ParticlesNumberLimit.js"], factory);
|
|
8
8
|
}
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.ParticlesNumber = void 0;
|
|
13
13
|
const ParticlesDensity_js_1 = require("./ParticlesDensity.js");
|
|
14
|
+
const ParticlesNumberLimit_js_1 = require("./ParticlesNumberLimit.js");
|
|
14
15
|
class ParticlesNumber {
|
|
15
16
|
constructor() {
|
|
16
17
|
this.density = new ParticlesDensity_js_1.ParticlesDensity();
|
|
17
|
-
this.limit =
|
|
18
|
+
this.limit = new ParticlesNumberLimit_js_1.ParticlesNumberLimit();
|
|
18
19
|
this.value = 0;
|
|
19
20
|
}
|
|
20
21
|
load(data) {
|
|
@@ -22,10 +23,7 @@
|
|
|
22
23
|
return;
|
|
23
24
|
}
|
|
24
25
|
this.density.load(data.density);
|
|
25
|
-
|
|
26
|
-
if (limit !== undefined) {
|
|
27
|
-
this.limit = limit;
|
|
28
|
-
}
|
|
26
|
+
this.limit.load(data.limit);
|
|
29
27
|
if (data.value !== undefined) {
|
|
30
28
|
this.value = data.value;
|
|
31
29
|
}
|
|
@@ -9,23 +9,23 @@
|
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
13
|
-
class
|
|
12
|
+
exports.ParticlesNumberLimit = void 0;
|
|
13
|
+
class ParticlesNumberLimit {
|
|
14
14
|
constructor() {
|
|
15
|
-
this.
|
|
16
|
-
this.
|
|
15
|
+
this.mode = "delete";
|
|
16
|
+
this.value = 0;
|
|
17
17
|
}
|
|
18
18
|
load(data) {
|
|
19
19
|
if (!data) {
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
|
-
if (data.
|
|
23
|
-
this.
|
|
22
|
+
if (data.mode !== undefined) {
|
|
23
|
+
this.mode = data.mode;
|
|
24
24
|
}
|
|
25
|
-
if (data.
|
|
26
|
-
this.
|
|
25
|
+
if (data.value !== undefined) {
|
|
26
|
+
this.value = data.value;
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
exports.
|
|
30
|
+
exports.ParticlesNumberLimit = ParticlesNumberLimit;
|
|
31
31
|
});
|
|
@@ -12,11 +12,10 @@
|
|
|
12
12
|
exports.Opacity = void 0;
|
|
13
13
|
const OpacityAnimation_js_1 = require("./OpacityAnimation.js");
|
|
14
14
|
const ValueWithRandom_js_1 = require("../../ValueWithRandom.js");
|
|
15
|
-
class Opacity extends ValueWithRandom_js_1.
|
|
15
|
+
class Opacity extends ValueWithRandom_js_1.RangedAnimationValueWithRandom {
|
|
16
16
|
constructor() {
|
|
17
17
|
super();
|
|
18
18
|
this.animation = new OpacityAnimation_js_1.OpacityAnimation();
|
|
19
|
-
this.random.minimumValue = 0.1;
|
|
20
19
|
this.value = 1;
|
|
21
20
|
}
|
|
22
21
|
load(data) {
|