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
|
@@ -799,7 +799,7 @@
|
|
|
799
799
|
function setColorAnimation(colorValue, colorAnimation, reduceFactor) {
|
|
800
800
|
colorValue.enable = colorAnimation.enable;
|
|
801
801
|
if (colorValue.enable) {
|
|
802
|
-
colorValue.velocity = colorAnimation.speed / 100 * reduceFactor;
|
|
802
|
+
colorValue.velocity = getRangeValue(colorAnimation.speed) / 100 * reduceFactor;
|
|
803
803
|
if (colorAnimation.sync) {
|
|
804
804
|
return;
|
|
805
805
|
}
|
|
@@ -1666,7 +1666,7 @@
|
|
|
1666
1666
|
}
|
|
1667
1667
|
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;
|
|
1668
1668
|
this.applyPath(particle, delta);
|
|
1669
|
-
const gravityOptions =
|
|
1669
|
+
const gravityOptions = particle.gravity;
|
|
1670
1670
|
const gravityFactor = gravityOptions.enable && gravityOptions.inverse ? -1 : 1;
|
|
1671
1671
|
if (gravityOptions.enable && moveSpeed) {
|
|
1672
1672
|
particle.velocity.y += gravityFactor * (gravityOptions.acceleration * delta.factor) / (60 * moveSpeed);
|
|
@@ -1680,7 +1680,7 @@
|
|
|
1680
1680
|
}
|
|
1681
1681
|
const velocity = particle.velocity.mult(moveSpeed);
|
|
1682
1682
|
const maxSpeed = (_c = particle.retina.maxSpeed) !== null && _c !== void 0 ? _c : container.retina.maxSpeed;
|
|
1683
|
-
if (gravityOptions.enable &&
|
|
1683
|
+
if (gravityOptions.enable && maxSpeed > 0 && (!gravityOptions.inverse && velocity.y >= 0 && velocity.y >= maxSpeed || gravityOptions.inverse && velocity.y <= 0 && velocity.y <= -maxSpeed)) {
|
|
1684
1684
|
velocity.y = gravityFactor * maxSpeed;
|
|
1685
1685
|
if (moveSpeed) {
|
|
1686
1686
|
particle.velocity.y = velocity.y / moveSpeed;
|
|
@@ -1994,9 +1994,9 @@
|
|
|
1994
1994
|
paint() {
|
|
1995
1995
|
const options = this.container.actualOptions;
|
|
1996
1996
|
this.draw((ctx => {
|
|
1997
|
-
if (options.backgroundMask.enable && options.backgroundMask.cover
|
|
1997
|
+
if (options.backgroundMask.enable && options.backgroundMask.cover) {
|
|
1998
1998
|
clear(ctx, this.size);
|
|
1999
|
-
this.paintBase(
|
|
1999
|
+
this.paintBase(this.coverColorStyle);
|
|
2000
2000
|
} else {
|
|
2001
2001
|
this.paintBase();
|
|
2002
2002
|
}
|
|
@@ -2098,7 +2098,7 @@
|
|
|
2098
2098
|
const zIndexOptions = particle.options.zIndex;
|
|
2099
2099
|
const zOpacityFactor = (1 - particle.zIndexFactor) ** zIndexOptions.opacityRate;
|
|
2100
2100
|
const radius = particle.getRadius();
|
|
2101
|
-
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;
|
|
2101
|
+
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;
|
|
2102
2102
|
const strokeOpacity = (_f = (_e = particle.stroke) === null || _e === void 0 ? void 0 : _e.opacity) !== null && _f !== void 0 ? _f : opacity;
|
|
2103
2103
|
const zOpacity = opacity * zOpacityFactor;
|
|
2104
2104
|
const fillColorValue = fColor ? getStyleFromHsl(fColor, zOpacity) : undefined;
|
|
@@ -2167,12 +2167,14 @@
|
|
|
2167
2167
|
const color = cover.color;
|
|
2168
2168
|
const coverRgb = colorToRgb(color);
|
|
2169
2169
|
if (coverRgb) {
|
|
2170
|
-
|
|
2170
|
+
const coverColor = {
|
|
2171
2171
|
r: coverRgb.r,
|
|
2172
2172
|
g: coverRgb.g,
|
|
2173
2173
|
b: coverRgb.b,
|
|
2174
2174
|
a: cover.opacity
|
|
2175
2175
|
};
|
|
2176
|
+
this.coverColorStyle = getStyleFromRgb(coverColor, coverColor.a);
|
|
2177
|
+
console.log(this.coverColorStyle);
|
|
2176
2178
|
}
|
|
2177
2179
|
}
|
|
2178
2180
|
initTrail() {
|
|
@@ -2369,7 +2371,7 @@
|
|
|
2369
2371
|
return;
|
|
2370
2372
|
}
|
|
2371
2373
|
if (data.count !== undefined) {
|
|
2372
|
-
this.count = data.count;
|
|
2374
|
+
this.count = setRangeValue(data.count);
|
|
2373
2375
|
}
|
|
2374
2376
|
if (data.enable !== undefined) {
|
|
2375
2377
|
this.enable = data.enable;
|
|
@@ -2378,7 +2380,7 @@
|
|
|
2378
2380
|
this.offset = setRangeValue(data.offset);
|
|
2379
2381
|
}
|
|
2380
2382
|
if (data.speed !== undefined) {
|
|
2381
|
-
this.speed = data.speed;
|
|
2383
|
+
this.speed = setRangeValue(data.speed);
|
|
2382
2384
|
}
|
|
2383
2385
|
if (data.sync !== undefined) {
|
|
2384
2386
|
this.sync = data.sync;
|
|
@@ -2526,13 +2528,13 @@
|
|
|
2526
2528
|
return;
|
|
2527
2529
|
}
|
|
2528
2530
|
if (data.count !== undefined) {
|
|
2529
|
-
this.count = data.count;
|
|
2531
|
+
this.count = setRangeValue(data.count);
|
|
2530
2532
|
}
|
|
2531
2533
|
if (data.enable !== undefined) {
|
|
2532
2534
|
this.enable = data.enable;
|
|
2533
2535
|
}
|
|
2534
2536
|
if (data.speed !== undefined) {
|
|
2535
|
-
this.speed = data.speed;
|
|
2537
|
+
this.speed = setRangeValue(data.speed);
|
|
2536
2538
|
}
|
|
2537
2539
|
if (data.sync !== undefined) {
|
|
2538
2540
|
this.sync = data.sync;
|
|
@@ -2552,13 +2554,13 @@
|
|
|
2552
2554
|
return;
|
|
2553
2555
|
}
|
|
2554
2556
|
if (data.count !== undefined) {
|
|
2555
|
-
this.count = data.count;
|
|
2557
|
+
this.count = setRangeValue(data.count);
|
|
2556
2558
|
}
|
|
2557
2559
|
if (data.enable !== undefined) {
|
|
2558
2560
|
this.enable = data.enable;
|
|
2559
2561
|
}
|
|
2560
2562
|
if (data.speed !== undefined) {
|
|
2561
|
-
this.speed = data.speed;
|
|
2563
|
+
this.speed = setRangeValue(data.speed);
|
|
2562
2564
|
}
|
|
2563
2565
|
if (data.sync !== undefined) {
|
|
2564
2566
|
this.sync = data.sync;
|
|
@@ -2730,6 +2732,90 @@
|
|
|
2730
2732
|
this.duration.load(data.duration);
|
|
2731
2733
|
}
|
|
2732
2734
|
}
|
|
2735
|
+
class Attract_Attract {
|
|
2736
|
+
constructor() {
|
|
2737
|
+
this.distance = 200;
|
|
2738
|
+
this.enable = false;
|
|
2739
|
+
this.rotate = {
|
|
2740
|
+
x: 3e3,
|
|
2741
|
+
y: 3e3
|
|
2742
|
+
};
|
|
2743
|
+
}
|
|
2744
|
+
get rotateX() {
|
|
2745
|
+
return this.rotate.x;
|
|
2746
|
+
}
|
|
2747
|
+
set rotateX(value) {
|
|
2748
|
+
this.rotate.x = value;
|
|
2749
|
+
}
|
|
2750
|
+
get rotateY() {
|
|
2751
|
+
return this.rotate.y;
|
|
2752
|
+
}
|
|
2753
|
+
set rotateY(value) {
|
|
2754
|
+
this.rotate.y = value;
|
|
2755
|
+
}
|
|
2756
|
+
load(data) {
|
|
2757
|
+
var _a, _b, _c, _d;
|
|
2758
|
+
if (!data) {
|
|
2759
|
+
return;
|
|
2760
|
+
}
|
|
2761
|
+
if (data.distance !== undefined) {
|
|
2762
|
+
this.distance = setRangeValue(data.distance);
|
|
2763
|
+
}
|
|
2764
|
+
if (data.enable !== undefined) {
|
|
2765
|
+
this.enable = data.enable;
|
|
2766
|
+
}
|
|
2767
|
+
const rotateX = (_b = (_a = data.rotate) === null || _a === void 0 ? void 0 : _a.x) !== null && _b !== void 0 ? _b : data.rotateX;
|
|
2768
|
+
if (rotateX !== undefined) {
|
|
2769
|
+
this.rotate.x = rotateX;
|
|
2770
|
+
}
|
|
2771
|
+
const rotateY = (_d = (_c = data.rotate) === null || _c === void 0 ? void 0 : _c.y) !== null && _d !== void 0 ? _d : data.rotateY;
|
|
2772
|
+
if (rotateY !== undefined) {
|
|
2773
|
+
this.rotate.y = rotateY;
|
|
2774
|
+
}
|
|
2775
|
+
}
|
|
2776
|
+
}
|
|
2777
|
+
class MoveAngle_MoveAngle {
|
|
2778
|
+
constructor() {
|
|
2779
|
+
this.offset = 0;
|
|
2780
|
+
this.value = 90;
|
|
2781
|
+
}
|
|
2782
|
+
load(data) {
|
|
2783
|
+
if (data === undefined) {
|
|
2784
|
+
return;
|
|
2785
|
+
}
|
|
2786
|
+
if (data.offset !== undefined) {
|
|
2787
|
+
this.offset = setRangeValue(data.offset);
|
|
2788
|
+
}
|
|
2789
|
+
if (data.value !== undefined) {
|
|
2790
|
+
this.value = setRangeValue(data.value);
|
|
2791
|
+
}
|
|
2792
|
+
}
|
|
2793
|
+
}
|
|
2794
|
+
class MoveGravity_MoveGravity {
|
|
2795
|
+
constructor() {
|
|
2796
|
+
this.acceleration = 9.81;
|
|
2797
|
+
this.enable = false;
|
|
2798
|
+
this.inverse = false;
|
|
2799
|
+
this.maxSpeed = 50;
|
|
2800
|
+
}
|
|
2801
|
+
load(data) {
|
|
2802
|
+
if (!data) {
|
|
2803
|
+
return;
|
|
2804
|
+
}
|
|
2805
|
+
if (data.acceleration !== undefined) {
|
|
2806
|
+
this.acceleration = setRangeValue(data.acceleration);
|
|
2807
|
+
}
|
|
2808
|
+
if (data.enable !== undefined) {
|
|
2809
|
+
this.enable = data.enable;
|
|
2810
|
+
}
|
|
2811
|
+
if (data.inverse !== undefined) {
|
|
2812
|
+
this.inverse = data.inverse;
|
|
2813
|
+
}
|
|
2814
|
+
if (data.maxSpeed !== undefined) {
|
|
2815
|
+
this.maxSpeed = setRangeValue(data.maxSpeed);
|
|
2816
|
+
}
|
|
2817
|
+
}
|
|
2818
|
+
}
|
|
2733
2819
|
class PathDelay_PathDelay extends(null && ValueWithRandom){
|
|
2734
2820
|
constructor() {
|
|
2735
2821
|
super();
|
|
@@ -2891,6 +2977,70 @@
|
|
|
2891
2977
|
}
|
|
2892
2978
|
}
|
|
2893
2979
|
}
|
|
2980
|
+
class AnimationOptions_AnimationOptions {
|
|
2981
|
+
constructor() {
|
|
2982
|
+
this.count = 0;
|
|
2983
|
+
this.enable = false;
|
|
2984
|
+
this.speed = 1;
|
|
2985
|
+
this.sync = false;
|
|
2986
|
+
}
|
|
2987
|
+
load(data) {
|
|
2988
|
+
if (!data) {
|
|
2989
|
+
return;
|
|
2990
|
+
}
|
|
2991
|
+
if (data.count !== undefined) {
|
|
2992
|
+
this.count = setRangeValue(data.count);
|
|
2993
|
+
}
|
|
2994
|
+
if (data.enable !== undefined) {
|
|
2995
|
+
this.enable = data.enable;
|
|
2996
|
+
}
|
|
2997
|
+
if (data.speed !== undefined) {
|
|
2998
|
+
this.speed = setRangeValue(data.speed);
|
|
2999
|
+
}
|
|
3000
|
+
if (data.sync !== undefined) {
|
|
3001
|
+
this.sync = data.sync;
|
|
3002
|
+
}
|
|
3003
|
+
}
|
|
3004
|
+
}
|
|
3005
|
+
class OpacityAnimation_OpacityAnimation extends(null && AnimationOptions){
|
|
3006
|
+
constructor() {
|
|
3007
|
+
super();
|
|
3008
|
+
this.destroy = "none";
|
|
3009
|
+
this.enable = false;
|
|
3010
|
+
this.speed = 2;
|
|
3011
|
+
this.startValue = "random";
|
|
3012
|
+
this.sync = false;
|
|
3013
|
+
}
|
|
3014
|
+
get opacity_min() {
|
|
3015
|
+
return this.minimumValue;
|
|
3016
|
+
}
|
|
3017
|
+
set opacity_min(value) {
|
|
3018
|
+
this.minimumValue = value;
|
|
3019
|
+
}
|
|
3020
|
+
load(data) {
|
|
3021
|
+
var _a;
|
|
3022
|
+
if (data === undefined) {
|
|
3023
|
+
return;
|
|
3024
|
+
}
|
|
3025
|
+
super.load(data);
|
|
3026
|
+
if (data.destroy !== undefined) {
|
|
3027
|
+
this.destroy = data.destroy;
|
|
3028
|
+
}
|
|
3029
|
+
if (data.enable !== undefined) {
|
|
3030
|
+
this.enable = data.enable;
|
|
3031
|
+
}
|
|
3032
|
+
this.minimumValue = (_a = data.minimumValue) !== null && _a !== void 0 ? _a : data.opacity_min;
|
|
3033
|
+
if (data.speed !== undefined) {
|
|
3034
|
+
this.speed = data.speed;
|
|
3035
|
+
}
|
|
3036
|
+
if (data.startValue !== undefined) {
|
|
3037
|
+
this.startValue = data.startValue;
|
|
3038
|
+
}
|
|
3039
|
+
if (data.sync !== undefined) {
|
|
3040
|
+
this.sync = data.sync;
|
|
3041
|
+
}
|
|
3042
|
+
}
|
|
3043
|
+
}
|
|
2894
3044
|
class Opacity_Opacity extends(null && ValueWithRandom){
|
|
2895
3045
|
constructor() {
|
|
2896
3046
|
super();
|
|
@@ -2949,13 +3099,13 @@
|
|
|
2949
3099
|
this.enable = data.enable;
|
|
2950
3100
|
}
|
|
2951
3101
|
if (data.opacity !== undefined) {
|
|
2952
|
-
this.opacity = data.opacity;
|
|
3102
|
+
this.opacity = setRangeValue(data.opacity);
|
|
2953
3103
|
}
|
|
2954
3104
|
if (data.width !== undefined) {
|
|
2955
|
-
this.width = data.width;
|
|
3105
|
+
this.width = setRangeValue(data.width);
|
|
2956
3106
|
}
|
|
2957
3107
|
if (data.radius !== undefined) {
|
|
2958
|
-
this.radius = data.radius;
|
|
3108
|
+
this.radius = setRangeValue(data.radius);
|
|
2959
3109
|
}
|
|
2960
3110
|
if (data.color !== undefined) {
|
|
2961
3111
|
this.color = OptionsColor.create(this.color, data.color);
|
|
@@ -2980,16 +3130,33 @@
|
|
|
2980
3130
|
this.enabled = data.enabled;
|
|
2981
3131
|
}
|
|
2982
3132
|
if (data.distance !== undefined) {
|
|
2983
|
-
this.distance = data.distance;
|
|
3133
|
+
this.distance = setRangeValue(data.distance);
|
|
2984
3134
|
}
|
|
2985
3135
|
if (data.duration !== undefined) {
|
|
2986
|
-
this.duration = data.duration;
|
|
3136
|
+
this.duration = setRangeValue(data.duration);
|
|
2987
3137
|
}
|
|
2988
3138
|
if (data.factor !== undefined) {
|
|
2989
|
-
this.factor = data.factor;
|
|
3139
|
+
this.factor = setRangeValue(data.factor);
|
|
2990
3140
|
}
|
|
2991
3141
|
if (data.speed !== undefined) {
|
|
2992
|
-
this.speed = data.speed;
|
|
3142
|
+
this.speed = setRangeValue(data.speed);
|
|
3143
|
+
}
|
|
3144
|
+
}
|
|
3145
|
+
}
|
|
3146
|
+
class RollLight_RollLight {
|
|
3147
|
+
constructor() {
|
|
3148
|
+
this.enable = false;
|
|
3149
|
+
this.value = 0;
|
|
3150
|
+
}
|
|
3151
|
+
load(data) {
|
|
3152
|
+
if (!data) {
|
|
3153
|
+
return;
|
|
3154
|
+
}
|
|
3155
|
+
if (data.enable !== undefined) {
|
|
3156
|
+
this.enable = data.enable;
|
|
3157
|
+
}
|
|
3158
|
+
if (data.value !== undefined) {
|
|
3159
|
+
this.value = setRangeValue(data.value);
|
|
2993
3160
|
}
|
|
2994
3161
|
}
|
|
2995
3162
|
}
|
|
@@ -3021,6 +3188,27 @@
|
|
|
3021
3188
|
}
|
|
3022
3189
|
}
|
|
3023
3190
|
}
|
|
3191
|
+
class RotateAnimation_RotateAnimation {
|
|
3192
|
+
constructor() {
|
|
3193
|
+
this.enable = false;
|
|
3194
|
+
this.speed = 0;
|
|
3195
|
+
this.sync = false;
|
|
3196
|
+
}
|
|
3197
|
+
load(data) {
|
|
3198
|
+
if (data === undefined) {
|
|
3199
|
+
return;
|
|
3200
|
+
}
|
|
3201
|
+
if (data.enable !== undefined) {
|
|
3202
|
+
this.enable = data.enable;
|
|
3203
|
+
}
|
|
3204
|
+
if (data.speed !== undefined) {
|
|
3205
|
+
this.speed = setRangeValue(data.speed);
|
|
3206
|
+
}
|
|
3207
|
+
if (data.sync !== undefined) {
|
|
3208
|
+
this.sync = data.sync;
|
|
3209
|
+
}
|
|
3210
|
+
}
|
|
3211
|
+
}
|
|
3024
3212
|
class Rotate_Rotate extends(null && ValueWithRandom){
|
|
3025
3213
|
constructor() {
|
|
3026
3214
|
super();
|
|
@@ -3139,6 +3327,45 @@
|
|
|
3139
3327
|
}
|
|
3140
3328
|
}
|
|
3141
3329
|
}
|
|
3330
|
+
class SizeAnimation_SizeAnimation extends(null && AnimationOptions){
|
|
3331
|
+
constructor() {
|
|
3332
|
+
super();
|
|
3333
|
+
this.destroy = "none";
|
|
3334
|
+
this.enable = false;
|
|
3335
|
+
this.speed = 5;
|
|
3336
|
+
this.startValue = "random";
|
|
3337
|
+
this.sync = false;
|
|
3338
|
+
}
|
|
3339
|
+
get size_min() {
|
|
3340
|
+
return this.minimumValue;
|
|
3341
|
+
}
|
|
3342
|
+
set size_min(value) {
|
|
3343
|
+
this.minimumValue = value;
|
|
3344
|
+
}
|
|
3345
|
+
load(data) {
|
|
3346
|
+
var _a;
|
|
3347
|
+
if (data === undefined) {
|
|
3348
|
+
return;
|
|
3349
|
+
}
|
|
3350
|
+
super.load(data);
|
|
3351
|
+
if (data.destroy !== undefined) {
|
|
3352
|
+
this.destroy = data.destroy;
|
|
3353
|
+
}
|
|
3354
|
+
if (data.enable !== undefined) {
|
|
3355
|
+
this.enable = data.enable;
|
|
3356
|
+
}
|
|
3357
|
+
this.minimumValue = (_a = data.minimumValue) !== null && _a !== void 0 ? _a : data.size_min;
|
|
3358
|
+
if (data.speed !== undefined) {
|
|
3359
|
+
this.speed = data.speed;
|
|
3360
|
+
}
|
|
3361
|
+
if (data.startValue !== undefined) {
|
|
3362
|
+
this.startValue = data.startValue;
|
|
3363
|
+
}
|
|
3364
|
+
if (data.sync !== undefined) {
|
|
3365
|
+
this.sync = data.sync;
|
|
3366
|
+
}
|
|
3367
|
+
}
|
|
3368
|
+
}
|
|
3142
3369
|
class Size_Size extends(null && ValueWithRandom){
|
|
3143
3370
|
constructor() {
|
|
3144
3371
|
super();
|
|
@@ -3184,6 +3411,27 @@
|
|
|
3184
3411
|
}
|
|
3185
3412
|
}
|
|
3186
3413
|
}
|
|
3414
|
+
class TiltAnimation_TiltAnimation {
|
|
3415
|
+
constructor() {
|
|
3416
|
+
this.enable = false;
|
|
3417
|
+
this.speed = 0;
|
|
3418
|
+
this.sync = false;
|
|
3419
|
+
}
|
|
3420
|
+
load(data) {
|
|
3421
|
+
if (data === undefined) {
|
|
3422
|
+
return;
|
|
3423
|
+
}
|
|
3424
|
+
if (data.enable !== undefined) {
|
|
3425
|
+
this.enable = data.enable;
|
|
3426
|
+
}
|
|
3427
|
+
if (data.speed !== undefined) {
|
|
3428
|
+
this.speed = setRangeValue(data.speed);
|
|
3429
|
+
}
|
|
3430
|
+
if (data.sync !== undefined) {
|
|
3431
|
+
this.sync = data.sync;
|
|
3432
|
+
}
|
|
3433
|
+
}
|
|
3434
|
+
}
|
|
3187
3435
|
class Tilt_Tilt extends(null && ValueWithRandom){
|
|
3188
3436
|
constructor() {
|
|
3189
3437
|
super();
|
|
@@ -3206,6 +3454,43 @@
|
|
|
3206
3454
|
}
|
|
3207
3455
|
}
|
|
3208
3456
|
}
|
|
3457
|
+
class TwinkleValues_TwinkleValues {
|
|
3458
|
+
constructor() {
|
|
3459
|
+
this.enable = false;
|
|
3460
|
+
this.frequency = .05;
|
|
3461
|
+
this.opacity = 1;
|
|
3462
|
+
}
|
|
3463
|
+
load(data) {
|
|
3464
|
+
if (data === undefined) {
|
|
3465
|
+
return;
|
|
3466
|
+
}
|
|
3467
|
+
if (data.color !== undefined) {
|
|
3468
|
+
this.color = OptionsColor.create(this.color, data.color);
|
|
3469
|
+
}
|
|
3470
|
+
if (data.enable !== undefined) {
|
|
3471
|
+
this.enable = data.enable;
|
|
3472
|
+
}
|
|
3473
|
+
if (data.frequency !== undefined) {
|
|
3474
|
+
this.frequency = data.frequency;
|
|
3475
|
+
}
|
|
3476
|
+
if (data.opacity !== undefined) {
|
|
3477
|
+
this.opacity = setRangeValue(data.opacity);
|
|
3478
|
+
}
|
|
3479
|
+
}
|
|
3480
|
+
}
|
|
3481
|
+
class Twinkle_Twinkle {
|
|
3482
|
+
constructor() {
|
|
3483
|
+
this.lines = new TwinkleValues;
|
|
3484
|
+
this.particles = new TwinkleValues;
|
|
3485
|
+
}
|
|
3486
|
+
load(data) {
|
|
3487
|
+
if (data === undefined) {
|
|
3488
|
+
return;
|
|
3489
|
+
}
|
|
3490
|
+
this.lines.load(data.lines);
|
|
3491
|
+
this.particles.load(data.particles);
|
|
3492
|
+
}
|
|
3493
|
+
}
|
|
3209
3494
|
class Wobble_Wobble {
|
|
3210
3495
|
constructor() {
|
|
3211
3496
|
this.distance = 5;
|
|
@@ -3643,7 +3928,7 @@
|
|
|
3643
3928
|
max: getRangeMax(sizeRange) * pxRatio,
|
|
3644
3929
|
min: getRangeMin(sizeRange) * pxRatio,
|
|
3645
3930
|
loops: 0,
|
|
3646
|
-
maxLoops: sizeOptions.animation.count
|
|
3931
|
+
maxLoops: getRangeValue(sizeOptions.animation.count)
|
|
3647
3932
|
};
|
|
3648
3933
|
const sizeAnimation = sizeOptions.animation;
|
|
3649
3934
|
if (sizeAnimation.enable) {
|
|
@@ -3677,6 +3962,12 @@
|
|
|
3677
3962
|
this.initialVelocity = this.calculateVelocity();
|
|
3678
3963
|
this.velocity = this.initialVelocity.copy();
|
|
3679
3964
|
this.moveDecay = 1 - getRangeValue(this.options.move.decay);
|
|
3965
|
+
const gravityOptions = this.options.move.gravity;
|
|
3966
|
+
this.gravity = {
|
|
3967
|
+
enable: gravityOptions.enable,
|
|
3968
|
+
acceleration: getRangeValue(gravityOptions.acceleration),
|
|
3969
|
+
inverse: gravityOptions.inverse
|
|
3970
|
+
};
|
|
3680
3971
|
this.position = this.calcPosition(container, position, clamp(zIndexValue, 0, container.zLayers));
|
|
3681
3972
|
this.initialPosition = this.position.copy();
|
|
3682
3973
|
this.offset = Vector.origin;
|
|
@@ -3884,12 +4175,7 @@
|
|
|
3884
4175
|
return overlaps;
|
|
3885
4176
|
}
|
|
3886
4177
|
calculateVelocity() {
|
|
3887
|
-
const baseVelocity = getParticleBaseVelocity(this.direction)
|
|
3888
|
-
const res = baseVelocity.copy();
|
|
3889
|
-
const moveOptions = this.options.move;
|
|
3890
|
-
const rad = Math.PI / 180 * moveOptions.angle.value;
|
|
3891
|
-
const radOffset = Math.PI / 180 * moveOptions.angle.offset;
|
|
3892
|
-
const range = {
|
|
4178
|
+
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 = {
|
|
3893
4179
|
left: radOffset - rad / 2,
|
|
3894
4180
|
right: radOffset + rad / 2
|
|
3895
4181
|
};
|
|
@@ -4279,13 +4565,13 @@
|
|
|
4279
4565
|
container.canvas.size.height = element.offsetHeight * ratio;
|
|
4280
4566
|
}
|
|
4281
4567
|
const particles = options.particles;
|
|
4282
|
-
this.attractDistance = particles.move.attract.distance * ratio;
|
|
4568
|
+
this.attractDistance = getRangeValue(particles.move.attract.distance) * ratio;
|
|
4283
4569
|
this.linksDistance = particles.links.distance * ratio;
|
|
4284
4570
|
this.linksWidth = particles.links.width * ratio;
|
|
4285
|
-
this.sizeAnimationSpeed = particles.size.animation.speed * ratio;
|
|
4286
|
-
this.maxSpeed = particles.move.gravity.maxSpeed * ratio;
|
|
4571
|
+
this.sizeAnimationSpeed = getRangeValue(particles.size.animation.speed) * ratio;
|
|
4572
|
+
this.maxSpeed = getRangeValue(particles.move.gravity.maxSpeed) * ratio;
|
|
4287
4573
|
if (particles.orbit.radius !== undefined) {
|
|
4288
|
-
this.orbitRadius = particles.orbit.radius * this.container.retina.pixelRatio;
|
|
4574
|
+
this.orbitRadius = getRangeValue(particles.orbit.radius) * this.container.retina.pixelRatio;
|
|
4289
4575
|
}
|
|
4290
4576
|
const modes = options.interactivity.modes;
|
|
4291
4577
|
this.connectModeDistance = modes.connect.distance * ratio;
|
|
@@ -4305,19 +4591,19 @@
|
|
|
4305
4591
|
const ratio = this.pixelRatio;
|
|
4306
4592
|
const moveDistance = options.move.distance;
|
|
4307
4593
|
const props = particle.retina;
|
|
4308
|
-
props.attractDistance = options.move.attract.distance * ratio;
|
|
4594
|
+
props.attractDistance = getRangeValue(options.move.attract.distance) * ratio;
|
|
4309
4595
|
props.linksDistance = options.links.distance * ratio;
|
|
4310
4596
|
props.linksWidth = options.links.width * ratio;
|
|
4311
4597
|
props.moveDrift = getRangeValue(options.move.drift) * ratio;
|
|
4312
4598
|
props.moveSpeed = getRangeValue(options.move.speed) * ratio;
|
|
4313
|
-
props.sizeAnimationSpeed = options.size.animation.speed * ratio;
|
|
4599
|
+
props.sizeAnimationSpeed = getRangeValue(options.size.animation.speed) * ratio;
|
|
4314
4600
|
if (particle.spin) {
|
|
4315
4601
|
props.spinAcceleration = getRangeValue(options.move.spin.acceleration) * ratio;
|
|
4316
4602
|
}
|
|
4317
4603
|
const maxDistance = props.maxDistance;
|
|
4318
4604
|
maxDistance.horizontal = moveDistance.horizontal !== undefined ? moveDistance.horizontal * ratio : undefined;
|
|
4319
4605
|
maxDistance.vertical = moveDistance.vertical !== undefined ? moveDistance.vertical * ratio : undefined;
|
|
4320
|
-
props.maxSpeed = options.move.gravity.maxSpeed * ratio;
|
|
4606
|
+
props.maxSpeed = getRangeValue(options.move.gravity.maxSpeed) * ratio;
|
|
4321
4607
|
}
|
|
4322
4608
|
handleMotionChange(mediaQuery) {
|
|
4323
4609
|
const options = this.container.actualOptions;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! tsParticles v1.
|
|
1
|
+
/*! tsParticles v1.42.2 by Matteo Bruni */
|
|
2
2
|
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}(window,(function(){return function(){"use strict";var e={d:function(t,n){for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function n(e,t){return e===t||t instanceof Array&&t.indexOf(e)>-1}e.r(t),e.d(t,{loadExternalConnectInteraction:function(){return i}});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;new WeakMap,new WeakSet;new WeakMap;new WeakMap;new WeakMap;new WeakMap;class a extends class{constructor(e){this.container=e,this.type=0}}{constructor(e){super(e)}isEnabled(){const e=this.container,t=e.interactivity.mouse,o=e.actualOptions.interactivity.events;return!(!o.onHover.enable||!t.position)&&n("connect",o.onHover.mode)}reset(){}async interact(){const e=this.container;if(e.actualOptions.interactivity.events.onHover.enable&&"mousemove"===e.interactivity.status){const t=e.interactivity.mouse.position;if(!t)return;const n=Math.abs(e.retina.connectModeRadius),o=e.particles.quadTree.queryCircle(t,n);let a=0;for(const t of o){const n=t.getPosition();for(const i of o.slice(a+1)){const o=i.getPosition(),a=Math.abs(e.retina.connectModeDistance),r=Math.abs(n.x-o.x),c=Math.abs(n.y-o.y);r<a&&c<a&&e.canvas.drawConnectLine(t,i)}++a}}}}async function i(e){await e.addInteractor("externalConnect",(e=>new a(e)))}return t}()}));
|