tsparticles 1.41.6 → 1.42.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Core/Canvas.d.ts +1 -1
- package/Core/Canvas.js +8 -4
- package/Core/Interfaces/ICoordinates.d.ts +8 -0
- package/Core/Interfaces/IParticleGravity.d.ts +5 -0
- package/Core/Interfaces/IParticleGravity.js +2 -0
- package/Core/Interfaces/index.d.ts +1 -0
- package/Core/Interfaces/index.js +1 -0
- package/Core/Particle.d.ts +2 -1
- package/Core/Particle.js +8 -7
- package/Core/Retina.js +7 -7
- package/Core/Utils/ParticlesMover.js +2 -2
- package/Interactions/Particles/Links/LinkInstance.js +1 -1
- package/Options/Classes/AnimatableGradient.d.ts +4 -4
- package/Options/Classes/AnimatableGradient.js +4 -4
- package/Options/Classes/AnimationOptions.d.ts +5 -5
- package/Options/Classes/AnimationOptions.js +3 -2
- package/Options/Classes/ColorAnimation.d.ts +2 -2
- package/Options/Classes/ColorAnimation.js +2 -2
- package/Options/Classes/Particles/Move/Attract.d.ts +2 -2
- package/Options/Classes/Particles/Move/Attract.js +2 -1
- package/Options/Classes/Particles/Move/MoveAngle.d.ts +3 -3
- package/Options/Classes/Particles/Move/MoveAngle.js +3 -2
- package/Options/Classes/Particles/Move/MoveGravity.d.ts +5 -5
- package/Options/Classes/Particles/Move/MoveGravity.js +3 -2
- package/Options/Classes/Particles/Orbit/Orbit.d.ts +4 -4
- package/Options/Classes/Particles/Orbit/Orbit.js +4 -3
- package/Options/Classes/Particles/Repulse/Repulse.d.ts +5 -5
- package/Options/Classes/Particles/Repulse/Repulse.js +5 -4
- package/Options/Classes/Particles/Roll/RollLight.d.ts +2 -2
- package/Options/Classes/Particles/Roll/RollLight.js +2 -1
- package/Options/Classes/Particles/Rotate/RotateAnimation.d.ts +2 -2
- package/Options/Classes/Particles/Rotate/RotateAnimation.js +2 -1
- package/Options/Classes/Particles/Tilt/TiltAnimation.d.ts +2 -2
- package/Options/Classes/Particles/Tilt/TiltAnimation.js +2 -1
- package/Options/Classes/Particles/Twinkle/TwinkleValues.d.ts +2 -2
- package/Options/Classes/Particles/Twinkle/TwinkleValues.js +2 -1
- package/Options/Interfaces/IAnimation.d.ts +3 -2
- package/Options/Interfaces/Particles/Move/IAttract.d.ts +3 -2
- package/Options/Interfaces/Particles/Move/IMoveAngle.d.ts +3 -2
- package/Options/Interfaces/Particles/Move/IMoveGravity.d.ts +3 -2
- package/Options/Interfaces/Particles/Orbit/IOrbit.d.ts +4 -3
- package/Options/Interfaces/Particles/Repulse/IRepulse.d.ts +5 -4
- package/Options/Interfaces/Particles/Roll/IRollLight.d.ts +2 -1
- package/Options/Interfaces/Particles/Rotate/IRotateAnimation.d.ts +2 -1
- package/Options/Interfaces/Particles/Tilt/ITiltAnimation.d.ts +2 -1
- package/Options/Interfaces/Particles/Twinkle/ITwinkleValues.d.ts +3 -2
- package/Plugins/Absorbers/AbsorberInstance.js +1 -1
- package/Plugins/Absorbers/Options/Classes/Absorber.d.ts +2 -2
- package/Plugins/Absorbers/Options/Classes/Absorber.js +8 -4
- package/Plugins/Absorbers/Options/Interfaces/IAbsorber.d.ts +2 -2
- package/Plugins/Emitters/EmitterInstance.js +3 -3
- package/Plugins/Emitters/Options/Classes/Emitter.d.ts +2 -2
- package/Plugins/Emitters/Options/Classes/Emitter.js +8 -5
- package/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +2 -2
- package/Updaters/Angle/AngleUpdater.js +2 -1
- package/Updaters/Opacity/OpacityUpdater.js +3 -2
- package/Updaters/Roll/RollUpdater.js +3 -3
- package/Updaters/Tilt/TiltUpdater.js +1 -1
- package/Utils/ColorUtils.js +1 -1
- package/browser/Core/Canvas.d.ts +1 -1
- package/browser/Core/Canvas.js +9 -5
- package/browser/Core/Interfaces/ICoordinates.d.ts +8 -0
- package/browser/Core/Interfaces/IParticleGravity.d.ts +5 -0
- package/browser/Core/Interfaces/IParticleGravity.js +1 -0
- package/browser/Core/Interfaces/index.d.ts +1 -0
- package/browser/Core/Interfaces/index.js +1 -0
- package/browser/Core/Particle.d.ts +2 -1
- package/browser/Core/Particle.js +8 -7
- package/browser/Core/Retina.js +7 -7
- package/browser/Core/Utils/ParticlesMover.js +2 -2
- package/browser/Interactions/Particles/Links/LinkInstance.js +2 -2
- package/browser/Options/Classes/AnimatableGradient.d.ts +4 -4
- package/browser/Options/Classes/AnimatableGradient.js +4 -4
- package/browser/Options/Classes/AnimationOptions.d.ts +5 -5
- package/browser/Options/Classes/AnimationOptions.js +3 -2
- package/browser/Options/Classes/ColorAnimation.d.ts +2 -2
- package/browser/Options/Classes/ColorAnimation.js +2 -2
- package/browser/Options/Classes/Particles/Move/Attract.d.ts +2 -2
- package/browser/Options/Classes/Particles/Move/Attract.js +2 -1
- package/browser/Options/Classes/Particles/Move/MoveAngle.d.ts +3 -3
- package/browser/Options/Classes/Particles/Move/MoveAngle.js +3 -2
- package/browser/Options/Classes/Particles/Move/MoveGravity.d.ts +5 -5
- package/browser/Options/Classes/Particles/Move/MoveGravity.js +3 -2
- package/browser/Options/Classes/Particles/Orbit/Orbit.d.ts +4 -4
- package/browser/Options/Classes/Particles/Orbit/Orbit.js +4 -3
- package/browser/Options/Classes/Particles/Repulse/Repulse.d.ts +5 -5
- package/browser/Options/Classes/Particles/Repulse/Repulse.js +5 -4
- package/browser/Options/Classes/Particles/Roll/RollLight.d.ts +2 -2
- package/browser/Options/Classes/Particles/Roll/RollLight.js +2 -1
- package/browser/Options/Classes/Particles/Rotate/RotateAnimation.d.ts +2 -2
- package/browser/Options/Classes/Particles/Rotate/RotateAnimation.js +2 -1
- package/browser/Options/Classes/Particles/Tilt/TiltAnimation.d.ts +2 -2
- package/browser/Options/Classes/Particles/Tilt/TiltAnimation.js +2 -1
- package/browser/Options/Classes/Particles/Twinkle/TwinkleValues.d.ts +2 -2
- package/browser/Options/Classes/Particles/Twinkle/TwinkleValues.js +2 -1
- package/browser/Options/Interfaces/IAnimation.d.ts +3 -2
- package/browser/Options/Interfaces/Particles/Move/IAttract.d.ts +3 -2
- package/browser/Options/Interfaces/Particles/Move/IMoveAngle.d.ts +3 -2
- package/browser/Options/Interfaces/Particles/Move/IMoveGravity.d.ts +3 -2
- package/browser/Options/Interfaces/Particles/Orbit/IOrbit.d.ts +4 -3
- package/browser/Options/Interfaces/Particles/Repulse/IRepulse.d.ts +5 -4
- package/browser/Options/Interfaces/Particles/Roll/IRollLight.d.ts +2 -1
- package/browser/Options/Interfaces/Particles/Rotate/IRotateAnimation.d.ts +2 -1
- package/browser/Options/Interfaces/Particles/Tilt/ITiltAnimation.d.ts +2 -1
- package/browser/Options/Interfaces/Particles/Twinkle/ITwinkleValues.d.ts +3 -2
- package/browser/Plugins/Absorbers/AbsorberInstance.js +1 -1
- package/browser/Plugins/Absorbers/Options/Classes/Absorber.d.ts +2 -2
- package/browser/Plugins/Absorbers/Options/Classes/Absorber.js +8 -4
- package/browser/Plugins/Absorbers/Options/Interfaces/IAbsorber.d.ts +2 -2
- package/browser/Plugins/Emitters/EmitterInstance.js +3 -3
- package/browser/Plugins/Emitters/Options/Classes/Emitter.d.ts +2 -2
- package/browser/Plugins/Emitters/Options/Classes/Emitter.js +8 -5
- package/browser/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +2 -2
- package/browser/Updaters/Angle/AngleUpdater.js +2 -1
- package/browser/Updaters/Opacity/OpacityUpdater.js +3 -2
- package/browser/Updaters/Roll/RollUpdater.js +3 -3
- package/browser/Updaters/Tilt/TiltUpdater.js +1 -1
- package/browser/Utils/ColorUtils.js +2 -2
- package/esm/Core/Canvas.d.ts +1 -1
- package/esm/Core/Canvas.js +9 -5
- package/esm/Core/Interfaces/ICoordinates.d.ts +8 -0
- package/esm/Core/Interfaces/IParticleGravity.d.ts +5 -0
- package/esm/Core/Interfaces/IParticleGravity.js +1 -0
- package/esm/Core/Interfaces/index.d.ts +1 -0
- package/esm/Core/Interfaces/index.js +1 -0
- package/esm/Core/Particle.d.ts +2 -1
- package/esm/Core/Particle.js +8 -7
- package/esm/Core/Retina.js +7 -7
- package/esm/Core/Utils/ParticlesMover.js +2 -2
- package/esm/Interactions/Particles/Links/LinkInstance.js +2 -2
- package/esm/Options/Classes/AnimatableGradient.d.ts +4 -4
- package/esm/Options/Classes/AnimatableGradient.js +4 -4
- package/esm/Options/Classes/AnimationOptions.d.ts +5 -5
- package/esm/Options/Classes/AnimationOptions.js +3 -2
- package/esm/Options/Classes/ColorAnimation.d.ts +2 -2
- package/esm/Options/Classes/ColorAnimation.js +2 -2
- package/esm/Options/Classes/Particles/Move/Attract.d.ts +2 -2
- package/esm/Options/Classes/Particles/Move/Attract.js +2 -1
- package/esm/Options/Classes/Particles/Move/MoveAngle.d.ts +3 -3
- package/esm/Options/Classes/Particles/Move/MoveAngle.js +3 -2
- package/esm/Options/Classes/Particles/Move/MoveGravity.d.ts +5 -5
- package/esm/Options/Classes/Particles/Move/MoveGravity.js +3 -2
- package/esm/Options/Classes/Particles/Orbit/Orbit.d.ts +4 -4
- package/esm/Options/Classes/Particles/Orbit/Orbit.js +4 -3
- package/esm/Options/Classes/Particles/Repulse/Repulse.d.ts +5 -5
- package/esm/Options/Classes/Particles/Repulse/Repulse.js +5 -4
- package/esm/Options/Classes/Particles/Roll/RollLight.d.ts +2 -2
- package/esm/Options/Classes/Particles/Roll/RollLight.js +2 -1
- package/esm/Options/Classes/Particles/Rotate/RotateAnimation.d.ts +2 -2
- package/esm/Options/Classes/Particles/Rotate/RotateAnimation.js +2 -1
- package/esm/Options/Classes/Particles/Tilt/TiltAnimation.d.ts +2 -2
- package/esm/Options/Classes/Particles/Tilt/TiltAnimation.js +2 -1
- package/esm/Options/Classes/Particles/Twinkle/TwinkleValues.d.ts +2 -2
- package/esm/Options/Classes/Particles/Twinkle/TwinkleValues.js +2 -1
- package/esm/Options/Interfaces/IAnimation.d.ts +3 -2
- package/esm/Options/Interfaces/Particles/Move/IAttract.d.ts +3 -2
- package/esm/Options/Interfaces/Particles/Move/IMoveAngle.d.ts +3 -2
- package/esm/Options/Interfaces/Particles/Move/IMoveGravity.d.ts +3 -2
- package/esm/Options/Interfaces/Particles/Orbit/IOrbit.d.ts +4 -3
- package/esm/Options/Interfaces/Particles/Repulse/IRepulse.d.ts +5 -4
- package/esm/Options/Interfaces/Particles/Roll/IRollLight.d.ts +2 -1
- package/esm/Options/Interfaces/Particles/Rotate/IRotateAnimation.d.ts +2 -1
- package/esm/Options/Interfaces/Particles/Tilt/ITiltAnimation.d.ts +2 -1
- package/esm/Options/Interfaces/Particles/Twinkle/ITwinkleValues.d.ts +3 -2
- package/esm/Plugins/Absorbers/AbsorberInstance.js +1 -1
- package/esm/Plugins/Absorbers/Options/Classes/Absorber.d.ts +2 -2
- package/esm/Plugins/Absorbers/Options/Classes/Absorber.js +8 -4
- package/esm/Plugins/Absorbers/Options/Interfaces/IAbsorber.d.ts +2 -2
- package/esm/Plugins/Emitters/EmitterInstance.js +3 -3
- package/esm/Plugins/Emitters/Options/Classes/Emitter.d.ts +2 -2
- package/esm/Plugins/Emitters/Options/Classes/Emitter.js +8 -5
- package/esm/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +2 -2
- package/esm/Updaters/Angle/AngleUpdater.js +2 -1
- package/esm/Updaters/Opacity/OpacityUpdater.js +3 -2
- package/esm/Updaters/Roll/RollUpdater.js +3 -3
- package/esm/Updaters/Tilt/TiltUpdater.js +1 -1
- package/esm/Utils/ColorUtils.js +2 -2
- package/package.json +15 -3
- package/report.html +2 -2
- package/report.slim.html +2 -2
- package/scripts/install.js +11 -2
- package/tsparticles.engine.js +48 -45
- package/tsparticles.engine.min.js +2 -2
- package/tsparticles.interaction.external.attract.js +320 -34
- package/tsparticles.interaction.external.attract.min.js +1 -1
- package/tsparticles.interaction.external.bounce.js +320 -34
- package/tsparticles.interaction.external.bounce.min.js +1 -1
- package/tsparticles.interaction.external.bubble.js +320 -34
- package/tsparticles.interaction.external.bubble.min.js +1 -1
- package/tsparticles.interaction.external.connect.js +320 -34
- package/tsparticles.interaction.external.connect.min.js +1 -1
- package/tsparticles.interaction.external.grab.js +320 -34
- package/tsparticles.interaction.external.grab.min.js +1 -1
- package/tsparticles.interaction.external.repulse.js +320 -34
- package/tsparticles.interaction.external.repulse.min.js +1 -1
- package/tsparticles.interaction.external.trail.js +320 -34
- package/tsparticles.interaction.external.trail.min.js +1 -1
- package/tsparticles.interaction.particles.attract.js +320 -34
- package/tsparticles.interaction.particles.attract.min.js +1 -1
- package/tsparticles.interaction.particles.collisions.js +320 -34
- package/tsparticles.interaction.particles.collisions.min.js +1 -1
- package/tsparticles.interaction.particles.links.js +321 -35
- package/tsparticles.interaction.particles.links.min.js +2 -2
- package/tsparticles.js +74 -65
- package/tsparticles.min.js +2 -2
- package/tsparticles.pathseg.min.js +1 -1
- package/tsparticles.plugins.absorbers.js +328 -39
- package/tsparticles.plugins.absorbers.min.js +2 -2
- package/tsparticles.plugins.emitters.js +431 -142
- package/tsparticles.plugins.emitters.min.js +2 -2
- package/tsparticles.plugins.polygonMask.js +320 -34
- package/tsparticles.plugins.polygonMask.min.js +1 -1
- package/tsparticles.shape.circle.min.js +1 -1
- package/tsparticles.shape.image.js +320 -34
- package/tsparticles.shape.image.min.js +1 -1
- package/tsparticles.shape.line.min.js +1 -1
- package/tsparticles.shape.polygon.min.js +1 -1
- package/tsparticles.shape.square.min.js +1 -1
- package/tsparticles.shape.star.min.js +1 -1
- package/tsparticles.shape.text.js +320 -34
- package/tsparticles.shape.text.min.js +1 -1
- package/tsparticles.slim.js +52 -49
- package/tsparticles.slim.min.js +2 -2
- package/tsparticles.updater.angle.js +321 -35
- package/tsparticles.updater.angle.min.js +2 -2
- package/tsparticles.updater.color.js +320 -34
- package/tsparticles.updater.color.min.js +2 -2
- package/tsparticles.updater.life.js +320 -34
- package/tsparticles.updater.life.min.js +1 -1
- package/tsparticles.updater.opacity.js +322 -36
- package/tsparticles.updater.opacity.min.js +2 -2
- package/tsparticles.updater.outModes.js +320 -34
- package/tsparticles.updater.outModes.min.js +1 -1
- package/tsparticles.updater.roll.js +323 -37
- package/tsparticles.updater.roll.min.js +2 -2
- package/tsparticles.updater.size.js +320 -34
- package/tsparticles.updater.size.min.js +1 -1
- package/tsparticles.updater.strokeColor.js +320 -34
- package/tsparticles.updater.strokeColor.min.js +2 -2
- package/tsparticles.updater.tilt.js +321 -35
- package/tsparticles.updater.tilt.min.js +2 -2
- package/tsparticles.updater.wobble.js +320 -34
- package/tsparticles.updater.wobble.min.js +1 -1
- package/umd/Core/Canvas.d.ts +1 -1
- package/umd/Core/Canvas.js +8 -4
- package/umd/Core/Interfaces/ICoordinates.d.ts +8 -0
- package/umd/Core/Interfaces/IParticleGravity.d.ts +5 -0
- package/umd/Core/Interfaces/IParticleGravity.js +12 -0
- package/umd/Core/Interfaces/index.d.ts +1 -0
- package/umd/Core/Interfaces/index.js +2 -1
- package/umd/Core/Particle.d.ts +2 -1
- package/umd/Core/Particle.js +8 -7
- package/umd/Core/Retina.js +7 -7
- package/umd/Core/Utils/ParticlesMover.js +2 -2
- package/umd/Interactions/Particles/Links/LinkInstance.js +1 -1
- package/umd/Options/Classes/AnimatableGradient.d.ts +4 -4
- package/umd/Options/Classes/AnimatableGradient.js +4 -4
- package/umd/Options/Classes/AnimationOptions.d.ts +5 -5
- package/umd/Options/Classes/AnimationOptions.js +4 -3
- package/umd/Options/Classes/ColorAnimation.d.ts +2 -2
- package/umd/Options/Classes/ColorAnimation.js +2 -2
- package/umd/Options/Classes/Particles/Move/Attract.d.ts +2 -2
- package/umd/Options/Classes/Particles/Move/Attract.js +3 -2
- package/umd/Options/Classes/Particles/Move/MoveAngle.d.ts +3 -3
- package/umd/Options/Classes/Particles/Move/MoveAngle.js +4 -3
- package/umd/Options/Classes/Particles/Move/MoveGravity.d.ts +5 -5
- package/umd/Options/Classes/Particles/Move/MoveGravity.js +4 -3
- package/umd/Options/Classes/Particles/Orbit/Orbit.d.ts +4 -4
- package/umd/Options/Classes/Particles/Orbit/Orbit.js +5 -4
- package/umd/Options/Classes/Particles/Repulse/Repulse.d.ts +5 -5
- package/umd/Options/Classes/Particles/Repulse/Repulse.js +6 -5
- package/umd/Options/Classes/Particles/Roll/RollLight.d.ts +2 -2
- package/umd/Options/Classes/Particles/Roll/RollLight.js +3 -2
- package/umd/Options/Classes/Particles/Rotate/RotateAnimation.d.ts +2 -2
- package/umd/Options/Classes/Particles/Rotate/RotateAnimation.js +3 -2
- package/umd/Options/Classes/Particles/Tilt/TiltAnimation.d.ts +2 -2
- package/umd/Options/Classes/Particles/Tilt/TiltAnimation.js +3 -2
- package/umd/Options/Classes/Particles/Twinkle/TwinkleValues.d.ts +2 -2
- package/umd/Options/Classes/Particles/Twinkle/TwinkleValues.js +3 -2
- package/umd/Options/Interfaces/IAnimation.d.ts +3 -2
- package/umd/Options/Interfaces/Particles/Move/IAttract.d.ts +3 -2
- package/umd/Options/Interfaces/Particles/Move/IMoveAngle.d.ts +3 -2
- package/umd/Options/Interfaces/Particles/Move/IMoveGravity.d.ts +3 -2
- package/umd/Options/Interfaces/Particles/Orbit/IOrbit.d.ts +4 -3
- package/umd/Options/Interfaces/Particles/Repulse/IRepulse.d.ts +5 -4
- package/umd/Options/Interfaces/Particles/Roll/IRollLight.d.ts +2 -1
- package/umd/Options/Interfaces/Particles/Rotate/IRotateAnimation.d.ts +2 -1
- package/umd/Options/Interfaces/Particles/Tilt/ITiltAnimation.d.ts +2 -1
- package/umd/Options/Interfaces/Particles/Twinkle/ITwinkleValues.d.ts +3 -2
- package/umd/Plugins/Absorbers/AbsorberInstance.js +1 -1
- package/umd/Plugins/Absorbers/Options/Classes/Absorber.d.ts +2 -2
- package/umd/Plugins/Absorbers/Options/Classes/Absorber.js +9 -5
- package/umd/Plugins/Absorbers/Options/Interfaces/IAbsorber.d.ts +2 -2
- package/umd/Plugins/Emitters/EmitterInstance.js +3 -3
- package/umd/Plugins/Emitters/Options/Classes/Emitter.d.ts +2 -2
- package/umd/Plugins/Emitters/Options/Classes/Emitter.js +9 -6
- package/umd/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +2 -2
- package/umd/Updaters/Angle/AngleUpdater.js +2 -1
- package/umd/Updaters/Opacity/OpacityUpdater.js +3 -2
- package/umd/Updaters/Roll/RollUpdater.js +3 -3
- package/umd/Updaters/Tilt/TiltUpdater.js +1 -1
- package/umd/Utils/ColorUtils.js +1 -1
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;
|
|
@@ -2515,9 +2515,9 @@
|
|
|
2515
2515
|
paint() {
|
|
2516
2516
|
const options = this.container.actualOptions;
|
|
2517
2517
|
this.draw((ctx => {
|
|
2518
|
-
if (options.backgroundMask.enable && options.backgroundMask.cover
|
|
2518
|
+
if (options.backgroundMask.enable && options.backgroundMask.cover) {
|
|
2519
2519
|
clear(ctx, this.size);
|
|
2520
|
-
this.paintBase(
|
|
2520
|
+
this.paintBase(this.coverColorStyle);
|
|
2521
2521
|
} else {
|
|
2522
2522
|
this.paintBase();
|
|
2523
2523
|
}
|
|
@@ -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;
|
|
@@ -2688,12 +2688,14 @@
|
|
|
2688
2688
|
const color = cover.color;
|
|
2689
2689
|
const coverRgb = colorToRgb(color);
|
|
2690
2690
|
if (coverRgb) {
|
|
2691
|
-
|
|
2691
|
+
const coverColor = {
|
|
2692
2692
|
r: coverRgb.r,
|
|
2693
2693
|
g: coverRgb.g,
|
|
2694
2694
|
b: coverRgb.b,
|
|
2695
2695
|
a: cover.opacity
|
|
2696
2696
|
};
|
|
2697
|
+
this.coverColorStyle = getStyleFromRgb(coverColor, coverColor.a);
|
|
2698
|
+
console.log(this.coverColorStyle);
|
|
2697
2699
|
}
|
|
2698
2700
|
}
|
|
2699
2701
|
initTrail() {
|
|
@@ -3637,7 +3639,7 @@
|
|
|
3637
3639
|
return;
|
|
3638
3640
|
}
|
|
3639
3641
|
if (data.count !== undefined) {
|
|
3640
|
-
this.count = data.count;
|
|
3642
|
+
this.count = setRangeValue(data.count);
|
|
3641
3643
|
}
|
|
3642
3644
|
if (data.enable !== undefined) {
|
|
3643
3645
|
this.enable = data.enable;
|
|
@@ -3646,7 +3648,7 @@
|
|
|
3646
3648
|
this.offset = setRangeValue(data.offset);
|
|
3647
3649
|
}
|
|
3648
3650
|
if (data.speed !== undefined) {
|
|
3649
|
-
this.speed = data.speed;
|
|
3651
|
+
this.speed = setRangeValue(data.speed);
|
|
3650
3652
|
}
|
|
3651
3653
|
if (data.sync !== undefined) {
|
|
3652
3654
|
this.sync = data.sync;
|
|
@@ -3794,13 +3796,13 @@
|
|
|
3794
3796
|
return;
|
|
3795
3797
|
}
|
|
3796
3798
|
if (data.count !== undefined) {
|
|
3797
|
-
this.count = data.count;
|
|
3799
|
+
this.count = setRangeValue(data.count);
|
|
3798
3800
|
}
|
|
3799
3801
|
if (data.enable !== undefined) {
|
|
3800
3802
|
this.enable = data.enable;
|
|
3801
3803
|
}
|
|
3802
3804
|
if (data.speed !== undefined) {
|
|
3803
|
-
this.speed = data.speed;
|
|
3805
|
+
this.speed = setRangeValue(data.speed);
|
|
3804
3806
|
}
|
|
3805
3807
|
if (data.sync !== undefined) {
|
|
3806
3808
|
this.sync = data.sync;
|
|
@@ -3820,13 +3822,13 @@
|
|
|
3820
3822
|
return;
|
|
3821
3823
|
}
|
|
3822
3824
|
if (data.count !== undefined) {
|
|
3823
|
-
this.count = data.count;
|
|
3825
|
+
this.count = setRangeValue(data.count);
|
|
3824
3826
|
}
|
|
3825
3827
|
if (data.enable !== undefined) {
|
|
3826
3828
|
this.enable = data.enable;
|
|
3827
3829
|
}
|
|
3828
3830
|
if (data.speed !== undefined) {
|
|
3829
|
-
this.speed = data.speed;
|
|
3831
|
+
this.speed = setRangeValue(data.speed);
|
|
3830
3832
|
}
|
|
3831
3833
|
if (data.sync !== undefined) {
|
|
3832
3834
|
this.sync = data.sync;
|
|
@@ -4152,7 +4154,7 @@
|
|
|
4152
4154
|
return;
|
|
4153
4155
|
}
|
|
4154
4156
|
if (data.distance !== undefined) {
|
|
4155
|
-
this.distance = data.distance;
|
|
4157
|
+
this.distance = setRangeValue(data.distance);
|
|
4156
4158
|
}
|
|
4157
4159
|
if (data.enable !== undefined) {
|
|
4158
4160
|
this.enable = data.enable;
|
|
@@ -4177,10 +4179,10 @@
|
|
|
4177
4179
|
return;
|
|
4178
4180
|
}
|
|
4179
4181
|
if (data.offset !== undefined) {
|
|
4180
|
-
this.offset = data.offset;
|
|
4182
|
+
this.offset = setRangeValue(data.offset);
|
|
4181
4183
|
}
|
|
4182
4184
|
if (data.value !== undefined) {
|
|
4183
|
-
this.value = data.value;
|
|
4185
|
+
this.value = setRangeValue(data.value);
|
|
4184
4186
|
}
|
|
4185
4187
|
}
|
|
4186
4188
|
}
|
|
@@ -4196,7 +4198,7 @@
|
|
|
4196
4198
|
return;
|
|
4197
4199
|
}
|
|
4198
4200
|
if (data.acceleration !== undefined) {
|
|
4199
|
-
this.acceleration = data.acceleration;
|
|
4201
|
+
this.acceleration = setRangeValue(data.acceleration);
|
|
4200
4202
|
}
|
|
4201
4203
|
if (data.enable !== undefined) {
|
|
4202
4204
|
this.enable = data.enable;
|
|
@@ -4205,7 +4207,7 @@
|
|
|
4205
4207
|
this.inverse = data.inverse;
|
|
4206
4208
|
}
|
|
4207
4209
|
if (data.maxSpeed !== undefined) {
|
|
4208
|
-
this.maxSpeed = data.maxSpeed;
|
|
4210
|
+
this.maxSpeed = setRangeValue(data.maxSpeed);
|
|
4209
4211
|
}
|
|
4210
4212
|
}
|
|
4211
4213
|
}
|
|
@@ -4420,13 +4422,13 @@
|
|
|
4420
4422
|
return;
|
|
4421
4423
|
}
|
|
4422
4424
|
if (data.count !== undefined) {
|
|
4423
|
-
this.count = data.count;
|
|
4425
|
+
this.count = setRangeValue(data.count);
|
|
4424
4426
|
}
|
|
4425
4427
|
if (data.enable !== undefined) {
|
|
4426
4428
|
this.enable = data.enable;
|
|
4427
4429
|
}
|
|
4428
4430
|
if (data.speed !== undefined) {
|
|
4429
|
-
this.speed = data.speed;
|
|
4431
|
+
this.speed = setRangeValue(data.speed);
|
|
4430
4432
|
}
|
|
4431
4433
|
if (data.sync !== undefined) {
|
|
4432
4434
|
this.sync = data.sync;
|
|
@@ -4530,13 +4532,13 @@
|
|
|
4530
4532
|
this.enable = data.enable;
|
|
4531
4533
|
}
|
|
4532
4534
|
if (data.opacity !== undefined) {
|
|
4533
|
-
this.opacity = data.opacity;
|
|
4535
|
+
this.opacity = setRangeValue(data.opacity);
|
|
4534
4536
|
}
|
|
4535
4537
|
if (data.width !== undefined) {
|
|
4536
|
-
this.width = data.width;
|
|
4538
|
+
this.width = setRangeValue(data.width);
|
|
4537
4539
|
}
|
|
4538
4540
|
if (data.radius !== undefined) {
|
|
4539
|
-
this.radius = data.radius;
|
|
4541
|
+
this.radius = setRangeValue(data.radius);
|
|
4540
4542
|
}
|
|
4541
4543
|
if (data.color !== undefined) {
|
|
4542
4544
|
this.color = OptionsColor.create(this.color, data.color);
|
|
@@ -4617,16 +4619,16 @@
|
|
|
4617
4619
|
this.enabled = data.enabled;
|
|
4618
4620
|
}
|
|
4619
4621
|
if (data.distance !== undefined) {
|
|
4620
|
-
this.distance = data.distance;
|
|
4622
|
+
this.distance = setRangeValue(data.distance);
|
|
4621
4623
|
}
|
|
4622
4624
|
if (data.duration !== undefined) {
|
|
4623
|
-
this.duration = data.duration;
|
|
4625
|
+
this.duration = setRangeValue(data.duration);
|
|
4624
4626
|
}
|
|
4625
4627
|
if (data.factor !== undefined) {
|
|
4626
|
-
this.factor = data.factor;
|
|
4628
|
+
this.factor = setRangeValue(data.factor);
|
|
4627
4629
|
}
|
|
4628
4630
|
if (data.speed !== undefined) {
|
|
4629
|
-
this.speed = data.speed;
|
|
4631
|
+
this.speed = setRangeValue(data.speed);
|
|
4630
4632
|
}
|
|
4631
4633
|
}
|
|
4632
4634
|
}
|
|
@@ -4643,7 +4645,7 @@
|
|
|
4643
4645
|
this.enable = data.enable;
|
|
4644
4646
|
}
|
|
4645
4647
|
if (data.value !== undefined) {
|
|
4646
|
-
this.value = data.value;
|
|
4648
|
+
this.value = setRangeValue(data.value);
|
|
4647
4649
|
}
|
|
4648
4650
|
}
|
|
4649
4651
|
}
|
|
@@ -4689,7 +4691,7 @@
|
|
|
4689
4691
|
this.enable = data.enable;
|
|
4690
4692
|
}
|
|
4691
4693
|
if (data.speed !== undefined) {
|
|
4692
|
-
this.speed = data.speed;
|
|
4694
|
+
this.speed = setRangeValue(data.speed);
|
|
4693
4695
|
}
|
|
4694
4696
|
if (data.sync !== undefined) {
|
|
4695
4697
|
this.sync = data.sync;
|
|
@@ -4945,7 +4947,7 @@
|
|
|
4945
4947
|
this.enable = data.enable;
|
|
4946
4948
|
}
|
|
4947
4949
|
if (data.speed !== undefined) {
|
|
4948
|
-
this.speed = data.speed;
|
|
4950
|
+
this.speed = setRangeValue(data.speed);
|
|
4949
4951
|
}
|
|
4950
4952
|
if (data.sync !== undefined) {
|
|
4951
4953
|
this.sync = data.sync;
|
|
@@ -4994,7 +4996,7 @@
|
|
|
4994
4996
|
this.frequency = data.frequency;
|
|
4995
4997
|
}
|
|
4996
4998
|
if (data.opacity !== undefined) {
|
|
4997
|
-
this.opacity = data.opacity;
|
|
4999
|
+
this.opacity = setRangeValue(data.opacity);
|
|
4998
5000
|
}
|
|
4999
5001
|
}
|
|
5000
5002
|
}
|
|
@@ -5469,7 +5471,7 @@
|
|
|
5469
5471
|
max: getRangeMax(sizeRange) * pxRatio,
|
|
5470
5472
|
min: getRangeMin(sizeRange) * pxRatio,
|
|
5471
5473
|
loops: 0,
|
|
5472
|
-
maxLoops: sizeOptions.animation.count
|
|
5474
|
+
maxLoops: getRangeValue(sizeOptions.animation.count)
|
|
5473
5475
|
};
|
|
5474
5476
|
const sizeAnimation = sizeOptions.animation;
|
|
5475
5477
|
if (sizeAnimation.enable) {
|
|
@@ -5503,6 +5505,12 @@
|
|
|
5503
5505
|
this.initialVelocity = this.calculateVelocity();
|
|
5504
5506
|
this.velocity = this.initialVelocity.copy();
|
|
5505
5507
|
this.moveDecay = 1 - getRangeValue(this.options.move.decay);
|
|
5508
|
+
const gravityOptions = this.options.move.gravity;
|
|
5509
|
+
this.gravity = {
|
|
5510
|
+
enable: gravityOptions.enable,
|
|
5511
|
+
acceleration: getRangeValue(gravityOptions.acceleration),
|
|
5512
|
+
inverse: gravityOptions.inverse
|
|
5513
|
+
};
|
|
5506
5514
|
this.position = this.calcPosition(container, position, clamp(zIndexValue, 0, container.zLayers));
|
|
5507
5515
|
this.initialPosition = this.position.copy();
|
|
5508
5516
|
this.offset = Vector.origin;
|
|
@@ -5710,12 +5718,7 @@
|
|
|
5710
5718
|
return overlaps;
|
|
5711
5719
|
}
|
|
5712
5720
|
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 = {
|
|
5721
|
+
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
5722
|
left: radOffset - rad / 2,
|
|
5720
5723
|
right: radOffset + rad / 2
|
|
5721
5724
|
};
|
|
@@ -6105,13 +6108,13 @@
|
|
|
6105
6108
|
container.canvas.size.height = element.offsetHeight * ratio;
|
|
6106
6109
|
}
|
|
6107
6110
|
const particles = options.particles;
|
|
6108
|
-
this.attractDistance = particles.move.attract.distance * ratio;
|
|
6111
|
+
this.attractDistance = getRangeValue(particles.move.attract.distance) * ratio;
|
|
6109
6112
|
this.linksDistance = particles.links.distance * ratio;
|
|
6110
6113
|
this.linksWidth = particles.links.width * ratio;
|
|
6111
|
-
this.sizeAnimationSpeed = particles.size.animation.speed * ratio;
|
|
6112
|
-
this.maxSpeed = particles.move.gravity.maxSpeed * ratio;
|
|
6114
|
+
this.sizeAnimationSpeed = getRangeValue(particles.size.animation.speed) * ratio;
|
|
6115
|
+
this.maxSpeed = getRangeValue(particles.move.gravity.maxSpeed) * ratio;
|
|
6113
6116
|
if (particles.orbit.radius !== undefined) {
|
|
6114
|
-
this.orbitRadius = particles.orbit.radius * this.container.retina.pixelRatio;
|
|
6117
|
+
this.orbitRadius = getRangeValue(particles.orbit.radius) * this.container.retina.pixelRatio;
|
|
6115
6118
|
}
|
|
6116
6119
|
const modes = options.interactivity.modes;
|
|
6117
6120
|
this.connectModeDistance = modes.connect.distance * ratio;
|
|
@@ -6131,19 +6134,19 @@
|
|
|
6131
6134
|
const ratio = this.pixelRatio;
|
|
6132
6135
|
const moveDistance = options.move.distance;
|
|
6133
6136
|
const props = particle.retina;
|
|
6134
|
-
props.attractDistance = options.move.attract.distance * ratio;
|
|
6137
|
+
props.attractDistance = getRangeValue(options.move.attract.distance) * ratio;
|
|
6135
6138
|
props.linksDistance = options.links.distance * ratio;
|
|
6136
6139
|
props.linksWidth = options.links.width * ratio;
|
|
6137
6140
|
props.moveDrift = getRangeValue(options.move.drift) * ratio;
|
|
6138
6141
|
props.moveSpeed = getRangeValue(options.move.speed) * ratio;
|
|
6139
|
-
props.sizeAnimationSpeed = options.size.animation.speed * ratio;
|
|
6142
|
+
props.sizeAnimationSpeed = getRangeValue(options.size.animation.speed) * ratio;
|
|
6140
6143
|
if (particle.spin) {
|
|
6141
6144
|
props.spinAcceleration = getRangeValue(options.move.spin.acceleration) * ratio;
|
|
6142
6145
|
}
|
|
6143
6146
|
const maxDistance = props.maxDistance;
|
|
6144
6147
|
maxDistance.horizontal = moveDistance.horizontal !== undefined ? moveDistance.horizontal * ratio : undefined;
|
|
6145
6148
|
maxDistance.vertical = moveDistance.vertical !== undefined ? moveDistance.vertical * ratio : undefined;
|
|
6146
|
-
props.maxSpeed = options.move.gravity.maxSpeed * ratio;
|
|
6149
|
+
props.maxSpeed = getRangeValue(options.move.gravity.maxSpeed) * ratio;
|
|
6147
6150
|
}
|
|
6148
6151
|
handleMotionChange(mediaQuery) {
|
|
6149
6152
|
const options = this.container.actualOptions;
|