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/tsparticles.slim.js
CHANGED
|
@@ -1087,7 +1087,7 @@
|
|
|
1087
1087
|
function setColorAnimation(colorValue, colorAnimation, reduceFactor) {
|
|
1088
1088
|
colorValue.enable = colorAnimation.enable;
|
|
1089
1089
|
if (colorValue.enable) {
|
|
1090
|
-
colorValue.velocity = colorAnimation.speed / 100 * reduceFactor;
|
|
1090
|
+
colorValue.velocity = getRangeValue(colorAnimation.speed) / 100 * reduceFactor;
|
|
1091
1091
|
if (colorAnimation.sync) {
|
|
1092
1092
|
return;
|
|
1093
1093
|
}
|
|
@@ -2037,7 +2037,7 @@
|
|
|
2037
2037
|
}
|
|
2038
2038
|
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;
|
|
2039
2039
|
this.applyPath(particle, delta);
|
|
2040
|
-
const gravityOptions =
|
|
2040
|
+
const gravityOptions = particle.gravity;
|
|
2041
2041
|
const gravityFactor = gravityOptions.enable && gravityOptions.inverse ? -1 : 1;
|
|
2042
2042
|
if (gravityOptions.enable && moveSpeed) {
|
|
2043
2043
|
particle.velocity.y += gravityFactor * (gravityOptions.acceleration * delta.factor) / (60 * moveSpeed);
|
|
@@ -2051,7 +2051,7 @@
|
|
|
2051
2051
|
}
|
|
2052
2052
|
const velocity = particle.velocity.mult(moveSpeed);
|
|
2053
2053
|
const maxSpeed = (_c = particle.retina.maxSpeed) !== null && _c !== void 0 ? _c : container.retina.maxSpeed;
|
|
2054
|
-
if (gravityOptions.enable &&
|
|
2054
|
+
if (gravityOptions.enable && maxSpeed > 0 && (!gravityOptions.inverse && velocity.y >= 0 && velocity.y >= maxSpeed || gravityOptions.inverse && velocity.y <= 0 && velocity.y <= -maxSpeed)) {
|
|
2055
2055
|
velocity.y = gravityFactor * maxSpeed;
|
|
2056
2056
|
if (moveSpeed) {
|
|
2057
2057
|
particle.velocity.y = velocity.y / moveSpeed;
|
|
@@ -2560,10 +2560,7 @@
|
|
|
2560
2560
|
const container = this.container;
|
|
2561
2561
|
const pxRatio = container.retina.pixelRatio;
|
|
2562
2562
|
const size = container.canvas.size;
|
|
2563
|
-
const oldSize = {
|
|
2564
|
-
width: size.width,
|
|
2565
|
-
height: size.height
|
|
2566
|
-
};
|
|
2563
|
+
const oldSize = Object.assign({}, size);
|
|
2567
2564
|
size.width = this.element.offsetWidth * pxRatio;
|
|
2568
2565
|
size.height = this.element.offsetHeight * pxRatio;
|
|
2569
2566
|
this.element.width = size.width;
|
|
@@ -2622,7 +2619,7 @@
|
|
|
2622
2619
|
const zIndexOptions = particle.options.zIndex;
|
|
2623
2620
|
const zOpacityFactor = (1 - particle.zIndexFactor) ** zIndexOptions.opacityRate;
|
|
2624
2621
|
const radius = particle.getRadius();
|
|
2625
|
-
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;
|
|
2622
|
+
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;
|
|
2626
2623
|
const strokeOpacity = (_f = (_e = particle.stroke) === null || _e === void 0 ? void 0 : _e.opacity) !== null && _f !== void 0 ? _f : opacity;
|
|
2627
2624
|
const zOpacity = opacity * zOpacityFactor;
|
|
2628
2625
|
const fillColorValue = fColor ? getStyleFromHsl(fColor, zOpacity) : undefined;
|
|
@@ -3640,7 +3637,7 @@
|
|
|
3640
3637
|
return;
|
|
3641
3638
|
}
|
|
3642
3639
|
if (data.count !== undefined) {
|
|
3643
|
-
this.count = data.count;
|
|
3640
|
+
this.count = setRangeValue(data.count);
|
|
3644
3641
|
}
|
|
3645
3642
|
if (data.enable !== undefined) {
|
|
3646
3643
|
this.enable = data.enable;
|
|
@@ -3649,7 +3646,7 @@
|
|
|
3649
3646
|
this.offset = setRangeValue(data.offset);
|
|
3650
3647
|
}
|
|
3651
3648
|
if (data.speed !== undefined) {
|
|
3652
|
-
this.speed = data.speed;
|
|
3649
|
+
this.speed = setRangeValue(data.speed);
|
|
3653
3650
|
}
|
|
3654
3651
|
if (data.sync !== undefined) {
|
|
3655
3652
|
this.sync = data.sync;
|
|
@@ -3797,13 +3794,13 @@
|
|
|
3797
3794
|
return;
|
|
3798
3795
|
}
|
|
3799
3796
|
if (data.count !== undefined) {
|
|
3800
|
-
this.count = data.count;
|
|
3797
|
+
this.count = setRangeValue(data.count);
|
|
3801
3798
|
}
|
|
3802
3799
|
if (data.enable !== undefined) {
|
|
3803
3800
|
this.enable = data.enable;
|
|
3804
3801
|
}
|
|
3805
3802
|
if (data.speed !== undefined) {
|
|
3806
|
-
this.speed = data.speed;
|
|
3803
|
+
this.speed = setRangeValue(data.speed);
|
|
3807
3804
|
}
|
|
3808
3805
|
if (data.sync !== undefined) {
|
|
3809
3806
|
this.sync = data.sync;
|
|
@@ -3823,13 +3820,13 @@
|
|
|
3823
3820
|
return;
|
|
3824
3821
|
}
|
|
3825
3822
|
if (data.count !== undefined) {
|
|
3826
|
-
this.count = data.count;
|
|
3823
|
+
this.count = setRangeValue(data.count);
|
|
3827
3824
|
}
|
|
3828
3825
|
if (data.enable !== undefined) {
|
|
3829
3826
|
this.enable = data.enable;
|
|
3830
3827
|
}
|
|
3831
3828
|
if (data.speed !== undefined) {
|
|
3832
|
-
this.speed = data.speed;
|
|
3829
|
+
this.speed = setRangeValue(data.speed);
|
|
3833
3830
|
}
|
|
3834
3831
|
if (data.sync !== undefined) {
|
|
3835
3832
|
this.sync = data.sync;
|
|
@@ -4155,7 +4152,7 @@
|
|
|
4155
4152
|
return;
|
|
4156
4153
|
}
|
|
4157
4154
|
if (data.distance !== undefined) {
|
|
4158
|
-
this.distance = data.distance;
|
|
4155
|
+
this.distance = setRangeValue(data.distance);
|
|
4159
4156
|
}
|
|
4160
4157
|
if (data.enable !== undefined) {
|
|
4161
4158
|
this.enable = data.enable;
|
|
@@ -4180,10 +4177,10 @@
|
|
|
4180
4177
|
return;
|
|
4181
4178
|
}
|
|
4182
4179
|
if (data.offset !== undefined) {
|
|
4183
|
-
this.offset = data.offset;
|
|
4180
|
+
this.offset = setRangeValue(data.offset);
|
|
4184
4181
|
}
|
|
4185
4182
|
if (data.value !== undefined) {
|
|
4186
|
-
this.value = data.value;
|
|
4183
|
+
this.value = setRangeValue(data.value);
|
|
4187
4184
|
}
|
|
4188
4185
|
}
|
|
4189
4186
|
}
|
|
@@ -4199,7 +4196,7 @@
|
|
|
4199
4196
|
return;
|
|
4200
4197
|
}
|
|
4201
4198
|
if (data.acceleration !== undefined) {
|
|
4202
|
-
this.acceleration = data.acceleration;
|
|
4199
|
+
this.acceleration = setRangeValue(data.acceleration);
|
|
4203
4200
|
}
|
|
4204
4201
|
if (data.enable !== undefined) {
|
|
4205
4202
|
this.enable = data.enable;
|
|
@@ -4208,7 +4205,7 @@
|
|
|
4208
4205
|
this.inverse = data.inverse;
|
|
4209
4206
|
}
|
|
4210
4207
|
if (data.maxSpeed !== undefined) {
|
|
4211
|
-
this.maxSpeed = data.maxSpeed;
|
|
4208
|
+
this.maxSpeed = setRangeValue(data.maxSpeed);
|
|
4212
4209
|
}
|
|
4213
4210
|
}
|
|
4214
4211
|
}
|
|
@@ -4423,13 +4420,13 @@
|
|
|
4423
4420
|
return;
|
|
4424
4421
|
}
|
|
4425
4422
|
if (data.count !== undefined) {
|
|
4426
|
-
this.count = data.count;
|
|
4423
|
+
this.count = setRangeValue(data.count);
|
|
4427
4424
|
}
|
|
4428
4425
|
if (data.enable !== undefined) {
|
|
4429
4426
|
this.enable = data.enable;
|
|
4430
4427
|
}
|
|
4431
4428
|
if (data.speed !== undefined) {
|
|
4432
|
-
this.speed = data.speed;
|
|
4429
|
+
this.speed = setRangeValue(data.speed);
|
|
4433
4430
|
}
|
|
4434
4431
|
if (data.sync !== undefined) {
|
|
4435
4432
|
this.sync = data.sync;
|
|
@@ -4533,13 +4530,13 @@
|
|
|
4533
4530
|
this.enable = data.enable;
|
|
4534
4531
|
}
|
|
4535
4532
|
if (data.opacity !== undefined) {
|
|
4536
|
-
this.opacity = data.opacity;
|
|
4533
|
+
this.opacity = setRangeValue(data.opacity);
|
|
4537
4534
|
}
|
|
4538
4535
|
if (data.width !== undefined) {
|
|
4539
|
-
this.width = data.width;
|
|
4536
|
+
this.width = setRangeValue(data.width);
|
|
4540
4537
|
}
|
|
4541
4538
|
if (data.radius !== undefined) {
|
|
4542
|
-
this.radius = data.radius;
|
|
4539
|
+
this.radius = setRangeValue(data.radius);
|
|
4543
4540
|
}
|
|
4544
4541
|
if (data.color !== undefined) {
|
|
4545
4542
|
this.color = OptionsColor.create(this.color, data.color);
|
|
@@ -4620,16 +4617,16 @@
|
|
|
4620
4617
|
this.enabled = data.enabled;
|
|
4621
4618
|
}
|
|
4622
4619
|
if (data.distance !== undefined) {
|
|
4623
|
-
this.distance = data.distance;
|
|
4620
|
+
this.distance = setRangeValue(data.distance);
|
|
4624
4621
|
}
|
|
4625
4622
|
if (data.duration !== undefined) {
|
|
4626
|
-
this.duration = data.duration;
|
|
4623
|
+
this.duration = setRangeValue(data.duration);
|
|
4627
4624
|
}
|
|
4628
4625
|
if (data.factor !== undefined) {
|
|
4629
|
-
this.factor = data.factor;
|
|
4626
|
+
this.factor = setRangeValue(data.factor);
|
|
4630
4627
|
}
|
|
4631
4628
|
if (data.speed !== undefined) {
|
|
4632
|
-
this.speed = data.speed;
|
|
4629
|
+
this.speed = setRangeValue(data.speed);
|
|
4633
4630
|
}
|
|
4634
4631
|
}
|
|
4635
4632
|
}
|
|
@@ -4646,7 +4643,7 @@
|
|
|
4646
4643
|
this.enable = data.enable;
|
|
4647
4644
|
}
|
|
4648
4645
|
if (data.value !== undefined) {
|
|
4649
|
-
this.value = data.value;
|
|
4646
|
+
this.value = setRangeValue(data.value);
|
|
4650
4647
|
}
|
|
4651
4648
|
}
|
|
4652
4649
|
}
|
|
@@ -4692,7 +4689,7 @@
|
|
|
4692
4689
|
this.enable = data.enable;
|
|
4693
4690
|
}
|
|
4694
4691
|
if (data.speed !== undefined) {
|
|
4695
|
-
this.speed = data.speed;
|
|
4692
|
+
this.speed = setRangeValue(data.speed);
|
|
4696
4693
|
}
|
|
4697
4694
|
if (data.sync !== undefined) {
|
|
4698
4695
|
this.sync = data.sync;
|
|
@@ -4948,7 +4945,7 @@
|
|
|
4948
4945
|
this.enable = data.enable;
|
|
4949
4946
|
}
|
|
4950
4947
|
if (data.speed !== undefined) {
|
|
4951
|
-
this.speed = data.speed;
|
|
4948
|
+
this.speed = setRangeValue(data.speed);
|
|
4952
4949
|
}
|
|
4953
4950
|
if (data.sync !== undefined) {
|
|
4954
4951
|
this.sync = data.sync;
|
|
@@ -4997,7 +4994,7 @@
|
|
|
4997
4994
|
this.frequency = data.frequency;
|
|
4998
4995
|
}
|
|
4999
4996
|
if (data.opacity !== undefined) {
|
|
5000
|
-
this.opacity = data.opacity;
|
|
4997
|
+
this.opacity = setRangeValue(data.opacity);
|
|
5001
4998
|
}
|
|
5002
4999
|
}
|
|
5003
5000
|
}
|
|
@@ -5432,6 +5429,7 @@
|
|
|
5432
5429
|
this.retina = {
|
|
5433
5430
|
maxDistance: {}
|
|
5434
5431
|
};
|
|
5432
|
+
this.ignoresResizeRatio = true;
|
|
5435
5433
|
const pxRatio = container.retina.pixelRatio;
|
|
5436
5434
|
const mainOptions = container.actualOptions;
|
|
5437
5435
|
const particlesOptions = new ParticlesOptions;
|
|
@@ -5471,7 +5469,7 @@
|
|
|
5471
5469
|
max: getRangeMax(sizeRange) * pxRatio,
|
|
5472
5470
|
min: getRangeMin(sizeRange) * pxRatio,
|
|
5473
5471
|
loops: 0,
|
|
5474
|
-
maxLoops: sizeOptions.animation.count
|
|
5472
|
+
maxLoops: getRangeValue(sizeOptions.animation.count)
|
|
5475
5473
|
};
|
|
5476
5474
|
const sizeAnimation = sizeOptions.animation;
|
|
5477
5475
|
if (sizeAnimation.enable) {
|
|
@@ -5505,6 +5503,12 @@
|
|
|
5505
5503
|
this.initialVelocity = this.calculateVelocity();
|
|
5506
5504
|
this.velocity = this.initialVelocity.copy();
|
|
5507
5505
|
this.moveDecay = 1 - getRangeValue(this.options.move.decay);
|
|
5506
|
+
const gravityOptions = this.options.move.gravity;
|
|
5507
|
+
this.gravity = {
|
|
5508
|
+
enable: gravityOptions.enable,
|
|
5509
|
+
acceleration: getRangeValue(gravityOptions.acceleration),
|
|
5510
|
+
inverse: gravityOptions.inverse
|
|
5511
|
+
};
|
|
5508
5512
|
this.position = this.calcPosition(container, position, clamp(zIndexValue, 0, container.zLayers));
|
|
5509
5513
|
this.initialPosition = this.position.copy();
|
|
5510
5514
|
this.offset = Vector.origin;
|
|
@@ -5712,12 +5716,7 @@
|
|
|
5712
5716
|
return overlaps;
|
|
5713
5717
|
}
|
|
5714
5718
|
calculateVelocity() {
|
|
5715
|
-
const baseVelocity = getParticleBaseVelocity(this.direction)
|
|
5716
|
-
const res = baseVelocity.copy();
|
|
5717
|
-
const moveOptions = this.options.move;
|
|
5718
|
-
const rad = Math.PI / 180 * moveOptions.angle.value;
|
|
5719
|
-
const radOffset = Math.PI / 180 * moveOptions.angle.offset;
|
|
5720
|
-
const range = {
|
|
5719
|
+
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 = {
|
|
5721
5720
|
left: radOffset - rad / 2,
|
|
5722
5721
|
right: radOffset + rad / 2
|
|
5723
5722
|
};
|
|
@@ -5867,10 +5866,11 @@
|
|
|
5867
5866
|
}
|
|
5868
5867
|
for (const particle of this.array) {
|
|
5869
5868
|
const resizeFactor = container.canvas.resizeFactor;
|
|
5870
|
-
if (resizeFactor) {
|
|
5869
|
+
if (resizeFactor && !particle.ignoresResizeRatio) {
|
|
5871
5870
|
particle.position.x *= resizeFactor.width;
|
|
5872
5871
|
particle.position.y *= resizeFactor.height;
|
|
5873
5872
|
}
|
|
5873
|
+
particle.ignoresResizeRatio = false;
|
|
5874
5874
|
particle.bubble.inRange = false;
|
|
5875
5875
|
for (const [, plugin] of this.container.plugins) {
|
|
5876
5876
|
if (particle.destroyed) {
|
|
@@ -6106,13 +6106,13 @@
|
|
|
6106
6106
|
container.canvas.size.height = element.offsetHeight * ratio;
|
|
6107
6107
|
}
|
|
6108
6108
|
const particles = options.particles;
|
|
6109
|
-
this.attractDistance = particles.move.attract.distance * ratio;
|
|
6109
|
+
this.attractDistance = getRangeValue(particles.move.attract.distance) * ratio;
|
|
6110
6110
|
this.linksDistance = particles.links.distance * ratio;
|
|
6111
6111
|
this.linksWidth = particles.links.width * ratio;
|
|
6112
|
-
this.sizeAnimationSpeed = particles.size.animation.speed * ratio;
|
|
6113
|
-
this.maxSpeed = particles.move.gravity.maxSpeed * ratio;
|
|
6112
|
+
this.sizeAnimationSpeed = getRangeValue(particles.size.animation.speed) * ratio;
|
|
6113
|
+
this.maxSpeed = getRangeValue(particles.move.gravity.maxSpeed) * ratio;
|
|
6114
6114
|
if (particles.orbit.radius !== undefined) {
|
|
6115
|
-
this.orbitRadius = particles.orbit.radius * this.container.retina.pixelRatio;
|
|
6115
|
+
this.orbitRadius = getRangeValue(particles.orbit.radius) * this.container.retina.pixelRatio;
|
|
6116
6116
|
}
|
|
6117
6117
|
const modes = options.interactivity.modes;
|
|
6118
6118
|
this.connectModeDistance = modes.connect.distance * ratio;
|
|
@@ -6132,19 +6132,19 @@
|
|
|
6132
6132
|
const ratio = this.pixelRatio;
|
|
6133
6133
|
const moveDistance = options.move.distance;
|
|
6134
6134
|
const props = particle.retina;
|
|
6135
|
-
props.attractDistance = options.move.attract.distance * ratio;
|
|
6135
|
+
props.attractDistance = getRangeValue(options.move.attract.distance) * ratio;
|
|
6136
6136
|
props.linksDistance = options.links.distance * ratio;
|
|
6137
6137
|
props.linksWidth = options.links.width * ratio;
|
|
6138
6138
|
props.moveDrift = getRangeValue(options.move.drift) * ratio;
|
|
6139
6139
|
props.moveSpeed = getRangeValue(options.move.speed) * ratio;
|
|
6140
|
-
props.sizeAnimationSpeed = options.size.animation.speed * ratio;
|
|
6140
|
+
props.sizeAnimationSpeed = getRangeValue(options.size.animation.speed) * ratio;
|
|
6141
6141
|
if (particle.spin) {
|
|
6142
6142
|
props.spinAcceleration = getRangeValue(options.move.spin.acceleration) * ratio;
|
|
6143
6143
|
}
|
|
6144
6144
|
const maxDistance = props.maxDistance;
|
|
6145
6145
|
maxDistance.horizontal = moveDistance.horizontal !== undefined ? moveDistance.horizontal * ratio : undefined;
|
|
6146
6146
|
maxDistance.vertical = moveDistance.vertical !== undefined ? moveDistance.vertical * ratio : undefined;
|
|
6147
|
-
props.maxSpeed = options.move.gravity.maxSpeed * ratio;
|
|
6147
|
+
props.maxSpeed = getRangeValue(options.move.gravity.maxSpeed) * ratio;
|
|
6148
6148
|
}
|
|
6149
6149
|
handleMotionChange(mediaQuery) {
|
|
6150
6150
|
const options = this.container.actualOptions;
|
|
@@ -6890,7 +6890,7 @@
|
|
|
6890
6890
|
}
|
|
6891
6891
|
const rotateAnimation = particle.options.rotate.animation;
|
|
6892
6892
|
if (rotateAnimation.enable) {
|
|
6893
|
-
particle.rotate.velocity = rotateAnimation.speed / 360 * this.container.retina.reduceFactor;
|
|
6893
|
+
particle.rotate.velocity = getRangeValue(rotateAnimation.speed) / 360 * this.container.retina.reduceFactor;
|
|
6894
6894
|
if (!rotateAnimation.sync) {
|
|
6895
6895
|
particle.rotate.velocity *= Math.random();
|
|
6896
6896
|
}
|
|
@@ -7873,7 +7873,7 @@
|
|
|
7873
7873
|
min: getRangeMin(opacityOptions.value),
|
|
7874
7874
|
value: getRangeValue(opacityOptions.value),
|
|
7875
7875
|
loops: 0,
|
|
7876
|
-
maxLoops: opacityOptions.animation.count
|
|
7876
|
+
maxLoops: getRangeValue(opacityOptions.animation.count)
|
|
7877
7877
|
};
|
|
7878
7878
|
const opacityAnimation = opacityOptions.animation;
|
|
7879
7879
|
if (opacityAnimation.enable) {
|
|
@@ -7898,7 +7898,7 @@
|
|
|
7898
7898
|
particle.opacity.status = 1;
|
|
7899
7899
|
break;
|
|
7900
7900
|
}
|
|
7901
|
-
particle.opacity.velocity = opacityAnimation.speed / 100 * this.container.retina.reduceFactor;
|
|
7901
|
+
particle.opacity.velocity = getRangeValue(opacityAnimation.speed) / 100 * this.container.retina.reduceFactor;
|
|
7902
7902
|
if (!opacityAnimation.sync) {
|
|
7903
7903
|
particle.opacity.velocity *= Math.random();
|
|
7904
7904
|
}
|
|
@@ -8426,7 +8426,7 @@
|
|
|
8426
8426
|
const twinkling = Math.random() < twinkleFreq;
|
|
8427
8427
|
if (twinkling && twinkleRgb !== undefined) {
|
|
8428
8428
|
colorLine = twinkleRgb;
|
|
8429
|
-
opacity = twinkle.opacity;
|
|
8429
|
+
opacity = getRangeValue(twinkle.opacity);
|
|
8430
8430
|
}
|
|
8431
8431
|
}
|
|
8432
8432
|
if (!colorLine) {
|