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
|
}
|
|
@@ -1674,7 +1674,7 @@
|
|
|
1674
1674
|
}
|
|
1675
1675
|
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;
|
|
1676
1676
|
this.applyPath(particle, delta);
|
|
1677
|
-
const gravityOptions =
|
|
1677
|
+
const gravityOptions = particle.gravity;
|
|
1678
1678
|
const gravityFactor = gravityOptions.enable && gravityOptions.inverse ? -1 : 1;
|
|
1679
1679
|
if (gravityOptions.enable && moveSpeed) {
|
|
1680
1680
|
particle.velocity.y += gravityFactor * (gravityOptions.acceleration * delta.factor) / (60 * moveSpeed);
|
|
@@ -1688,7 +1688,7 @@
|
|
|
1688
1688
|
}
|
|
1689
1689
|
const velocity = particle.velocity.mult(moveSpeed);
|
|
1690
1690
|
const maxSpeed = (_c = particle.retina.maxSpeed) !== null && _c !== void 0 ? _c : container.retina.maxSpeed;
|
|
1691
|
-
if (gravityOptions.enable &&
|
|
1691
|
+
if (gravityOptions.enable && maxSpeed > 0 && (!gravityOptions.inverse && velocity.y >= 0 && velocity.y >= maxSpeed || gravityOptions.inverse && velocity.y <= 0 && velocity.y <= -maxSpeed)) {
|
|
1692
1692
|
velocity.y = gravityFactor * maxSpeed;
|
|
1693
1693
|
if (moveSpeed) {
|
|
1694
1694
|
particle.velocity.y = velocity.y / moveSpeed;
|
|
@@ -2034,9 +2034,9 @@
|
|
|
2034
2034
|
paint() {
|
|
2035
2035
|
const options = this.container.actualOptions;
|
|
2036
2036
|
this.draw((ctx => {
|
|
2037
|
-
if (options.backgroundMask.enable && options.backgroundMask.cover
|
|
2037
|
+
if (options.backgroundMask.enable && options.backgroundMask.cover) {
|
|
2038
2038
|
clear(ctx, this.size);
|
|
2039
|
-
this.paintBase(
|
|
2039
|
+
this.paintBase(this.coverColorStyle);
|
|
2040
2040
|
} else {
|
|
2041
2041
|
this.paintBase();
|
|
2042
2042
|
}
|
|
@@ -2138,7 +2138,7 @@
|
|
|
2138
2138
|
const zIndexOptions = particle.options.zIndex;
|
|
2139
2139
|
const zOpacityFactor = (1 - particle.zIndexFactor) ** zIndexOptions.opacityRate;
|
|
2140
2140
|
const radius = particle.getRadius();
|
|
2141
|
-
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;
|
|
2141
|
+
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;
|
|
2142
2142
|
const strokeOpacity = (_f = (_e = particle.stroke) === null || _e === void 0 ? void 0 : _e.opacity) !== null && _f !== void 0 ? _f : opacity;
|
|
2143
2143
|
const zOpacity = opacity * zOpacityFactor;
|
|
2144
2144
|
const fillColorValue = fColor ? getStyleFromHsl(fColor, zOpacity) : undefined;
|
|
@@ -2207,12 +2207,14 @@
|
|
|
2207
2207
|
const color = cover.color;
|
|
2208
2208
|
const coverRgb = colorToRgb(color);
|
|
2209
2209
|
if (coverRgb) {
|
|
2210
|
-
|
|
2210
|
+
const coverColor = {
|
|
2211
2211
|
r: coverRgb.r,
|
|
2212
2212
|
g: coverRgb.g,
|
|
2213
2213
|
b: coverRgb.b,
|
|
2214
2214
|
a: cover.opacity
|
|
2215
2215
|
};
|
|
2216
|
+
this.coverColorStyle = getStyleFromRgb(coverColor, coverColor.a);
|
|
2217
|
+
console.log(this.coverColorStyle);
|
|
2216
2218
|
}
|
|
2217
2219
|
}
|
|
2218
2220
|
initTrail() {
|
|
@@ -2409,7 +2411,7 @@
|
|
|
2409
2411
|
return;
|
|
2410
2412
|
}
|
|
2411
2413
|
if (data.count !== undefined) {
|
|
2412
|
-
this.count = data.count;
|
|
2414
|
+
this.count = setRangeValue(data.count);
|
|
2413
2415
|
}
|
|
2414
2416
|
if (data.enable !== undefined) {
|
|
2415
2417
|
this.enable = data.enable;
|
|
@@ -2418,7 +2420,7 @@
|
|
|
2418
2420
|
this.offset = setRangeValue(data.offset);
|
|
2419
2421
|
}
|
|
2420
2422
|
if (data.speed !== undefined) {
|
|
2421
|
-
this.speed = data.speed;
|
|
2423
|
+
this.speed = setRangeValue(data.speed);
|
|
2422
2424
|
}
|
|
2423
2425
|
if (data.sync !== undefined) {
|
|
2424
2426
|
this.sync = data.sync;
|
|
@@ -2566,13 +2568,13 @@
|
|
|
2566
2568
|
return;
|
|
2567
2569
|
}
|
|
2568
2570
|
if (data.count !== undefined) {
|
|
2569
|
-
this.count = data.count;
|
|
2571
|
+
this.count = setRangeValue(data.count);
|
|
2570
2572
|
}
|
|
2571
2573
|
if (data.enable !== undefined) {
|
|
2572
2574
|
this.enable = data.enable;
|
|
2573
2575
|
}
|
|
2574
2576
|
if (data.speed !== undefined) {
|
|
2575
|
-
this.speed = data.speed;
|
|
2577
|
+
this.speed = setRangeValue(data.speed);
|
|
2576
2578
|
}
|
|
2577
2579
|
if (data.sync !== undefined) {
|
|
2578
2580
|
this.sync = data.sync;
|
|
@@ -2592,13 +2594,13 @@
|
|
|
2592
2594
|
return;
|
|
2593
2595
|
}
|
|
2594
2596
|
if (data.count !== undefined) {
|
|
2595
|
-
this.count = data.count;
|
|
2597
|
+
this.count = setRangeValue(data.count);
|
|
2596
2598
|
}
|
|
2597
2599
|
if (data.enable !== undefined) {
|
|
2598
2600
|
this.enable = data.enable;
|
|
2599
2601
|
}
|
|
2600
2602
|
if (data.speed !== undefined) {
|
|
2601
|
-
this.speed = data.speed;
|
|
2603
|
+
this.speed = setRangeValue(data.speed);
|
|
2602
2604
|
}
|
|
2603
2605
|
if (data.sync !== undefined) {
|
|
2604
2606
|
this.sync = data.sync;
|
|
@@ -2770,6 +2772,90 @@
|
|
|
2770
2772
|
this.duration.load(data.duration);
|
|
2771
2773
|
}
|
|
2772
2774
|
}
|
|
2775
|
+
class Attract_Attract {
|
|
2776
|
+
constructor() {
|
|
2777
|
+
this.distance = 200;
|
|
2778
|
+
this.enable = false;
|
|
2779
|
+
this.rotate = {
|
|
2780
|
+
x: 3e3,
|
|
2781
|
+
y: 3e3
|
|
2782
|
+
};
|
|
2783
|
+
}
|
|
2784
|
+
get rotateX() {
|
|
2785
|
+
return this.rotate.x;
|
|
2786
|
+
}
|
|
2787
|
+
set rotateX(value) {
|
|
2788
|
+
this.rotate.x = value;
|
|
2789
|
+
}
|
|
2790
|
+
get rotateY() {
|
|
2791
|
+
return this.rotate.y;
|
|
2792
|
+
}
|
|
2793
|
+
set rotateY(value) {
|
|
2794
|
+
this.rotate.y = value;
|
|
2795
|
+
}
|
|
2796
|
+
load(data) {
|
|
2797
|
+
var _a, _b, _c, _d;
|
|
2798
|
+
if (!data) {
|
|
2799
|
+
return;
|
|
2800
|
+
}
|
|
2801
|
+
if (data.distance !== undefined) {
|
|
2802
|
+
this.distance = setRangeValue(data.distance);
|
|
2803
|
+
}
|
|
2804
|
+
if (data.enable !== undefined) {
|
|
2805
|
+
this.enable = data.enable;
|
|
2806
|
+
}
|
|
2807
|
+
const rotateX = (_b = (_a = data.rotate) === null || _a === void 0 ? void 0 : _a.x) !== null && _b !== void 0 ? _b : data.rotateX;
|
|
2808
|
+
if (rotateX !== undefined) {
|
|
2809
|
+
this.rotate.x = rotateX;
|
|
2810
|
+
}
|
|
2811
|
+
const rotateY = (_d = (_c = data.rotate) === null || _c === void 0 ? void 0 : _c.y) !== null && _d !== void 0 ? _d : data.rotateY;
|
|
2812
|
+
if (rotateY !== undefined) {
|
|
2813
|
+
this.rotate.y = rotateY;
|
|
2814
|
+
}
|
|
2815
|
+
}
|
|
2816
|
+
}
|
|
2817
|
+
class MoveAngle_MoveAngle {
|
|
2818
|
+
constructor() {
|
|
2819
|
+
this.offset = 0;
|
|
2820
|
+
this.value = 90;
|
|
2821
|
+
}
|
|
2822
|
+
load(data) {
|
|
2823
|
+
if (data === undefined) {
|
|
2824
|
+
return;
|
|
2825
|
+
}
|
|
2826
|
+
if (data.offset !== undefined) {
|
|
2827
|
+
this.offset = setRangeValue(data.offset);
|
|
2828
|
+
}
|
|
2829
|
+
if (data.value !== undefined) {
|
|
2830
|
+
this.value = setRangeValue(data.value);
|
|
2831
|
+
}
|
|
2832
|
+
}
|
|
2833
|
+
}
|
|
2834
|
+
class MoveGravity_MoveGravity {
|
|
2835
|
+
constructor() {
|
|
2836
|
+
this.acceleration = 9.81;
|
|
2837
|
+
this.enable = false;
|
|
2838
|
+
this.inverse = false;
|
|
2839
|
+
this.maxSpeed = 50;
|
|
2840
|
+
}
|
|
2841
|
+
load(data) {
|
|
2842
|
+
if (!data) {
|
|
2843
|
+
return;
|
|
2844
|
+
}
|
|
2845
|
+
if (data.acceleration !== undefined) {
|
|
2846
|
+
this.acceleration = setRangeValue(data.acceleration);
|
|
2847
|
+
}
|
|
2848
|
+
if (data.enable !== undefined) {
|
|
2849
|
+
this.enable = data.enable;
|
|
2850
|
+
}
|
|
2851
|
+
if (data.inverse !== undefined) {
|
|
2852
|
+
this.inverse = data.inverse;
|
|
2853
|
+
}
|
|
2854
|
+
if (data.maxSpeed !== undefined) {
|
|
2855
|
+
this.maxSpeed = setRangeValue(data.maxSpeed);
|
|
2856
|
+
}
|
|
2857
|
+
}
|
|
2858
|
+
}
|
|
2773
2859
|
class PathDelay_PathDelay extends(null && ValueWithRandom){
|
|
2774
2860
|
constructor() {
|
|
2775
2861
|
super();
|
|
@@ -2931,6 +3017,70 @@
|
|
|
2931
3017
|
}
|
|
2932
3018
|
}
|
|
2933
3019
|
}
|
|
3020
|
+
class AnimationOptions_AnimationOptions {
|
|
3021
|
+
constructor() {
|
|
3022
|
+
this.count = 0;
|
|
3023
|
+
this.enable = false;
|
|
3024
|
+
this.speed = 1;
|
|
3025
|
+
this.sync = false;
|
|
3026
|
+
}
|
|
3027
|
+
load(data) {
|
|
3028
|
+
if (!data) {
|
|
3029
|
+
return;
|
|
3030
|
+
}
|
|
3031
|
+
if (data.count !== undefined) {
|
|
3032
|
+
this.count = setRangeValue(data.count);
|
|
3033
|
+
}
|
|
3034
|
+
if (data.enable !== undefined) {
|
|
3035
|
+
this.enable = data.enable;
|
|
3036
|
+
}
|
|
3037
|
+
if (data.speed !== undefined) {
|
|
3038
|
+
this.speed = setRangeValue(data.speed);
|
|
3039
|
+
}
|
|
3040
|
+
if (data.sync !== undefined) {
|
|
3041
|
+
this.sync = data.sync;
|
|
3042
|
+
}
|
|
3043
|
+
}
|
|
3044
|
+
}
|
|
3045
|
+
class OpacityAnimation_OpacityAnimation extends(null && AnimationOptions){
|
|
3046
|
+
constructor() {
|
|
3047
|
+
super();
|
|
3048
|
+
this.destroy = "none";
|
|
3049
|
+
this.enable = false;
|
|
3050
|
+
this.speed = 2;
|
|
3051
|
+
this.startValue = "random";
|
|
3052
|
+
this.sync = false;
|
|
3053
|
+
}
|
|
3054
|
+
get opacity_min() {
|
|
3055
|
+
return this.minimumValue;
|
|
3056
|
+
}
|
|
3057
|
+
set opacity_min(value) {
|
|
3058
|
+
this.minimumValue = value;
|
|
3059
|
+
}
|
|
3060
|
+
load(data) {
|
|
3061
|
+
var _a;
|
|
3062
|
+
if (data === undefined) {
|
|
3063
|
+
return;
|
|
3064
|
+
}
|
|
3065
|
+
super.load(data);
|
|
3066
|
+
if (data.destroy !== undefined) {
|
|
3067
|
+
this.destroy = data.destroy;
|
|
3068
|
+
}
|
|
3069
|
+
if (data.enable !== undefined) {
|
|
3070
|
+
this.enable = data.enable;
|
|
3071
|
+
}
|
|
3072
|
+
this.minimumValue = (_a = data.minimumValue) !== null && _a !== void 0 ? _a : data.opacity_min;
|
|
3073
|
+
if (data.speed !== undefined) {
|
|
3074
|
+
this.speed = data.speed;
|
|
3075
|
+
}
|
|
3076
|
+
if (data.startValue !== undefined) {
|
|
3077
|
+
this.startValue = data.startValue;
|
|
3078
|
+
}
|
|
3079
|
+
if (data.sync !== undefined) {
|
|
3080
|
+
this.sync = data.sync;
|
|
3081
|
+
}
|
|
3082
|
+
}
|
|
3083
|
+
}
|
|
2934
3084
|
class Opacity_Opacity extends(null && ValueWithRandom){
|
|
2935
3085
|
constructor() {
|
|
2936
3086
|
super();
|
|
@@ -2989,13 +3139,13 @@
|
|
|
2989
3139
|
this.enable = data.enable;
|
|
2990
3140
|
}
|
|
2991
3141
|
if (data.opacity !== undefined) {
|
|
2992
|
-
this.opacity = data.opacity;
|
|
3142
|
+
this.opacity = setRangeValue(data.opacity);
|
|
2993
3143
|
}
|
|
2994
3144
|
if (data.width !== undefined) {
|
|
2995
|
-
this.width = data.width;
|
|
3145
|
+
this.width = setRangeValue(data.width);
|
|
2996
3146
|
}
|
|
2997
3147
|
if (data.radius !== undefined) {
|
|
2998
|
-
this.radius = data.radius;
|
|
3148
|
+
this.radius = setRangeValue(data.radius);
|
|
2999
3149
|
}
|
|
3000
3150
|
if (data.color !== undefined) {
|
|
3001
3151
|
this.color = OptionsColor.create(this.color, data.color);
|
|
@@ -3020,16 +3170,33 @@
|
|
|
3020
3170
|
this.enabled = data.enabled;
|
|
3021
3171
|
}
|
|
3022
3172
|
if (data.distance !== undefined) {
|
|
3023
|
-
this.distance = data.distance;
|
|
3173
|
+
this.distance = setRangeValue(data.distance);
|
|
3024
3174
|
}
|
|
3025
3175
|
if (data.duration !== undefined) {
|
|
3026
|
-
this.duration = data.duration;
|
|
3176
|
+
this.duration = setRangeValue(data.duration);
|
|
3027
3177
|
}
|
|
3028
3178
|
if (data.factor !== undefined) {
|
|
3029
|
-
this.factor = data.factor;
|
|
3179
|
+
this.factor = setRangeValue(data.factor);
|
|
3030
3180
|
}
|
|
3031
3181
|
if (data.speed !== undefined) {
|
|
3032
|
-
this.speed = data.speed;
|
|
3182
|
+
this.speed = setRangeValue(data.speed);
|
|
3183
|
+
}
|
|
3184
|
+
}
|
|
3185
|
+
}
|
|
3186
|
+
class RollLight_RollLight {
|
|
3187
|
+
constructor() {
|
|
3188
|
+
this.enable = false;
|
|
3189
|
+
this.value = 0;
|
|
3190
|
+
}
|
|
3191
|
+
load(data) {
|
|
3192
|
+
if (!data) {
|
|
3193
|
+
return;
|
|
3194
|
+
}
|
|
3195
|
+
if (data.enable !== undefined) {
|
|
3196
|
+
this.enable = data.enable;
|
|
3197
|
+
}
|
|
3198
|
+
if (data.value !== undefined) {
|
|
3199
|
+
this.value = setRangeValue(data.value);
|
|
3033
3200
|
}
|
|
3034
3201
|
}
|
|
3035
3202
|
}
|
|
@@ -3061,6 +3228,27 @@
|
|
|
3061
3228
|
}
|
|
3062
3229
|
}
|
|
3063
3230
|
}
|
|
3231
|
+
class RotateAnimation_RotateAnimation {
|
|
3232
|
+
constructor() {
|
|
3233
|
+
this.enable = false;
|
|
3234
|
+
this.speed = 0;
|
|
3235
|
+
this.sync = false;
|
|
3236
|
+
}
|
|
3237
|
+
load(data) {
|
|
3238
|
+
if (data === undefined) {
|
|
3239
|
+
return;
|
|
3240
|
+
}
|
|
3241
|
+
if (data.enable !== undefined) {
|
|
3242
|
+
this.enable = data.enable;
|
|
3243
|
+
}
|
|
3244
|
+
if (data.speed !== undefined) {
|
|
3245
|
+
this.speed = setRangeValue(data.speed);
|
|
3246
|
+
}
|
|
3247
|
+
if (data.sync !== undefined) {
|
|
3248
|
+
this.sync = data.sync;
|
|
3249
|
+
}
|
|
3250
|
+
}
|
|
3251
|
+
}
|
|
3064
3252
|
class Rotate_Rotate extends(null && ValueWithRandom){
|
|
3065
3253
|
constructor() {
|
|
3066
3254
|
super();
|
|
@@ -3179,6 +3367,45 @@
|
|
|
3179
3367
|
}
|
|
3180
3368
|
}
|
|
3181
3369
|
}
|
|
3370
|
+
class SizeAnimation_SizeAnimation extends(null && AnimationOptions){
|
|
3371
|
+
constructor() {
|
|
3372
|
+
super();
|
|
3373
|
+
this.destroy = "none";
|
|
3374
|
+
this.enable = false;
|
|
3375
|
+
this.speed = 5;
|
|
3376
|
+
this.startValue = "random";
|
|
3377
|
+
this.sync = false;
|
|
3378
|
+
}
|
|
3379
|
+
get size_min() {
|
|
3380
|
+
return this.minimumValue;
|
|
3381
|
+
}
|
|
3382
|
+
set size_min(value) {
|
|
3383
|
+
this.minimumValue = value;
|
|
3384
|
+
}
|
|
3385
|
+
load(data) {
|
|
3386
|
+
var _a;
|
|
3387
|
+
if (data === undefined) {
|
|
3388
|
+
return;
|
|
3389
|
+
}
|
|
3390
|
+
super.load(data);
|
|
3391
|
+
if (data.destroy !== undefined) {
|
|
3392
|
+
this.destroy = data.destroy;
|
|
3393
|
+
}
|
|
3394
|
+
if (data.enable !== undefined) {
|
|
3395
|
+
this.enable = data.enable;
|
|
3396
|
+
}
|
|
3397
|
+
this.minimumValue = (_a = data.minimumValue) !== null && _a !== void 0 ? _a : data.size_min;
|
|
3398
|
+
if (data.speed !== undefined) {
|
|
3399
|
+
this.speed = data.speed;
|
|
3400
|
+
}
|
|
3401
|
+
if (data.startValue !== undefined) {
|
|
3402
|
+
this.startValue = data.startValue;
|
|
3403
|
+
}
|
|
3404
|
+
if (data.sync !== undefined) {
|
|
3405
|
+
this.sync = data.sync;
|
|
3406
|
+
}
|
|
3407
|
+
}
|
|
3408
|
+
}
|
|
3182
3409
|
class Size_Size extends(null && ValueWithRandom){
|
|
3183
3410
|
constructor() {
|
|
3184
3411
|
super();
|
|
@@ -3224,6 +3451,27 @@
|
|
|
3224
3451
|
}
|
|
3225
3452
|
}
|
|
3226
3453
|
}
|
|
3454
|
+
class TiltAnimation_TiltAnimation {
|
|
3455
|
+
constructor() {
|
|
3456
|
+
this.enable = false;
|
|
3457
|
+
this.speed = 0;
|
|
3458
|
+
this.sync = false;
|
|
3459
|
+
}
|
|
3460
|
+
load(data) {
|
|
3461
|
+
if (data === undefined) {
|
|
3462
|
+
return;
|
|
3463
|
+
}
|
|
3464
|
+
if (data.enable !== undefined) {
|
|
3465
|
+
this.enable = data.enable;
|
|
3466
|
+
}
|
|
3467
|
+
if (data.speed !== undefined) {
|
|
3468
|
+
this.speed = setRangeValue(data.speed);
|
|
3469
|
+
}
|
|
3470
|
+
if (data.sync !== undefined) {
|
|
3471
|
+
this.sync = data.sync;
|
|
3472
|
+
}
|
|
3473
|
+
}
|
|
3474
|
+
}
|
|
3227
3475
|
class Tilt_Tilt extends(null && ValueWithRandom){
|
|
3228
3476
|
constructor() {
|
|
3229
3477
|
super();
|
|
@@ -3246,6 +3494,43 @@
|
|
|
3246
3494
|
}
|
|
3247
3495
|
}
|
|
3248
3496
|
}
|
|
3497
|
+
class TwinkleValues_TwinkleValues {
|
|
3498
|
+
constructor() {
|
|
3499
|
+
this.enable = false;
|
|
3500
|
+
this.frequency = .05;
|
|
3501
|
+
this.opacity = 1;
|
|
3502
|
+
}
|
|
3503
|
+
load(data) {
|
|
3504
|
+
if (data === undefined) {
|
|
3505
|
+
return;
|
|
3506
|
+
}
|
|
3507
|
+
if (data.color !== undefined) {
|
|
3508
|
+
this.color = OptionsColor.create(this.color, data.color);
|
|
3509
|
+
}
|
|
3510
|
+
if (data.enable !== undefined) {
|
|
3511
|
+
this.enable = data.enable;
|
|
3512
|
+
}
|
|
3513
|
+
if (data.frequency !== undefined) {
|
|
3514
|
+
this.frequency = data.frequency;
|
|
3515
|
+
}
|
|
3516
|
+
if (data.opacity !== undefined) {
|
|
3517
|
+
this.opacity = setRangeValue(data.opacity);
|
|
3518
|
+
}
|
|
3519
|
+
}
|
|
3520
|
+
}
|
|
3521
|
+
class Twinkle_Twinkle {
|
|
3522
|
+
constructor() {
|
|
3523
|
+
this.lines = new TwinkleValues;
|
|
3524
|
+
this.particles = new TwinkleValues;
|
|
3525
|
+
}
|
|
3526
|
+
load(data) {
|
|
3527
|
+
if (data === undefined) {
|
|
3528
|
+
return;
|
|
3529
|
+
}
|
|
3530
|
+
this.lines.load(data.lines);
|
|
3531
|
+
this.particles.load(data.particles);
|
|
3532
|
+
}
|
|
3533
|
+
}
|
|
3249
3534
|
class Wobble_Wobble {
|
|
3250
3535
|
constructor() {
|
|
3251
3536
|
this.distance = 5;
|
|
@@ -3683,7 +3968,7 @@
|
|
|
3683
3968
|
max: getRangeMax(sizeRange) * pxRatio,
|
|
3684
3969
|
min: getRangeMin(sizeRange) * pxRatio,
|
|
3685
3970
|
loops: 0,
|
|
3686
|
-
maxLoops: sizeOptions.animation.count
|
|
3971
|
+
maxLoops: getRangeValue(sizeOptions.animation.count)
|
|
3687
3972
|
};
|
|
3688
3973
|
const sizeAnimation = sizeOptions.animation;
|
|
3689
3974
|
if (sizeAnimation.enable) {
|
|
@@ -3717,6 +4002,12 @@
|
|
|
3717
4002
|
this.initialVelocity = this.calculateVelocity();
|
|
3718
4003
|
this.velocity = this.initialVelocity.copy();
|
|
3719
4004
|
this.moveDecay = 1 - getRangeValue(this.options.move.decay);
|
|
4005
|
+
const gravityOptions = this.options.move.gravity;
|
|
4006
|
+
this.gravity = {
|
|
4007
|
+
enable: gravityOptions.enable,
|
|
4008
|
+
acceleration: getRangeValue(gravityOptions.acceleration),
|
|
4009
|
+
inverse: gravityOptions.inverse
|
|
4010
|
+
};
|
|
3720
4011
|
this.position = this.calcPosition(container, position, clamp(zIndexValue, 0, container.zLayers));
|
|
3721
4012
|
this.initialPosition = this.position.copy();
|
|
3722
4013
|
this.offset = Vector.origin;
|
|
@@ -3924,12 +4215,7 @@
|
|
|
3924
4215
|
return overlaps;
|
|
3925
4216
|
}
|
|
3926
4217
|
calculateVelocity() {
|
|
3927
|
-
const baseVelocity = getParticleBaseVelocity(this.direction)
|
|
3928
|
-
const res = baseVelocity.copy();
|
|
3929
|
-
const moveOptions = this.options.move;
|
|
3930
|
-
const rad = Math.PI / 180 * moveOptions.angle.value;
|
|
3931
|
-
const radOffset = Math.PI / 180 * moveOptions.angle.offset;
|
|
3932
|
-
const range = {
|
|
4218
|
+
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 = {
|
|
3933
4219
|
left: radOffset - rad / 2,
|
|
3934
4220
|
right: radOffset + rad / 2
|
|
3935
4221
|
};
|
|
@@ -4319,13 +4605,13 @@
|
|
|
4319
4605
|
container.canvas.size.height = element.offsetHeight * ratio;
|
|
4320
4606
|
}
|
|
4321
4607
|
const particles = options.particles;
|
|
4322
|
-
this.attractDistance = particles.move.attract.distance * ratio;
|
|
4608
|
+
this.attractDistance = getRangeValue(particles.move.attract.distance) * ratio;
|
|
4323
4609
|
this.linksDistance = particles.links.distance * ratio;
|
|
4324
4610
|
this.linksWidth = particles.links.width * ratio;
|
|
4325
|
-
this.sizeAnimationSpeed = particles.size.animation.speed * ratio;
|
|
4326
|
-
this.maxSpeed = particles.move.gravity.maxSpeed * ratio;
|
|
4611
|
+
this.sizeAnimationSpeed = getRangeValue(particles.size.animation.speed) * ratio;
|
|
4612
|
+
this.maxSpeed = getRangeValue(particles.move.gravity.maxSpeed) * ratio;
|
|
4327
4613
|
if (particles.orbit.radius !== undefined) {
|
|
4328
|
-
this.orbitRadius = particles.orbit.radius * this.container.retina.pixelRatio;
|
|
4614
|
+
this.orbitRadius = getRangeValue(particles.orbit.radius) * this.container.retina.pixelRatio;
|
|
4329
4615
|
}
|
|
4330
4616
|
const modes = options.interactivity.modes;
|
|
4331
4617
|
this.connectModeDistance = modes.connect.distance * ratio;
|
|
@@ -4345,19 +4631,19 @@
|
|
|
4345
4631
|
const ratio = this.pixelRatio;
|
|
4346
4632
|
const moveDistance = options.move.distance;
|
|
4347
4633
|
const props = particle.retina;
|
|
4348
|
-
props.attractDistance = options.move.attract.distance * ratio;
|
|
4634
|
+
props.attractDistance = getRangeValue(options.move.attract.distance) * ratio;
|
|
4349
4635
|
props.linksDistance = options.links.distance * ratio;
|
|
4350
4636
|
props.linksWidth = options.links.width * ratio;
|
|
4351
4637
|
props.moveDrift = getRangeValue(options.move.drift) * ratio;
|
|
4352
4638
|
props.moveSpeed = getRangeValue(options.move.speed) * ratio;
|
|
4353
|
-
props.sizeAnimationSpeed = options.size.animation.speed * ratio;
|
|
4639
|
+
props.sizeAnimationSpeed = getRangeValue(options.size.animation.speed) * ratio;
|
|
4354
4640
|
if (particle.spin) {
|
|
4355
4641
|
props.spinAcceleration = getRangeValue(options.move.spin.acceleration) * ratio;
|
|
4356
4642
|
}
|
|
4357
4643
|
const maxDistance = props.maxDistance;
|
|
4358
4644
|
maxDistance.horizontal = moveDistance.horizontal !== undefined ? moveDistance.horizontal * ratio : undefined;
|
|
4359
4645
|
maxDistance.vertical = moveDistance.vertical !== undefined ? moveDistance.vertical * ratio : undefined;
|
|
4360
|
-
props.maxSpeed = options.move.gravity.maxSpeed * ratio;
|
|
4646
|
+
props.maxSpeed = getRangeValue(options.move.gravity.maxSpeed) * ratio;
|
|
4361
4647
|
}
|
|
4362
4648
|
handleMotionChange(mediaQuery) {
|
|
4363
4649
|
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 o=t();for(var n in o)("object"==typeof exports?exports:e)[n]=o[n]}}(window,(function(){return function(){"use strict";var e={d:function(t,o){for(var n in o)e.o(o,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:o[n]})},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 o(e,t,o){return Math.min(Math.max(e,t),o)}function n(e,t,o,n){return Math.floor((e*o+t*n)/(o+n))}function i(e){const t=s(e);let o=r(e);return t===o&&(o=0),Math.random()*(t-o)+o}function r(e){return"number"==typeof e?e:e.min}function s(e){return"number"==typeof e?e:e.max}function a(e,t){if(e===t||void 0===t&&"number"==typeof e)return e;const o=r(e),n=s(e);return void 0!==t?{min:Math.min(o,t),max:Math.max(n,t)}:a(o,n)}function l(e,t){return function(e,t){const o=e.x-t.x,n=e.y-t.y;return{dx:o,dy:n,distance:Math.sqrt(o*o+n*n)}}(e,t).distance}function u(e,t){if(t instanceof Array){for(const o of t)if(e.matches(o))return!0;return!1}return e.matches(t)}function b(e,t){return e===t||t instanceof Array&&t.indexOf(e)>-1}function c(e,t,o=!0){return e[void 0!==t&&o?t%e.length:function(e){return Math.floor(Math.random()*e.length)}(e)]}function d(e,t){const o=e.selectors;if(o instanceof Array)for(const n of o)t(n,e);else t(o,e)}function f(e,t){if(t&&e)return e instanceof Array?e.find((e=>u(t,e.selectors))):u(t,e.selectors)?e:void 0}function v(e,t,o){let n=o;return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function h(e){if(e.startsWith("rgb")){const t=/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([\d.]+)\s*)?\)/i.exec(e);return t?{a:t.length>4?parseFloat(t[5]):1,b:parseInt(t[3],10),g:parseInt(t[2],10),r:parseInt(t[1],10)}:void 0}if(e.startsWith("hsl")){const t=/hsla?\(\s*(\d+)\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(,\s*([\d.]+)\s*)?\)/i.exec(e);return t?function(e){const t=g(e);return{a:e.a,b:t.b,g:t.g,r:t.r}}({a:t.length>4?parseFloat(t[5]):1,h:parseInt(t[1],10),l:parseInt(t[3],10),s:parseInt(t[2],10)}):void 0}if(e.startsWith("hsv")){const t=/hsva?\(\s*(\d+)°\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(,\s*([\d.]+)\s*)?\)/i.exec(e);return t?function(e){const t=m(e);return{a:e.a,b:t.b,g:t.g,r:t.r}}({a:t.length>4?parseFloat(t[5]):1,h:parseInt(t[1],10),s:parseInt(t[2],10),v:parseInt(t[3],10)}):void 0}{const t=/^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i,o=e.replace(t,((e,t,o,n,i)=>t+t+o+o+n+n+(void 0!==i?i+i:""))),n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i.exec(o);return n?{a:void 0!==n[4]?parseInt(n[4],16)/255:1,b:parseInt(n[3],16),g:parseInt(n[2],16),r:parseInt(n[1],16)}:void 0}}function p(e,t,o=!0){var n,i,r;if(void 0===e)return;const s="string"==typeof e?{value:e}:e;let a;if("string"==typeof s.value)a=s.value===O.randomColorValue?M():function(e){return h(e)}(s.value);else if(s.value instanceof Array){a=p({value:c(s.value,t,o)})}else{const e=s.value,t=null!==(n=e.rgb)&&void 0!==n?n:s.value;if(void 0!==t.r)a=t;else{const t=null!==(i=e.hsl)&&void 0!==i?i:s.value;if(void 0!==t.h&&void 0!==t.l)a=g(t);else{const t=null!==(r=e.hsv)&&void 0!==r?r:s.value;void 0!==t.h&&void 0!==t.v&&(a=m(t))}}}return a}function y(e){const t=e.r/255,o=e.g/255,n=e.b/255,i=Math.max(t,o,n),r=Math.min(t,o,n),s={h:0,l:(i+r)/2,s:0};return i!=r&&(s.s=s.l<.5?(i-r)/(i+r):(i-r)/(2-i-r),s.h=t===i?(o-n)/(i-r):s.h=o===i?2+(n-t)/(i-r):4+(t-o)/(i-r)),s.l*=100,s.s*=100,s.h*=60,s.h<0&&(s.h+=360),s}function g(e){const t={b:0,g:0,r:0},o={h:e.h/360,l:e.l/100,s:e.s/100};if(0===o.s)t.b=o.l,t.g=o.l,t.r=o.l;else{const e=o.l<.5?o.l*(1+o.s):o.l+o.s-o.l*o.s,n=2*o.l-e;t.r=v(n,e,o.h+1/3),t.g=v(n,e,o.h),t.b=v(n,e,o.h-1/3)}return t.r=Math.floor(255*t.r),t.g=Math.floor(255*t.g),t.b=Math.floor(255*t.b),t}function m(e){const t={b:0,g:0,r:0},o=e.h/60,n=e.s/100,i=e.v/100,r=i*n,s=r*(1-Math.abs(o%2-1));let a;if(o>=0&&o<=1?a={r:r,g:s,b:0}:o>1&&o<=2?a={r:s,g:r,b:0}:o>2&&o<=3?a={r:0,g:r,b:s}:o>3&&o<=4?a={r:0,g:s,b:r}:o>4&&o<=5?a={r:s,g:0,b:r}:o>5&&o<=6&&(a={r:r,g:0,b:s}),a){const e=i-r;t.r=Math.floor(255*(a.r+e)),t.g=Math.floor(255*(a.g+e)),t.b=Math.floor(255*(a.b+e))}return t}function M(e){const t=null!=e?e:0;return{b:Math.floor(i(a(t,256))),g:Math.floor(i(a(t,256))),r:Math.floor(i(a(t,256)))}}function x(e,t,o,i){let r=e,s=t;return void 0===r.r&&(r=g(e)),void 0===s.r&&(s=g(t)),{b:n(r.b,s.b,o,i),g:n(r.g,s.g,o,i),r:n(r.r,s.r,o,i)}}e.r(t),e.d(t,{loadExternalBubbleInteraction:function(){return B}});class z{constructor(e,t){this.position={x:e,y:t}}}class w extends z{constructor(e,t,o){super(e,t),this.radius=o}contains(e){return l(e,this.position)<=this.radius}intersects(e){const t=e,o=e,n=this.position,i=e.position,r=Math.abs(i.x-n.x),s=Math.abs(i.y-n.y),a=this.radius;if(void 0!==o.radius){return a+o.radius>Math.sqrt(r*r+s+s)}if(void 0!==t.size){const e=t.size.width,o=t.size.height,n=Math.pow(r-e,2)+Math.pow(s-o,2);return!(r>a+e||s>a+o)&&(r<=e||s<=o||n<=a*a)}return!1}}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 E extends z{constructor(e,t,o,n){super(e,t),this.size={height:n,width:o}}contains(e){const t=this.size.width,o=this.size.height,n=this.position;return e.x>=n.x&&e.x<=n.x+t&&e.y>=n.y&&e.y<=n.y+o}intersects(e){const t=e,o=e,n=this.size.width,i=this.size.height,r=this.position,s=e.position;if(void 0!==o.radius)return o.intersects(this);if(void 0!==t.size){const e=t.size,o=e.width,a=e.height;return s.x<r.x+n&&s.x+o>r.x&&s.y<r.y+i&&s.y+a>r.y}return!1}}new WeakMap,new WeakSet;new WeakMap;new WeakMap;new WeakMap;function C(e,t,n,i){if(t>=n){return o(e+(t-n)*i,e,t)}if(t<n){return o(e-(n-t)*i,t,e)}}new WeakMap;class k extends class{constructor(e){this.container=e,this.type=0}}{constructor(e){super(e)}isEnabled(){const e=this.container,t=e.actualOptions,o=e.interactivity.mouse,n=t.interactivity.events,i=function(e,t){return t instanceof Array?!!t.find((t=>t.enable&&b(e,t.mode))):b(e,t.mode)}("bubble",n.onDiv);if(!(i||n.onHover.enable&&o.position||n.onClick.enable&&o.clickPosition))return!1;const r=n.onHover.mode,s=n.onClick.mode;return b("bubble",r)||b("bubble",s)||i}reset(e,t){e.bubble.inRange&&!t||(delete e.bubble.div,delete e.bubble.opacity,delete e.bubble.radius,delete e.bubble.color)}async interact(){const e=this.container.actualOptions.interactivity.events,t=e.onHover,o=e.onClick,n=t.enable,i=t.mode,r=o.enable,s=o.mode,a=e.onDiv;n&&b("bubble",i)?this.hoverBubble():r&&b("bubble",s)?this.clickBubble():function(e,t,o){if(t instanceof Array)for(const n of t){const t=n.mode;n.enable&&b(e,t)&&d(n,o)}else{const n=t.mode;t.enable&&b(e,n)&&d(t,o)}}("bubble",a,((e,t)=>this.singleSelectorHover(e,t)))}singleSelectorHover(e,t){const o=this.container,n=document.querySelectorAll(e);n.length&&n.forEach((e=>{const n=e,i=o.retina.pixelRatio,r={x:(n.offsetLeft+n.offsetWidth/2)*i,y:(n.offsetTop+n.offsetHeight/2)*i},s=n.offsetWidth/2*i,a="circle"===t.type?new w(r.x,r.y,s):new E(n.offsetLeft*i,n.offsetTop*i,n.offsetWidth*i,n.offsetHeight*i),l=o.particles.quadTree.query(a);for(const e of l){if(!a.contains(e.getPosition()))continue;e.bubble.inRange=!0;const t=f(o.actualOptions.interactivity.modes.bubble.divs,n);e.bubble.div&&e.bubble.div===n||(this.reset(e,!0),e.bubble.div=n),this.hoverBubbleSize(e,1,t),this.hoverBubbleOpacity(e,1,t),this.hoverBubbleColor(e,1,t)}}))}process(e,t,o,n){const i=this.container,r=n.bubbleObj.optValue;if(void 0===r)return;const s=i.actualOptions.interactivity.modes.bubble.duration,a=i.retina.bubbleModeDistance,l=n.particlesObj.optValue,u=n.bubbleObj.value,b=n.particlesObj.value||0,c=n.type;if(r!==l)if(i.bubble.durationEnd)u&&("size"===c&&delete e.bubble.radius,"opacity"===c&&delete e.bubble.opacity);else if(t<=a){if((null!=u?u:b)!==r){const t=b-o*(b-r)/s;"size"===c&&(e.bubble.radius=t),"opacity"===c&&(e.bubble.opacity=t)}}else"size"===c&&delete e.bubble.radius,"opacity"===c&&delete e.bubble.opacity}clickBubble(){var e,t;const o=this.container,n=o.actualOptions,i=o.interactivity.mouse.clickPosition;if(!i)return;const r=o.retina.bubbleModeDistance,a=o.particles.quadTree.queryCircle(i,r);for(const r of a){if(!o.bubble.clicking)continue;r.bubble.inRange=!o.bubble.durationEnd;const a=l(r.getPosition(),i),u=((new Date).getTime()-(o.interactivity.mouse.clickTime||0))/1e3;u>n.interactivity.modes.bubble.duration&&(o.bubble.durationEnd=!0),u>2*n.interactivity.modes.bubble.duration&&(o.bubble.clicking=!1,o.bubble.durationEnd=!1);const b={bubbleObj:{optValue:o.retina.bubbleModeSize,value:r.bubble.radius},particlesObj:{optValue:s(r.options.size.value)*o.retina.pixelRatio,value:r.size.value},type:"size"};this.process(r,a,u,b);const c={bubbleObj:{optValue:n.interactivity.modes.bubble.opacity,value:r.bubble.opacity},particlesObj:{optValue:s(r.options.opacity.value),value:null!==(t=null===(e=r.opacity)||void 0===e?void 0:e.value)&&void 0!==t?t:1},type:"opacity"};this.process(r,a,u,c),o.bubble.durationEnd?delete r.bubble.color:a<=o.retina.bubbleModeDistance?this.hoverBubbleColor(r,a):delete r.bubble.color}}hoverBubble(){const e=this.container,t=e.interactivity.mouse.position;if(void 0===t)return;const o=e.retina.bubbleModeDistance,n=e.particles.quadTree.queryCircle(t,o);for(const i of n){i.bubble.inRange=!0;const n=l(i.getPosition(),t),r=1-n/o;n<=o?r>=0&&e.interactivity.status===O.mouseMoveEvent&&(this.hoverBubbleSize(i,r),this.hoverBubbleOpacity(i,r),this.hoverBubbleColor(i,r)):this.reset(i),e.interactivity.status===O.mouseLeaveEvent&&this.reset(i)}}hoverBubbleSize(e,t,o){const n=this.container,i=(null==o?void 0:o.size)?o.size*n.retina.pixelRatio:n.retina.bubbleModeSize;if(void 0===i)return;const r=s(e.options.size.value)*n.retina.pixelRatio,a=C(e.size.value,i,r,t);void 0!==a&&(e.bubble.radius=a)}hoverBubbleOpacity(e,t,o){var n,i,r;const a=this.container.actualOptions,l=null!==(n=null==o?void 0:o.opacity)&&void 0!==n?n:a.interactivity.modes.bubble.opacity;if(!l)return;const u=e.options.opacity.value,b=C(null!==(r=null===(i=e.opacity)||void 0===i?void 0:i.value)&&void 0!==r?r:1,l,s(u),t);void 0!==b&&(e.bubble.opacity=b)}hoverBubbleColor(e,t,o){const n=this.container.actualOptions,i=null!=o?o:n.interactivity.modes.bubble;if(!e.bubble.finalColor){const t=i.color;if(!t)return;const o=t instanceof Array?c(t):t;e.bubble.finalColor=function(e,t,o=!0){const n=p(e,t,o);return void 0!==n?y(n):void 0}(o)}if(e.bubble.finalColor)if(i.mix){e.bubble.color=void 0;const o=e.getFillColor();e.bubble.color=o?y(x(o,e.bubble.finalColor,1-t,t)):e.bubble.finalColor}else e.bubble.color=e.bubble.finalColor}}async function B(e){await e.addInteractor("externalBubble",(e=>new k(e)))}return t}()}));
|