tsparticles 1.41.6 → 1.42.2
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/Core/Canvas.d.ts +1 -1
- package/Core/Canvas.js +8 -4
- package/Core/Interfaces/ICoordinates.d.ts +8 -0
- package/Core/Interfaces/IParticleGravity.d.ts +5 -0
- package/Core/Interfaces/IParticleGravity.js +2 -0
- package/Core/Interfaces/index.d.ts +1 -0
- package/Core/Interfaces/index.js +1 -0
- package/Core/Particle.d.ts +2 -1
- package/Core/Particle.js +8 -7
- package/Core/Retina.js +7 -7
- package/Core/Utils/ParticlesMover.js +2 -2
- package/Interactions/Particles/Links/LinkInstance.js +1 -1
- package/Options/Classes/AnimatableGradient.d.ts +4 -4
- package/Options/Classes/AnimatableGradient.js +4 -4
- package/Options/Classes/AnimationOptions.d.ts +5 -5
- package/Options/Classes/AnimationOptions.js +3 -2
- package/Options/Classes/ColorAnimation.d.ts +2 -2
- package/Options/Classes/ColorAnimation.js +2 -2
- package/Options/Classes/Particles/Move/Attract.d.ts +2 -2
- package/Options/Classes/Particles/Move/Attract.js +2 -1
- package/Options/Classes/Particles/Move/MoveAngle.d.ts +3 -3
- package/Options/Classes/Particles/Move/MoveAngle.js +3 -2
- package/Options/Classes/Particles/Move/MoveGravity.d.ts +5 -5
- package/Options/Classes/Particles/Move/MoveGravity.js +3 -2
- package/Options/Classes/Particles/Orbit/Orbit.d.ts +4 -4
- package/Options/Classes/Particles/Orbit/Orbit.js +4 -3
- package/Options/Classes/Particles/Repulse/Repulse.d.ts +5 -5
- package/Options/Classes/Particles/Repulse/Repulse.js +5 -4
- package/Options/Classes/Particles/Roll/RollLight.d.ts +2 -2
- package/Options/Classes/Particles/Roll/RollLight.js +2 -1
- package/Options/Classes/Particles/Rotate/RotateAnimation.d.ts +2 -2
- package/Options/Classes/Particles/Rotate/RotateAnimation.js +2 -1
- package/Options/Classes/Particles/Tilt/TiltAnimation.d.ts +2 -2
- package/Options/Classes/Particles/Tilt/TiltAnimation.js +2 -1
- package/Options/Classes/Particles/Twinkle/TwinkleValues.d.ts +2 -2
- package/Options/Classes/Particles/Twinkle/TwinkleValues.js +2 -1
- package/Options/Interfaces/IAnimation.d.ts +3 -2
- package/Options/Interfaces/Particles/Move/IAttract.d.ts +3 -2
- package/Options/Interfaces/Particles/Move/IMoveAngle.d.ts +3 -2
- package/Options/Interfaces/Particles/Move/IMoveGravity.d.ts +3 -2
- package/Options/Interfaces/Particles/Orbit/IOrbit.d.ts +4 -3
- package/Options/Interfaces/Particles/Repulse/IRepulse.d.ts +5 -4
- package/Options/Interfaces/Particles/Roll/IRollLight.d.ts +2 -1
- package/Options/Interfaces/Particles/Rotate/IRotateAnimation.d.ts +2 -1
- package/Options/Interfaces/Particles/Tilt/ITiltAnimation.d.ts +2 -1
- package/Options/Interfaces/Particles/Twinkle/ITwinkleValues.d.ts +3 -2
- package/Plugins/Absorbers/AbsorberInstance.js +1 -1
- package/Plugins/Absorbers/Options/Classes/Absorber.d.ts +2 -2
- package/Plugins/Absorbers/Options/Classes/Absorber.js +8 -4
- package/Plugins/Absorbers/Options/Interfaces/IAbsorber.d.ts +2 -2
- package/Plugins/Emitters/EmitterInstance.js +3 -3
- package/Plugins/Emitters/Options/Classes/Emitter.d.ts +2 -2
- package/Plugins/Emitters/Options/Classes/Emitter.js +8 -5
- package/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +2 -2
- package/Updaters/Angle/AngleUpdater.js +2 -1
- package/Updaters/Opacity/OpacityUpdater.js +3 -2
- package/Updaters/Roll/RollUpdater.js +3 -3
- package/Updaters/Tilt/TiltUpdater.js +1 -1
- package/Utils/ColorUtils.js +1 -1
- package/browser/Core/Canvas.d.ts +1 -1
- package/browser/Core/Canvas.js +9 -5
- package/browser/Core/Interfaces/ICoordinates.d.ts +8 -0
- package/browser/Core/Interfaces/IParticleGravity.d.ts +5 -0
- package/browser/Core/Interfaces/IParticleGravity.js +1 -0
- package/browser/Core/Interfaces/index.d.ts +1 -0
- package/browser/Core/Interfaces/index.js +1 -0
- package/browser/Core/Particle.d.ts +2 -1
- package/browser/Core/Particle.js +8 -7
- package/browser/Core/Retina.js +7 -7
- package/browser/Core/Utils/ParticlesMover.js +2 -2
- package/browser/Interactions/Particles/Links/LinkInstance.js +2 -2
- package/browser/Options/Classes/AnimatableGradient.d.ts +4 -4
- package/browser/Options/Classes/AnimatableGradient.js +4 -4
- package/browser/Options/Classes/AnimationOptions.d.ts +5 -5
- package/browser/Options/Classes/AnimationOptions.js +3 -2
- package/browser/Options/Classes/ColorAnimation.d.ts +2 -2
- package/browser/Options/Classes/ColorAnimation.js +2 -2
- package/browser/Options/Classes/Particles/Move/Attract.d.ts +2 -2
- package/browser/Options/Classes/Particles/Move/Attract.js +2 -1
- package/browser/Options/Classes/Particles/Move/MoveAngle.d.ts +3 -3
- package/browser/Options/Classes/Particles/Move/MoveAngle.js +3 -2
- package/browser/Options/Classes/Particles/Move/MoveGravity.d.ts +5 -5
- package/browser/Options/Classes/Particles/Move/MoveGravity.js +3 -2
- package/browser/Options/Classes/Particles/Orbit/Orbit.d.ts +4 -4
- package/browser/Options/Classes/Particles/Orbit/Orbit.js +4 -3
- package/browser/Options/Classes/Particles/Repulse/Repulse.d.ts +5 -5
- package/browser/Options/Classes/Particles/Repulse/Repulse.js +5 -4
- package/browser/Options/Classes/Particles/Roll/RollLight.d.ts +2 -2
- package/browser/Options/Classes/Particles/Roll/RollLight.js +2 -1
- package/browser/Options/Classes/Particles/Rotate/RotateAnimation.d.ts +2 -2
- package/browser/Options/Classes/Particles/Rotate/RotateAnimation.js +2 -1
- package/browser/Options/Classes/Particles/Tilt/TiltAnimation.d.ts +2 -2
- package/browser/Options/Classes/Particles/Tilt/TiltAnimation.js +2 -1
- package/browser/Options/Classes/Particles/Twinkle/TwinkleValues.d.ts +2 -2
- package/browser/Options/Classes/Particles/Twinkle/TwinkleValues.js +2 -1
- package/browser/Options/Interfaces/IAnimation.d.ts +3 -2
- package/browser/Options/Interfaces/Particles/Move/IAttract.d.ts +3 -2
- package/browser/Options/Interfaces/Particles/Move/IMoveAngle.d.ts +3 -2
- package/browser/Options/Interfaces/Particles/Move/IMoveGravity.d.ts +3 -2
- package/browser/Options/Interfaces/Particles/Orbit/IOrbit.d.ts +4 -3
- package/browser/Options/Interfaces/Particles/Repulse/IRepulse.d.ts +5 -4
- package/browser/Options/Interfaces/Particles/Roll/IRollLight.d.ts +2 -1
- package/browser/Options/Interfaces/Particles/Rotate/IRotateAnimation.d.ts +2 -1
- package/browser/Options/Interfaces/Particles/Tilt/ITiltAnimation.d.ts +2 -1
- package/browser/Options/Interfaces/Particles/Twinkle/ITwinkleValues.d.ts +3 -2
- package/browser/Plugins/Absorbers/AbsorberInstance.js +1 -1
- package/browser/Plugins/Absorbers/Options/Classes/Absorber.d.ts +2 -2
- package/browser/Plugins/Absorbers/Options/Classes/Absorber.js +8 -4
- package/browser/Plugins/Absorbers/Options/Interfaces/IAbsorber.d.ts +2 -2
- package/browser/Plugins/Emitters/EmitterInstance.js +3 -3
- package/browser/Plugins/Emitters/Options/Classes/Emitter.d.ts +2 -2
- package/browser/Plugins/Emitters/Options/Classes/Emitter.js +8 -5
- package/browser/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +2 -2
- package/browser/Updaters/Angle/AngleUpdater.js +2 -1
- package/browser/Updaters/Opacity/OpacityUpdater.js +3 -2
- package/browser/Updaters/Roll/RollUpdater.js +3 -3
- package/browser/Updaters/Tilt/TiltUpdater.js +1 -1
- package/browser/Utils/ColorUtils.js +2 -2
- package/esm/Core/Canvas.d.ts +1 -1
- package/esm/Core/Canvas.js +9 -5
- package/esm/Core/Interfaces/ICoordinates.d.ts +8 -0
- package/esm/Core/Interfaces/IParticleGravity.d.ts +5 -0
- package/esm/Core/Interfaces/IParticleGravity.js +1 -0
- package/esm/Core/Interfaces/index.d.ts +1 -0
- package/esm/Core/Interfaces/index.js +1 -0
- package/esm/Core/Particle.d.ts +2 -1
- package/esm/Core/Particle.js +8 -7
- package/esm/Core/Retina.js +7 -7
- package/esm/Core/Utils/ParticlesMover.js +2 -2
- package/esm/Interactions/Particles/Links/LinkInstance.js +2 -2
- package/esm/Options/Classes/AnimatableGradient.d.ts +4 -4
- package/esm/Options/Classes/AnimatableGradient.js +4 -4
- package/esm/Options/Classes/AnimationOptions.d.ts +5 -5
- package/esm/Options/Classes/AnimationOptions.js +3 -2
- package/esm/Options/Classes/ColorAnimation.d.ts +2 -2
- package/esm/Options/Classes/ColorAnimation.js +2 -2
- package/esm/Options/Classes/Particles/Move/Attract.d.ts +2 -2
- package/esm/Options/Classes/Particles/Move/Attract.js +2 -1
- package/esm/Options/Classes/Particles/Move/MoveAngle.d.ts +3 -3
- package/esm/Options/Classes/Particles/Move/MoveAngle.js +3 -2
- package/esm/Options/Classes/Particles/Move/MoveGravity.d.ts +5 -5
- package/esm/Options/Classes/Particles/Move/MoveGravity.js +3 -2
- package/esm/Options/Classes/Particles/Orbit/Orbit.d.ts +4 -4
- package/esm/Options/Classes/Particles/Orbit/Orbit.js +4 -3
- package/esm/Options/Classes/Particles/Repulse/Repulse.d.ts +5 -5
- package/esm/Options/Classes/Particles/Repulse/Repulse.js +5 -4
- package/esm/Options/Classes/Particles/Roll/RollLight.d.ts +2 -2
- package/esm/Options/Classes/Particles/Roll/RollLight.js +2 -1
- package/esm/Options/Classes/Particles/Rotate/RotateAnimation.d.ts +2 -2
- package/esm/Options/Classes/Particles/Rotate/RotateAnimation.js +2 -1
- package/esm/Options/Classes/Particles/Tilt/TiltAnimation.d.ts +2 -2
- package/esm/Options/Classes/Particles/Tilt/TiltAnimation.js +2 -1
- package/esm/Options/Classes/Particles/Twinkle/TwinkleValues.d.ts +2 -2
- package/esm/Options/Classes/Particles/Twinkle/TwinkleValues.js +2 -1
- package/esm/Options/Interfaces/IAnimation.d.ts +3 -2
- package/esm/Options/Interfaces/Particles/Move/IAttract.d.ts +3 -2
- package/esm/Options/Interfaces/Particles/Move/IMoveAngle.d.ts +3 -2
- package/esm/Options/Interfaces/Particles/Move/IMoveGravity.d.ts +3 -2
- package/esm/Options/Interfaces/Particles/Orbit/IOrbit.d.ts +4 -3
- package/esm/Options/Interfaces/Particles/Repulse/IRepulse.d.ts +5 -4
- package/esm/Options/Interfaces/Particles/Roll/IRollLight.d.ts +2 -1
- package/esm/Options/Interfaces/Particles/Rotate/IRotateAnimation.d.ts +2 -1
- package/esm/Options/Interfaces/Particles/Tilt/ITiltAnimation.d.ts +2 -1
- package/esm/Options/Interfaces/Particles/Twinkle/ITwinkleValues.d.ts +3 -2
- package/esm/Plugins/Absorbers/AbsorberInstance.js +1 -1
- package/esm/Plugins/Absorbers/Options/Classes/Absorber.d.ts +2 -2
- package/esm/Plugins/Absorbers/Options/Classes/Absorber.js +8 -4
- package/esm/Plugins/Absorbers/Options/Interfaces/IAbsorber.d.ts +2 -2
- package/esm/Plugins/Emitters/EmitterInstance.js +3 -3
- package/esm/Plugins/Emitters/Options/Classes/Emitter.d.ts +2 -2
- package/esm/Plugins/Emitters/Options/Classes/Emitter.js +8 -5
- package/esm/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +2 -2
- package/esm/Updaters/Angle/AngleUpdater.js +2 -1
- package/esm/Updaters/Opacity/OpacityUpdater.js +3 -2
- package/esm/Updaters/Roll/RollUpdater.js +3 -3
- package/esm/Updaters/Tilt/TiltUpdater.js +1 -1
- package/esm/Utils/ColorUtils.js +2 -2
- package/package.json +15 -3
- package/report.html +2 -2
- package/report.slim.html +2 -2
- package/scripts/install.js +11 -2
- package/tsparticles.engine.js +48 -45
- package/tsparticles.engine.min.js +2 -2
- package/tsparticles.interaction.external.attract.js +320 -34
- package/tsparticles.interaction.external.attract.min.js +1 -1
- package/tsparticles.interaction.external.bounce.js +320 -34
- package/tsparticles.interaction.external.bounce.min.js +1 -1
- package/tsparticles.interaction.external.bubble.js +320 -34
- package/tsparticles.interaction.external.bubble.min.js +1 -1
- package/tsparticles.interaction.external.connect.js +320 -34
- package/tsparticles.interaction.external.connect.min.js +1 -1
- package/tsparticles.interaction.external.grab.js +320 -34
- package/tsparticles.interaction.external.grab.min.js +1 -1
- package/tsparticles.interaction.external.repulse.js +320 -34
- package/tsparticles.interaction.external.repulse.min.js +1 -1
- package/tsparticles.interaction.external.trail.js +320 -34
- package/tsparticles.interaction.external.trail.min.js +1 -1
- package/tsparticles.interaction.particles.attract.js +320 -34
- package/tsparticles.interaction.particles.attract.min.js +1 -1
- package/tsparticles.interaction.particles.collisions.js +320 -34
- package/tsparticles.interaction.particles.collisions.min.js +1 -1
- package/tsparticles.interaction.particles.links.js +321 -35
- package/tsparticles.interaction.particles.links.min.js +2 -2
- package/tsparticles.js +74 -65
- package/tsparticles.min.js +2 -2
- package/tsparticles.pathseg.min.js +1 -1
- package/tsparticles.plugins.absorbers.js +328 -39
- package/tsparticles.plugins.absorbers.min.js +2 -2
- package/tsparticles.plugins.emitters.js +431 -142
- package/tsparticles.plugins.emitters.min.js +2 -2
- package/tsparticles.plugins.polygonMask.js +320 -34
- package/tsparticles.plugins.polygonMask.min.js +1 -1
- package/tsparticles.shape.circle.min.js +1 -1
- package/tsparticles.shape.image.js +320 -34
- package/tsparticles.shape.image.min.js +1 -1
- package/tsparticles.shape.line.min.js +1 -1
- package/tsparticles.shape.polygon.min.js +1 -1
- package/tsparticles.shape.square.min.js +1 -1
- package/tsparticles.shape.star.min.js +1 -1
- package/tsparticles.shape.text.js +320 -34
- package/tsparticles.shape.text.min.js +1 -1
- package/tsparticles.slim.js +52 -49
- package/tsparticles.slim.min.js +2 -2
- package/tsparticles.updater.angle.js +321 -35
- package/tsparticles.updater.angle.min.js +2 -2
- package/tsparticles.updater.color.js +320 -34
- package/tsparticles.updater.color.min.js +2 -2
- package/tsparticles.updater.life.js +320 -34
- package/tsparticles.updater.life.min.js +1 -1
- package/tsparticles.updater.opacity.js +322 -36
- package/tsparticles.updater.opacity.min.js +2 -2
- package/tsparticles.updater.outModes.js +320 -34
- package/tsparticles.updater.outModes.min.js +1 -1
- package/tsparticles.updater.roll.js +323 -37
- package/tsparticles.updater.roll.min.js +2 -2
- package/tsparticles.updater.size.js +320 -34
- package/tsparticles.updater.size.min.js +1 -1
- package/tsparticles.updater.strokeColor.js +320 -34
- package/tsparticles.updater.strokeColor.min.js +2 -2
- package/tsparticles.updater.tilt.js +321 -35
- package/tsparticles.updater.tilt.min.js +2 -2
- package/tsparticles.updater.wobble.js +320 -34
- package/tsparticles.updater.wobble.min.js +1 -1
- package/umd/Core/Canvas.d.ts +1 -1
- package/umd/Core/Canvas.js +8 -4
- package/umd/Core/Interfaces/ICoordinates.d.ts +8 -0
- package/umd/Core/Interfaces/IParticleGravity.d.ts +5 -0
- package/umd/Core/Interfaces/IParticleGravity.js +12 -0
- package/umd/Core/Interfaces/index.d.ts +1 -0
- package/umd/Core/Interfaces/index.js +2 -1
- package/umd/Core/Particle.d.ts +2 -1
- package/umd/Core/Particle.js +8 -7
- package/umd/Core/Retina.js +7 -7
- package/umd/Core/Utils/ParticlesMover.js +2 -2
- package/umd/Interactions/Particles/Links/LinkInstance.js +1 -1
- package/umd/Options/Classes/AnimatableGradient.d.ts +4 -4
- package/umd/Options/Classes/AnimatableGradient.js +4 -4
- package/umd/Options/Classes/AnimationOptions.d.ts +5 -5
- package/umd/Options/Classes/AnimationOptions.js +4 -3
- package/umd/Options/Classes/ColorAnimation.d.ts +2 -2
- package/umd/Options/Classes/ColorAnimation.js +2 -2
- package/umd/Options/Classes/Particles/Move/Attract.d.ts +2 -2
- package/umd/Options/Classes/Particles/Move/Attract.js +3 -2
- package/umd/Options/Classes/Particles/Move/MoveAngle.d.ts +3 -3
- package/umd/Options/Classes/Particles/Move/MoveAngle.js +4 -3
- package/umd/Options/Classes/Particles/Move/MoveGravity.d.ts +5 -5
- package/umd/Options/Classes/Particles/Move/MoveGravity.js +4 -3
- package/umd/Options/Classes/Particles/Orbit/Orbit.d.ts +4 -4
- package/umd/Options/Classes/Particles/Orbit/Orbit.js +5 -4
- package/umd/Options/Classes/Particles/Repulse/Repulse.d.ts +5 -5
- package/umd/Options/Classes/Particles/Repulse/Repulse.js +6 -5
- package/umd/Options/Classes/Particles/Roll/RollLight.d.ts +2 -2
- package/umd/Options/Classes/Particles/Roll/RollLight.js +3 -2
- package/umd/Options/Classes/Particles/Rotate/RotateAnimation.d.ts +2 -2
- package/umd/Options/Classes/Particles/Rotate/RotateAnimation.js +3 -2
- package/umd/Options/Classes/Particles/Tilt/TiltAnimation.d.ts +2 -2
- package/umd/Options/Classes/Particles/Tilt/TiltAnimation.js +3 -2
- package/umd/Options/Classes/Particles/Twinkle/TwinkleValues.d.ts +2 -2
- package/umd/Options/Classes/Particles/Twinkle/TwinkleValues.js +3 -2
- package/umd/Options/Interfaces/IAnimation.d.ts +3 -2
- package/umd/Options/Interfaces/Particles/Move/IAttract.d.ts +3 -2
- package/umd/Options/Interfaces/Particles/Move/IMoveAngle.d.ts +3 -2
- package/umd/Options/Interfaces/Particles/Move/IMoveGravity.d.ts +3 -2
- package/umd/Options/Interfaces/Particles/Orbit/IOrbit.d.ts +4 -3
- package/umd/Options/Interfaces/Particles/Repulse/IRepulse.d.ts +5 -4
- package/umd/Options/Interfaces/Particles/Roll/IRollLight.d.ts +2 -1
- package/umd/Options/Interfaces/Particles/Rotate/IRotateAnimation.d.ts +2 -1
- package/umd/Options/Interfaces/Particles/Tilt/ITiltAnimation.d.ts +2 -1
- package/umd/Options/Interfaces/Particles/Twinkle/ITwinkleValues.d.ts +3 -2
- package/umd/Plugins/Absorbers/AbsorberInstance.js +1 -1
- package/umd/Plugins/Absorbers/Options/Classes/Absorber.d.ts +2 -2
- package/umd/Plugins/Absorbers/Options/Classes/Absorber.js +9 -5
- package/umd/Plugins/Absorbers/Options/Interfaces/IAbsorber.d.ts +2 -2
- package/umd/Plugins/Emitters/EmitterInstance.js +3 -3
- package/umd/Plugins/Emitters/Options/Classes/Emitter.d.ts +2 -2
- package/umd/Plugins/Emitters/Options/Classes/Emitter.js +9 -6
- package/umd/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +2 -2
- package/umd/Updaters/Angle/AngleUpdater.js +2 -1
- package/umd/Updaters/Opacity/OpacityUpdater.js +3 -2
- package/umd/Updaters/Roll/RollUpdater.js +3 -3
- package/umd/Updaters/Tilt/TiltUpdater.js +1 -1
- package/umd/Utils/ColorUtils.js +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import type { RangeValue, RecursivePartial } from "../../../../Types";
|
|
2
|
+
import type { IMoveGravity } from "../../../Interfaces/Particles/Move/IMoveGravity";
|
|
3
|
+
import type { IOptionLoader } from "../../../Interfaces/IOptionLoader";
|
|
4
4
|
export declare class MoveGravity implements IMoveGravity, IOptionLoader<IMoveGravity> {
|
|
5
|
-
acceleration:
|
|
5
|
+
acceleration: RangeValue;
|
|
6
6
|
enable: boolean;
|
|
7
7
|
inverse: boolean;
|
|
8
|
-
maxSpeed:
|
|
8
|
+
maxSpeed: RangeValue;
|
|
9
9
|
constructor();
|
|
10
10
|
load(data?: RecursivePartial<IMoveGravity>): void;
|
|
11
11
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { setRangeValue } from "../../../../Utils";
|
|
1
2
|
export class MoveGravity {
|
|
2
3
|
constructor() {
|
|
3
4
|
this.acceleration = 9.81;
|
|
@@ -10,7 +11,7 @@ export class MoveGravity {
|
|
|
10
11
|
return;
|
|
11
12
|
}
|
|
12
13
|
if (data.acceleration !== undefined) {
|
|
13
|
-
this.acceleration = data.acceleration;
|
|
14
|
+
this.acceleration = setRangeValue(data.acceleration);
|
|
14
15
|
}
|
|
15
16
|
if (data.enable !== undefined) {
|
|
16
17
|
this.enable = data.enable;
|
|
@@ -19,7 +20,7 @@ export class MoveGravity {
|
|
|
19
20
|
this.inverse = data.inverse;
|
|
20
21
|
}
|
|
21
22
|
if (data.maxSpeed !== undefined) {
|
|
22
|
-
this.maxSpeed = data.maxSpeed;
|
|
23
|
+
this.maxSpeed = setRangeValue(data.maxSpeed);
|
|
23
24
|
}
|
|
24
25
|
}
|
|
25
26
|
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
+
import type { RangeValue, RecursivePartial } from "../../../../Types";
|
|
1
2
|
import { AnimationOptions } from "../../AnimationOptions";
|
|
2
3
|
import type { IAnimatable } from "../../../Interfaces/IAnimatable";
|
|
3
4
|
import type { IOptionLoader } from "../../../Interfaces/IOptionLoader";
|
|
4
5
|
import type { IOrbit } from "../../../Interfaces/Particles/Orbit/IOrbit";
|
|
5
6
|
import { OptionsColor } from "../../OptionsColor";
|
|
6
7
|
import { OrbitRotation } from "./OrbitRotation";
|
|
7
|
-
import type { RecursivePartial } from "../../../../Types";
|
|
8
8
|
export declare class Orbit implements IOrbit, IOptionLoader<IOrbit>, IAnimatable<AnimationOptions> {
|
|
9
9
|
animation: AnimationOptions;
|
|
10
10
|
enable: boolean;
|
|
11
|
-
opacity:
|
|
12
|
-
width:
|
|
11
|
+
opacity: RangeValue;
|
|
12
|
+
width: RangeValue;
|
|
13
13
|
color?: OptionsColor;
|
|
14
|
-
radius?:
|
|
14
|
+
radius?: RangeValue;
|
|
15
15
|
rotation: OrbitRotation;
|
|
16
16
|
constructor();
|
|
17
17
|
load(data?: RecursivePartial<IOrbit>): void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AnimationOptions } from "../../AnimationOptions";
|
|
2
2
|
import { OptionsColor } from "../../OptionsColor";
|
|
3
3
|
import { OrbitRotation } from "./OrbitRotation";
|
|
4
|
+
import { setRangeValue } from "../../../../Utils";
|
|
4
5
|
export class Orbit {
|
|
5
6
|
constructor() {
|
|
6
7
|
this.animation = new AnimationOptions();
|
|
@@ -19,13 +20,13 @@ export class Orbit {
|
|
|
19
20
|
this.enable = data.enable;
|
|
20
21
|
}
|
|
21
22
|
if (data.opacity !== undefined) {
|
|
22
|
-
this.opacity = data.opacity;
|
|
23
|
+
this.opacity = setRangeValue(data.opacity);
|
|
23
24
|
}
|
|
24
25
|
if (data.width !== undefined) {
|
|
25
|
-
this.width = data.width;
|
|
26
|
+
this.width = setRangeValue(data.width);
|
|
26
27
|
}
|
|
27
28
|
if (data.radius !== undefined) {
|
|
28
|
-
this.radius = data.radius;
|
|
29
|
+
this.radius = setRangeValue(data.radius);
|
|
29
30
|
}
|
|
30
31
|
if (data.color !== undefined) {
|
|
31
32
|
this.color = OptionsColor.create(this.color, data.color);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
+
import type { RangeValue, RecursivePartial } from "../../../../Types";
|
|
1
2
|
import type { IOptionLoader } from "../../../Interfaces/IOptionLoader";
|
|
2
3
|
import type { IRepulse } from "../../../Interfaces/Particles/Repulse/IRepulse";
|
|
3
|
-
import type { RecursivePartial } from "../../../../Types";
|
|
4
4
|
import { ValueWithRandom } from "../../ValueWithRandom";
|
|
5
5
|
export declare class Repulse extends ValueWithRandom implements IRepulse, IOptionLoader<IRepulse> {
|
|
6
6
|
enabled: boolean;
|
|
7
|
-
distance:
|
|
8
|
-
duration:
|
|
9
|
-
factor:
|
|
10
|
-
speed:
|
|
7
|
+
distance: RangeValue;
|
|
8
|
+
duration: RangeValue;
|
|
9
|
+
factor: RangeValue;
|
|
10
|
+
speed: RangeValue;
|
|
11
11
|
constructor();
|
|
12
12
|
load(data?: RecursivePartial<IRepulse>): void;
|
|
13
13
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ValueWithRandom } from "../../ValueWithRandom";
|
|
2
|
+
import { setRangeValue } from "../../../../Utils";
|
|
2
3
|
export class Repulse extends ValueWithRandom {
|
|
3
4
|
constructor() {
|
|
4
5
|
super();
|
|
@@ -17,16 +18,16 @@ export class Repulse extends ValueWithRandom {
|
|
|
17
18
|
this.enabled = data.enabled;
|
|
18
19
|
}
|
|
19
20
|
if (data.distance !== undefined) {
|
|
20
|
-
this.distance = data.distance;
|
|
21
|
+
this.distance = setRangeValue(data.distance);
|
|
21
22
|
}
|
|
22
23
|
if (data.duration !== undefined) {
|
|
23
|
-
this.duration = data.duration;
|
|
24
|
+
this.duration = setRangeValue(data.duration);
|
|
24
25
|
}
|
|
25
26
|
if (data.factor !== undefined) {
|
|
26
|
-
this.factor = data.factor;
|
|
27
|
+
this.factor = setRangeValue(data.factor);
|
|
27
28
|
}
|
|
28
29
|
if (data.speed !== undefined) {
|
|
29
|
-
this.speed = data.speed;
|
|
30
|
+
this.speed = setRangeValue(data.speed);
|
|
30
31
|
}
|
|
31
32
|
}
|
|
32
33
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import type { RangeValue, RecursivePartial } from "../../../../Types";
|
|
1
2
|
import type { IOptionLoader } from "../../../Interfaces/IOptionLoader";
|
|
2
3
|
import type { IRollLight } from "../../../Interfaces/Particles/Roll/IRollLight";
|
|
3
|
-
import type { RecursivePartial } from "../../../../Types";
|
|
4
4
|
export declare class RollLight implements IRollLight, IOptionLoader<IRollLight> {
|
|
5
5
|
enable: boolean;
|
|
6
|
-
value:
|
|
6
|
+
value: RangeValue;
|
|
7
7
|
constructor();
|
|
8
8
|
load(data?: RecursivePartial<IRollLight>): void;
|
|
9
9
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { setRangeValue } from "../../../../Utils";
|
|
1
2
|
export class RollLight {
|
|
2
3
|
constructor() {
|
|
3
4
|
this.enable = false;
|
|
@@ -11,7 +12,7 @@ export class RollLight {
|
|
|
11
12
|
this.enable = data.enable;
|
|
12
13
|
}
|
|
13
14
|
if (data.value !== undefined) {
|
|
14
|
-
this.value = data.value;
|
|
15
|
+
this.value = setRangeValue(data.value);
|
|
15
16
|
}
|
|
16
17
|
}
|
|
17
18
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import type { RangeValue, RecursivePartial } from "../../../../Types";
|
|
1
2
|
import type { IOptionLoader } from "../../../Interfaces/IOptionLoader";
|
|
2
3
|
import type { IRotateAnimation } from "../../../Interfaces/Particles/Rotate/IRotateAnimation";
|
|
3
|
-
import type { RecursivePartial } from "../../../../Types";
|
|
4
4
|
export declare class RotateAnimation implements IRotateAnimation, IOptionLoader<IRotateAnimation> {
|
|
5
5
|
enable: boolean;
|
|
6
|
-
speed:
|
|
6
|
+
speed: RangeValue;
|
|
7
7
|
sync: boolean;
|
|
8
8
|
constructor();
|
|
9
9
|
load(data?: RecursivePartial<IRotateAnimation>): void;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { setRangeValue } from "../../../../Utils";
|
|
1
2
|
export class RotateAnimation {
|
|
2
3
|
constructor() {
|
|
3
4
|
this.enable = false;
|
|
@@ -12,7 +13,7 @@ export class RotateAnimation {
|
|
|
12
13
|
this.enable = data.enable;
|
|
13
14
|
}
|
|
14
15
|
if (data.speed !== undefined) {
|
|
15
|
-
this.speed = data.speed;
|
|
16
|
+
this.speed = setRangeValue(data.speed);
|
|
16
17
|
}
|
|
17
18
|
if (data.sync !== undefined) {
|
|
18
19
|
this.sync = data.sync;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import type { RangeValue, RecursivePartial } from "../../../../Types";
|
|
1
2
|
import type { IOptionLoader } from "../../../Interfaces/IOptionLoader";
|
|
2
3
|
import type { ITiltAnimation } from "../../../Interfaces/Particles/Tilt/ITiltAnimation";
|
|
3
|
-
import type { RecursivePartial } from "../../../../Types";
|
|
4
4
|
export declare class TiltAnimation implements ITiltAnimation, IOptionLoader<ITiltAnimation> {
|
|
5
5
|
enable: boolean;
|
|
6
|
-
speed:
|
|
6
|
+
speed: RangeValue;
|
|
7
7
|
sync: boolean;
|
|
8
8
|
constructor();
|
|
9
9
|
load(data?: RecursivePartial<ITiltAnimation>): void;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { setRangeValue } from "../../../../Utils";
|
|
1
2
|
export class TiltAnimation {
|
|
2
3
|
constructor() {
|
|
3
4
|
this.enable = false;
|
|
@@ -12,7 +13,7 @@ export class TiltAnimation {
|
|
|
12
13
|
this.enable = data.enable;
|
|
13
14
|
}
|
|
14
15
|
if (data.speed !== undefined) {
|
|
15
|
-
this.speed = data.speed;
|
|
16
|
+
this.speed = setRangeValue(data.speed);
|
|
16
17
|
}
|
|
17
18
|
if (data.sync !== undefined) {
|
|
18
19
|
this.sync = data.sync;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import type { RangeValue, RecursivePartial } from "../../../../Types";
|
|
1
2
|
import type { IOptionLoader } from "../../../Interfaces/IOptionLoader";
|
|
2
3
|
import type { ITwinkleValues } from "../../../Interfaces/Particles/Twinkle/ITwinkleValues";
|
|
3
4
|
import { OptionsColor } from "../../OptionsColor";
|
|
4
|
-
import type { RecursivePartial } from "../../../../Types";
|
|
5
5
|
export declare class TwinkleValues implements ITwinkleValues, IOptionLoader<ITwinkleValues> {
|
|
6
6
|
color?: OptionsColor;
|
|
7
7
|
enable: boolean;
|
|
8
8
|
frequency: number;
|
|
9
|
-
opacity:
|
|
9
|
+
opacity: RangeValue;
|
|
10
10
|
constructor();
|
|
11
11
|
load(data?: RecursivePartial<ITwinkleValues>): void;
|
|
12
12
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { OptionsColor } from "../../OptionsColor";
|
|
2
|
+
import { setRangeValue } from "../../../../Utils";
|
|
2
3
|
export class TwinkleValues {
|
|
3
4
|
constructor() {
|
|
4
5
|
this.enable = false;
|
|
@@ -19,7 +20,7 @@ export class TwinkleValues {
|
|
|
19
20
|
this.frequency = data.frequency;
|
|
20
21
|
}
|
|
21
22
|
if (data.opacity !== undefined) {
|
|
22
|
-
this.opacity = data.opacity;
|
|
23
|
+
this.opacity = setRangeValue(data.opacity);
|
|
23
24
|
}
|
|
24
25
|
}
|
|
25
26
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { ICoordinates } from "../../../../Core
|
|
1
|
+
import type { ICoordinates } from "../../../../Core";
|
|
2
|
+
import type { RangeValue } from "../../../../Types";
|
|
2
3
|
export interface IAttract {
|
|
3
|
-
distance:
|
|
4
|
+
distance: RangeValue;
|
|
4
5
|
enable: boolean;
|
|
5
6
|
rotateX: number;
|
|
6
7
|
rotateY: number;
|
|
@@ -2,11 +2,12 @@ import type { IAnimatable } from "../../IAnimatable";
|
|
|
2
2
|
import type { IAnimation } from "../../IAnimation";
|
|
3
3
|
import type { IColor } from "../../../../Core";
|
|
4
4
|
import type { IValueWithRandom } from "../../IValueWithRandom";
|
|
5
|
+
import type { RangeValue } from "../../../../Types";
|
|
5
6
|
export interface IOrbit extends IAnimatable<IAnimation> {
|
|
6
7
|
color?: string | IColor;
|
|
7
8
|
enable: boolean;
|
|
8
|
-
radius?:
|
|
9
|
+
radius?: RangeValue;
|
|
9
10
|
rotation: IValueWithRandom;
|
|
10
|
-
opacity:
|
|
11
|
-
width:
|
|
11
|
+
opacity: RangeValue;
|
|
12
|
+
width: RangeValue;
|
|
12
13
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { IValueWithRandom } from "../../IValueWithRandom";
|
|
2
|
+
import type { RangeValue } from "../../../../Types";
|
|
2
3
|
export interface IRepulse extends IValueWithRandom {
|
|
3
4
|
enabled: boolean;
|
|
4
|
-
distance:
|
|
5
|
-
duration:
|
|
6
|
-
factor:
|
|
7
|
-
speed:
|
|
5
|
+
distance: RangeValue;
|
|
6
|
+
duration: RangeValue;
|
|
7
|
+
factor: RangeValue;
|
|
8
|
+
speed: RangeValue;
|
|
8
9
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { IColor } from "../../../../Core
|
|
1
|
+
import type { IColor } from "../../../../Core";
|
|
2
|
+
import type { RangeValue } from "../../../../Types";
|
|
2
3
|
export interface ITwinkleValues {
|
|
3
4
|
color?: string | IColor;
|
|
4
5
|
enable: boolean;
|
|
5
6
|
frequency: number;
|
|
6
|
-
opacity:
|
|
7
|
+
opacity: RangeValue;
|
|
7
8
|
}
|
|
@@ -102,7 +102,7 @@ export class AbsorberInstance {
|
|
|
102
102
|
var _a, _b;
|
|
103
103
|
const container = this.container;
|
|
104
104
|
const percentPosition = this.options.position;
|
|
105
|
-
return Vector.create((((_a = percentPosition === null || percentPosition === void 0 ? void 0 : percentPosition.x) !== null && _a !== void 0 ? _a : Math.random() * 100) / 100) * container.canvas.size.width, (((_b = percentPosition === null || percentPosition === void 0 ? void 0 : percentPosition.y) !== null && _b !== void 0 ? _b : Math.random() * 100) / 100) * container.canvas.size.height);
|
|
105
|
+
return Vector.create((getRangeValue((_a = percentPosition === null || percentPosition === void 0 ? void 0 : percentPosition.x) !== null && _a !== void 0 ? _a : Math.random() * 100) / 100) * container.canvas.size.width, (getRangeValue((_b = percentPosition === null || percentPosition === void 0 ? void 0 : percentPosition.y) !== null && _b !== void 0 ? _b : Math.random() * 100) / 100) * container.canvas.size.height);
|
|
106
106
|
}
|
|
107
107
|
updateParticlePosition(particle, v) {
|
|
108
108
|
var _a;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AbsorberSize } from "./AbsorberSize";
|
|
2
2
|
import type { IAbsorber } from "../Interfaces/IAbsorber";
|
|
3
|
-
import type { ICoordinates } from "../../../../Core";
|
|
4
3
|
import type { IOptionLoader } from "../../../../Options/Interfaces/IOptionLoader";
|
|
4
|
+
import type { IRangedCoordinates } from "../../../../Core";
|
|
5
5
|
import { OptionsColor } from "../../../../Options/Classes/OptionsColor";
|
|
6
6
|
import type { RecursivePartial } from "../../../../Types";
|
|
7
7
|
export declare class Absorber implements IAbsorber, IOptionLoader<IAbsorber> {
|
|
@@ -9,7 +9,7 @@ export declare class Absorber implements IAbsorber, IOptionLoader<IAbsorber> {
|
|
|
9
9
|
draggable: boolean;
|
|
10
10
|
name?: string;
|
|
11
11
|
opacity: number;
|
|
12
|
-
position?: RecursivePartial<
|
|
12
|
+
position?: RecursivePartial<IRangedCoordinates>;
|
|
13
13
|
size: AbsorberSize;
|
|
14
14
|
destroy: boolean;
|
|
15
15
|
orbits: boolean;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AbsorberSize } from "./AbsorberSize";
|
|
2
2
|
import { OptionsColor } from "../../../../Options/Classes/OptionsColor";
|
|
3
|
+
import { setRangeValue } from "../../../../Utils";
|
|
3
4
|
export class Absorber {
|
|
4
5
|
constructor() {
|
|
5
6
|
this.color = new OptionsColor();
|
|
@@ -25,10 +26,13 @@ export class Absorber {
|
|
|
25
26
|
this.opacity = data.opacity;
|
|
26
27
|
}
|
|
27
28
|
if (data.position !== undefined) {
|
|
28
|
-
this.position = {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
29
|
+
this.position = {};
|
|
30
|
+
if (data.position.x !== undefined) {
|
|
31
|
+
this.position.x = setRangeValue(data.position.x);
|
|
32
|
+
}
|
|
33
|
+
if (data.position.y !== undefined) {
|
|
34
|
+
this.position.y = setRangeValue(data.position.y);
|
|
35
|
+
}
|
|
32
36
|
}
|
|
33
37
|
if (data.size !== undefined) {
|
|
34
38
|
this.size.load(data.size);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { IColor,
|
|
1
|
+
import type { IColor, IRangedCoordinates } from "../../../../Core";
|
|
2
2
|
import type { IAbsorberSize } from "./IAbsorberSize";
|
|
3
3
|
import { RecursivePartial } from "../../../../Types";
|
|
4
4
|
export interface IAbsorber {
|
|
5
5
|
color: IColor | string;
|
|
6
6
|
name?: string;
|
|
7
7
|
opacity: number;
|
|
8
|
-
position?: RecursivePartial<
|
|
8
|
+
position?: RecursivePartial<IRangedCoordinates>;
|
|
9
9
|
size: IAbsorberSize;
|
|
10
10
|
draggable: boolean;
|
|
11
11
|
destroy: boolean;
|
|
@@ -208,8 +208,8 @@ export class EmitterInstance {
|
|
|
208
208
|
const container = this.container;
|
|
209
209
|
const percentPosition = this.options.position;
|
|
210
210
|
return {
|
|
211
|
-
x: (((_a = percentPosition === null || percentPosition === void 0 ? void 0 : percentPosition.x) !== null && _a !== void 0 ? _a : Math.random() * 100) / 100) * container.canvas.size.width,
|
|
212
|
-
y: (((_b = percentPosition === null || percentPosition === void 0 ? void 0 : percentPosition.y) !== null && _b !== void 0 ? _b : Math.random() * 100) / 100) * container.canvas.size.height,
|
|
211
|
+
x: (getRangeValue((_a = percentPosition === null || percentPosition === void 0 ? void 0 : percentPosition.x) !== null && _a !== void 0 ? _a : Math.random() * 100) / 100) * container.canvas.size.width,
|
|
212
|
+
y: (getRangeValue((_b = percentPosition === null || percentPosition === void 0 ? void 0 : percentPosition.y) !== null && _b !== void 0 ? _b : Math.random() * 100) / 100) * container.canvas.size.height,
|
|
213
213
|
};
|
|
214
214
|
}
|
|
215
215
|
emit() {
|
|
@@ -258,7 +258,7 @@ export class EmitterInstance {
|
|
|
258
258
|
const colorOffset = randomInRange(animation.offset);
|
|
259
259
|
const delay = getRangeValue(this.options.rate.delay);
|
|
260
260
|
const emitFactor = (1000 * delay) / container.retina.reduceFactor;
|
|
261
|
-
const colorSpeed = (_a = animation.speed) !== null && _a !== void 0 ? _a : 0;
|
|
261
|
+
const colorSpeed = getRangeValue((_a = animation.speed) !== null && _a !== void 0 ? _a : 0);
|
|
262
262
|
return (initValue + (colorSpeed * container.fpsLimit) / emitFactor + colorOffset * 3.6) % maxValue;
|
|
263
263
|
}
|
|
264
264
|
}
|
|
@@ -4,10 +4,10 @@ import { EmitterLife } from "./EmitterLife";
|
|
|
4
4
|
import { EmitterRate } from "./EmitterRate";
|
|
5
5
|
import { EmitterShapeType } from "../../Enums";
|
|
6
6
|
import { EmitterSize } from "./EmitterSize";
|
|
7
|
-
import type { ICoordinates } from "../../../../Core";
|
|
8
7
|
import type { IEmitter } from "../Interfaces/IEmitter";
|
|
9
8
|
import type { IOptionLoader } from "../../../../Options/Interfaces/IOptionLoader";
|
|
10
9
|
import type { IParticles } from "../../../../Options/Interfaces/Particles/IParticles";
|
|
10
|
+
import type { IRangedCoordinates } from "../../../../Core";
|
|
11
11
|
import type { RecursivePartial } from "../../../../Types";
|
|
12
12
|
export declare class Emitter implements IEmitter, IOptionLoader<IEmitter> {
|
|
13
13
|
autoPlay: boolean;
|
|
@@ -18,7 +18,7 @@ export declare class Emitter implements IEmitter, IOptionLoader<IEmitter> {
|
|
|
18
18
|
life: EmitterLife;
|
|
19
19
|
name?: string;
|
|
20
20
|
particles?: RecursivePartial<IParticles>;
|
|
21
|
-
position?: RecursivePartial<
|
|
21
|
+
position?: RecursivePartial<IRangedCoordinates>;
|
|
22
22
|
rate: EmitterRate;
|
|
23
23
|
shape: EmitterShapeType | keyof typeof EmitterShapeType;
|
|
24
24
|
spawnColor?: AnimatableColor;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { deepExtend, setRangeValue } from "../../../../Utils";
|
|
1
2
|
import { AnimatableColor } from "../../../../Options/Classes/AnimatableColor";
|
|
2
3
|
import { EmitterLife } from "./EmitterLife";
|
|
3
4
|
import { EmitterRate } from "./EmitterRate";
|
|
4
5
|
import { EmitterSize } from "./EmitterSize";
|
|
5
|
-
import { deepExtend } from "../../../../Utils";
|
|
6
6
|
export class Emitter {
|
|
7
7
|
constructor() {
|
|
8
8
|
this.autoPlay = true;
|
|
@@ -42,10 +42,13 @@ export class Emitter {
|
|
|
42
42
|
this.shape = data.shape;
|
|
43
43
|
}
|
|
44
44
|
if (data.position !== undefined) {
|
|
45
|
-
this.position = {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
45
|
+
this.position = {};
|
|
46
|
+
if (data.position.x !== undefined) {
|
|
47
|
+
this.position.x = setRangeValue(data.position.x);
|
|
48
|
+
}
|
|
49
|
+
if (data.position.y !== undefined) {
|
|
50
|
+
this.position.y = setRangeValue(data.position.y);
|
|
51
|
+
}
|
|
49
52
|
}
|
|
50
53
|
if (data.spawnColor !== undefined) {
|
|
51
54
|
if (this.spawnColor === undefined) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { MoveDirection, MoveDirectionAlt } from "../../../../Enums";
|
|
2
2
|
import type { EmitterShapeType } from "../../Enums";
|
|
3
3
|
import type { IAnimatableColor } from "../../../../Options/Interfaces/IAnimatableColor";
|
|
4
|
-
import type { ICoordinates } from "../../../../Core";
|
|
5
4
|
import type { IEmitterLife } from "./IEmitterLife";
|
|
6
5
|
import type { IEmitterRate } from "./IEmitterRate";
|
|
7
6
|
import type { IEmitterSize } from "./IEmitterSize";
|
|
8
7
|
import type { IParticles } from "../../../../Options/Interfaces/Particles/IParticles";
|
|
8
|
+
import type { IRangedCoordinates } from "../../../../Core";
|
|
9
9
|
import type { RecursivePartial } from "../../../../Types";
|
|
10
10
|
export interface IEmitter {
|
|
11
11
|
autoPlay: boolean;
|
|
@@ -16,7 +16,7 @@ export interface IEmitter {
|
|
|
16
16
|
life: IEmitterLife;
|
|
17
17
|
name?: string;
|
|
18
18
|
particles?: RecursivePartial<IParticles>;
|
|
19
|
-
position?: RecursivePartial<
|
|
19
|
+
position?: RecursivePartial<IRangedCoordinates>;
|
|
20
20
|
rate: IEmitterRate;
|
|
21
21
|
shape: EmitterShapeType | keyof typeof EmitterShapeType;
|
|
22
22
|
spawnColor?: IAnimatableColor;
|
|
@@ -54,7 +54,8 @@ export class AngleUpdater {
|
|
|
54
54
|
}
|
|
55
55
|
const rotateAnimation = particle.options.rotate.animation;
|
|
56
56
|
if (rotateAnimation.enable) {
|
|
57
|
-
particle.rotate.velocity =
|
|
57
|
+
particle.rotate.velocity =
|
|
58
|
+
(getRangeValue(rotateAnimation.speed) / 360) * this.container.retina.reduceFactor;
|
|
58
59
|
if (!rotateAnimation.sync) {
|
|
59
60
|
particle.rotate.velocity *= Math.random();
|
|
60
61
|
}
|
|
@@ -68,7 +68,7 @@ export class OpacityUpdater {
|
|
|
68
68
|
min: getRangeMin(opacityOptions.value),
|
|
69
69
|
value: getRangeValue(opacityOptions.value),
|
|
70
70
|
loops: 0,
|
|
71
|
-
maxLoops: opacityOptions.animation.count,
|
|
71
|
+
maxLoops: getRangeValue(opacityOptions.animation.count),
|
|
72
72
|
};
|
|
73
73
|
const opacityAnimation = opacityOptions.animation;
|
|
74
74
|
if (opacityAnimation.enable) {
|
|
@@ -92,7 +92,8 @@ export class OpacityUpdater {
|
|
|
92
92
|
particle.opacity.status = 1;
|
|
93
93
|
break;
|
|
94
94
|
}
|
|
95
|
-
particle.opacity.velocity =
|
|
95
|
+
particle.opacity.velocity =
|
|
96
|
+
(getRangeValue(opacityAnimation.speed) / 100) * this.container.retina.reduceFactor;
|
|
96
97
|
if (!opacityAnimation.sync) {
|
|
97
98
|
particle.opacity.velocity *= Math.random();
|
|
98
99
|
}
|
|
@@ -26,19 +26,19 @@ export class RollUpdater {
|
|
|
26
26
|
const alterType = Math.random() >= 0.5 ? "darken" : "enlighten";
|
|
27
27
|
particle.roll.alter = {
|
|
28
28
|
type: alterType,
|
|
29
|
-
value: alterType === "darken" ? rollOpt.darken.value : rollOpt.enlighten.value,
|
|
29
|
+
value: getRangeValue(alterType === "darken" ? rollOpt.darken.value : rollOpt.enlighten.value),
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
32
|
else if (rollOpt.darken.enable) {
|
|
33
33
|
particle.roll.alter = {
|
|
34
34
|
type: "darken",
|
|
35
|
-
value: rollOpt.darken.value,
|
|
35
|
+
value: getRangeValue(rollOpt.darken.value),
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
38
|
else if (rollOpt.enlighten.enable) {
|
|
39
39
|
particle.roll.alter = {
|
|
40
40
|
type: "enlighten",
|
|
41
|
-
value: rollOpt.enlighten.value,
|
|
41
|
+
value: getRangeValue(rollOpt.enlighten.value),
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
44
|
}
|
|
@@ -55,7 +55,7 @@ export class TiltUpdater {
|
|
|
55
55
|
}
|
|
56
56
|
const tiltAnimation = particle.options.tilt.animation;
|
|
57
57
|
if (tiltAnimation.enable) {
|
|
58
|
-
particle.tilt.velocity = (tiltAnimation.speed / 360) * this.container.retina.reduceFactor;
|
|
58
|
+
particle.tilt.velocity = (getRangeValue(tiltAnimation.speed) / 360) * this.container.retina.reduceFactor;
|
|
59
59
|
if (!tiltAnimation.sync) {
|
|
60
60
|
particle.tilt.velocity *= Math.random();
|
|
61
61
|
}
|
package/esm/Utils/ColorUtils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { mix, randomInRange, setRangeValue } from "./NumberUtils";
|
|
1
|
+
import { getRangeValue, mix, randomInRange, setRangeValue } from "./NumberUtils";
|
|
2
2
|
import { Constants } from "../Core";
|
|
3
3
|
import { itemFromArray } from "./Utils";
|
|
4
4
|
function hue2rgb(p, q, t) {
|
|
@@ -433,7 +433,7 @@ export function getHslAnimationFromHsl(hsl, animationOptions, reduceFactor) {
|
|
|
433
433
|
function setColorAnimation(colorValue, colorAnimation, reduceFactor) {
|
|
434
434
|
colorValue.enable = colorAnimation.enable;
|
|
435
435
|
if (colorValue.enable) {
|
|
436
|
-
colorValue.velocity = (colorAnimation.speed / 100) * reduceFactor;
|
|
436
|
+
colorValue.velocity = (getRangeValue(colorAnimation.speed) / 100) * reduceFactor;
|
|
437
437
|
if (colorAnimation.sync) {
|
|
438
438
|
return;
|
|
439
439
|
}
|