tsparticles 1.41.6 → 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 +3 -1
- package/Core/Interfaces/ICoordinates.d.ts +8 -0
- package/Core/Interfaces/IParticleGravity.d.ts +5 -0
- package/Core/Interfaces/IParticleGravity.js +2 -0
- package/Core/Interfaces/index.d.ts +1 -0
- package/Core/Interfaces/index.js +1 -0
- package/Core/Particle.d.ts +2 -1
- package/Core/Particle.js +8 -7
- package/Core/Retina.js +7 -7
- package/Core/Utils/ParticlesMover.js +2 -2
- package/Interactions/Particles/Links/LinkInstance.js +1 -1
- package/Options/Classes/AnimatableGradient.d.ts +4 -4
- package/Options/Classes/AnimatableGradient.js +4 -4
- package/Options/Classes/AnimationOptions.d.ts +5 -5
- package/Options/Classes/AnimationOptions.js +3 -2
- package/Options/Classes/ColorAnimation.d.ts +2 -2
- package/Options/Classes/ColorAnimation.js +2 -2
- package/Options/Classes/Particles/Move/Attract.d.ts +2 -2
- package/Options/Classes/Particles/Move/Attract.js +2 -1
- package/Options/Classes/Particles/Move/MoveAngle.d.ts +3 -3
- package/Options/Classes/Particles/Move/MoveAngle.js +3 -2
- package/Options/Classes/Particles/Move/MoveGravity.d.ts +5 -5
- package/Options/Classes/Particles/Move/MoveGravity.js +3 -2
- package/Options/Classes/Particles/Orbit/Orbit.d.ts +4 -4
- package/Options/Classes/Particles/Orbit/Orbit.js +4 -3
- package/Options/Classes/Particles/Repulse/Repulse.d.ts +5 -5
- package/Options/Classes/Particles/Repulse/Repulse.js +5 -4
- package/Options/Classes/Particles/Roll/RollLight.d.ts +2 -2
- package/Options/Classes/Particles/Roll/RollLight.js +2 -1
- package/Options/Classes/Particles/Rotate/RotateAnimation.d.ts +2 -2
- package/Options/Classes/Particles/Rotate/RotateAnimation.js +2 -1
- package/Options/Classes/Particles/Tilt/TiltAnimation.d.ts +2 -2
- package/Options/Classes/Particles/Tilt/TiltAnimation.js +2 -1
- package/Options/Classes/Particles/Twinkle/TwinkleValues.d.ts +2 -2
- package/Options/Classes/Particles/Twinkle/TwinkleValues.js +2 -1
- package/Options/Interfaces/IAnimation.d.ts +3 -2
- package/Options/Interfaces/Particles/Move/IAttract.d.ts +3 -2
- package/Options/Interfaces/Particles/Move/IMoveAngle.d.ts +3 -2
- package/Options/Interfaces/Particles/Move/IMoveGravity.d.ts +3 -2
- package/Options/Interfaces/Particles/Orbit/IOrbit.d.ts +4 -3
- package/Options/Interfaces/Particles/Repulse/IRepulse.d.ts +5 -4
- package/Options/Interfaces/Particles/Roll/IRollLight.d.ts +2 -1
- package/Options/Interfaces/Particles/Rotate/IRotateAnimation.d.ts +2 -1
- package/Options/Interfaces/Particles/Tilt/ITiltAnimation.d.ts +2 -1
- package/Options/Interfaces/Particles/Twinkle/ITwinkleValues.d.ts +3 -2
- package/Plugins/Absorbers/AbsorberInstance.js +1 -1
- package/Plugins/Absorbers/Options/Classes/Absorber.d.ts +2 -2
- package/Plugins/Absorbers/Options/Classes/Absorber.js +8 -4
- package/Plugins/Absorbers/Options/Interfaces/IAbsorber.d.ts +2 -2
- package/Plugins/Emitters/EmitterInstance.js +3 -3
- package/Plugins/Emitters/Options/Classes/Emitter.d.ts +2 -2
- package/Plugins/Emitters/Options/Classes/Emitter.js +8 -5
- package/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +2 -2
- package/Updaters/Angle/AngleUpdater.js +2 -1
- package/Updaters/Opacity/OpacityUpdater.js +3 -2
- package/Updaters/Roll/RollUpdater.js +3 -3
- package/Updaters/Tilt/TiltUpdater.js +1 -1
- package/Utils/ColorUtils.js +1 -1
- package/browser/Core/Canvas.js +4 -2
- package/browser/Core/Interfaces/ICoordinates.d.ts +8 -0
- package/browser/Core/Interfaces/IParticleGravity.d.ts +5 -0
- package/browser/Core/Interfaces/IParticleGravity.js +1 -0
- package/browser/Core/Interfaces/index.d.ts +1 -0
- package/browser/Core/Interfaces/index.js +1 -0
- package/browser/Core/Particle.d.ts +2 -1
- package/browser/Core/Particle.js +8 -7
- package/browser/Core/Retina.js +7 -7
- package/browser/Core/Utils/ParticlesMover.js +2 -2
- package/browser/Interactions/Particles/Links/LinkInstance.js +2 -2
- package/browser/Options/Classes/AnimatableGradient.d.ts +4 -4
- package/browser/Options/Classes/AnimatableGradient.js +4 -4
- package/browser/Options/Classes/AnimationOptions.d.ts +5 -5
- package/browser/Options/Classes/AnimationOptions.js +3 -2
- package/browser/Options/Classes/ColorAnimation.d.ts +2 -2
- package/browser/Options/Classes/ColorAnimation.js +2 -2
- package/browser/Options/Classes/Particles/Move/Attract.d.ts +2 -2
- package/browser/Options/Classes/Particles/Move/Attract.js +2 -1
- package/browser/Options/Classes/Particles/Move/MoveAngle.d.ts +3 -3
- package/browser/Options/Classes/Particles/Move/MoveAngle.js +3 -2
- package/browser/Options/Classes/Particles/Move/MoveGravity.d.ts +5 -5
- package/browser/Options/Classes/Particles/Move/MoveGravity.js +3 -2
- package/browser/Options/Classes/Particles/Orbit/Orbit.d.ts +4 -4
- package/browser/Options/Classes/Particles/Orbit/Orbit.js +4 -3
- package/browser/Options/Classes/Particles/Repulse/Repulse.d.ts +5 -5
- package/browser/Options/Classes/Particles/Repulse/Repulse.js +5 -4
- package/browser/Options/Classes/Particles/Roll/RollLight.d.ts +2 -2
- package/browser/Options/Classes/Particles/Roll/RollLight.js +2 -1
- package/browser/Options/Classes/Particles/Rotate/RotateAnimation.d.ts +2 -2
- package/browser/Options/Classes/Particles/Rotate/RotateAnimation.js +2 -1
- package/browser/Options/Classes/Particles/Tilt/TiltAnimation.d.ts +2 -2
- package/browser/Options/Classes/Particles/Tilt/TiltAnimation.js +2 -1
- package/browser/Options/Classes/Particles/Twinkle/TwinkleValues.d.ts +2 -2
- package/browser/Options/Classes/Particles/Twinkle/TwinkleValues.js +2 -1
- package/browser/Options/Interfaces/IAnimation.d.ts +3 -2
- package/browser/Options/Interfaces/Particles/Move/IAttract.d.ts +3 -2
- package/browser/Options/Interfaces/Particles/Move/IMoveAngle.d.ts +3 -2
- package/browser/Options/Interfaces/Particles/Move/IMoveGravity.d.ts +3 -2
- package/browser/Options/Interfaces/Particles/Orbit/IOrbit.d.ts +4 -3
- package/browser/Options/Interfaces/Particles/Repulse/IRepulse.d.ts +5 -4
- package/browser/Options/Interfaces/Particles/Roll/IRollLight.d.ts +2 -1
- package/browser/Options/Interfaces/Particles/Rotate/IRotateAnimation.d.ts +2 -1
- package/browser/Options/Interfaces/Particles/Tilt/ITiltAnimation.d.ts +2 -1
- package/browser/Options/Interfaces/Particles/Twinkle/ITwinkleValues.d.ts +3 -2
- package/browser/Plugins/Absorbers/AbsorberInstance.js +1 -1
- package/browser/Plugins/Absorbers/Options/Classes/Absorber.d.ts +2 -2
- package/browser/Plugins/Absorbers/Options/Classes/Absorber.js +8 -4
- package/browser/Plugins/Absorbers/Options/Interfaces/IAbsorber.d.ts +2 -2
- package/browser/Plugins/Emitters/EmitterInstance.js +3 -3
- package/browser/Plugins/Emitters/Options/Classes/Emitter.d.ts +2 -2
- package/browser/Plugins/Emitters/Options/Classes/Emitter.js +8 -5
- package/browser/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +2 -2
- package/browser/Updaters/Angle/AngleUpdater.js +2 -1
- package/browser/Updaters/Opacity/OpacityUpdater.js +3 -2
- package/browser/Updaters/Roll/RollUpdater.js +3 -3
- package/browser/Updaters/Tilt/TiltUpdater.js +1 -1
- package/browser/Utils/ColorUtils.js +2 -2
- package/esm/Core/Canvas.js +4 -2
- package/esm/Core/Interfaces/ICoordinates.d.ts +8 -0
- package/esm/Core/Interfaces/IParticleGravity.d.ts +5 -0
- package/esm/Core/Interfaces/IParticleGravity.js +1 -0
- package/esm/Core/Interfaces/index.d.ts +1 -0
- package/esm/Core/Interfaces/index.js +1 -0
- package/esm/Core/Particle.d.ts +2 -1
- package/esm/Core/Particle.js +8 -7
- package/esm/Core/Retina.js +7 -7
- package/esm/Core/Utils/ParticlesMover.js +2 -2
- package/esm/Interactions/Particles/Links/LinkInstance.js +2 -2
- package/esm/Options/Classes/AnimatableGradient.d.ts +4 -4
- package/esm/Options/Classes/AnimatableGradient.js +4 -4
- package/esm/Options/Classes/AnimationOptions.d.ts +5 -5
- package/esm/Options/Classes/AnimationOptions.js +3 -2
- package/esm/Options/Classes/ColorAnimation.d.ts +2 -2
- package/esm/Options/Classes/ColorAnimation.js +2 -2
- package/esm/Options/Classes/Particles/Move/Attract.d.ts +2 -2
- package/esm/Options/Classes/Particles/Move/Attract.js +2 -1
- package/esm/Options/Classes/Particles/Move/MoveAngle.d.ts +3 -3
- package/esm/Options/Classes/Particles/Move/MoveAngle.js +3 -2
- package/esm/Options/Classes/Particles/Move/MoveGravity.d.ts +5 -5
- package/esm/Options/Classes/Particles/Move/MoveGravity.js +3 -2
- package/esm/Options/Classes/Particles/Orbit/Orbit.d.ts +4 -4
- package/esm/Options/Classes/Particles/Orbit/Orbit.js +4 -3
- package/esm/Options/Classes/Particles/Repulse/Repulse.d.ts +5 -5
- package/esm/Options/Classes/Particles/Repulse/Repulse.js +5 -4
- package/esm/Options/Classes/Particles/Roll/RollLight.d.ts +2 -2
- package/esm/Options/Classes/Particles/Roll/RollLight.js +2 -1
- package/esm/Options/Classes/Particles/Rotate/RotateAnimation.d.ts +2 -2
- package/esm/Options/Classes/Particles/Rotate/RotateAnimation.js +2 -1
- package/esm/Options/Classes/Particles/Tilt/TiltAnimation.d.ts +2 -2
- package/esm/Options/Classes/Particles/Tilt/TiltAnimation.js +2 -1
- package/esm/Options/Classes/Particles/Twinkle/TwinkleValues.d.ts +2 -2
- package/esm/Options/Classes/Particles/Twinkle/TwinkleValues.js +2 -1
- package/esm/Options/Interfaces/IAnimation.d.ts +3 -2
- package/esm/Options/Interfaces/Particles/Move/IAttract.d.ts +3 -2
- package/esm/Options/Interfaces/Particles/Move/IMoveAngle.d.ts +3 -2
- package/esm/Options/Interfaces/Particles/Move/IMoveGravity.d.ts +3 -2
- package/esm/Options/Interfaces/Particles/Orbit/IOrbit.d.ts +4 -3
- package/esm/Options/Interfaces/Particles/Repulse/IRepulse.d.ts +5 -4
- package/esm/Options/Interfaces/Particles/Roll/IRollLight.d.ts +2 -1
- package/esm/Options/Interfaces/Particles/Rotate/IRotateAnimation.d.ts +2 -1
- package/esm/Options/Interfaces/Particles/Tilt/ITiltAnimation.d.ts +2 -1
- package/esm/Options/Interfaces/Particles/Twinkle/ITwinkleValues.d.ts +3 -2
- package/esm/Plugins/Absorbers/AbsorberInstance.js +1 -1
- package/esm/Plugins/Absorbers/Options/Classes/Absorber.d.ts +2 -2
- package/esm/Plugins/Absorbers/Options/Classes/Absorber.js +8 -4
- package/esm/Plugins/Absorbers/Options/Interfaces/IAbsorber.d.ts +2 -2
- package/esm/Plugins/Emitters/EmitterInstance.js +3 -3
- package/esm/Plugins/Emitters/Options/Classes/Emitter.d.ts +2 -2
- package/esm/Plugins/Emitters/Options/Classes/Emitter.js +8 -5
- package/esm/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +2 -2
- package/esm/Updaters/Angle/AngleUpdater.js +2 -1
- package/esm/Updaters/Opacity/OpacityUpdater.js +3 -2
- package/esm/Updaters/Roll/RollUpdater.js +3 -3
- package/esm/Updaters/Tilt/TiltUpdater.js +1 -1
- package/esm/Utils/ColorUtils.js +2 -2
- package/package.json +1 -1
- package/report.html +2 -2
- package/report.slim.html +2 -2
- package/scripts/install.js +11 -2
- package/tsparticles.engine.js +43 -42
- package/tsparticles.engine.min.js +2 -2
- package/tsparticles.interaction.external.attract.js +315 -31
- package/tsparticles.interaction.external.attract.min.js +1 -1
- package/tsparticles.interaction.external.bounce.js +315 -31
- package/tsparticles.interaction.external.bounce.min.js +1 -1
- package/tsparticles.interaction.external.bubble.js +315 -31
- package/tsparticles.interaction.external.bubble.min.js +1 -1
- package/tsparticles.interaction.external.connect.js +315 -31
- package/tsparticles.interaction.external.connect.min.js +1 -1
- package/tsparticles.interaction.external.grab.js +315 -31
- package/tsparticles.interaction.external.grab.min.js +1 -1
- package/tsparticles.interaction.external.repulse.js +315 -31
- package/tsparticles.interaction.external.repulse.min.js +1 -1
- package/tsparticles.interaction.external.trail.js +315 -31
- package/tsparticles.interaction.external.trail.min.js +1 -1
- package/tsparticles.interaction.particles.attract.js +315 -31
- package/tsparticles.interaction.particles.attract.min.js +1 -1
- package/tsparticles.interaction.particles.collisions.js +315 -31
- package/tsparticles.interaction.particles.collisions.min.js +1 -1
- package/tsparticles.interaction.particles.links.js +316 -32
- package/tsparticles.interaction.particles.links.min.js +2 -2
- package/tsparticles.js +69 -62
- package/tsparticles.min.js +2 -2
- package/tsparticles.pathseg.min.js +1 -1
- package/tsparticles.plugins.absorbers.js +323 -36
- package/tsparticles.plugins.absorbers.min.js +2 -2
- package/tsparticles.plugins.emitters.js +426 -139
- package/tsparticles.plugins.emitters.min.js +2 -2
- package/tsparticles.plugins.polygonMask.js +315 -31
- package/tsparticles.plugins.polygonMask.min.js +1 -1
- package/tsparticles.shape.circle.min.js +1 -1
- package/tsparticles.shape.image.js +315 -31
- 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 +315 -31
- package/tsparticles.shape.text.min.js +1 -1
- package/tsparticles.slim.js +47 -46
- package/tsparticles.slim.min.js +2 -2
- package/tsparticles.updater.angle.js +316 -32
- package/tsparticles.updater.angle.min.js +2 -2
- package/tsparticles.updater.color.js +315 -31
- package/tsparticles.updater.color.min.js +2 -2
- package/tsparticles.updater.life.js +315 -31
- package/tsparticles.updater.life.min.js +1 -1
- package/tsparticles.updater.opacity.js +317 -33
- package/tsparticles.updater.opacity.min.js +2 -2
- package/tsparticles.updater.outModes.js +315 -31
- package/tsparticles.updater.outModes.min.js +1 -1
- package/tsparticles.updater.roll.js +318 -34
- package/tsparticles.updater.roll.min.js +2 -2
- package/tsparticles.updater.size.js +315 -31
- package/tsparticles.updater.size.min.js +1 -1
- package/tsparticles.updater.strokeColor.js +315 -31
- package/tsparticles.updater.strokeColor.min.js +2 -2
- package/tsparticles.updater.tilt.js +316 -32
- package/tsparticles.updater.tilt.min.js +2 -2
- package/tsparticles.updater.wobble.js +315 -31
- package/tsparticles.updater.wobble.min.js +1 -1
- package/umd/Core/Canvas.js +3 -1
- package/umd/Core/Interfaces/ICoordinates.d.ts +8 -0
- package/umd/Core/Interfaces/IParticleGravity.d.ts +5 -0
- package/umd/Core/Interfaces/IParticleGravity.js +12 -0
- package/umd/Core/Interfaces/index.d.ts +1 -0
- package/umd/Core/Interfaces/index.js +2 -1
- package/umd/Core/Particle.d.ts +2 -1
- package/umd/Core/Particle.js +8 -7
- package/umd/Core/Retina.js +7 -7
- package/umd/Core/Utils/ParticlesMover.js +2 -2
- package/umd/Interactions/Particles/Links/LinkInstance.js +1 -1
- package/umd/Options/Classes/AnimatableGradient.d.ts +4 -4
- package/umd/Options/Classes/AnimatableGradient.js +4 -4
- package/umd/Options/Classes/AnimationOptions.d.ts +5 -5
- package/umd/Options/Classes/AnimationOptions.js +4 -3
- package/umd/Options/Classes/ColorAnimation.d.ts +2 -2
- package/umd/Options/Classes/ColorAnimation.js +2 -2
- package/umd/Options/Classes/Particles/Move/Attract.d.ts +2 -2
- package/umd/Options/Classes/Particles/Move/Attract.js +3 -2
- package/umd/Options/Classes/Particles/Move/MoveAngle.d.ts +3 -3
- package/umd/Options/Classes/Particles/Move/MoveAngle.js +4 -3
- package/umd/Options/Classes/Particles/Move/MoveGravity.d.ts +5 -5
- package/umd/Options/Classes/Particles/Move/MoveGravity.js +4 -3
- package/umd/Options/Classes/Particles/Orbit/Orbit.d.ts +4 -4
- package/umd/Options/Classes/Particles/Orbit/Orbit.js +5 -4
- package/umd/Options/Classes/Particles/Repulse/Repulse.d.ts +5 -5
- package/umd/Options/Classes/Particles/Repulse/Repulse.js +6 -5
- package/umd/Options/Classes/Particles/Roll/RollLight.d.ts +2 -2
- package/umd/Options/Classes/Particles/Roll/RollLight.js +3 -2
- package/umd/Options/Classes/Particles/Rotate/RotateAnimation.d.ts +2 -2
- package/umd/Options/Classes/Particles/Rotate/RotateAnimation.js +3 -2
- package/umd/Options/Classes/Particles/Tilt/TiltAnimation.d.ts +2 -2
- package/umd/Options/Classes/Particles/Tilt/TiltAnimation.js +3 -2
- package/umd/Options/Classes/Particles/Twinkle/TwinkleValues.d.ts +2 -2
- package/umd/Options/Classes/Particles/Twinkle/TwinkleValues.js +3 -2
- package/umd/Options/Interfaces/IAnimation.d.ts +3 -2
- package/umd/Options/Interfaces/Particles/Move/IAttract.d.ts +3 -2
- package/umd/Options/Interfaces/Particles/Move/IMoveAngle.d.ts +3 -2
- package/umd/Options/Interfaces/Particles/Move/IMoveGravity.d.ts +3 -2
- package/umd/Options/Interfaces/Particles/Orbit/IOrbit.d.ts +4 -3
- package/umd/Options/Interfaces/Particles/Repulse/IRepulse.d.ts +5 -4
- package/umd/Options/Interfaces/Particles/Roll/IRollLight.d.ts +2 -1
- package/umd/Options/Interfaces/Particles/Rotate/IRotateAnimation.d.ts +2 -1
- package/umd/Options/Interfaces/Particles/Tilt/ITiltAnimation.d.ts +2 -1
- package/umd/Options/Interfaces/Particles/Twinkle/ITwinkleValues.d.ts +3 -2
- package/umd/Plugins/Absorbers/AbsorberInstance.js +1 -1
- package/umd/Plugins/Absorbers/Options/Classes/Absorber.d.ts +2 -2
- package/umd/Plugins/Absorbers/Options/Classes/Absorber.js +9 -5
- package/umd/Plugins/Absorbers/Options/Interfaces/IAbsorber.d.ts +2 -2
- package/umd/Plugins/Emitters/EmitterInstance.js +3 -3
- package/umd/Plugins/Emitters/Options/Classes/Emitter.d.ts +2 -2
- package/umd/Plugins/Emitters/Options/Classes/Emitter.js +9 -6
- package/umd/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +2 -2
- package/umd/Updaters/Angle/AngleUpdater.js +2 -1
- package/umd/Updaters/Opacity/OpacityUpdater.js +3 -2
- package/umd/Updaters/Roll/RollUpdater.js +3 -3
- package/umd/Updaters/Tilt/TiltUpdater.js +1 -1
- package/umd/Utils/ColorUtils.js +1 -1
package/scripts/install.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
|
+
const particlesJsFoundError = "particles.js-found";
|
|
2
3
|
const reactParticlesJsFoundError = "react-particles-js-found";
|
|
3
4
|
|
|
4
5
|
try {
|
|
@@ -20,8 +21,16 @@ try {
|
|
|
20
21
|
return;
|
|
21
22
|
}
|
|
22
23
|
|
|
24
|
+
if (dependencies["particles.js"]) {
|
|
25
|
+
console.error("\x1b[31m%s\x1b[0m", "The package particles.js can't be installed with tsparticles, since it can lead to unexpected behaviors, please uninstall particles.js and remove it from the package.json file.");
|
|
26
|
+
|
|
27
|
+
throw new Error(reactParticlesJsFoundError);
|
|
28
|
+
}
|
|
29
|
+
|
|
23
30
|
if (dependencies["react-particles-js"]) {
|
|
24
|
-
console.error("\x1b[31m%s\x1b[0m", "The package react-particles-js has been deprecated and is not supported anymore.
|
|
31
|
+
console.error("\x1b[31m%s\x1b[0m", "The package react-particles-js has been deprecated and is not supported anymore.");
|
|
32
|
+
console.error("\x1b[31m%s\x1b[0m", "Please consider switching to react-tsparticles package.")
|
|
33
|
+
console.error("\x1b[31m%s\x1b[0m", "This error will be fixed once react-particles-js is removed from the package.json file.");
|
|
25
34
|
|
|
26
35
|
throw new Error(reactParticlesJsFoundError);
|
|
27
36
|
}
|
|
@@ -88,7 +97,7 @@ try {
|
|
|
88
97
|
}
|
|
89
98
|
}
|
|
90
99
|
} catch (error) {
|
|
91
|
-
if (error.message === reactParticlesJsFoundError) {
|
|
100
|
+
if (error.message === reactParticlesJsFoundError || error.message === particlesJsFoundError) {
|
|
92
101
|
throw error;
|
|
93
102
|
}
|
|
94
103
|
|
package/tsparticles.engine.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;
|
|
@@ -2619,7 +2619,7 @@
|
|
|
2619
2619
|
const zIndexOptions = particle.options.zIndex;
|
|
2620
2620
|
const zOpacityFactor = (1 - particle.zIndexFactor) ** zIndexOptions.opacityRate;
|
|
2621
2621
|
const radius = particle.getRadius();
|
|
2622
|
-
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;
|
|
2623
2623
|
const strokeOpacity = (_f = (_e = particle.stroke) === null || _e === void 0 ? void 0 : _e.opacity) !== null && _f !== void 0 ? _f : opacity;
|
|
2624
2624
|
const zOpacity = opacity * zOpacityFactor;
|
|
2625
2625
|
const fillColorValue = fColor ? getStyleFromHsl(fColor, zOpacity) : undefined;
|
|
@@ -3637,7 +3637,7 @@
|
|
|
3637
3637
|
return;
|
|
3638
3638
|
}
|
|
3639
3639
|
if (data.count !== undefined) {
|
|
3640
|
-
this.count = data.count;
|
|
3640
|
+
this.count = setRangeValue(data.count);
|
|
3641
3641
|
}
|
|
3642
3642
|
if (data.enable !== undefined) {
|
|
3643
3643
|
this.enable = data.enable;
|
|
@@ -3646,7 +3646,7 @@
|
|
|
3646
3646
|
this.offset = setRangeValue(data.offset);
|
|
3647
3647
|
}
|
|
3648
3648
|
if (data.speed !== undefined) {
|
|
3649
|
-
this.speed = data.speed;
|
|
3649
|
+
this.speed = setRangeValue(data.speed);
|
|
3650
3650
|
}
|
|
3651
3651
|
if (data.sync !== undefined) {
|
|
3652
3652
|
this.sync = data.sync;
|
|
@@ -3794,13 +3794,13 @@
|
|
|
3794
3794
|
return;
|
|
3795
3795
|
}
|
|
3796
3796
|
if (data.count !== undefined) {
|
|
3797
|
-
this.count = data.count;
|
|
3797
|
+
this.count = setRangeValue(data.count);
|
|
3798
3798
|
}
|
|
3799
3799
|
if (data.enable !== undefined) {
|
|
3800
3800
|
this.enable = data.enable;
|
|
3801
3801
|
}
|
|
3802
3802
|
if (data.speed !== undefined) {
|
|
3803
|
-
this.speed = data.speed;
|
|
3803
|
+
this.speed = setRangeValue(data.speed);
|
|
3804
3804
|
}
|
|
3805
3805
|
if (data.sync !== undefined) {
|
|
3806
3806
|
this.sync = data.sync;
|
|
@@ -3820,13 +3820,13 @@
|
|
|
3820
3820
|
return;
|
|
3821
3821
|
}
|
|
3822
3822
|
if (data.count !== undefined) {
|
|
3823
|
-
this.count = data.count;
|
|
3823
|
+
this.count = setRangeValue(data.count);
|
|
3824
3824
|
}
|
|
3825
3825
|
if (data.enable !== undefined) {
|
|
3826
3826
|
this.enable = data.enable;
|
|
3827
3827
|
}
|
|
3828
3828
|
if (data.speed !== undefined) {
|
|
3829
|
-
this.speed = data.speed;
|
|
3829
|
+
this.speed = setRangeValue(data.speed);
|
|
3830
3830
|
}
|
|
3831
3831
|
if (data.sync !== undefined) {
|
|
3832
3832
|
this.sync = data.sync;
|
|
@@ -4152,7 +4152,7 @@
|
|
|
4152
4152
|
return;
|
|
4153
4153
|
}
|
|
4154
4154
|
if (data.distance !== undefined) {
|
|
4155
|
-
this.distance = data.distance;
|
|
4155
|
+
this.distance = setRangeValue(data.distance);
|
|
4156
4156
|
}
|
|
4157
4157
|
if (data.enable !== undefined) {
|
|
4158
4158
|
this.enable = data.enable;
|
|
@@ -4177,10 +4177,10 @@
|
|
|
4177
4177
|
return;
|
|
4178
4178
|
}
|
|
4179
4179
|
if (data.offset !== undefined) {
|
|
4180
|
-
this.offset = data.offset;
|
|
4180
|
+
this.offset = setRangeValue(data.offset);
|
|
4181
4181
|
}
|
|
4182
4182
|
if (data.value !== undefined) {
|
|
4183
|
-
this.value = data.value;
|
|
4183
|
+
this.value = setRangeValue(data.value);
|
|
4184
4184
|
}
|
|
4185
4185
|
}
|
|
4186
4186
|
}
|
|
@@ -4196,7 +4196,7 @@
|
|
|
4196
4196
|
return;
|
|
4197
4197
|
}
|
|
4198
4198
|
if (data.acceleration !== undefined) {
|
|
4199
|
-
this.acceleration = data.acceleration;
|
|
4199
|
+
this.acceleration = setRangeValue(data.acceleration);
|
|
4200
4200
|
}
|
|
4201
4201
|
if (data.enable !== undefined) {
|
|
4202
4202
|
this.enable = data.enable;
|
|
@@ -4205,7 +4205,7 @@
|
|
|
4205
4205
|
this.inverse = data.inverse;
|
|
4206
4206
|
}
|
|
4207
4207
|
if (data.maxSpeed !== undefined) {
|
|
4208
|
-
this.maxSpeed = data.maxSpeed;
|
|
4208
|
+
this.maxSpeed = setRangeValue(data.maxSpeed);
|
|
4209
4209
|
}
|
|
4210
4210
|
}
|
|
4211
4211
|
}
|
|
@@ -4420,13 +4420,13 @@
|
|
|
4420
4420
|
return;
|
|
4421
4421
|
}
|
|
4422
4422
|
if (data.count !== undefined) {
|
|
4423
|
-
this.count = data.count;
|
|
4423
|
+
this.count = setRangeValue(data.count);
|
|
4424
4424
|
}
|
|
4425
4425
|
if (data.enable !== undefined) {
|
|
4426
4426
|
this.enable = data.enable;
|
|
4427
4427
|
}
|
|
4428
4428
|
if (data.speed !== undefined) {
|
|
4429
|
-
this.speed = data.speed;
|
|
4429
|
+
this.speed = setRangeValue(data.speed);
|
|
4430
4430
|
}
|
|
4431
4431
|
if (data.sync !== undefined) {
|
|
4432
4432
|
this.sync = data.sync;
|
|
@@ -4530,13 +4530,13 @@
|
|
|
4530
4530
|
this.enable = data.enable;
|
|
4531
4531
|
}
|
|
4532
4532
|
if (data.opacity !== undefined) {
|
|
4533
|
-
this.opacity = data.opacity;
|
|
4533
|
+
this.opacity = setRangeValue(data.opacity);
|
|
4534
4534
|
}
|
|
4535
4535
|
if (data.width !== undefined) {
|
|
4536
|
-
this.width = data.width;
|
|
4536
|
+
this.width = setRangeValue(data.width);
|
|
4537
4537
|
}
|
|
4538
4538
|
if (data.radius !== undefined) {
|
|
4539
|
-
this.radius = data.radius;
|
|
4539
|
+
this.radius = setRangeValue(data.radius);
|
|
4540
4540
|
}
|
|
4541
4541
|
if (data.color !== undefined) {
|
|
4542
4542
|
this.color = OptionsColor.create(this.color, data.color);
|
|
@@ -4617,16 +4617,16 @@
|
|
|
4617
4617
|
this.enabled = data.enabled;
|
|
4618
4618
|
}
|
|
4619
4619
|
if (data.distance !== undefined) {
|
|
4620
|
-
this.distance = data.distance;
|
|
4620
|
+
this.distance = setRangeValue(data.distance);
|
|
4621
4621
|
}
|
|
4622
4622
|
if (data.duration !== undefined) {
|
|
4623
|
-
this.duration = data.duration;
|
|
4623
|
+
this.duration = setRangeValue(data.duration);
|
|
4624
4624
|
}
|
|
4625
4625
|
if (data.factor !== undefined) {
|
|
4626
|
-
this.factor = data.factor;
|
|
4626
|
+
this.factor = setRangeValue(data.factor);
|
|
4627
4627
|
}
|
|
4628
4628
|
if (data.speed !== undefined) {
|
|
4629
|
-
this.speed = data.speed;
|
|
4629
|
+
this.speed = setRangeValue(data.speed);
|
|
4630
4630
|
}
|
|
4631
4631
|
}
|
|
4632
4632
|
}
|
|
@@ -4643,7 +4643,7 @@
|
|
|
4643
4643
|
this.enable = data.enable;
|
|
4644
4644
|
}
|
|
4645
4645
|
if (data.value !== undefined) {
|
|
4646
|
-
this.value = data.value;
|
|
4646
|
+
this.value = setRangeValue(data.value);
|
|
4647
4647
|
}
|
|
4648
4648
|
}
|
|
4649
4649
|
}
|
|
@@ -4689,7 +4689,7 @@
|
|
|
4689
4689
|
this.enable = data.enable;
|
|
4690
4690
|
}
|
|
4691
4691
|
if (data.speed !== undefined) {
|
|
4692
|
-
this.speed = data.speed;
|
|
4692
|
+
this.speed = setRangeValue(data.speed);
|
|
4693
4693
|
}
|
|
4694
4694
|
if (data.sync !== undefined) {
|
|
4695
4695
|
this.sync = data.sync;
|
|
@@ -4945,7 +4945,7 @@
|
|
|
4945
4945
|
this.enable = data.enable;
|
|
4946
4946
|
}
|
|
4947
4947
|
if (data.speed !== undefined) {
|
|
4948
|
-
this.speed = data.speed;
|
|
4948
|
+
this.speed = setRangeValue(data.speed);
|
|
4949
4949
|
}
|
|
4950
4950
|
if (data.sync !== undefined) {
|
|
4951
4951
|
this.sync = data.sync;
|
|
@@ -4994,7 +4994,7 @@
|
|
|
4994
4994
|
this.frequency = data.frequency;
|
|
4995
4995
|
}
|
|
4996
4996
|
if (data.opacity !== undefined) {
|
|
4997
|
-
this.opacity = data.opacity;
|
|
4997
|
+
this.opacity = setRangeValue(data.opacity);
|
|
4998
4998
|
}
|
|
4999
4999
|
}
|
|
5000
5000
|
}
|
|
@@ -5469,7 +5469,7 @@
|
|
|
5469
5469
|
max: getRangeMax(sizeRange) * pxRatio,
|
|
5470
5470
|
min: getRangeMin(sizeRange) * pxRatio,
|
|
5471
5471
|
loops: 0,
|
|
5472
|
-
maxLoops: sizeOptions.animation.count
|
|
5472
|
+
maxLoops: getRangeValue(sizeOptions.animation.count)
|
|
5473
5473
|
};
|
|
5474
5474
|
const sizeAnimation = sizeOptions.animation;
|
|
5475
5475
|
if (sizeAnimation.enable) {
|
|
@@ -5503,6 +5503,12 @@
|
|
|
5503
5503
|
this.initialVelocity = this.calculateVelocity();
|
|
5504
5504
|
this.velocity = this.initialVelocity.copy();
|
|
5505
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
|
+
};
|
|
5506
5512
|
this.position = this.calcPosition(container, position, clamp(zIndexValue, 0, container.zLayers));
|
|
5507
5513
|
this.initialPosition = this.position.copy();
|
|
5508
5514
|
this.offset = Vector.origin;
|
|
@@ -5710,12 +5716,7 @@
|
|
|
5710
5716
|
return overlaps;
|
|
5711
5717
|
}
|
|
5712
5718
|
calculateVelocity() {
|
|
5713
|
-
const baseVelocity = getParticleBaseVelocity(this.direction)
|
|
5714
|
-
const res = baseVelocity.copy();
|
|
5715
|
-
const moveOptions = this.options.move;
|
|
5716
|
-
const rad = Math.PI / 180 * moveOptions.angle.value;
|
|
5717
|
-
const radOffset = Math.PI / 180 * moveOptions.angle.offset;
|
|
5718
|
-
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 = {
|
|
5719
5720
|
left: radOffset - rad / 2,
|
|
5720
5721
|
right: radOffset + rad / 2
|
|
5721
5722
|
};
|
|
@@ -6105,13 +6106,13 @@
|
|
|
6105
6106
|
container.canvas.size.height = element.offsetHeight * ratio;
|
|
6106
6107
|
}
|
|
6107
6108
|
const particles = options.particles;
|
|
6108
|
-
this.attractDistance = particles.move.attract.distance * ratio;
|
|
6109
|
+
this.attractDistance = getRangeValue(particles.move.attract.distance) * ratio;
|
|
6109
6110
|
this.linksDistance = particles.links.distance * ratio;
|
|
6110
6111
|
this.linksWidth = particles.links.width * ratio;
|
|
6111
|
-
this.sizeAnimationSpeed = particles.size.animation.speed * ratio;
|
|
6112
|
-
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;
|
|
6113
6114
|
if (particles.orbit.radius !== undefined) {
|
|
6114
|
-
this.orbitRadius = particles.orbit.radius * this.container.retina.pixelRatio;
|
|
6115
|
+
this.orbitRadius = getRangeValue(particles.orbit.radius) * this.container.retina.pixelRatio;
|
|
6115
6116
|
}
|
|
6116
6117
|
const modes = options.interactivity.modes;
|
|
6117
6118
|
this.connectModeDistance = modes.connect.distance * ratio;
|
|
@@ -6131,19 +6132,19 @@
|
|
|
6131
6132
|
const ratio = this.pixelRatio;
|
|
6132
6133
|
const moveDistance = options.move.distance;
|
|
6133
6134
|
const props = particle.retina;
|
|
6134
|
-
props.attractDistance = options.move.attract.distance * ratio;
|
|
6135
|
+
props.attractDistance = getRangeValue(options.move.attract.distance) * ratio;
|
|
6135
6136
|
props.linksDistance = options.links.distance * ratio;
|
|
6136
6137
|
props.linksWidth = options.links.width * ratio;
|
|
6137
6138
|
props.moveDrift = getRangeValue(options.move.drift) * ratio;
|
|
6138
6139
|
props.moveSpeed = getRangeValue(options.move.speed) * ratio;
|
|
6139
|
-
props.sizeAnimationSpeed = options.size.animation.speed * ratio;
|
|
6140
|
+
props.sizeAnimationSpeed = getRangeValue(options.size.animation.speed) * ratio;
|
|
6140
6141
|
if (particle.spin) {
|
|
6141
6142
|
props.spinAcceleration = getRangeValue(options.move.spin.acceleration) * ratio;
|
|
6142
6143
|
}
|
|
6143
6144
|
const maxDistance = props.maxDistance;
|
|
6144
6145
|
maxDistance.horizontal = moveDistance.horizontal !== undefined ? moveDistance.horizontal * ratio : undefined;
|
|
6145
6146
|
maxDistance.vertical = moveDistance.vertical !== undefined ? moveDistance.vertical * ratio : undefined;
|
|
6146
|
-
props.maxSpeed = options.move.gravity.maxSpeed * ratio;
|
|
6147
|
+
props.maxSpeed = getRangeValue(options.move.gravity.maxSpeed) * ratio;
|
|
6147
6148
|
}
|
|
6148
6149
|
handleMotionChange(mediaQuery) {
|
|
6149
6150
|
const options = this.container.actualOptions;
|