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
|
@@ -619,7 +619,7 @@
|
|
|
619
619
|
}
|
|
620
620
|
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;
|
|
621
621
|
this.applyPath(particle, delta);
|
|
622
|
-
const gravityOptions =
|
|
622
|
+
const gravityOptions = particle.gravity;
|
|
623
623
|
const gravityFactor = gravityOptions.enable && gravityOptions.inverse ? -1 : 1;
|
|
624
624
|
if (gravityOptions.enable && moveSpeed) {
|
|
625
625
|
particle.velocity.y += gravityFactor * (gravityOptions.acceleration * delta.factor) / (60 * moveSpeed);
|
|
@@ -633,7 +633,7 @@
|
|
|
633
633
|
}
|
|
634
634
|
const velocity = particle.velocity.mult(moveSpeed);
|
|
635
635
|
const maxSpeed = (_c = particle.retina.maxSpeed) !== null && _c !== void 0 ? _c : container.retina.maxSpeed;
|
|
636
|
-
if (gravityOptions.enable &&
|
|
636
|
+
if (gravityOptions.enable && maxSpeed > 0 && (!gravityOptions.inverse && velocity.y >= 0 && velocity.y >= maxSpeed || gravityOptions.inverse && velocity.y <= 0 && velocity.y <= -maxSpeed)) {
|
|
637
637
|
velocity.y = gravityFactor * maxSpeed;
|
|
638
638
|
if (moveSpeed) {
|
|
639
639
|
particle.velocity.y = velocity.y / moveSpeed;
|
|
@@ -1038,9 +1038,9 @@
|
|
|
1038
1038
|
paint() {
|
|
1039
1039
|
const options = this.container.actualOptions;
|
|
1040
1040
|
this.draw((ctx => {
|
|
1041
|
-
if (options.backgroundMask.enable && options.backgroundMask.cover
|
|
1041
|
+
if (options.backgroundMask.enable && options.backgroundMask.cover) {
|
|
1042
1042
|
clear(ctx, this.size);
|
|
1043
|
-
this.paintBase(
|
|
1043
|
+
this.paintBase(this.coverColorStyle);
|
|
1044
1044
|
} else {
|
|
1045
1045
|
this.paintBase();
|
|
1046
1046
|
}
|
|
@@ -1142,7 +1142,7 @@
|
|
|
1142
1142
|
const zIndexOptions = particle.options.zIndex;
|
|
1143
1143
|
const zOpacityFactor = (1 - particle.zIndexFactor) ** zIndexOptions.opacityRate;
|
|
1144
1144
|
const radius = particle.getRadius();
|
|
1145
|
-
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;
|
|
1145
|
+
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;
|
|
1146
1146
|
const strokeOpacity = (_f = (_e = particle.stroke) === null || _e === void 0 ? void 0 : _e.opacity) !== null && _f !== void 0 ? _f : opacity;
|
|
1147
1147
|
const zOpacity = opacity * zOpacityFactor;
|
|
1148
1148
|
const fillColorValue = fColor ? getStyleFromHsl(fColor, zOpacity) : undefined;
|
|
@@ -1211,12 +1211,14 @@
|
|
|
1211
1211
|
const color = cover.color;
|
|
1212
1212
|
const coverRgb = colorToRgb(color);
|
|
1213
1213
|
if (coverRgb) {
|
|
1214
|
-
|
|
1214
|
+
const coverColor = {
|
|
1215
1215
|
r: coverRgb.r,
|
|
1216
1216
|
g: coverRgb.g,
|
|
1217
1217
|
b: coverRgb.b,
|
|
1218
1218
|
a: cover.opacity
|
|
1219
1219
|
};
|
|
1220
|
+
this.coverColorStyle = getStyleFromRgb(coverColor, coverColor.a);
|
|
1221
|
+
console.log(this.coverColorStyle);
|
|
1220
1222
|
}
|
|
1221
1223
|
}
|
|
1222
1224
|
initTrail() {
|
|
@@ -1413,7 +1415,7 @@
|
|
|
1413
1415
|
return;
|
|
1414
1416
|
}
|
|
1415
1417
|
if (data.count !== undefined) {
|
|
1416
|
-
this.count = data.count;
|
|
1418
|
+
this.count = setRangeValue(data.count);
|
|
1417
1419
|
}
|
|
1418
1420
|
if (data.enable !== undefined) {
|
|
1419
1421
|
this.enable = data.enable;
|
|
@@ -1422,7 +1424,7 @@
|
|
|
1422
1424
|
this.offset = setRangeValue(data.offset);
|
|
1423
1425
|
}
|
|
1424
1426
|
if (data.speed !== undefined) {
|
|
1425
|
-
this.speed = data.speed;
|
|
1427
|
+
this.speed = setRangeValue(data.speed);
|
|
1426
1428
|
}
|
|
1427
1429
|
if (data.sync !== undefined) {
|
|
1428
1430
|
this.sync = data.sync;
|
|
@@ -1570,13 +1572,13 @@
|
|
|
1570
1572
|
return;
|
|
1571
1573
|
}
|
|
1572
1574
|
if (data.count !== undefined) {
|
|
1573
|
-
this.count = data.count;
|
|
1575
|
+
this.count = setRangeValue(data.count);
|
|
1574
1576
|
}
|
|
1575
1577
|
if (data.enable !== undefined) {
|
|
1576
1578
|
this.enable = data.enable;
|
|
1577
1579
|
}
|
|
1578
1580
|
if (data.speed !== undefined) {
|
|
1579
|
-
this.speed = data.speed;
|
|
1581
|
+
this.speed = setRangeValue(data.speed);
|
|
1580
1582
|
}
|
|
1581
1583
|
if (data.sync !== undefined) {
|
|
1582
1584
|
this.sync = data.sync;
|
|
@@ -1596,13 +1598,13 @@
|
|
|
1596
1598
|
return;
|
|
1597
1599
|
}
|
|
1598
1600
|
if (data.count !== undefined) {
|
|
1599
|
-
this.count = data.count;
|
|
1601
|
+
this.count = setRangeValue(data.count);
|
|
1600
1602
|
}
|
|
1601
1603
|
if (data.enable !== undefined) {
|
|
1602
1604
|
this.enable = data.enable;
|
|
1603
1605
|
}
|
|
1604
1606
|
if (data.speed !== undefined) {
|
|
1605
|
-
this.speed = data.speed;
|
|
1607
|
+
this.speed = setRangeValue(data.speed);
|
|
1606
1608
|
}
|
|
1607
1609
|
if (data.sync !== undefined) {
|
|
1608
1610
|
this.sync = data.sync;
|
|
@@ -1774,6 +1776,90 @@
|
|
|
1774
1776
|
this.duration.load(data.duration);
|
|
1775
1777
|
}
|
|
1776
1778
|
}
|
|
1779
|
+
class Attract_Attract {
|
|
1780
|
+
constructor() {
|
|
1781
|
+
this.distance = 200;
|
|
1782
|
+
this.enable = false;
|
|
1783
|
+
this.rotate = {
|
|
1784
|
+
x: 3e3,
|
|
1785
|
+
y: 3e3
|
|
1786
|
+
};
|
|
1787
|
+
}
|
|
1788
|
+
get rotateX() {
|
|
1789
|
+
return this.rotate.x;
|
|
1790
|
+
}
|
|
1791
|
+
set rotateX(value) {
|
|
1792
|
+
this.rotate.x = value;
|
|
1793
|
+
}
|
|
1794
|
+
get rotateY() {
|
|
1795
|
+
return this.rotate.y;
|
|
1796
|
+
}
|
|
1797
|
+
set rotateY(value) {
|
|
1798
|
+
this.rotate.y = value;
|
|
1799
|
+
}
|
|
1800
|
+
load(data) {
|
|
1801
|
+
var _a, _b, _c, _d;
|
|
1802
|
+
if (!data) {
|
|
1803
|
+
return;
|
|
1804
|
+
}
|
|
1805
|
+
if (data.distance !== undefined) {
|
|
1806
|
+
this.distance = setRangeValue(data.distance);
|
|
1807
|
+
}
|
|
1808
|
+
if (data.enable !== undefined) {
|
|
1809
|
+
this.enable = data.enable;
|
|
1810
|
+
}
|
|
1811
|
+
const rotateX = (_b = (_a = data.rotate) === null || _a === void 0 ? void 0 : _a.x) !== null && _b !== void 0 ? _b : data.rotateX;
|
|
1812
|
+
if (rotateX !== undefined) {
|
|
1813
|
+
this.rotate.x = rotateX;
|
|
1814
|
+
}
|
|
1815
|
+
const rotateY = (_d = (_c = data.rotate) === null || _c === void 0 ? void 0 : _c.y) !== null && _d !== void 0 ? _d : data.rotateY;
|
|
1816
|
+
if (rotateY !== undefined) {
|
|
1817
|
+
this.rotate.y = rotateY;
|
|
1818
|
+
}
|
|
1819
|
+
}
|
|
1820
|
+
}
|
|
1821
|
+
class MoveAngle_MoveAngle {
|
|
1822
|
+
constructor() {
|
|
1823
|
+
this.offset = 0;
|
|
1824
|
+
this.value = 90;
|
|
1825
|
+
}
|
|
1826
|
+
load(data) {
|
|
1827
|
+
if (data === undefined) {
|
|
1828
|
+
return;
|
|
1829
|
+
}
|
|
1830
|
+
if (data.offset !== undefined) {
|
|
1831
|
+
this.offset = setRangeValue(data.offset);
|
|
1832
|
+
}
|
|
1833
|
+
if (data.value !== undefined) {
|
|
1834
|
+
this.value = setRangeValue(data.value);
|
|
1835
|
+
}
|
|
1836
|
+
}
|
|
1837
|
+
}
|
|
1838
|
+
class MoveGravity_MoveGravity {
|
|
1839
|
+
constructor() {
|
|
1840
|
+
this.acceleration = 9.81;
|
|
1841
|
+
this.enable = false;
|
|
1842
|
+
this.inverse = false;
|
|
1843
|
+
this.maxSpeed = 50;
|
|
1844
|
+
}
|
|
1845
|
+
load(data) {
|
|
1846
|
+
if (!data) {
|
|
1847
|
+
return;
|
|
1848
|
+
}
|
|
1849
|
+
if (data.acceleration !== undefined) {
|
|
1850
|
+
this.acceleration = setRangeValue(data.acceleration);
|
|
1851
|
+
}
|
|
1852
|
+
if (data.enable !== undefined) {
|
|
1853
|
+
this.enable = data.enable;
|
|
1854
|
+
}
|
|
1855
|
+
if (data.inverse !== undefined) {
|
|
1856
|
+
this.inverse = data.inverse;
|
|
1857
|
+
}
|
|
1858
|
+
if (data.maxSpeed !== undefined) {
|
|
1859
|
+
this.maxSpeed = setRangeValue(data.maxSpeed);
|
|
1860
|
+
}
|
|
1861
|
+
}
|
|
1862
|
+
}
|
|
1777
1863
|
class PathDelay_PathDelay extends(null && ValueWithRandom){
|
|
1778
1864
|
constructor() {
|
|
1779
1865
|
super();
|
|
@@ -1935,6 +2021,70 @@
|
|
|
1935
2021
|
}
|
|
1936
2022
|
}
|
|
1937
2023
|
}
|
|
2024
|
+
class AnimationOptions_AnimationOptions {
|
|
2025
|
+
constructor() {
|
|
2026
|
+
this.count = 0;
|
|
2027
|
+
this.enable = false;
|
|
2028
|
+
this.speed = 1;
|
|
2029
|
+
this.sync = false;
|
|
2030
|
+
}
|
|
2031
|
+
load(data) {
|
|
2032
|
+
if (!data) {
|
|
2033
|
+
return;
|
|
2034
|
+
}
|
|
2035
|
+
if (data.count !== undefined) {
|
|
2036
|
+
this.count = setRangeValue(data.count);
|
|
2037
|
+
}
|
|
2038
|
+
if (data.enable !== undefined) {
|
|
2039
|
+
this.enable = data.enable;
|
|
2040
|
+
}
|
|
2041
|
+
if (data.speed !== undefined) {
|
|
2042
|
+
this.speed = setRangeValue(data.speed);
|
|
2043
|
+
}
|
|
2044
|
+
if (data.sync !== undefined) {
|
|
2045
|
+
this.sync = data.sync;
|
|
2046
|
+
}
|
|
2047
|
+
}
|
|
2048
|
+
}
|
|
2049
|
+
class OpacityAnimation_OpacityAnimation extends(null && AnimationOptions){
|
|
2050
|
+
constructor() {
|
|
2051
|
+
super();
|
|
2052
|
+
this.destroy = "none";
|
|
2053
|
+
this.enable = false;
|
|
2054
|
+
this.speed = 2;
|
|
2055
|
+
this.startValue = "random";
|
|
2056
|
+
this.sync = false;
|
|
2057
|
+
}
|
|
2058
|
+
get opacity_min() {
|
|
2059
|
+
return this.minimumValue;
|
|
2060
|
+
}
|
|
2061
|
+
set opacity_min(value) {
|
|
2062
|
+
this.minimumValue = value;
|
|
2063
|
+
}
|
|
2064
|
+
load(data) {
|
|
2065
|
+
var _a;
|
|
2066
|
+
if (data === undefined) {
|
|
2067
|
+
return;
|
|
2068
|
+
}
|
|
2069
|
+
super.load(data);
|
|
2070
|
+
if (data.destroy !== undefined) {
|
|
2071
|
+
this.destroy = data.destroy;
|
|
2072
|
+
}
|
|
2073
|
+
if (data.enable !== undefined) {
|
|
2074
|
+
this.enable = data.enable;
|
|
2075
|
+
}
|
|
2076
|
+
this.minimumValue = (_a = data.minimumValue) !== null && _a !== void 0 ? _a : data.opacity_min;
|
|
2077
|
+
if (data.speed !== undefined) {
|
|
2078
|
+
this.speed = data.speed;
|
|
2079
|
+
}
|
|
2080
|
+
if (data.startValue !== undefined) {
|
|
2081
|
+
this.startValue = data.startValue;
|
|
2082
|
+
}
|
|
2083
|
+
if (data.sync !== undefined) {
|
|
2084
|
+
this.sync = data.sync;
|
|
2085
|
+
}
|
|
2086
|
+
}
|
|
2087
|
+
}
|
|
1938
2088
|
class Opacity_Opacity extends(null && ValueWithRandom){
|
|
1939
2089
|
constructor() {
|
|
1940
2090
|
super();
|
|
@@ -1993,13 +2143,13 @@
|
|
|
1993
2143
|
this.enable = data.enable;
|
|
1994
2144
|
}
|
|
1995
2145
|
if (data.opacity !== undefined) {
|
|
1996
|
-
this.opacity = data.opacity;
|
|
2146
|
+
this.opacity = setRangeValue(data.opacity);
|
|
1997
2147
|
}
|
|
1998
2148
|
if (data.width !== undefined) {
|
|
1999
|
-
this.width = data.width;
|
|
2149
|
+
this.width = setRangeValue(data.width);
|
|
2000
2150
|
}
|
|
2001
2151
|
if (data.radius !== undefined) {
|
|
2002
|
-
this.radius = data.radius;
|
|
2152
|
+
this.radius = setRangeValue(data.radius);
|
|
2003
2153
|
}
|
|
2004
2154
|
if (data.color !== undefined) {
|
|
2005
2155
|
this.color = OptionsColor.create(this.color, data.color);
|
|
@@ -2024,16 +2174,33 @@
|
|
|
2024
2174
|
this.enabled = data.enabled;
|
|
2025
2175
|
}
|
|
2026
2176
|
if (data.distance !== undefined) {
|
|
2027
|
-
this.distance = data.distance;
|
|
2177
|
+
this.distance = setRangeValue(data.distance);
|
|
2028
2178
|
}
|
|
2029
2179
|
if (data.duration !== undefined) {
|
|
2030
|
-
this.duration = data.duration;
|
|
2180
|
+
this.duration = setRangeValue(data.duration);
|
|
2031
2181
|
}
|
|
2032
2182
|
if (data.factor !== undefined) {
|
|
2033
|
-
this.factor = data.factor;
|
|
2183
|
+
this.factor = setRangeValue(data.factor);
|
|
2034
2184
|
}
|
|
2035
2185
|
if (data.speed !== undefined) {
|
|
2036
|
-
this.speed = data.speed;
|
|
2186
|
+
this.speed = setRangeValue(data.speed);
|
|
2187
|
+
}
|
|
2188
|
+
}
|
|
2189
|
+
}
|
|
2190
|
+
class RollLight_RollLight {
|
|
2191
|
+
constructor() {
|
|
2192
|
+
this.enable = false;
|
|
2193
|
+
this.value = 0;
|
|
2194
|
+
}
|
|
2195
|
+
load(data) {
|
|
2196
|
+
if (!data) {
|
|
2197
|
+
return;
|
|
2198
|
+
}
|
|
2199
|
+
if (data.enable !== undefined) {
|
|
2200
|
+
this.enable = data.enable;
|
|
2201
|
+
}
|
|
2202
|
+
if (data.value !== undefined) {
|
|
2203
|
+
this.value = setRangeValue(data.value);
|
|
2037
2204
|
}
|
|
2038
2205
|
}
|
|
2039
2206
|
}
|
|
@@ -2065,6 +2232,27 @@
|
|
|
2065
2232
|
}
|
|
2066
2233
|
}
|
|
2067
2234
|
}
|
|
2235
|
+
class RotateAnimation_RotateAnimation {
|
|
2236
|
+
constructor() {
|
|
2237
|
+
this.enable = false;
|
|
2238
|
+
this.speed = 0;
|
|
2239
|
+
this.sync = false;
|
|
2240
|
+
}
|
|
2241
|
+
load(data) {
|
|
2242
|
+
if (data === undefined) {
|
|
2243
|
+
return;
|
|
2244
|
+
}
|
|
2245
|
+
if (data.enable !== undefined) {
|
|
2246
|
+
this.enable = data.enable;
|
|
2247
|
+
}
|
|
2248
|
+
if (data.speed !== undefined) {
|
|
2249
|
+
this.speed = setRangeValue(data.speed);
|
|
2250
|
+
}
|
|
2251
|
+
if (data.sync !== undefined) {
|
|
2252
|
+
this.sync = data.sync;
|
|
2253
|
+
}
|
|
2254
|
+
}
|
|
2255
|
+
}
|
|
2068
2256
|
class Rotate_Rotate extends(null && ValueWithRandom){
|
|
2069
2257
|
constructor() {
|
|
2070
2258
|
super();
|
|
@@ -2183,6 +2371,45 @@
|
|
|
2183
2371
|
}
|
|
2184
2372
|
}
|
|
2185
2373
|
}
|
|
2374
|
+
class SizeAnimation_SizeAnimation extends(null && AnimationOptions){
|
|
2375
|
+
constructor() {
|
|
2376
|
+
super();
|
|
2377
|
+
this.destroy = "none";
|
|
2378
|
+
this.enable = false;
|
|
2379
|
+
this.speed = 5;
|
|
2380
|
+
this.startValue = "random";
|
|
2381
|
+
this.sync = false;
|
|
2382
|
+
}
|
|
2383
|
+
get size_min() {
|
|
2384
|
+
return this.minimumValue;
|
|
2385
|
+
}
|
|
2386
|
+
set size_min(value) {
|
|
2387
|
+
this.minimumValue = value;
|
|
2388
|
+
}
|
|
2389
|
+
load(data) {
|
|
2390
|
+
var _a;
|
|
2391
|
+
if (data === undefined) {
|
|
2392
|
+
return;
|
|
2393
|
+
}
|
|
2394
|
+
super.load(data);
|
|
2395
|
+
if (data.destroy !== undefined) {
|
|
2396
|
+
this.destroy = data.destroy;
|
|
2397
|
+
}
|
|
2398
|
+
if (data.enable !== undefined) {
|
|
2399
|
+
this.enable = data.enable;
|
|
2400
|
+
}
|
|
2401
|
+
this.minimumValue = (_a = data.minimumValue) !== null && _a !== void 0 ? _a : data.size_min;
|
|
2402
|
+
if (data.speed !== undefined) {
|
|
2403
|
+
this.speed = data.speed;
|
|
2404
|
+
}
|
|
2405
|
+
if (data.startValue !== undefined) {
|
|
2406
|
+
this.startValue = data.startValue;
|
|
2407
|
+
}
|
|
2408
|
+
if (data.sync !== undefined) {
|
|
2409
|
+
this.sync = data.sync;
|
|
2410
|
+
}
|
|
2411
|
+
}
|
|
2412
|
+
}
|
|
2186
2413
|
class Size_Size extends(null && ValueWithRandom){
|
|
2187
2414
|
constructor() {
|
|
2188
2415
|
super();
|
|
@@ -2228,6 +2455,27 @@
|
|
|
2228
2455
|
}
|
|
2229
2456
|
}
|
|
2230
2457
|
}
|
|
2458
|
+
class TiltAnimation_TiltAnimation {
|
|
2459
|
+
constructor() {
|
|
2460
|
+
this.enable = false;
|
|
2461
|
+
this.speed = 0;
|
|
2462
|
+
this.sync = false;
|
|
2463
|
+
}
|
|
2464
|
+
load(data) {
|
|
2465
|
+
if (data === undefined) {
|
|
2466
|
+
return;
|
|
2467
|
+
}
|
|
2468
|
+
if (data.enable !== undefined) {
|
|
2469
|
+
this.enable = data.enable;
|
|
2470
|
+
}
|
|
2471
|
+
if (data.speed !== undefined) {
|
|
2472
|
+
this.speed = setRangeValue(data.speed);
|
|
2473
|
+
}
|
|
2474
|
+
if (data.sync !== undefined) {
|
|
2475
|
+
this.sync = data.sync;
|
|
2476
|
+
}
|
|
2477
|
+
}
|
|
2478
|
+
}
|
|
2231
2479
|
class Tilt_Tilt extends(null && ValueWithRandom){
|
|
2232
2480
|
constructor() {
|
|
2233
2481
|
super();
|
|
@@ -2250,6 +2498,43 @@
|
|
|
2250
2498
|
}
|
|
2251
2499
|
}
|
|
2252
2500
|
}
|
|
2501
|
+
class TwinkleValues_TwinkleValues {
|
|
2502
|
+
constructor() {
|
|
2503
|
+
this.enable = false;
|
|
2504
|
+
this.frequency = .05;
|
|
2505
|
+
this.opacity = 1;
|
|
2506
|
+
}
|
|
2507
|
+
load(data) {
|
|
2508
|
+
if (data === undefined) {
|
|
2509
|
+
return;
|
|
2510
|
+
}
|
|
2511
|
+
if (data.color !== undefined) {
|
|
2512
|
+
this.color = OptionsColor.create(this.color, data.color);
|
|
2513
|
+
}
|
|
2514
|
+
if (data.enable !== undefined) {
|
|
2515
|
+
this.enable = data.enable;
|
|
2516
|
+
}
|
|
2517
|
+
if (data.frequency !== undefined) {
|
|
2518
|
+
this.frequency = data.frequency;
|
|
2519
|
+
}
|
|
2520
|
+
if (data.opacity !== undefined) {
|
|
2521
|
+
this.opacity = setRangeValue(data.opacity);
|
|
2522
|
+
}
|
|
2523
|
+
}
|
|
2524
|
+
}
|
|
2525
|
+
class Twinkle_Twinkle {
|
|
2526
|
+
constructor() {
|
|
2527
|
+
this.lines = new TwinkleValues;
|
|
2528
|
+
this.particles = new TwinkleValues;
|
|
2529
|
+
}
|
|
2530
|
+
load(data) {
|
|
2531
|
+
if (data === undefined) {
|
|
2532
|
+
return;
|
|
2533
|
+
}
|
|
2534
|
+
this.lines.load(data.lines);
|
|
2535
|
+
this.particles.load(data.particles);
|
|
2536
|
+
}
|
|
2537
|
+
}
|
|
2253
2538
|
class Wobble_Wobble {
|
|
2254
2539
|
constructor() {
|
|
2255
2540
|
this.distance = 5;
|
|
@@ -2687,7 +2972,7 @@
|
|
|
2687
2972
|
max: getRangeMax(sizeRange) * pxRatio,
|
|
2688
2973
|
min: getRangeMin(sizeRange) * pxRatio,
|
|
2689
2974
|
loops: 0,
|
|
2690
|
-
maxLoops: sizeOptions.animation.count
|
|
2975
|
+
maxLoops: getRangeValue(sizeOptions.animation.count)
|
|
2691
2976
|
};
|
|
2692
2977
|
const sizeAnimation = sizeOptions.animation;
|
|
2693
2978
|
if (sizeAnimation.enable) {
|
|
@@ -2721,6 +3006,12 @@
|
|
|
2721
3006
|
this.initialVelocity = this.calculateVelocity();
|
|
2722
3007
|
this.velocity = this.initialVelocity.copy();
|
|
2723
3008
|
this.moveDecay = 1 - getRangeValue(this.options.move.decay);
|
|
3009
|
+
const gravityOptions = this.options.move.gravity;
|
|
3010
|
+
this.gravity = {
|
|
3011
|
+
enable: gravityOptions.enable,
|
|
3012
|
+
acceleration: getRangeValue(gravityOptions.acceleration),
|
|
3013
|
+
inverse: gravityOptions.inverse
|
|
3014
|
+
};
|
|
2724
3015
|
this.position = this.calcPosition(container, position, clamp(zIndexValue, 0, container.zLayers));
|
|
2725
3016
|
this.initialPosition = this.position.copy();
|
|
2726
3017
|
this.offset = Vector.origin;
|
|
@@ -2928,12 +3219,7 @@
|
|
|
2928
3219
|
return overlaps;
|
|
2929
3220
|
}
|
|
2930
3221
|
calculateVelocity() {
|
|
2931
|
-
const baseVelocity = getParticleBaseVelocity(this.direction)
|
|
2932
|
-
const res = baseVelocity.copy();
|
|
2933
|
-
const moveOptions = this.options.move;
|
|
2934
|
-
const rad = Math.PI / 180 * moveOptions.angle.value;
|
|
2935
|
-
const radOffset = Math.PI / 180 * moveOptions.angle.offset;
|
|
2936
|
-
const range = {
|
|
3222
|
+
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 = {
|
|
2937
3223
|
left: radOffset - rad / 2,
|
|
2938
3224
|
right: radOffset + rad / 2
|
|
2939
3225
|
};
|
|
@@ -3323,13 +3609,13 @@
|
|
|
3323
3609
|
container.canvas.size.height = element.offsetHeight * ratio;
|
|
3324
3610
|
}
|
|
3325
3611
|
const particles = options.particles;
|
|
3326
|
-
this.attractDistance = particles.move.attract.distance * ratio;
|
|
3612
|
+
this.attractDistance = getRangeValue(particles.move.attract.distance) * ratio;
|
|
3327
3613
|
this.linksDistance = particles.links.distance * ratio;
|
|
3328
3614
|
this.linksWidth = particles.links.width * ratio;
|
|
3329
|
-
this.sizeAnimationSpeed = particles.size.animation.speed * ratio;
|
|
3330
|
-
this.maxSpeed = particles.move.gravity.maxSpeed * ratio;
|
|
3615
|
+
this.sizeAnimationSpeed = getRangeValue(particles.size.animation.speed) * ratio;
|
|
3616
|
+
this.maxSpeed = getRangeValue(particles.move.gravity.maxSpeed) * ratio;
|
|
3331
3617
|
if (particles.orbit.radius !== undefined) {
|
|
3332
|
-
this.orbitRadius = particles.orbit.radius * this.container.retina.pixelRatio;
|
|
3618
|
+
this.orbitRadius = getRangeValue(particles.orbit.radius) * this.container.retina.pixelRatio;
|
|
3333
3619
|
}
|
|
3334
3620
|
const modes = options.interactivity.modes;
|
|
3335
3621
|
this.connectModeDistance = modes.connect.distance * ratio;
|
|
@@ -3349,19 +3635,19 @@
|
|
|
3349
3635
|
const ratio = this.pixelRatio;
|
|
3350
3636
|
const moveDistance = options.move.distance;
|
|
3351
3637
|
const props = particle.retina;
|
|
3352
|
-
props.attractDistance = options.move.attract.distance * ratio;
|
|
3638
|
+
props.attractDistance = getRangeValue(options.move.attract.distance) * ratio;
|
|
3353
3639
|
props.linksDistance = options.links.distance * ratio;
|
|
3354
3640
|
props.linksWidth = options.links.width * ratio;
|
|
3355
3641
|
props.moveDrift = getRangeValue(options.move.drift) * ratio;
|
|
3356
3642
|
props.moveSpeed = getRangeValue(options.move.speed) * ratio;
|
|
3357
|
-
props.sizeAnimationSpeed = options.size.animation.speed * ratio;
|
|
3643
|
+
props.sizeAnimationSpeed = getRangeValue(options.size.animation.speed) * ratio;
|
|
3358
3644
|
if (particle.spin) {
|
|
3359
3645
|
props.spinAcceleration = getRangeValue(options.move.spin.acceleration) * ratio;
|
|
3360
3646
|
}
|
|
3361
3647
|
const maxDistance = props.maxDistance;
|
|
3362
3648
|
maxDistance.horizontal = moveDistance.horizontal !== undefined ? moveDistance.horizontal * ratio : undefined;
|
|
3363
3649
|
maxDistance.vertical = moveDistance.vertical !== undefined ? moveDistance.vertical * ratio : undefined;
|
|
3364
|
-
props.maxSpeed = options.move.gravity.maxSpeed * ratio;
|
|
3650
|
+
props.maxSpeed = getRangeValue(options.move.gravity.maxSpeed) * ratio;
|
|
3365
3651
|
}
|
|
3366
3652
|
handleMotionChange(mediaQuery) {
|
|
3367
3653
|
const options = this.container.actualOptions;
|
|
@@ -4693,7 +4979,7 @@
|
|
|
4693
4979
|
function setColorAnimation(colorValue, colorAnimation, reduceFactor) {
|
|
4694
4980
|
colorValue.enable = colorAnimation.enable;
|
|
4695
4981
|
if (colorValue.enable) {
|
|
4696
|
-
colorValue.velocity = colorAnimation.speed / 100 * reduceFactor;
|
|
4982
|
+
colorValue.velocity = getRangeValue(colorAnimation.speed) / 100 * reduceFactor;
|
|
4697
4983
|
if (colorAnimation.sync) {
|
|
4698
4984
|
return;
|
|
4699
4985
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! tsParticles v1.
|
|
1
|
+
/*! tsParticles v1.42.2 by Matteo Bruni */
|
|
2
2
|
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var o=e();for(var i in o)("object"==typeof exports?exports:t)[i]=o[i]}}(window,(function(){return function(){"use strict";var t={d:function(e,o){for(var i in o)t.o(o,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:o[i]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r:function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{loadParticlesCollisionsInteraction:function(){return g}});class o{}o.generatedAttribute="generated",o.randomColorValue="random",o.midColorValue="mid",o.touchEndEvent="touchend",o.mouseDownEvent="mousedown",o.mouseUpEvent="mouseup",o.mouseMoveEvent="mousemove",o.touchStartEvent="touchstart",o.touchMoveEvent="touchmove",o.mouseLeaveEvent="mouseleave",o.mouseOutEvent="mouseout",o.touchCancelEvent="touchcancel",o.resizeEvent="resize",o.visibilityChangeEvent="visibilitychange",o.noPolygonDataLoaded="No polygon data loaded.",o.noPolygonFound="No polygon found, you need to specify SVG url in config.";new WeakMap;new WeakMap;class i{constructor(t,e){let o,i;if(void 0===e){if("number"==typeof t)throw new Error("tsParticles - Vector not initialized correctly");const e=t;[o,i]=[e.x,e.y]}else[o,i]=[t,e];this.x=o,this.y=i}static clone(t){return i.create(t.x,t.y)}static create(t,e){return new i(t,e)}static get origin(){return i.create(0,0)}get angle(){return Math.atan2(this.y,this.x)}set angle(t){this.updateFromAngle(t,this.length)}get length(){return Math.sqrt(this.x**2+this.y**2)}set length(t){this.updateFromAngle(this.angle,t)}add(t){return i.create(this.x+t.x,this.y+t.y)}addTo(t){this.x+=t.x,this.y+=t.y}sub(t){return i.create(this.x-t.x,this.y-t.y)}subFrom(t){this.x-=t.x,this.y-=t.y}mult(t){return i.create(this.x*t,this.y*t)}multTo(t){this.x*=t,this.y*=t}div(t){return i.create(this.x/t,this.y/t)}divTo(t){this.x/=t,this.y/=t}distanceTo(t){return this.sub(t).length}getLengthSq(){return this.x**2+this.y**2}distanceToSq(t){return this.sub(t).getLengthSq()}manhattanDistanceTo(t){return Math.abs(t.x-this.x)+Math.abs(t.y-this.y)}copy(){return i.clone(this)}setTo(t){this.x=t.x,this.y=t.y}rotate(t){return i.create(this.x*Math.cos(t)-this.y*Math.sin(t),this.x*Math.sin(t)+this.y*Math.cos(t))}updateFromAngle(t,e){this.x=Math.cos(t)*e,this.y=Math.sin(t)*e}}new WeakMap,new WeakSet;new WeakMap;new WeakMap;new WeakMap;function n(t,e,o){return Math.min(Math.max(t,e),o)}function s(t){return"number"==typeof t?t:function(t){const e=r(t);let o=a(t);return e===o&&(o=0),Math.random()*(e-o)+o}(t)}function a(t){return"number"==typeof t?t:t.min}function r(t){return"number"==typeof t?t:t.max}function u(t,e){if(t===e||void 0===e&&"number"==typeof t)return t;const o=a(t),i=r(t);return void 0!==e?{min:Math.min(o,e),max:Math.max(i,e)}:u(o,i)}function c(t){const e=t.random,{enable:o,minimumValue:i}="boolean"==typeof e?{enable:e,minimumValue:0}:e;return s(o?u(t.value,i):t.value)}function d(t,e){const o=t.x-e.x,i=t.y-e.y;return{dx:o,dy:i,distance:Math.sqrt(o*o+i*i)}}function l(t,e,o,n){return i.create(t.x*(o-n)/(o+n)+2*e.x*n/(o+n),t.y)}function y(t){return{position:t.getPosition(),radius:t.getRadius(),mass:t.getMass(),velocity:t.velocity,factor:i.create(c(t.options.bounce.horizontal),c(t.options.bounce.vertical))}}function h(t,e){!function(t,e){const{x:o,y:i}=t.velocity.sub(e.velocity),[n,s]=[t.position,e.position],{dx:a,dy:r}=d(s,n);if(o*a+i*r>=0){const o=-Math.atan2(r,a),i=t.mass,n=e.mass,s=t.velocity.rotate(o),u=e.velocity.rotate(o),c=l(s,u,i,n),d=l(u,s,i,n),y=c.rotate(-o),h=d.rotate(-o);t.velocity.x=y.x*t.factor.x,t.velocity.y=y.y*t.factor.y,e.velocity.x=h.x*e.factor.x,e.velocity.y=h.y*e.factor.y}}(y(t),y(e))}new WeakMap;class f extends class{constructor(t){this.container=t,this.type=1}}{constructor(t){super(t)}isEnabled(t){return t.options.collisions.enable}reset(){}async interact(t){const e=this.container,o=t.getPosition(),i=t.getRadius(),n=e.particles.quadTree.queryCircle(o,2*i);for(const e of n){if(t===e||!e.options.collisions.enable||t.options.collisions.mode!==e.options.collisions.mode||e.destroyed||e.spawning)continue;const n=e.getPosition();if(Math.round(o.z)!==Math.round(n.z))continue;d(o,n).distance<=i+e.getRadius()&&this.resolveCollision(t,e)}}resolveCollision(t,e){switch(t.options.collisions.mode){case"absorb":this.absorb(t,e);break;case"bounce":h(t,e);break;case"destroy":!function(t,e){t.unbreakable||e.unbreakable||h(t,e),void 0===t.getRadius()&&void 0!==e.getRadius()?t.destroy():void 0!==t.getRadius()&&void 0===e.getRadius()?e.destroy():void 0!==t.getRadius()&&void 0!==e.getRadius()&&(t.getRadius()>=e.getRadius()?e.destroy():t.destroy())}(t,e)}}absorb(t,e){const o=this.container,i=o.fpsLimit/1e3;if(void 0===t.getRadius()&&void 0!==e.getRadius())t.destroy();else if(void 0!==t.getRadius()&&void 0===e.getRadius())e.destroy();else if(void 0!==t.getRadius()&&void 0!==e.getRadius())if(t.getRadius()>=e.getRadius()){const s=n(t.getRadius()/e.getRadius(),0,e.getRadius())*i;t.size.value+=s,e.size.value-=s,e.getRadius()<=o.retina.pixelRatio&&(e.size.value=0,e.destroy())}else{const s=n(e.getRadius()/t.getRadius(),0,t.getRadius())*i;t.size.value-=s,e.size.value+=s,t.getRadius()<=o.retina.pixelRatio&&(t.size.value=0,t.destroy())}}}async function g(t){await t.addInteractor("particlesCollisions",(t=>new f(t)))}return e}()}));
|