tsparticles 1.41.4 → 1.42.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/Core/Canvas.js +4 -5
- 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 +3 -1
- package/Core/Particle.js +9 -7
- package/Core/Particles.js +2 -1
- 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 +11 -10
- 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.js +5 -6
- 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 +3 -1
- package/browser/Core/Particle.js +9 -7
- package/browser/Core/Particles.js +2 -1
- 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 +11 -10
- 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.js +5 -6
- 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 +3 -1
- package/esm/Core/Particle.js +9 -7
- package/esm/Core/Particles.js +2 -1
- 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 +11 -10
- 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 +1 -1
- package/report.html +2 -2
- package/report.slim.html +2 -2
- package/scripts/install.js +11 -2
- package/tsparticles.engine.js +47 -47
- package/tsparticles.engine.min.js +2 -2
- package/tsparticles.interaction.external.attract.js +319 -36
- package/tsparticles.interaction.external.attract.min.js +1 -1
- package/tsparticles.interaction.external.bounce.js +319 -36
- package/tsparticles.interaction.external.bounce.min.js +1 -1
- package/tsparticles.interaction.external.bubble.js +319 -36
- package/tsparticles.interaction.external.bubble.min.js +1 -1
- package/tsparticles.interaction.external.connect.js +319 -36
- package/tsparticles.interaction.external.connect.min.js +1 -1
- package/tsparticles.interaction.external.grab.js +319 -36
- package/tsparticles.interaction.external.grab.min.js +1 -1
- package/tsparticles.interaction.external.repulse.js +319 -36
- package/tsparticles.interaction.external.repulse.min.js +1 -1
- package/tsparticles.interaction.external.trail.js +319 -36
- package/tsparticles.interaction.external.trail.min.js +1 -1
- package/tsparticles.interaction.particles.attract.js +319 -36
- package/tsparticles.interaction.particles.attract.min.js +1 -1
- package/tsparticles.interaction.particles.collisions.js +319 -36
- package/tsparticles.interaction.particles.collisions.min.js +1 -1
- package/tsparticles.interaction.particles.links.js +320 -37
- package/tsparticles.interaction.particles.links.min.js +2 -2
- package/tsparticles.js +81 -74
- package/tsparticles.min.js +2 -2
- package/tsparticles.pathseg.min.js +1 -1
- package/tsparticles.plugins.absorbers.js +327 -41
- package/tsparticles.plugins.absorbers.min.js +2 -2
- package/tsparticles.plugins.emitters.js +438 -151
- package/tsparticles.plugins.emitters.min.js +2 -2
- package/tsparticles.plugins.polygonMask.js +319 -36
- package/tsparticles.plugins.polygonMask.min.js +1 -1
- package/tsparticles.shape.circle.min.js +1 -1
- package/tsparticles.shape.image.js +319 -36
- 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 +319 -36
- package/tsparticles.shape.text.min.js +1 -1
- package/tsparticles.slim.js +51 -51
- package/tsparticles.slim.min.js +2 -2
- package/tsparticles.updater.angle.js +320 -37
- package/tsparticles.updater.angle.min.js +2 -2
- package/tsparticles.updater.color.js +319 -36
- package/tsparticles.updater.color.min.js +2 -2
- package/tsparticles.updater.life.js +319 -36
- package/tsparticles.updater.life.min.js +1 -1
- package/tsparticles.updater.opacity.js +321 -38
- package/tsparticles.updater.opacity.min.js +2 -2
- package/tsparticles.updater.outModes.js +319 -36
- package/tsparticles.updater.outModes.min.js +1 -1
- package/tsparticles.updater.roll.js +322 -39
- package/tsparticles.updater.roll.min.js +2 -2
- package/tsparticles.updater.size.js +319 -36
- package/tsparticles.updater.size.min.js +1 -1
- package/tsparticles.updater.strokeColor.js +319 -36
- package/tsparticles.updater.strokeColor.min.js +2 -2
- package/tsparticles.updater.tilt.js +320 -37
- package/tsparticles.updater.tilt.min.js +2 -2
- package/tsparticles.updater.wobble.js +319 -36
- package/tsparticles.updater.wobble.min.js +1 -1
- package/umd/Core/Canvas.js +4 -5
- 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 +3 -1
- package/umd/Core/Particle.js +9 -7
- package/umd/Core/Particles.js +2 -1
- 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 +11 -10
- 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
package/browser/Core/Retina.js
CHANGED
|
@@ -49,13 +49,13 @@ export class Retina {
|
|
|
49
49
|
container.canvas.size.height = element.offsetHeight * ratio;
|
|
50
50
|
}
|
|
51
51
|
const particles = options.particles;
|
|
52
|
-
this.attractDistance = particles.move.attract.distance * ratio;
|
|
52
|
+
this.attractDistance = getRangeValue(particles.move.attract.distance) * ratio;
|
|
53
53
|
this.linksDistance = particles.links.distance * ratio;
|
|
54
54
|
this.linksWidth = particles.links.width * ratio;
|
|
55
|
-
this.sizeAnimationSpeed = particles.size.animation.speed * ratio;
|
|
56
|
-
this.maxSpeed = particles.move.gravity.maxSpeed * ratio;
|
|
55
|
+
this.sizeAnimationSpeed = getRangeValue(particles.size.animation.speed) * ratio;
|
|
56
|
+
this.maxSpeed = getRangeValue(particles.move.gravity.maxSpeed) * ratio;
|
|
57
57
|
if (particles.orbit.radius !== undefined) {
|
|
58
|
-
this.orbitRadius = particles.orbit.radius * this.container.retina.pixelRatio;
|
|
58
|
+
this.orbitRadius = getRangeValue(particles.orbit.radius) * this.container.retina.pixelRatio;
|
|
59
59
|
}
|
|
60
60
|
const modes = options.interactivity.modes;
|
|
61
61
|
this.connectModeDistance = modes.connect.distance * ratio;
|
|
@@ -75,19 +75,19 @@ export class Retina {
|
|
|
75
75
|
const ratio = this.pixelRatio;
|
|
76
76
|
const moveDistance = options.move.distance;
|
|
77
77
|
const props = particle.retina;
|
|
78
|
-
props.attractDistance = options.move.attract.distance * ratio;
|
|
78
|
+
props.attractDistance = getRangeValue(options.move.attract.distance) * ratio;
|
|
79
79
|
props.linksDistance = options.links.distance * ratio;
|
|
80
80
|
props.linksWidth = options.links.width * ratio;
|
|
81
81
|
props.moveDrift = getRangeValue(options.move.drift) * ratio;
|
|
82
82
|
props.moveSpeed = getRangeValue(options.move.speed) * ratio;
|
|
83
|
-
props.sizeAnimationSpeed = options.size.animation.speed * ratio;
|
|
83
|
+
props.sizeAnimationSpeed = getRangeValue(options.size.animation.speed) * ratio;
|
|
84
84
|
if (particle.spin) {
|
|
85
85
|
props.spinAcceleration = getRangeValue(options.move.spin.acceleration) * ratio;
|
|
86
86
|
}
|
|
87
87
|
const maxDistance = props.maxDistance;
|
|
88
88
|
maxDistance.horizontal = moveDistance.horizontal !== undefined ? moveDistance.horizontal * ratio : undefined;
|
|
89
89
|
maxDistance.vertical = moveDistance.vertical !== undefined ? moveDistance.vertical * ratio : undefined;
|
|
90
|
-
props.maxSpeed = options.move.gravity.maxSpeed * ratio;
|
|
90
|
+
props.maxSpeed = getRangeValue(options.move.gravity.maxSpeed) * ratio;
|
|
91
91
|
}
|
|
92
92
|
handleMotionChange(mediaQuery) {
|
|
93
93
|
const options = this.container.actualOptions;
|
|
@@ -56,7 +56,7 @@ export class ParticlesMover {
|
|
|
56
56
|
const container = this.container, slowFactor = this.getProximitySpeedFactor(particle), baseSpeed = ((_a = (_d = particle.retina).moveSpeed) !== null && _a !== void 0 ? _a : (_d.moveSpeed = getRangeValue(moveOptions.speed) * container.retina.pixelRatio)) *
|
|
57
57
|
container.retina.reduceFactor, moveDrift = ((_b = (_e = particle.retina).moveDrift) !== null && _b !== void 0 ? _b : (_e.moveDrift = getRangeValue(particle.options.move.drift) * container.retina.pixelRatio)), maxSize = getRangeMax(particleOptions.size.value) * container.retina.pixelRatio, sizeFactor = moveOptions.size ? particle.getRadius() / maxSize : 1, diffFactor = 2, speedFactor = (sizeFactor * slowFactor * (delta.factor || 1)) / diffFactor, moveSpeed = baseSpeed * speedFactor;
|
|
58
58
|
this.applyPath(particle, delta);
|
|
59
|
-
const gravityOptions =
|
|
59
|
+
const gravityOptions = particle.gravity;
|
|
60
60
|
const gravityFactor = gravityOptions.enable && gravityOptions.inverse ? -1 : 1;
|
|
61
61
|
if (gravityOptions.enable && moveSpeed) {
|
|
62
62
|
particle.velocity.y += (gravityFactor * (gravityOptions.acceleration * delta.factor)) / (60 * moveSpeed);
|
|
@@ -71,7 +71,7 @@ export class ParticlesMover {
|
|
|
71
71
|
const velocity = particle.velocity.mult(moveSpeed);
|
|
72
72
|
const maxSpeed = (_c = particle.retina.maxSpeed) !== null && _c !== void 0 ? _c : container.retina.maxSpeed;
|
|
73
73
|
if (gravityOptions.enable &&
|
|
74
|
-
|
|
74
|
+
maxSpeed > 0 &&
|
|
75
75
|
((!gravityOptions.inverse && velocity.y >= 0 && velocity.y >= maxSpeed) ||
|
|
76
76
|
(gravityOptions.inverse && velocity.y <= 0 && velocity.y <= -maxSpeed))) {
|
|
77
77
|
velocity.y = gravityFactor * maxSpeed;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { colorToRgb, drawLinkLine, drawLinkTriangle, getDistance, getLinkColor } from "../../../Utils";
|
|
1
|
+
import { colorToRgb, drawLinkLine, drawLinkTriangle, getDistance, getLinkColor, getRangeValue } from "../../../Utils";
|
|
2
2
|
export class LinkInstance {
|
|
3
3
|
constructor(container) {
|
|
4
4
|
this.container = container;
|
|
@@ -107,7 +107,7 @@ export class LinkInstance {
|
|
|
107
107
|
const twinkling = Math.random() < twinkleFreq;
|
|
108
108
|
if (twinkling && twinkleRgb !== undefined) {
|
|
109
109
|
colorLine = twinkleRgb;
|
|
110
|
-
opacity = twinkle.opacity;
|
|
110
|
+
opacity = getRangeValue(twinkle.opacity);
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
if (!colorLine) {
|
|
@@ -35,17 +35,17 @@ export declare class AnimatableGradientColor implements IAnimatableGradientColor
|
|
|
35
35
|
load(data?: RecursivePartial<IAnimatableGradientColor>): void;
|
|
36
36
|
}
|
|
37
37
|
export declare class GradientAngleAnimation implements IAnimation, IOptionLoader<IAnimation> {
|
|
38
|
-
count:
|
|
38
|
+
count: RangeValue;
|
|
39
39
|
enable: boolean;
|
|
40
|
-
speed:
|
|
40
|
+
speed: RangeValue;
|
|
41
41
|
sync: boolean;
|
|
42
42
|
constructor();
|
|
43
43
|
load(data?: RecursivePartial<IAnimation>): void;
|
|
44
44
|
}
|
|
45
45
|
export declare class GradientColorOpacityAnimation implements IGradientColorOpacityAnimation, IOptionLoader<IGradientColorOpacityAnimation> {
|
|
46
|
-
count:
|
|
46
|
+
count: RangeValue;
|
|
47
47
|
enable: boolean;
|
|
48
|
-
speed:
|
|
48
|
+
speed: RangeValue;
|
|
49
49
|
sync: boolean;
|
|
50
50
|
startValue: StartValueType | keyof typeof StartValueType;
|
|
51
51
|
constructor();
|
|
@@ -93,13 +93,13 @@ export class GradientAngleAnimation {
|
|
|
93
93
|
return;
|
|
94
94
|
}
|
|
95
95
|
if (data.count !== undefined) {
|
|
96
|
-
this.count = data.count;
|
|
96
|
+
this.count = setRangeValue(data.count);
|
|
97
97
|
}
|
|
98
98
|
if (data.enable !== undefined) {
|
|
99
99
|
this.enable = data.enable;
|
|
100
100
|
}
|
|
101
101
|
if (data.speed !== undefined) {
|
|
102
|
-
this.speed = data.speed;
|
|
102
|
+
this.speed = setRangeValue(data.speed);
|
|
103
103
|
}
|
|
104
104
|
if (data.sync !== undefined) {
|
|
105
105
|
this.sync = data.sync;
|
|
@@ -119,13 +119,13 @@ export class GradientColorOpacityAnimation {
|
|
|
119
119
|
return;
|
|
120
120
|
}
|
|
121
121
|
if (data.count !== undefined) {
|
|
122
|
-
this.count = data.count;
|
|
122
|
+
this.count = setRangeValue(data.count);
|
|
123
123
|
}
|
|
124
124
|
if (data.enable !== undefined) {
|
|
125
125
|
this.enable = data.enable;
|
|
126
126
|
}
|
|
127
127
|
if (data.speed !== undefined) {
|
|
128
|
-
this.speed = data.speed;
|
|
128
|
+
this.speed = setRangeValue(data.speed);
|
|
129
129
|
}
|
|
130
130
|
if (data.sync !== undefined) {
|
|
131
131
|
this.sync = data.sync;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import type { RangeValue, RecursivePartial } from "../../Types";
|
|
2
|
+
import type { IAnimation } from "../Interfaces/IAnimation";
|
|
3
|
+
import type { IOptionLoader } from "../Interfaces/IOptionLoader";
|
|
4
4
|
export declare class AnimationOptions implements IAnimation, IOptionLoader<IAnimation> {
|
|
5
|
-
count:
|
|
5
|
+
count: RangeValue;
|
|
6
6
|
enable: boolean;
|
|
7
|
-
speed:
|
|
7
|
+
speed: RangeValue;
|
|
8
8
|
sync: boolean;
|
|
9
9
|
constructor();
|
|
10
10
|
load(data?: RecursivePartial<IAnimation>): void;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { setRangeValue } from "../../Utils";
|
|
1
2
|
export class AnimationOptions {
|
|
2
3
|
constructor() {
|
|
3
4
|
this.count = 0;
|
|
@@ -10,13 +11,13 @@ export class AnimationOptions {
|
|
|
10
11
|
return;
|
|
11
12
|
}
|
|
12
13
|
if (data.count !== undefined) {
|
|
13
|
-
this.count = data.count;
|
|
14
|
+
this.count = setRangeValue(data.count);
|
|
14
15
|
}
|
|
15
16
|
if (data.enable !== undefined) {
|
|
16
17
|
this.enable = data.enable;
|
|
17
18
|
}
|
|
18
19
|
if (data.speed !== undefined) {
|
|
19
|
-
this.speed = data.speed;
|
|
20
|
+
this.speed = setRangeValue(data.speed);
|
|
20
21
|
}
|
|
21
22
|
if (data.sync !== undefined) {
|
|
22
23
|
this.sync = data.sync;
|
|
@@ -5,10 +5,10 @@ import type { IOptionLoader } from "../Interfaces/IOptionLoader";
|
|
|
5
5
|
* @category Options
|
|
6
6
|
*/
|
|
7
7
|
export declare class ColorAnimation implements IColorAnimation, IOptionLoader<IColorAnimation> {
|
|
8
|
-
count:
|
|
8
|
+
count: RangeValue;
|
|
9
9
|
enable: boolean;
|
|
10
10
|
offset: RangeValue;
|
|
11
|
-
speed:
|
|
11
|
+
speed: RangeValue;
|
|
12
12
|
sync: boolean;
|
|
13
13
|
constructor();
|
|
14
14
|
load(data?: RecursivePartial<IColorAnimation>): void;
|
|
@@ -15,7 +15,7 @@ export class ColorAnimation {
|
|
|
15
15
|
return;
|
|
16
16
|
}
|
|
17
17
|
if (data.count !== undefined) {
|
|
18
|
-
this.count = data.count;
|
|
18
|
+
this.count = setRangeValue(data.count);
|
|
19
19
|
}
|
|
20
20
|
if (data.enable !== undefined) {
|
|
21
21
|
this.enable = data.enable;
|
|
@@ -24,7 +24,7 @@ export class ColorAnimation {
|
|
|
24
24
|
this.offset = setRangeValue(data.offset);
|
|
25
25
|
}
|
|
26
26
|
if (data.speed !== undefined) {
|
|
27
|
-
this.speed = data.speed;
|
|
27
|
+
this.speed = setRangeValue(data.speed);
|
|
28
28
|
}
|
|
29
29
|
if (data.sync !== undefined) {
|
|
30
30
|
this.sync = data.sync;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import type { RangeValue, RecursivePartial } from "../../../../Types";
|
|
1
2
|
import type { IAttract } from "../../../Interfaces/Particles/Move/IAttract";
|
|
2
3
|
import type { ICoordinates } from "../../../../Core";
|
|
3
4
|
import type { IOptionLoader } from "../../../Interfaces/IOptionLoader";
|
|
4
|
-
import type { RecursivePartial } from "../../../../Types";
|
|
5
5
|
/**
|
|
6
6
|
* @category Options
|
|
7
7
|
*/
|
|
@@ -28,7 +28,7 @@ export declare class Attract implements IAttract, IOptionLoader<IAttract> {
|
|
|
28
28
|
* @param value
|
|
29
29
|
*/
|
|
30
30
|
set rotateY(value: number);
|
|
31
|
-
distance:
|
|
31
|
+
distance: RangeValue;
|
|
32
32
|
enable: boolean;
|
|
33
33
|
rotate: ICoordinates;
|
|
34
34
|
constructor();
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { setRangeValue } from "../../../../Utils";
|
|
1
2
|
/**
|
|
2
3
|
* @category Options
|
|
3
4
|
*/
|
|
@@ -46,7 +47,7 @@ export class Attract {
|
|
|
46
47
|
return;
|
|
47
48
|
}
|
|
48
49
|
if (data.distance !== undefined) {
|
|
49
|
-
this.distance = data.distance;
|
|
50
|
+
this.distance = setRangeValue(data.distance);
|
|
50
51
|
}
|
|
51
52
|
if (data.enable !== undefined) {
|
|
52
53
|
this.enable = data.enable;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import type { RangeValue, RecursivePartial } from "../../../../Types";
|
|
1
2
|
import type { IMoveAngle } from "../../../Interfaces/Particles/Move/IMoveAngle";
|
|
2
3
|
import type { IOptionLoader } from "../../../Interfaces/IOptionLoader";
|
|
3
|
-
import type { RecursivePartial } from "../../../../Types";
|
|
4
4
|
/**
|
|
5
5
|
* @category Options
|
|
6
6
|
*/
|
|
7
7
|
export declare class MoveAngle implements IMoveAngle, IOptionLoader<IMoveAngle> {
|
|
8
|
-
offset:
|
|
9
|
-
value:
|
|
8
|
+
offset: RangeValue;
|
|
9
|
+
value: RangeValue;
|
|
10
10
|
constructor();
|
|
11
11
|
load(data?: RecursivePartial<IMoveAngle>): void;
|
|
12
12
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { setRangeValue } from "../../../../Utils";
|
|
1
2
|
/**
|
|
2
3
|
* @category Options
|
|
3
4
|
*/
|
|
@@ -11,10 +12,10 @@ export class MoveAngle {
|
|
|
11
12
|
return;
|
|
12
13
|
}
|
|
13
14
|
if (data.offset !== undefined) {
|
|
14
|
-
this.offset = data.offset;
|
|
15
|
+
this.offset = setRangeValue(data.offset);
|
|
15
16
|
}
|
|
16
17
|
if (data.value !== undefined) {
|
|
17
|
-
this.value = data.value;
|
|
18
|
+
this.value = setRangeValue(data.value);
|
|
18
19
|
}
|
|
19
20
|
}
|
|
20
21
|
}
|
|
@@ -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,10 +1,10 @@
|
|
|
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
|
/**
|
|
9
9
|
* [[include:Options/Particles/Orbit.md]]
|
|
10
10
|
* @category Options
|
|
@@ -12,10 +12,10 @@ import type { RecursivePartial } from "../../../../Types";
|
|
|
12
12
|
export declare class Orbit implements IOrbit, IOptionLoader<IOrbit>, IAnimatable<AnimationOptions> {
|
|
13
13
|
animation: AnimationOptions;
|
|
14
14
|
enable: boolean;
|
|
15
|
-
opacity:
|
|
16
|
-
width:
|
|
15
|
+
opacity: RangeValue;
|
|
16
|
+
width: RangeValue;
|
|
17
17
|
color?: OptionsColor;
|
|
18
|
-
radius?:
|
|
18
|
+
radius?: RangeValue;
|
|
19
19
|
rotation: OrbitRotation;
|
|
20
20
|
constructor();
|
|
21
21
|
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
|
/**
|
|
5
6
|
* [[include:Options/Particles/Orbit.md]]
|
|
6
7
|
* @category Options
|
|
@@ -23,13 +24,13 @@ export class Orbit {
|
|
|
23
24
|
this.enable = data.enable;
|
|
24
25
|
}
|
|
25
26
|
if (data.opacity !== undefined) {
|
|
26
|
-
this.opacity = data.opacity;
|
|
27
|
+
this.opacity = setRangeValue(data.opacity);
|
|
27
28
|
}
|
|
28
29
|
if (data.width !== undefined) {
|
|
29
|
-
this.width = data.width;
|
|
30
|
+
this.width = setRangeValue(data.width);
|
|
30
31
|
}
|
|
31
32
|
if (data.radius !== undefined) {
|
|
32
|
-
this.radius = data.radius;
|
|
33
|
+
this.radius = setRangeValue(data.radius);
|
|
33
34
|
}
|
|
34
35
|
if (data.color !== undefined) {
|
|
35
36
|
this.color = OptionsColor.create(this.color, data.color);
|
|
@@ -1,16 +1,16 @@
|
|
|
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
|
/**
|
|
6
6
|
* @category Options
|
|
7
7
|
*/
|
|
8
8
|
export declare class Repulse extends ValueWithRandom implements IRepulse, IOptionLoader<IRepulse> {
|
|
9
9
|
enabled: boolean;
|
|
10
|
-
distance:
|
|
11
|
-
duration:
|
|
12
|
-
factor:
|
|
13
|
-
speed:
|
|
10
|
+
distance: RangeValue;
|
|
11
|
+
duration: RangeValue;
|
|
12
|
+
factor: RangeValue;
|
|
13
|
+
speed: RangeValue;
|
|
14
14
|
constructor();
|
|
15
15
|
load(data?: RecursivePartial<IRepulse>): void;
|
|
16
16
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ValueWithRandom } from "../../ValueWithRandom";
|
|
2
|
+
import { setRangeValue } from "../../../../Utils";
|
|
2
3
|
/**
|
|
3
4
|
* @category Options
|
|
4
5
|
*/
|
|
@@ -20,16 +21,16 @@ export class Repulse extends ValueWithRandom {
|
|
|
20
21
|
this.enabled = data.enabled;
|
|
21
22
|
}
|
|
22
23
|
if (data.distance !== undefined) {
|
|
23
|
-
this.distance = data.distance;
|
|
24
|
+
this.distance = setRangeValue(data.distance);
|
|
24
25
|
}
|
|
25
26
|
if (data.duration !== undefined) {
|
|
26
|
-
this.duration = data.duration;
|
|
27
|
+
this.duration = setRangeValue(data.duration);
|
|
27
28
|
}
|
|
28
29
|
if (data.factor !== undefined) {
|
|
29
|
-
this.factor = data.factor;
|
|
30
|
+
this.factor = setRangeValue(data.factor);
|
|
30
31
|
}
|
|
31
32
|
if (data.speed !== undefined) {
|
|
32
|
-
this.speed = data.speed;
|
|
33
|
+
this.speed = setRangeValue(data.speed);
|
|
33
34
|
}
|
|
34
35
|
}
|
|
35
36
|
}
|
|
@@ -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,12 +1,12 @@
|
|
|
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
|
/**
|
|
5
5
|
* @category Options
|
|
6
6
|
*/
|
|
7
7
|
export declare class RotateAnimation implements IRotateAnimation, IOptionLoader<IRotateAnimation> {
|
|
8
8
|
enable: boolean;
|
|
9
|
-
speed:
|
|
9
|
+
speed: RangeValue;
|
|
10
10
|
sync: boolean;
|
|
11
11
|
constructor();
|
|
12
12
|
load(data?: RecursivePartial<IRotateAnimation>): void;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { setRangeValue } from "../../../../Utils";
|
|
1
2
|
/**
|
|
2
3
|
* @category Options
|
|
3
4
|
*/
|
|
@@ -15,7 +16,7 @@ export class RotateAnimation {
|
|
|
15
16
|
this.enable = data.enable;
|
|
16
17
|
}
|
|
17
18
|
if (data.speed !== undefined) {
|
|
18
|
-
this.speed = data.speed;
|
|
19
|
+
this.speed = setRangeValue(data.speed);
|
|
19
20
|
}
|
|
20
21
|
if (data.sync !== undefined) {
|
|
21
22
|
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 { ITiltAnimation } from "../../../Interfaces/Particles/Tilt/ITiltAnimation";
|
|
3
|
-
import type { RecursivePartial } from "../../../../Types";
|
|
4
4
|
/**
|
|
5
5
|
* @category Options
|
|
6
6
|
*/
|
|
7
7
|
export declare class TiltAnimation implements ITiltAnimation, IOptionLoader<ITiltAnimation> {
|
|
8
8
|
enable: boolean;
|
|
9
|
-
speed:
|
|
9
|
+
speed: RangeValue;
|
|
10
10
|
sync: boolean;
|
|
11
11
|
constructor();
|
|
12
12
|
load(data?: RecursivePartial<ITiltAnimation>): void;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { setRangeValue } from "../../../../Utils";
|
|
1
2
|
/**
|
|
2
3
|
* @category Options
|
|
3
4
|
*/
|
|
@@ -15,7 +16,7 @@ export class TiltAnimation {
|
|
|
15
16
|
this.enable = data.enable;
|
|
16
17
|
}
|
|
17
18
|
if (data.speed !== undefined) {
|
|
18
|
-
this.speed = data.speed;
|
|
19
|
+
this.speed = setRangeValue(data.speed);
|
|
19
20
|
}
|
|
20
21
|
if (data.sync !== undefined) {
|
|
21
22
|
this.sync = data.sync;
|
|
@@ -1,7 +1,7 @@
|
|
|
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
|
/**
|
|
6
6
|
* @category Options
|
|
7
7
|
*/
|
|
@@ -9,7 +9,7 @@ export declare class TwinkleValues implements ITwinkleValues, IOptionLoader<ITwi
|
|
|
9
9
|
color?: OptionsColor;
|
|
10
10
|
enable: boolean;
|
|
11
11
|
frequency: number;
|
|
12
|
-
opacity:
|
|
12
|
+
opacity: RangeValue;
|
|
13
13
|
constructor();
|
|
14
14
|
load(data?: RecursivePartial<ITwinkleValues>): void;
|
|
15
15
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { OptionsColor } from "../../OptionsColor";
|
|
2
|
+
import { setRangeValue } from "../../../../Utils";
|
|
2
3
|
/**
|
|
3
4
|
* @category Options
|
|
4
5
|
*/
|
|
@@ -22,7 +23,7 @@ export class TwinkleValues {
|
|
|
22
23
|
this.frequency = data.frequency;
|
|
23
24
|
}
|
|
24
25
|
if (data.opacity !== undefined) {
|
|
25
|
-
this.opacity = data.opacity;
|
|
26
|
+
this.opacity = setRangeValue(data.opacity);
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { RangeValue } from "../../Types";
|
|
1
2
|
export interface IAnimation {
|
|
2
|
-
count:
|
|
3
|
+
count: RangeValue;
|
|
3
4
|
/**
|
|
4
5
|
* Enables/disables the animation
|
|
5
6
|
*/
|
|
@@ -7,7 +8,7 @@ export interface IAnimation {
|
|
|
7
8
|
/**
|
|
8
9
|
* Speed animation
|
|
9
10
|
*/
|
|
10
|
-
speed:
|
|
11
|
+
speed: RangeValue;
|
|
11
12
|
/**
|
|
12
13
|
* Enables the sync animations for the particles created at the same time
|
|
13
14
|
* pushed or emitter particles will be out of sync
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type { ICoordinates } from "../../../../Core
|
|
1
|
+
import type { ICoordinates } from "../../../../Core";
|
|
2
|
+
import type { RangeValue } from "../../../../Types";
|
|
2
3
|
/**
|
|
3
4
|
* @category Options
|
|
4
5
|
*/
|
|
5
6
|
export interface IAttract {
|
|
6
|
-
distance:
|
|
7
|
+
distance: RangeValue;
|
|
7
8
|
enable: boolean;
|
|
8
9
|
/**
|
|
9
10
|
* @deprecated use the new rotate.x instead
|
|
@@ -2,6 +2,7 @@ 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
|
/**
|
|
6
7
|
* @category Options
|
|
7
8
|
* [[include:Options/Particles/Orbit.md]]
|
|
@@ -12,8 +13,8 @@ export interface IOrbit extends IAnimatable<IAnimation> {
|
|
|
12
13
|
* Enables/disables the animation
|
|
13
14
|
*/
|
|
14
15
|
enable: boolean;
|
|
15
|
-
radius?:
|
|
16
|
+
radius?: RangeValue;
|
|
16
17
|
rotation: IValueWithRandom;
|
|
17
|
-
opacity:
|
|
18
|
-
width:
|
|
18
|
+
opacity: RangeValue;
|
|
19
|
+
width: RangeValue;
|
|
19
20
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import type { IValueWithRandom } from "../../IValueWithRandom";
|
|
2
|
+
import type { RangeValue } from "../../../../Types";
|
|
2
3
|
/**
|
|
3
4
|
* @category Options
|
|
4
5
|
* [[include:Options/Particles/Repulse.md]]
|
|
5
6
|
*/
|
|
6
7
|
export interface IRepulse extends IValueWithRandom {
|
|
7
8
|
enabled: boolean;
|
|
8
|
-
distance:
|
|
9
|
-
duration:
|
|
10
|
-
factor:
|
|
11
|
-
speed:
|
|
9
|
+
distance: RangeValue;
|
|
10
|
+
duration: RangeValue;
|
|
11
|
+
factor: RangeValue;
|
|
12
|
+
speed: RangeValue;
|
|
12
13
|
}
|