tsparticles 1.41.5 → 1.42.1
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 +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.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 +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.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 +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 +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 +73 -67
- 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 +430 -144
- 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 +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
package/tsparticles.js
CHANGED
|
@@ -1352,7 +1352,7 @@
|
|
|
1352
1352
|
function setColorAnimation(colorValue, colorAnimation, reduceFactor) {
|
|
1353
1353
|
colorValue.enable = colorAnimation.enable;
|
|
1354
1354
|
if (colorValue.enable) {
|
|
1355
|
-
colorValue.velocity = colorAnimation.speed / 100 * reduceFactor;
|
|
1355
|
+
colorValue.velocity = getRangeValue(colorAnimation.speed) / 100 * reduceFactor;
|
|
1356
1356
|
if (colorAnimation.sync) {
|
|
1357
1357
|
return;
|
|
1358
1358
|
}
|
|
@@ -2302,7 +2302,7 @@
|
|
|
2302
2302
|
}
|
|
2303
2303
|
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) * 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;
|
|
2304
2304
|
this.applyPath(particle, delta);
|
|
2305
|
-
const gravityOptions =
|
|
2305
|
+
const gravityOptions = particle.gravity;
|
|
2306
2306
|
const gravityFactor = gravityOptions.enable && gravityOptions.inverse ? -1 : 1;
|
|
2307
2307
|
if (gravityOptions.enable && moveSpeed) {
|
|
2308
2308
|
particle.velocity.y += gravityFactor * (gravityOptions.acceleration * delta.factor) / (60 * moveSpeed);
|
|
@@ -2316,7 +2316,7 @@
|
|
|
2316
2316
|
}
|
|
2317
2317
|
const velocity = particle.velocity.mult(moveSpeed);
|
|
2318
2318
|
const maxSpeed = (_c = particle.retina.maxSpeed) !== null && _c !== void 0 ? _c : container.retina.maxSpeed;
|
|
2319
|
-
if (gravityOptions.enable &&
|
|
2319
|
+
if (gravityOptions.enable && maxSpeed > 0 && (!gravityOptions.inverse && velocity.y >= 0 && velocity.y >= maxSpeed || gravityOptions.inverse && velocity.y <= 0 && velocity.y <= -maxSpeed)) {
|
|
2320
2320
|
velocity.y = gravityFactor * maxSpeed;
|
|
2321
2321
|
if (moveSpeed) {
|
|
2322
2322
|
particle.velocity.y = velocity.y / moveSpeed;
|
|
@@ -2825,10 +2825,7 @@
|
|
|
2825
2825
|
const container = this.container;
|
|
2826
2826
|
const pxRatio = container.retina.pixelRatio;
|
|
2827
2827
|
const size = container.canvas.size;
|
|
2828
|
-
const oldSize = {
|
|
2829
|
-
width: size.width,
|
|
2830
|
-
height: size.height
|
|
2831
|
-
};
|
|
2828
|
+
const oldSize = Object.assign({}, size);
|
|
2832
2829
|
size.width = this.element.offsetWidth * pxRatio;
|
|
2833
2830
|
size.height = this.element.offsetHeight * pxRatio;
|
|
2834
2831
|
this.element.width = size.width;
|
|
@@ -2887,7 +2884,7 @@
|
|
|
2887
2884
|
const zIndexOptions = particle.options.zIndex;
|
|
2888
2885
|
const zOpacityFactor = (1 - particle.zIndexFactor) ** zIndexOptions.opacityRate;
|
|
2889
2886
|
const radius = particle.getRadius();
|
|
2890
|
-
const opacity = twinkling ? twinkle.opacity : (_d = (_b = particle.bubble.opacity) !== null && _b !== void 0 ? _b : (_c = particle.opacity) === null || _c === void 0 ? void 0 : _c.value) !== null && _d !== void 0 ? _d : 1;
|
|
2887
|
+
const opacity = twinkling ? getRangeValue(twinkle.opacity) : (_d = (_b = particle.bubble.opacity) !== null && _b !== void 0 ? _b : (_c = particle.opacity) === null || _c === void 0 ? void 0 : _c.value) !== null && _d !== void 0 ? _d : 1;
|
|
2891
2888
|
const strokeOpacity = (_f = (_e = particle.stroke) === null || _e === void 0 ? void 0 : _e.opacity) !== null && _f !== void 0 ? _f : opacity;
|
|
2892
2889
|
const zOpacity = opacity * zOpacityFactor;
|
|
2893
2890
|
const fillColorValue = fColor ? getStyleFromHsl(fColor, zOpacity) : undefined;
|
|
@@ -3905,7 +3902,7 @@
|
|
|
3905
3902
|
return;
|
|
3906
3903
|
}
|
|
3907
3904
|
if (data.count !== undefined) {
|
|
3908
|
-
this.count = data.count;
|
|
3905
|
+
this.count = setRangeValue(data.count);
|
|
3909
3906
|
}
|
|
3910
3907
|
if (data.enable !== undefined) {
|
|
3911
3908
|
this.enable = data.enable;
|
|
@@ -3914,7 +3911,7 @@
|
|
|
3914
3911
|
this.offset = setRangeValue(data.offset);
|
|
3915
3912
|
}
|
|
3916
3913
|
if (data.speed !== undefined) {
|
|
3917
|
-
this.speed = data.speed;
|
|
3914
|
+
this.speed = setRangeValue(data.speed);
|
|
3918
3915
|
}
|
|
3919
3916
|
if (data.sync !== undefined) {
|
|
3920
3917
|
this.sync = data.sync;
|
|
@@ -4062,13 +4059,13 @@
|
|
|
4062
4059
|
return;
|
|
4063
4060
|
}
|
|
4064
4061
|
if (data.count !== undefined) {
|
|
4065
|
-
this.count = data.count;
|
|
4062
|
+
this.count = setRangeValue(data.count);
|
|
4066
4063
|
}
|
|
4067
4064
|
if (data.enable !== undefined) {
|
|
4068
4065
|
this.enable = data.enable;
|
|
4069
4066
|
}
|
|
4070
4067
|
if (data.speed !== undefined) {
|
|
4071
|
-
this.speed = data.speed;
|
|
4068
|
+
this.speed = setRangeValue(data.speed);
|
|
4072
4069
|
}
|
|
4073
4070
|
if (data.sync !== undefined) {
|
|
4074
4071
|
this.sync = data.sync;
|
|
@@ -4088,13 +4085,13 @@
|
|
|
4088
4085
|
return;
|
|
4089
4086
|
}
|
|
4090
4087
|
if (data.count !== undefined) {
|
|
4091
|
-
this.count = data.count;
|
|
4088
|
+
this.count = setRangeValue(data.count);
|
|
4092
4089
|
}
|
|
4093
4090
|
if (data.enable !== undefined) {
|
|
4094
4091
|
this.enable = data.enable;
|
|
4095
4092
|
}
|
|
4096
4093
|
if (data.speed !== undefined) {
|
|
4097
|
-
this.speed = data.speed;
|
|
4094
|
+
this.speed = setRangeValue(data.speed);
|
|
4098
4095
|
}
|
|
4099
4096
|
if (data.sync !== undefined) {
|
|
4100
4097
|
this.sync = data.sync;
|
|
@@ -4420,7 +4417,7 @@
|
|
|
4420
4417
|
return;
|
|
4421
4418
|
}
|
|
4422
4419
|
if (data.distance !== undefined) {
|
|
4423
|
-
this.distance = data.distance;
|
|
4420
|
+
this.distance = setRangeValue(data.distance);
|
|
4424
4421
|
}
|
|
4425
4422
|
if (data.enable !== undefined) {
|
|
4426
4423
|
this.enable = data.enable;
|
|
@@ -4445,10 +4442,10 @@
|
|
|
4445
4442
|
return;
|
|
4446
4443
|
}
|
|
4447
4444
|
if (data.offset !== undefined) {
|
|
4448
|
-
this.offset = data.offset;
|
|
4445
|
+
this.offset = setRangeValue(data.offset);
|
|
4449
4446
|
}
|
|
4450
4447
|
if (data.value !== undefined) {
|
|
4451
|
-
this.value = data.value;
|
|
4448
|
+
this.value = setRangeValue(data.value);
|
|
4452
4449
|
}
|
|
4453
4450
|
}
|
|
4454
4451
|
}
|
|
@@ -4464,7 +4461,7 @@
|
|
|
4464
4461
|
return;
|
|
4465
4462
|
}
|
|
4466
4463
|
if (data.acceleration !== undefined) {
|
|
4467
|
-
this.acceleration = data.acceleration;
|
|
4464
|
+
this.acceleration = setRangeValue(data.acceleration);
|
|
4468
4465
|
}
|
|
4469
4466
|
if (data.enable !== undefined) {
|
|
4470
4467
|
this.enable = data.enable;
|
|
@@ -4473,7 +4470,7 @@
|
|
|
4473
4470
|
this.inverse = data.inverse;
|
|
4474
4471
|
}
|
|
4475
4472
|
if (data.maxSpeed !== undefined) {
|
|
4476
|
-
this.maxSpeed = data.maxSpeed;
|
|
4473
|
+
this.maxSpeed = setRangeValue(data.maxSpeed);
|
|
4477
4474
|
}
|
|
4478
4475
|
}
|
|
4479
4476
|
}
|
|
@@ -4688,13 +4685,13 @@
|
|
|
4688
4685
|
return;
|
|
4689
4686
|
}
|
|
4690
4687
|
if (data.count !== undefined) {
|
|
4691
|
-
this.count = data.count;
|
|
4688
|
+
this.count = setRangeValue(data.count);
|
|
4692
4689
|
}
|
|
4693
4690
|
if (data.enable !== undefined) {
|
|
4694
4691
|
this.enable = data.enable;
|
|
4695
4692
|
}
|
|
4696
4693
|
if (data.speed !== undefined) {
|
|
4697
|
-
this.speed = data.speed;
|
|
4694
|
+
this.speed = setRangeValue(data.speed);
|
|
4698
4695
|
}
|
|
4699
4696
|
if (data.sync !== undefined) {
|
|
4700
4697
|
this.sync = data.sync;
|
|
@@ -4798,13 +4795,13 @@
|
|
|
4798
4795
|
this.enable = data.enable;
|
|
4799
4796
|
}
|
|
4800
4797
|
if (data.opacity !== undefined) {
|
|
4801
|
-
this.opacity = data.opacity;
|
|
4798
|
+
this.opacity = setRangeValue(data.opacity);
|
|
4802
4799
|
}
|
|
4803
4800
|
if (data.width !== undefined) {
|
|
4804
|
-
this.width = data.width;
|
|
4801
|
+
this.width = setRangeValue(data.width);
|
|
4805
4802
|
}
|
|
4806
4803
|
if (data.radius !== undefined) {
|
|
4807
|
-
this.radius = data.radius;
|
|
4804
|
+
this.radius = setRangeValue(data.radius);
|
|
4808
4805
|
}
|
|
4809
4806
|
if (data.color !== undefined) {
|
|
4810
4807
|
this.color = OptionsColor.create(this.color, data.color);
|
|
@@ -4885,16 +4882,16 @@
|
|
|
4885
4882
|
this.enabled = data.enabled;
|
|
4886
4883
|
}
|
|
4887
4884
|
if (data.distance !== undefined) {
|
|
4888
|
-
this.distance = data.distance;
|
|
4885
|
+
this.distance = setRangeValue(data.distance);
|
|
4889
4886
|
}
|
|
4890
4887
|
if (data.duration !== undefined) {
|
|
4891
|
-
this.duration = data.duration;
|
|
4888
|
+
this.duration = setRangeValue(data.duration);
|
|
4892
4889
|
}
|
|
4893
4890
|
if (data.factor !== undefined) {
|
|
4894
|
-
this.factor = data.factor;
|
|
4891
|
+
this.factor = setRangeValue(data.factor);
|
|
4895
4892
|
}
|
|
4896
4893
|
if (data.speed !== undefined) {
|
|
4897
|
-
this.speed = data.speed;
|
|
4894
|
+
this.speed = setRangeValue(data.speed);
|
|
4898
4895
|
}
|
|
4899
4896
|
}
|
|
4900
4897
|
}
|
|
@@ -4911,7 +4908,7 @@
|
|
|
4911
4908
|
this.enable = data.enable;
|
|
4912
4909
|
}
|
|
4913
4910
|
if (data.value !== undefined) {
|
|
4914
|
-
this.value = data.value;
|
|
4911
|
+
this.value = setRangeValue(data.value);
|
|
4915
4912
|
}
|
|
4916
4913
|
}
|
|
4917
4914
|
}
|
|
@@ -4957,7 +4954,7 @@
|
|
|
4957
4954
|
this.enable = data.enable;
|
|
4958
4955
|
}
|
|
4959
4956
|
if (data.speed !== undefined) {
|
|
4960
|
-
this.speed = data.speed;
|
|
4957
|
+
this.speed = setRangeValue(data.speed);
|
|
4961
4958
|
}
|
|
4962
4959
|
if (data.sync !== undefined) {
|
|
4963
4960
|
this.sync = data.sync;
|
|
@@ -5213,7 +5210,7 @@
|
|
|
5213
5210
|
this.enable = data.enable;
|
|
5214
5211
|
}
|
|
5215
5212
|
if (data.speed !== undefined) {
|
|
5216
|
-
this.speed = data.speed;
|
|
5213
|
+
this.speed = setRangeValue(data.speed);
|
|
5217
5214
|
}
|
|
5218
5215
|
if (data.sync !== undefined) {
|
|
5219
5216
|
this.sync = data.sync;
|
|
@@ -5262,7 +5259,7 @@
|
|
|
5262
5259
|
this.frequency = data.frequency;
|
|
5263
5260
|
}
|
|
5264
5261
|
if (data.opacity !== undefined) {
|
|
5265
|
-
this.opacity = data.opacity;
|
|
5262
|
+
this.opacity = setRangeValue(data.opacity);
|
|
5266
5263
|
}
|
|
5267
5264
|
}
|
|
5268
5265
|
}
|
|
@@ -5697,6 +5694,7 @@
|
|
|
5697
5694
|
this.retina = {
|
|
5698
5695
|
maxDistance: {}
|
|
5699
5696
|
};
|
|
5697
|
+
this.ignoresResizeRatio = true;
|
|
5700
5698
|
const pxRatio = container.retina.pixelRatio;
|
|
5701
5699
|
const mainOptions = container.actualOptions;
|
|
5702
5700
|
const particlesOptions = new ParticlesOptions;
|
|
@@ -5736,7 +5734,7 @@
|
|
|
5736
5734
|
max: getRangeMax(sizeRange) * pxRatio,
|
|
5737
5735
|
min: getRangeMin(sizeRange) * pxRatio,
|
|
5738
5736
|
loops: 0,
|
|
5739
|
-
maxLoops: sizeOptions.animation.count
|
|
5737
|
+
maxLoops: getRangeValue(sizeOptions.animation.count)
|
|
5740
5738
|
};
|
|
5741
5739
|
const sizeAnimation = sizeOptions.animation;
|
|
5742
5740
|
if (sizeAnimation.enable) {
|
|
@@ -5770,6 +5768,12 @@
|
|
|
5770
5768
|
this.initialVelocity = this.calculateVelocity();
|
|
5771
5769
|
this.velocity = this.initialVelocity.copy();
|
|
5772
5770
|
this.moveDecay = 1 - getRangeValue(this.options.move.decay);
|
|
5771
|
+
const gravityOptions = this.options.move.gravity;
|
|
5772
|
+
this.gravity = {
|
|
5773
|
+
enable: gravityOptions.enable,
|
|
5774
|
+
acceleration: getRangeValue(gravityOptions.acceleration),
|
|
5775
|
+
inverse: gravityOptions.inverse
|
|
5776
|
+
};
|
|
5773
5777
|
this.position = this.calcPosition(container, position, clamp(zIndexValue, 0, container.zLayers));
|
|
5774
5778
|
this.initialPosition = this.position.copy();
|
|
5775
5779
|
this.offset = Vector.origin;
|
|
@@ -5977,12 +5981,7 @@
|
|
|
5977
5981
|
return overlaps;
|
|
5978
5982
|
}
|
|
5979
5983
|
calculateVelocity() {
|
|
5980
|
-
const baseVelocity = getParticleBaseVelocity(this.direction)
|
|
5981
|
-
const res = baseVelocity.copy();
|
|
5982
|
-
const moveOptions = this.options.move;
|
|
5983
|
-
const rad = Math.PI / 180 * moveOptions.angle.value;
|
|
5984
|
-
const radOffset = Math.PI / 180 * moveOptions.angle.offset;
|
|
5985
|
-
const range = {
|
|
5984
|
+
const baseVelocity = getParticleBaseVelocity(this.direction), res = baseVelocity.copy(), moveOptions = this.options.move, rad = Math.PI / 180 * getRangeValue(moveOptions.angle.value), radOffset = Math.PI / 180 * getRangeValue(moveOptions.angle.offset), range = {
|
|
5986
5985
|
left: radOffset - rad / 2,
|
|
5987
5986
|
right: radOffset + rad / 2
|
|
5988
5987
|
};
|
|
@@ -6132,10 +6131,11 @@
|
|
|
6132
6131
|
}
|
|
6133
6132
|
for (const particle of this.array) {
|
|
6134
6133
|
const resizeFactor = container.canvas.resizeFactor;
|
|
6135
|
-
if (resizeFactor) {
|
|
6134
|
+
if (resizeFactor && !particle.ignoresResizeRatio) {
|
|
6136
6135
|
particle.position.x *= resizeFactor.width;
|
|
6137
6136
|
particle.position.y *= resizeFactor.height;
|
|
6138
6137
|
}
|
|
6138
|
+
particle.ignoresResizeRatio = false;
|
|
6139
6139
|
particle.bubble.inRange = false;
|
|
6140
6140
|
for (const [, plugin] of this.container.plugins) {
|
|
6141
6141
|
if (particle.destroyed) {
|
|
@@ -6371,13 +6371,13 @@
|
|
|
6371
6371
|
container.canvas.size.height = element.offsetHeight * ratio;
|
|
6372
6372
|
}
|
|
6373
6373
|
const particles = options.particles;
|
|
6374
|
-
this.attractDistance = particles.move.attract.distance * ratio;
|
|
6374
|
+
this.attractDistance = getRangeValue(particles.move.attract.distance) * ratio;
|
|
6375
6375
|
this.linksDistance = particles.links.distance * ratio;
|
|
6376
6376
|
this.linksWidth = particles.links.width * ratio;
|
|
6377
|
-
this.sizeAnimationSpeed = particles.size.animation.speed * ratio;
|
|
6378
|
-
this.maxSpeed = particles.move.gravity.maxSpeed * ratio;
|
|
6377
|
+
this.sizeAnimationSpeed = getRangeValue(particles.size.animation.speed) * ratio;
|
|
6378
|
+
this.maxSpeed = getRangeValue(particles.move.gravity.maxSpeed) * ratio;
|
|
6379
6379
|
if (particles.orbit.radius !== undefined) {
|
|
6380
|
-
this.orbitRadius = particles.orbit.radius * this.container.retina.pixelRatio;
|
|
6380
|
+
this.orbitRadius = getRangeValue(particles.orbit.radius) * this.container.retina.pixelRatio;
|
|
6381
6381
|
}
|
|
6382
6382
|
const modes = options.interactivity.modes;
|
|
6383
6383
|
this.connectModeDistance = modes.connect.distance * ratio;
|
|
@@ -6397,19 +6397,19 @@
|
|
|
6397
6397
|
const ratio = this.pixelRatio;
|
|
6398
6398
|
const moveDistance = options.move.distance;
|
|
6399
6399
|
const props = particle.retina;
|
|
6400
|
-
props.attractDistance = options.move.attract.distance * ratio;
|
|
6400
|
+
props.attractDistance = getRangeValue(options.move.attract.distance) * ratio;
|
|
6401
6401
|
props.linksDistance = options.links.distance * ratio;
|
|
6402
6402
|
props.linksWidth = options.links.width * ratio;
|
|
6403
6403
|
props.moveDrift = getRangeValue(options.move.drift) * ratio;
|
|
6404
6404
|
props.moveSpeed = getRangeValue(options.move.speed) * ratio;
|
|
6405
|
-
props.sizeAnimationSpeed = options.size.animation.speed * ratio;
|
|
6405
|
+
props.sizeAnimationSpeed = getRangeValue(options.size.animation.speed) * ratio;
|
|
6406
6406
|
if (particle.spin) {
|
|
6407
6407
|
props.spinAcceleration = getRangeValue(options.move.spin.acceleration) * ratio;
|
|
6408
6408
|
}
|
|
6409
6409
|
const maxDistance = props.maxDistance;
|
|
6410
6410
|
maxDistance.horizontal = moveDistance.horizontal !== undefined ? moveDistance.horizontal * ratio : undefined;
|
|
6411
6411
|
maxDistance.vertical = moveDistance.vertical !== undefined ? moveDistance.vertical * ratio : undefined;
|
|
6412
|
-
props.maxSpeed = options.move.gravity.maxSpeed * ratio;
|
|
6412
|
+
props.maxSpeed = getRangeValue(options.move.gravity.maxSpeed) * ratio;
|
|
6413
6413
|
}
|
|
6414
6414
|
handleMotionChange(mediaQuery) {
|
|
6415
6415
|
const options = this.container.actualOptions;
|
|
@@ -7163,10 +7163,13 @@
|
|
|
7163
7163
|
this.opacity = data.opacity;
|
|
7164
7164
|
}
|
|
7165
7165
|
if (data.position !== undefined) {
|
|
7166
|
-
this.position = {
|
|
7167
|
-
|
|
7168
|
-
|
|
7169
|
-
}
|
|
7166
|
+
this.position = {};
|
|
7167
|
+
if (data.position.x !== undefined) {
|
|
7168
|
+
this.position.x = setRangeValue(data.position.x);
|
|
7169
|
+
}
|
|
7170
|
+
if (data.position.y !== undefined) {
|
|
7171
|
+
this.position.y = setRangeValue(data.position.y);
|
|
7172
|
+
}
|
|
7170
7173
|
}
|
|
7171
7174
|
if (data.size !== undefined) {
|
|
7172
7175
|
this.size.load(data.size);
|
|
@@ -7271,7 +7274,7 @@
|
|
|
7271
7274
|
var _a, _b;
|
|
7272
7275
|
const container = this.container;
|
|
7273
7276
|
const percentPosition = this.options.position;
|
|
7274
|
-
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);
|
|
7277
|
+
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);
|
|
7275
7278
|
}
|
|
7276
7279
|
updateParticlePosition(particle, v) {
|
|
7277
7280
|
var _a;
|
|
@@ -7618,10 +7621,13 @@
|
|
|
7618
7621
|
this.shape = data.shape;
|
|
7619
7622
|
}
|
|
7620
7623
|
if (data.position !== undefined) {
|
|
7621
|
-
this.position = {
|
|
7622
|
-
|
|
7623
|
-
|
|
7624
|
-
}
|
|
7624
|
+
this.position = {};
|
|
7625
|
+
if (data.position.x !== undefined) {
|
|
7626
|
+
this.position.x = setRangeValue(data.position.x);
|
|
7627
|
+
}
|
|
7628
|
+
if (data.position.y !== undefined) {
|
|
7629
|
+
this.position.y = setRangeValue(data.position.y);
|
|
7630
|
+
}
|
|
7625
7631
|
}
|
|
7626
7632
|
if (data.spawnColor !== undefined) {
|
|
7627
7633
|
if (this.spawnColor === undefined) {
|
|
@@ -7827,8 +7833,8 @@
|
|
|
7827
7833
|
const container = this.container;
|
|
7828
7834
|
const percentPosition = this.options.position;
|
|
7829
7835
|
return {
|
|
7830
|
-
x: ((_a = percentPosition === null || percentPosition === void 0 ? void 0 : percentPosition.x) !== null && _a !== void 0 ? _a : Math.random() * 100) / 100 * container.canvas.size.width,
|
|
7831
|
-
y: ((_b = percentPosition === null || percentPosition === void 0 ? void 0 : percentPosition.y) !== null && _b !== void 0 ? _b : Math.random() * 100) / 100 * container.canvas.size.height
|
|
7836
|
+
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,
|
|
7837
|
+
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
|
|
7832
7838
|
};
|
|
7833
7839
|
}
|
|
7834
7840
|
emit() {
|
|
@@ -7876,7 +7882,7 @@
|
|
|
7876
7882
|
const colorOffset = randomInRange(animation.offset);
|
|
7877
7883
|
const delay = getRangeValue(this.options.rate.delay);
|
|
7878
7884
|
const emitFactor = 1e3 * delay / container.retina.reduceFactor;
|
|
7879
|
-
const colorSpeed = (_a = animation.speed) !== null && _a !== void 0 ? _a : 0;
|
|
7885
|
+
const colorSpeed = getRangeValue((_a = animation.speed) !== null && _a !== void 0 ? _a : 0);
|
|
7880
7886
|
return (initValue + colorSpeed * container.fpsLimit / emitFactor + colorOffset * 3.6) % maxValue;
|
|
7881
7887
|
}
|
|
7882
7888
|
}
|
|
@@ -8925,17 +8931,17 @@
|
|
|
8925
8931
|
const alterType = Math.random() >= .5 ? "darken" : "enlighten";
|
|
8926
8932
|
particle.roll.alter = {
|
|
8927
8933
|
type: alterType,
|
|
8928
|
-
value: alterType === "darken" ? rollOpt.darken.value : rollOpt.enlighten.value
|
|
8934
|
+
value: getRangeValue(alterType === "darken" ? rollOpt.darken.value : rollOpt.enlighten.value)
|
|
8929
8935
|
};
|
|
8930
8936
|
} else if (rollOpt.darken.enable) {
|
|
8931
8937
|
particle.roll.alter = {
|
|
8932
8938
|
type: "darken",
|
|
8933
|
-
value: rollOpt.darken.value
|
|
8939
|
+
value: getRangeValue(rollOpt.darken.value)
|
|
8934
8940
|
};
|
|
8935
8941
|
} else if (rollOpt.enlighten.enable) {
|
|
8936
8942
|
particle.roll.alter = {
|
|
8937
8943
|
type: "enlighten",
|
|
8938
|
-
value: rollOpt.enlighten.value
|
|
8944
|
+
value: getRangeValue(rollOpt.enlighten.value)
|
|
8939
8945
|
};
|
|
8940
8946
|
}
|
|
8941
8947
|
} else {
|
|
@@ -9016,7 +9022,7 @@
|
|
|
9016
9022
|
}
|
|
9017
9023
|
const rotateAnimation = particle.options.rotate.animation;
|
|
9018
9024
|
if (rotateAnimation.enable) {
|
|
9019
|
-
particle.rotate.velocity = rotateAnimation.speed / 360 * this.container.retina.reduceFactor;
|
|
9025
|
+
particle.rotate.velocity = getRangeValue(rotateAnimation.speed) / 360 * this.container.retina.reduceFactor;
|
|
9020
9026
|
if (!rotateAnimation.sync) {
|
|
9021
9027
|
particle.rotate.velocity *= Math.random();
|
|
9022
9028
|
}
|
|
@@ -9999,7 +10005,7 @@
|
|
|
9999
10005
|
min: getRangeMin(opacityOptions.value),
|
|
10000
10006
|
value: getRangeValue(opacityOptions.value),
|
|
10001
10007
|
loops: 0,
|
|
10002
|
-
maxLoops: opacityOptions.animation.count
|
|
10008
|
+
maxLoops: getRangeValue(opacityOptions.animation.count)
|
|
10003
10009
|
};
|
|
10004
10010
|
const opacityAnimation = opacityOptions.animation;
|
|
10005
10011
|
if (opacityAnimation.enable) {
|
|
@@ -10024,7 +10030,7 @@
|
|
|
10024
10030
|
particle.opacity.status = 1;
|
|
10025
10031
|
break;
|
|
10026
10032
|
}
|
|
10027
|
-
particle.opacity.velocity = opacityAnimation.speed / 100 * this.container.retina.reduceFactor;
|
|
10033
|
+
particle.opacity.velocity = getRangeValue(opacityAnimation.speed) / 100 * this.container.retina.reduceFactor;
|
|
10028
10034
|
if (!opacityAnimation.sync) {
|
|
10029
10035
|
particle.opacity.velocity *= Math.random();
|
|
10030
10036
|
}
|
|
@@ -10552,7 +10558,7 @@
|
|
|
10552
10558
|
const twinkling = Math.random() < twinkleFreq;
|
|
10553
10559
|
if (twinkling && twinkleRgb !== undefined) {
|
|
10554
10560
|
colorLine = twinkleRgb;
|
|
10555
|
-
opacity = twinkle.opacity;
|
|
10561
|
+
opacity = getRangeValue(twinkle.opacity);
|
|
10556
10562
|
}
|
|
10557
10563
|
}
|
|
10558
10564
|
if (!colorLine) {
|
|
@@ -10990,7 +10996,7 @@
|
|
|
10990
10996
|
}
|
|
10991
10997
|
const tiltAnimation = particle.options.tilt.animation;
|
|
10992
10998
|
if (tiltAnimation.enable) {
|
|
10993
|
-
particle.tilt.velocity = tiltAnimation.speed / 360 * this.container.retina.reduceFactor;
|
|
10999
|
+
particle.tilt.velocity = getRangeValue(tiltAnimation.speed) / 360 * this.container.retina.reduceFactor;
|
|
10994
11000
|
if (!tiltAnimation.sync) {
|
|
10995
11001
|
particle.tilt.velocity *= Math.random();
|
|
10996
11002
|
}
|