tsparticles 1.41.5 → 1.42.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Core/Canvas.js +4 -5
- 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 +3 -1
- package/Core/Particle.js +9 -7
- package/Core/Particles.js +2 -1
- package/Core/Retina.js +7 -7
- package/Core/Utils/ParticlesMover.js +2 -2
- package/Interactions/Particles/Links/LinkInstance.js +1 -1
- package/Options/Classes/AnimatableGradient.d.ts +4 -4
- package/Options/Classes/AnimatableGradient.js +4 -4
- package/Options/Classes/AnimationOptions.d.ts +5 -5
- package/Options/Classes/AnimationOptions.js +3 -2
- package/Options/Classes/ColorAnimation.d.ts +2 -2
- package/Options/Classes/ColorAnimation.js +2 -2
- package/Options/Classes/Particles/Move/Attract.d.ts +2 -2
- package/Options/Classes/Particles/Move/Attract.js +2 -1
- package/Options/Classes/Particles/Move/MoveAngle.d.ts +3 -3
- package/Options/Classes/Particles/Move/MoveAngle.js +3 -2
- package/Options/Classes/Particles/Move/MoveGravity.d.ts +5 -5
- package/Options/Classes/Particles/Move/MoveGravity.js +3 -2
- package/Options/Classes/Particles/Orbit/Orbit.d.ts +4 -4
- package/Options/Classes/Particles/Orbit/Orbit.js +4 -3
- package/Options/Classes/Particles/Repulse/Repulse.d.ts +5 -5
- package/Options/Classes/Particles/Repulse/Repulse.js +5 -4
- package/Options/Classes/Particles/Roll/RollLight.d.ts +2 -2
- package/Options/Classes/Particles/Roll/RollLight.js +2 -1
- package/Options/Classes/Particles/Rotate/RotateAnimation.d.ts +2 -2
- package/Options/Classes/Particles/Rotate/RotateAnimation.js +2 -1
- package/Options/Classes/Particles/Tilt/TiltAnimation.d.ts +2 -2
- package/Options/Classes/Particles/Tilt/TiltAnimation.js +2 -1
- package/Options/Classes/Particles/Twinkle/TwinkleValues.d.ts +2 -2
- package/Options/Classes/Particles/Twinkle/TwinkleValues.js +2 -1
- package/Options/Interfaces/IAnimation.d.ts +3 -2
- package/Options/Interfaces/Particles/Move/IAttract.d.ts +3 -2
- package/Options/Interfaces/Particles/Move/IMoveAngle.d.ts +3 -2
- package/Options/Interfaces/Particles/Move/IMoveGravity.d.ts +3 -2
- package/Options/Interfaces/Particles/Orbit/IOrbit.d.ts +4 -3
- package/Options/Interfaces/Particles/Repulse/IRepulse.d.ts +5 -4
- package/Options/Interfaces/Particles/Roll/IRollLight.d.ts +2 -1
- package/Options/Interfaces/Particles/Rotate/IRotateAnimation.d.ts +2 -1
- package/Options/Interfaces/Particles/Tilt/ITiltAnimation.d.ts +2 -1
- package/Options/Interfaces/Particles/Twinkle/ITwinkleValues.d.ts +3 -2
- package/Plugins/Absorbers/AbsorberInstance.js +1 -1
- package/Plugins/Absorbers/Options/Classes/Absorber.d.ts +2 -2
- package/Plugins/Absorbers/Options/Classes/Absorber.js +8 -4
- package/Plugins/Absorbers/Options/Interfaces/IAbsorber.d.ts +2 -2
- package/Plugins/Emitters/EmitterInstance.js +3 -3
- package/Plugins/Emitters/Options/Classes/Emitter.d.ts +2 -2
- package/Plugins/Emitters/Options/Classes/Emitter.js +8 -5
- package/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +2 -2
- package/Updaters/Angle/AngleUpdater.js +2 -1
- package/Updaters/Opacity/OpacityUpdater.js +3 -2
- package/Updaters/Roll/RollUpdater.js +3 -3
- package/Updaters/Tilt/TiltUpdater.js +1 -1
- package/Utils/ColorUtils.js +1 -1
- package/browser/Core/Canvas.js +5 -6
- 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 +3 -1
- package/browser/Core/Particle.js +9 -7
- package/browser/Core/Particles.js +2 -1
- package/browser/Core/Retina.js +7 -7
- package/browser/Core/Utils/ParticlesMover.js +2 -2
- package/browser/Interactions/Particles/Links/LinkInstance.js +2 -2
- package/browser/Options/Classes/AnimatableGradient.d.ts +4 -4
- package/browser/Options/Classes/AnimatableGradient.js +4 -4
- package/browser/Options/Classes/AnimationOptions.d.ts +5 -5
- package/browser/Options/Classes/AnimationOptions.js +3 -2
- package/browser/Options/Classes/ColorAnimation.d.ts +2 -2
- package/browser/Options/Classes/ColorAnimation.js +2 -2
- package/browser/Options/Classes/Particles/Move/Attract.d.ts +2 -2
- package/browser/Options/Classes/Particles/Move/Attract.js +2 -1
- package/browser/Options/Classes/Particles/Move/MoveAngle.d.ts +3 -3
- package/browser/Options/Classes/Particles/Move/MoveAngle.js +3 -2
- package/browser/Options/Classes/Particles/Move/MoveGravity.d.ts +5 -5
- package/browser/Options/Classes/Particles/Move/MoveGravity.js +3 -2
- package/browser/Options/Classes/Particles/Orbit/Orbit.d.ts +4 -4
- package/browser/Options/Classes/Particles/Orbit/Orbit.js +4 -3
- package/browser/Options/Classes/Particles/Repulse/Repulse.d.ts +5 -5
- package/browser/Options/Classes/Particles/Repulse/Repulse.js +5 -4
- package/browser/Options/Classes/Particles/Roll/RollLight.d.ts +2 -2
- package/browser/Options/Classes/Particles/Roll/RollLight.js +2 -1
- package/browser/Options/Classes/Particles/Rotate/RotateAnimation.d.ts +2 -2
- package/browser/Options/Classes/Particles/Rotate/RotateAnimation.js +2 -1
- package/browser/Options/Classes/Particles/Tilt/TiltAnimation.d.ts +2 -2
- package/browser/Options/Classes/Particles/Tilt/TiltAnimation.js +2 -1
- package/browser/Options/Classes/Particles/Twinkle/TwinkleValues.d.ts +2 -2
- package/browser/Options/Classes/Particles/Twinkle/TwinkleValues.js +2 -1
- package/browser/Options/Interfaces/IAnimation.d.ts +3 -2
- package/browser/Options/Interfaces/Particles/Move/IAttract.d.ts +3 -2
- package/browser/Options/Interfaces/Particles/Move/IMoveAngle.d.ts +3 -2
- package/browser/Options/Interfaces/Particles/Move/IMoveGravity.d.ts +3 -2
- package/browser/Options/Interfaces/Particles/Orbit/IOrbit.d.ts +4 -3
- package/browser/Options/Interfaces/Particles/Repulse/IRepulse.d.ts +5 -4
- package/browser/Options/Interfaces/Particles/Roll/IRollLight.d.ts +2 -1
- package/browser/Options/Interfaces/Particles/Rotate/IRotateAnimation.d.ts +2 -1
- package/browser/Options/Interfaces/Particles/Tilt/ITiltAnimation.d.ts +2 -1
- package/browser/Options/Interfaces/Particles/Twinkle/ITwinkleValues.d.ts +3 -2
- package/browser/Plugins/Absorbers/AbsorberInstance.js +1 -1
- package/browser/Plugins/Absorbers/Options/Classes/Absorber.d.ts +2 -2
- package/browser/Plugins/Absorbers/Options/Classes/Absorber.js +8 -4
- package/browser/Plugins/Absorbers/Options/Interfaces/IAbsorber.d.ts +2 -2
- package/browser/Plugins/Emitters/EmitterInstance.js +3 -3
- package/browser/Plugins/Emitters/Options/Classes/Emitter.d.ts +2 -2
- package/browser/Plugins/Emitters/Options/Classes/Emitter.js +8 -5
- package/browser/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +2 -2
- package/browser/Updaters/Angle/AngleUpdater.js +2 -1
- package/browser/Updaters/Opacity/OpacityUpdater.js +3 -2
- package/browser/Updaters/Roll/RollUpdater.js +3 -3
- package/browser/Updaters/Tilt/TiltUpdater.js +1 -1
- package/browser/Utils/ColorUtils.js +2 -2
- package/esm/Core/Canvas.js +5 -6
- 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 +3 -1
- package/esm/Core/Particle.js +9 -7
- package/esm/Core/Particles.js +2 -1
- package/esm/Core/Retina.js +7 -7
- package/esm/Core/Utils/ParticlesMover.js +2 -2
- package/esm/Interactions/Particles/Links/LinkInstance.js +2 -2
- package/esm/Options/Classes/AnimatableGradient.d.ts +4 -4
- package/esm/Options/Classes/AnimatableGradient.js +4 -4
- package/esm/Options/Classes/AnimationOptions.d.ts +5 -5
- package/esm/Options/Classes/AnimationOptions.js +3 -2
- package/esm/Options/Classes/ColorAnimation.d.ts +2 -2
- package/esm/Options/Classes/ColorAnimation.js +2 -2
- package/esm/Options/Classes/Particles/Move/Attract.d.ts +2 -2
- package/esm/Options/Classes/Particles/Move/Attract.js +2 -1
- package/esm/Options/Classes/Particles/Move/MoveAngle.d.ts +3 -3
- package/esm/Options/Classes/Particles/Move/MoveAngle.js +3 -2
- package/esm/Options/Classes/Particles/Move/MoveGravity.d.ts +5 -5
- package/esm/Options/Classes/Particles/Move/MoveGravity.js +3 -2
- package/esm/Options/Classes/Particles/Orbit/Orbit.d.ts +4 -4
- package/esm/Options/Classes/Particles/Orbit/Orbit.js +4 -3
- package/esm/Options/Classes/Particles/Repulse/Repulse.d.ts +5 -5
- package/esm/Options/Classes/Particles/Repulse/Repulse.js +5 -4
- package/esm/Options/Classes/Particles/Roll/RollLight.d.ts +2 -2
- package/esm/Options/Classes/Particles/Roll/RollLight.js +2 -1
- package/esm/Options/Classes/Particles/Rotate/RotateAnimation.d.ts +2 -2
- package/esm/Options/Classes/Particles/Rotate/RotateAnimation.js +2 -1
- package/esm/Options/Classes/Particles/Tilt/TiltAnimation.d.ts +2 -2
- package/esm/Options/Classes/Particles/Tilt/TiltAnimation.js +2 -1
- package/esm/Options/Classes/Particles/Twinkle/TwinkleValues.d.ts +2 -2
- package/esm/Options/Classes/Particles/Twinkle/TwinkleValues.js +2 -1
- package/esm/Options/Interfaces/IAnimation.d.ts +3 -2
- package/esm/Options/Interfaces/Particles/Move/IAttract.d.ts +3 -2
- package/esm/Options/Interfaces/Particles/Move/IMoveAngle.d.ts +3 -2
- package/esm/Options/Interfaces/Particles/Move/IMoveGravity.d.ts +3 -2
- package/esm/Options/Interfaces/Particles/Orbit/IOrbit.d.ts +4 -3
- package/esm/Options/Interfaces/Particles/Repulse/IRepulse.d.ts +5 -4
- package/esm/Options/Interfaces/Particles/Roll/IRollLight.d.ts +2 -1
- package/esm/Options/Interfaces/Particles/Rotate/IRotateAnimation.d.ts +2 -1
- package/esm/Options/Interfaces/Particles/Tilt/ITiltAnimation.d.ts +2 -1
- package/esm/Options/Interfaces/Particles/Twinkle/ITwinkleValues.d.ts +3 -2
- package/esm/Plugins/Absorbers/AbsorberInstance.js +1 -1
- package/esm/Plugins/Absorbers/Options/Classes/Absorber.d.ts +2 -2
- package/esm/Plugins/Absorbers/Options/Classes/Absorber.js +8 -4
- package/esm/Plugins/Absorbers/Options/Interfaces/IAbsorber.d.ts +2 -2
- package/esm/Plugins/Emitters/EmitterInstance.js +3 -3
- package/esm/Plugins/Emitters/Options/Classes/Emitter.d.ts +2 -2
- package/esm/Plugins/Emitters/Options/Classes/Emitter.js +8 -5
- package/esm/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +2 -2
- package/esm/Updaters/Angle/AngleUpdater.js +2 -1
- package/esm/Updaters/Opacity/OpacityUpdater.js +3 -2
- package/esm/Updaters/Roll/RollUpdater.js +3 -3
- package/esm/Updaters/Tilt/TiltUpdater.js +1 -1
- package/esm/Utils/ColorUtils.js +2 -2
- package/package.json +1 -1
- package/report.html +2 -2
- package/report.slim.html +2 -2
- package/scripts/install.js +11 -2
- package/tsparticles.engine.js +47 -47
- package/tsparticles.engine.min.js +2 -2
- package/tsparticles.interaction.external.attract.js +319 -36
- package/tsparticles.interaction.external.attract.min.js +1 -1
- package/tsparticles.interaction.external.bounce.js +319 -36
- package/tsparticles.interaction.external.bounce.min.js +1 -1
- package/tsparticles.interaction.external.bubble.js +319 -36
- package/tsparticles.interaction.external.bubble.min.js +1 -1
- package/tsparticles.interaction.external.connect.js +319 -36
- package/tsparticles.interaction.external.connect.min.js +1 -1
- package/tsparticles.interaction.external.grab.js +319 -36
- package/tsparticles.interaction.external.grab.min.js +1 -1
- package/tsparticles.interaction.external.repulse.js +319 -36
- package/tsparticles.interaction.external.repulse.min.js +1 -1
- package/tsparticles.interaction.external.trail.js +319 -36
- package/tsparticles.interaction.external.trail.min.js +1 -1
- package/tsparticles.interaction.particles.attract.js +319 -36
- package/tsparticles.interaction.particles.attract.min.js +1 -1
- package/tsparticles.interaction.particles.collisions.js +319 -36
- package/tsparticles.interaction.particles.collisions.min.js +1 -1
- package/tsparticles.interaction.particles.links.js +320 -37
- package/tsparticles.interaction.particles.links.min.js +2 -2
- package/tsparticles.js +73 -67
- package/tsparticles.min.js +2 -2
- package/tsparticles.pathseg.min.js +1 -1
- package/tsparticles.plugins.absorbers.js +327 -41
- package/tsparticles.plugins.absorbers.min.js +2 -2
- package/tsparticles.plugins.emitters.js +430 -144
- package/tsparticles.plugins.emitters.min.js +2 -2
- package/tsparticles.plugins.polygonMask.js +319 -36
- package/tsparticles.plugins.polygonMask.min.js +1 -1
- package/tsparticles.shape.circle.min.js +1 -1
- package/tsparticles.shape.image.js +319 -36
- 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 +319 -36
- package/tsparticles.shape.text.min.js +1 -1
- package/tsparticles.slim.js +51 -51
- package/tsparticles.slim.min.js +2 -2
- package/tsparticles.updater.angle.js +320 -37
- package/tsparticles.updater.angle.min.js +2 -2
- package/tsparticles.updater.color.js +319 -36
- package/tsparticles.updater.color.min.js +2 -2
- package/tsparticles.updater.life.js +319 -36
- package/tsparticles.updater.life.min.js +1 -1
- package/tsparticles.updater.opacity.js +321 -38
- package/tsparticles.updater.opacity.min.js +2 -2
- package/tsparticles.updater.outModes.js +319 -36
- package/tsparticles.updater.outModes.min.js +1 -1
- package/tsparticles.updater.roll.js +322 -39
- package/tsparticles.updater.roll.min.js +2 -2
- package/tsparticles.updater.size.js +319 -36
- package/tsparticles.updater.size.min.js +1 -1
- package/tsparticles.updater.strokeColor.js +319 -36
- package/tsparticles.updater.strokeColor.min.js +2 -2
- package/tsparticles.updater.tilt.js +320 -37
- package/tsparticles.updater.tilt.min.js +2 -2
- package/tsparticles.updater.wobble.js +319 -36
- package/tsparticles.updater.wobble.min.js +1 -1
- package/umd/Core/Canvas.js +4 -5
- 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 +3 -1
- package/umd/Core/Particle.js +9 -7
- package/umd/Core/Particles.js +2 -1
- 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;
|
|
@@ -2170,10 +2170,7 @@
|
|
|
2170
2170
|
const container = this.container;
|
|
2171
2171
|
const pxRatio = container.retina.pixelRatio;
|
|
2172
2172
|
const size = container.canvas.size;
|
|
2173
|
-
const oldSize = {
|
|
2174
|
-
width: size.width,
|
|
2175
|
-
height: size.height
|
|
2176
|
-
};
|
|
2173
|
+
const oldSize = Object.assign({}, size);
|
|
2177
2174
|
size.width = this.element.offsetWidth * pxRatio;
|
|
2178
2175
|
size.height = this.element.offsetHeight * pxRatio;
|
|
2179
2176
|
this.element.width = size.width;
|
|
@@ -2232,7 +2229,7 @@
|
|
|
2232
2229
|
const zIndexOptions = particle.options.zIndex;
|
|
2233
2230
|
const zOpacityFactor = (1 - particle.zIndexFactor) ** zIndexOptions.opacityRate;
|
|
2234
2231
|
const radius = particle.getRadius();
|
|
2235
|
-
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;
|
|
2232
|
+
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;
|
|
2236
2233
|
const strokeOpacity = (_f = (_e = particle.stroke) === null || _e === void 0 ? void 0 : _e.opacity) !== null && _f !== void 0 ? _f : opacity;
|
|
2237
2234
|
const zOpacity = opacity * zOpacityFactor;
|
|
2238
2235
|
const fillColorValue = fColor ? getStyleFromHsl(fColor, zOpacity) : undefined;
|
|
@@ -2503,7 +2500,7 @@
|
|
|
2503
2500
|
return;
|
|
2504
2501
|
}
|
|
2505
2502
|
if (data.count !== undefined) {
|
|
2506
|
-
this.count = data.count;
|
|
2503
|
+
this.count = setRangeValue(data.count);
|
|
2507
2504
|
}
|
|
2508
2505
|
if (data.enable !== undefined) {
|
|
2509
2506
|
this.enable = data.enable;
|
|
@@ -2512,7 +2509,7 @@
|
|
|
2512
2509
|
this.offset = setRangeValue(data.offset);
|
|
2513
2510
|
}
|
|
2514
2511
|
if (data.speed !== undefined) {
|
|
2515
|
-
this.speed = data.speed;
|
|
2512
|
+
this.speed = setRangeValue(data.speed);
|
|
2516
2513
|
}
|
|
2517
2514
|
if (data.sync !== undefined) {
|
|
2518
2515
|
this.sync = data.sync;
|
|
@@ -2660,13 +2657,13 @@
|
|
|
2660
2657
|
return;
|
|
2661
2658
|
}
|
|
2662
2659
|
if (data.count !== undefined) {
|
|
2663
|
-
this.count = data.count;
|
|
2660
|
+
this.count = setRangeValue(data.count);
|
|
2664
2661
|
}
|
|
2665
2662
|
if (data.enable !== undefined) {
|
|
2666
2663
|
this.enable = data.enable;
|
|
2667
2664
|
}
|
|
2668
2665
|
if (data.speed !== undefined) {
|
|
2669
|
-
this.speed = data.speed;
|
|
2666
|
+
this.speed = setRangeValue(data.speed);
|
|
2670
2667
|
}
|
|
2671
2668
|
if (data.sync !== undefined) {
|
|
2672
2669
|
this.sync = data.sync;
|
|
@@ -2686,13 +2683,13 @@
|
|
|
2686
2683
|
return;
|
|
2687
2684
|
}
|
|
2688
2685
|
if (data.count !== undefined) {
|
|
2689
|
-
this.count = data.count;
|
|
2686
|
+
this.count = setRangeValue(data.count);
|
|
2690
2687
|
}
|
|
2691
2688
|
if (data.enable !== undefined) {
|
|
2692
2689
|
this.enable = data.enable;
|
|
2693
2690
|
}
|
|
2694
2691
|
if (data.speed !== undefined) {
|
|
2695
|
-
this.speed = data.speed;
|
|
2692
|
+
this.speed = setRangeValue(data.speed);
|
|
2696
2693
|
}
|
|
2697
2694
|
if (data.sync !== undefined) {
|
|
2698
2695
|
this.sync = data.sync;
|
|
@@ -2864,6 +2861,90 @@
|
|
|
2864
2861
|
this.duration.load(data.duration);
|
|
2865
2862
|
}
|
|
2866
2863
|
}
|
|
2864
|
+
class Attract_Attract {
|
|
2865
|
+
constructor() {
|
|
2866
|
+
this.distance = 200;
|
|
2867
|
+
this.enable = false;
|
|
2868
|
+
this.rotate = {
|
|
2869
|
+
x: 3e3,
|
|
2870
|
+
y: 3e3
|
|
2871
|
+
};
|
|
2872
|
+
}
|
|
2873
|
+
get rotateX() {
|
|
2874
|
+
return this.rotate.x;
|
|
2875
|
+
}
|
|
2876
|
+
set rotateX(value) {
|
|
2877
|
+
this.rotate.x = value;
|
|
2878
|
+
}
|
|
2879
|
+
get rotateY() {
|
|
2880
|
+
return this.rotate.y;
|
|
2881
|
+
}
|
|
2882
|
+
set rotateY(value) {
|
|
2883
|
+
this.rotate.y = value;
|
|
2884
|
+
}
|
|
2885
|
+
load(data) {
|
|
2886
|
+
var _a, _b, _c, _d;
|
|
2887
|
+
if (!data) {
|
|
2888
|
+
return;
|
|
2889
|
+
}
|
|
2890
|
+
if (data.distance !== undefined) {
|
|
2891
|
+
this.distance = setRangeValue(data.distance);
|
|
2892
|
+
}
|
|
2893
|
+
if (data.enable !== undefined) {
|
|
2894
|
+
this.enable = data.enable;
|
|
2895
|
+
}
|
|
2896
|
+
const rotateX = (_b = (_a = data.rotate) === null || _a === void 0 ? void 0 : _a.x) !== null && _b !== void 0 ? _b : data.rotateX;
|
|
2897
|
+
if (rotateX !== undefined) {
|
|
2898
|
+
this.rotate.x = rotateX;
|
|
2899
|
+
}
|
|
2900
|
+
const rotateY = (_d = (_c = data.rotate) === null || _c === void 0 ? void 0 : _c.y) !== null && _d !== void 0 ? _d : data.rotateY;
|
|
2901
|
+
if (rotateY !== undefined) {
|
|
2902
|
+
this.rotate.y = rotateY;
|
|
2903
|
+
}
|
|
2904
|
+
}
|
|
2905
|
+
}
|
|
2906
|
+
class MoveAngle_MoveAngle {
|
|
2907
|
+
constructor() {
|
|
2908
|
+
this.offset = 0;
|
|
2909
|
+
this.value = 90;
|
|
2910
|
+
}
|
|
2911
|
+
load(data) {
|
|
2912
|
+
if (data === undefined) {
|
|
2913
|
+
return;
|
|
2914
|
+
}
|
|
2915
|
+
if (data.offset !== undefined) {
|
|
2916
|
+
this.offset = setRangeValue(data.offset);
|
|
2917
|
+
}
|
|
2918
|
+
if (data.value !== undefined) {
|
|
2919
|
+
this.value = setRangeValue(data.value);
|
|
2920
|
+
}
|
|
2921
|
+
}
|
|
2922
|
+
}
|
|
2923
|
+
class MoveGravity_MoveGravity {
|
|
2924
|
+
constructor() {
|
|
2925
|
+
this.acceleration = 9.81;
|
|
2926
|
+
this.enable = false;
|
|
2927
|
+
this.inverse = false;
|
|
2928
|
+
this.maxSpeed = 50;
|
|
2929
|
+
}
|
|
2930
|
+
load(data) {
|
|
2931
|
+
if (!data) {
|
|
2932
|
+
return;
|
|
2933
|
+
}
|
|
2934
|
+
if (data.acceleration !== undefined) {
|
|
2935
|
+
this.acceleration = setRangeValue(data.acceleration);
|
|
2936
|
+
}
|
|
2937
|
+
if (data.enable !== undefined) {
|
|
2938
|
+
this.enable = data.enable;
|
|
2939
|
+
}
|
|
2940
|
+
if (data.inverse !== undefined) {
|
|
2941
|
+
this.inverse = data.inverse;
|
|
2942
|
+
}
|
|
2943
|
+
if (data.maxSpeed !== undefined) {
|
|
2944
|
+
this.maxSpeed = setRangeValue(data.maxSpeed);
|
|
2945
|
+
}
|
|
2946
|
+
}
|
|
2947
|
+
}
|
|
2867
2948
|
class PathDelay_PathDelay extends(null && ValueWithRandom){
|
|
2868
2949
|
constructor() {
|
|
2869
2950
|
super();
|
|
@@ -3025,6 +3106,70 @@
|
|
|
3025
3106
|
}
|
|
3026
3107
|
}
|
|
3027
3108
|
}
|
|
3109
|
+
class AnimationOptions_AnimationOptions {
|
|
3110
|
+
constructor() {
|
|
3111
|
+
this.count = 0;
|
|
3112
|
+
this.enable = false;
|
|
3113
|
+
this.speed = 1;
|
|
3114
|
+
this.sync = false;
|
|
3115
|
+
}
|
|
3116
|
+
load(data) {
|
|
3117
|
+
if (!data) {
|
|
3118
|
+
return;
|
|
3119
|
+
}
|
|
3120
|
+
if (data.count !== undefined) {
|
|
3121
|
+
this.count = setRangeValue(data.count);
|
|
3122
|
+
}
|
|
3123
|
+
if (data.enable !== undefined) {
|
|
3124
|
+
this.enable = data.enable;
|
|
3125
|
+
}
|
|
3126
|
+
if (data.speed !== undefined) {
|
|
3127
|
+
this.speed = setRangeValue(data.speed);
|
|
3128
|
+
}
|
|
3129
|
+
if (data.sync !== undefined) {
|
|
3130
|
+
this.sync = data.sync;
|
|
3131
|
+
}
|
|
3132
|
+
}
|
|
3133
|
+
}
|
|
3134
|
+
class OpacityAnimation_OpacityAnimation extends(null && AnimationOptions){
|
|
3135
|
+
constructor() {
|
|
3136
|
+
super();
|
|
3137
|
+
this.destroy = "none";
|
|
3138
|
+
this.enable = false;
|
|
3139
|
+
this.speed = 2;
|
|
3140
|
+
this.startValue = "random";
|
|
3141
|
+
this.sync = false;
|
|
3142
|
+
}
|
|
3143
|
+
get opacity_min() {
|
|
3144
|
+
return this.minimumValue;
|
|
3145
|
+
}
|
|
3146
|
+
set opacity_min(value) {
|
|
3147
|
+
this.minimumValue = value;
|
|
3148
|
+
}
|
|
3149
|
+
load(data) {
|
|
3150
|
+
var _a;
|
|
3151
|
+
if (data === undefined) {
|
|
3152
|
+
return;
|
|
3153
|
+
}
|
|
3154
|
+
super.load(data);
|
|
3155
|
+
if (data.destroy !== undefined) {
|
|
3156
|
+
this.destroy = data.destroy;
|
|
3157
|
+
}
|
|
3158
|
+
if (data.enable !== undefined) {
|
|
3159
|
+
this.enable = data.enable;
|
|
3160
|
+
}
|
|
3161
|
+
this.minimumValue = (_a = data.minimumValue) !== null && _a !== void 0 ? _a : data.opacity_min;
|
|
3162
|
+
if (data.speed !== undefined) {
|
|
3163
|
+
this.speed = data.speed;
|
|
3164
|
+
}
|
|
3165
|
+
if (data.startValue !== undefined) {
|
|
3166
|
+
this.startValue = data.startValue;
|
|
3167
|
+
}
|
|
3168
|
+
if (data.sync !== undefined) {
|
|
3169
|
+
this.sync = data.sync;
|
|
3170
|
+
}
|
|
3171
|
+
}
|
|
3172
|
+
}
|
|
3028
3173
|
class Opacity_Opacity extends(null && ValueWithRandom){
|
|
3029
3174
|
constructor() {
|
|
3030
3175
|
super();
|
|
@@ -3083,13 +3228,13 @@
|
|
|
3083
3228
|
this.enable = data.enable;
|
|
3084
3229
|
}
|
|
3085
3230
|
if (data.opacity !== undefined) {
|
|
3086
|
-
this.opacity = data.opacity;
|
|
3231
|
+
this.opacity = setRangeValue(data.opacity);
|
|
3087
3232
|
}
|
|
3088
3233
|
if (data.width !== undefined) {
|
|
3089
|
-
this.width = data.width;
|
|
3234
|
+
this.width = setRangeValue(data.width);
|
|
3090
3235
|
}
|
|
3091
3236
|
if (data.radius !== undefined) {
|
|
3092
|
-
this.radius = data.radius;
|
|
3237
|
+
this.radius = setRangeValue(data.radius);
|
|
3093
3238
|
}
|
|
3094
3239
|
if (data.color !== undefined) {
|
|
3095
3240
|
this.color = OptionsColor.create(this.color, data.color);
|
|
@@ -3114,16 +3259,33 @@
|
|
|
3114
3259
|
this.enabled = data.enabled;
|
|
3115
3260
|
}
|
|
3116
3261
|
if (data.distance !== undefined) {
|
|
3117
|
-
this.distance = data.distance;
|
|
3262
|
+
this.distance = setRangeValue(data.distance);
|
|
3118
3263
|
}
|
|
3119
3264
|
if (data.duration !== undefined) {
|
|
3120
|
-
this.duration = data.duration;
|
|
3265
|
+
this.duration = setRangeValue(data.duration);
|
|
3121
3266
|
}
|
|
3122
3267
|
if (data.factor !== undefined) {
|
|
3123
|
-
this.factor = data.factor;
|
|
3268
|
+
this.factor = setRangeValue(data.factor);
|
|
3124
3269
|
}
|
|
3125
3270
|
if (data.speed !== undefined) {
|
|
3126
|
-
this.speed = data.speed;
|
|
3271
|
+
this.speed = setRangeValue(data.speed);
|
|
3272
|
+
}
|
|
3273
|
+
}
|
|
3274
|
+
}
|
|
3275
|
+
class RollLight_RollLight {
|
|
3276
|
+
constructor() {
|
|
3277
|
+
this.enable = false;
|
|
3278
|
+
this.value = 0;
|
|
3279
|
+
}
|
|
3280
|
+
load(data) {
|
|
3281
|
+
if (!data) {
|
|
3282
|
+
return;
|
|
3283
|
+
}
|
|
3284
|
+
if (data.enable !== undefined) {
|
|
3285
|
+
this.enable = data.enable;
|
|
3286
|
+
}
|
|
3287
|
+
if (data.value !== undefined) {
|
|
3288
|
+
this.value = setRangeValue(data.value);
|
|
3127
3289
|
}
|
|
3128
3290
|
}
|
|
3129
3291
|
}
|
|
@@ -3155,6 +3317,27 @@
|
|
|
3155
3317
|
}
|
|
3156
3318
|
}
|
|
3157
3319
|
}
|
|
3320
|
+
class RotateAnimation_RotateAnimation {
|
|
3321
|
+
constructor() {
|
|
3322
|
+
this.enable = false;
|
|
3323
|
+
this.speed = 0;
|
|
3324
|
+
this.sync = false;
|
|
3325
|
+
}
|
|
3326
|
+
load(data) {
|
|
3327
|
+
if (data === undefined) {
|
|
3328
|
+
return;
|
|
3329
|
+
}
|
|
3330
|
+
if (data.enable !== undefined) {
|
|
3331
|
+
this.enable = data.enable;
|
|
3332
|
+
}
|
|
3333
|
+
if (data.speed !== undefined) {
|
|
3334
|
+
this.speed = setRangeValue(data.speed);
|
|
3335
|
+
}
|
|
3336
|
+
if (data.sync !== undefined) {
|
|
3337
|
+
this.sync = data.sync;
|
|
3338
|
+
}
|
|
3339
|
+
}
|
|
3340
|
+
}
|
|
3158
3341
|
class Rotate_Rotate extends(null && ValueWithRandom){
|
|
3159
3342
|
constructor() {
|
|
3160
3343
|
super();
|
|
@@ -3273,6 +3456,45 @@
|
|
|
3273
3456
|
}
|
|
3274
3457
|
}
|
|
3275
3458
|
}
|
|
3459
|
+
class SizeAnimation_SizeAnimation extends(null && AnimationOptions){
|
|
3460
|
+
constructor() {
|
|
3461
|
+
super();
|
|
3462
|
+
this.destroy = "none";
|
|
3463
|
+
this.enable = false;
|
|
3464
|
+
this.speed = 5;
|
|
3465
|
+
this.startValue = "random";
|
|
3466
|
+
this.sync = false;
|
|
3467
|
+
}
|
|
3468
|
+
get size_min() {
|
|
3469
|
+
return this.minimumValue;
|
|
3470
|
+
}
|
|
3471
|
+
set size_min(value) {
|
|
3472
|
+
this.minimumValue = value;
|
|
3473
|
+
}
|
|
3474
|
+
load(data) {
|
|
3475
|
+
var _a;
|
|
3476
|
+
if (data === undefined) {
|
|
3477
|
+
return;
|
|
3478
|
+
}
|
|
3479
|
+
super.load(data);
|
|
3480
|
+
if (data.destroy !== undefined) {
|
|
3481
|
+
this.destroy = data.destroy;
|
|
3482
|
+
}
|
|
3483
|
+
if (data.enable !== undefined) {
|
|
3484
|
+
this.enable = data.enable;
|
|
3485
|
+
}
|
|
3486
|
+
this.minimumValue = (_a = data.minimumValue) !== null && _a !== void 0 ? _a : data.size_min;
|
|
3487
|
+
if (data.speed !== undefined) {
|
|
3488
|
+
this.speed = data.speed;
|
|
3489
|
+
}
|
|
3490
|
+
if (data.startValue !== undefined) {
|
|
3491
|
+
this.startValue = data.startValue;
|
|
3492
|
+
}
|
|
3493
|
+
if (data.sync !== undefined) {
|
|
3494
|
+
this.sync = data.sync;
|
|
3495
|
+
}
|
|
3496
|
+
}
|
|
3497
|
+
}
|
|
3276
3498
|
class Size_Size extends(null && ValueWithRandom){
|
|
3277
3499
|
constructor() {
|
|
3278
3500
|
super();
|
|
@@ -3318,6 +3540,27 @@
|
|
|
3318
3540
|
}
|
|
3319
3541
|
}
|
|
3320
3542
|
}
|
|
3543
|
+
class TiltAnimation_TiltAnimation {
|
|
3544
|
+
constructor() {
|
|
3545
|
+
this.enable = false;
|
|
3546
|
+
this.speed = 0;
|
|
3547
|
+
this.sync = false;
|
|
3548
|
+
}
|
|
3549
|
+
load(data) {
|
|
3550
|
+
if (data === undefined) {
|
|
3551
|
+
return;
|
|
3552
|
+
}
|
|
3553
|
+
if (data.enable !== undefined) {
|
|
3554
|
+
this.enable = data.enable;
|
|
3555
|
+
}
|
|
3556
|
+
if (data.speed !== undefined) {
|
|
3557
|
+
this.speed = setRangeValue(data.speed);
|
|
3558
|
+
}
|
|
3559
|
+
if (data.sync !== undefined) {
|
|
3560
|
+
this.sync = data.sync;
|
|
3561
|
+
}
|
|
3562
|
+
}
|
|
3563
|
+
}
|
|
3321
3564
|
class Tilt_Tilt extends(null && ValueWithRandom){
|
|
3322
3565
|
constructor() {
|
|
3323
3566
|
super();
|
|
@@ -3340,6 +3583,43 @@
|
|
|
3340
3583
|
}
|
|
3341
3584
|
}
|
|
3342
3585
|
}
|
|
3586
|
+
class TwinkleValues_TwinkleValues {
|
|
3587
|
+
constructor() {
|
|
3588
|
+
this.enable = false;
|
|
3589
|
+
this.frequency = .05;
|
|
3590
|
+
this.opacity = 1;
|
|
3591
|
+
}
|
|
3592
|
+
load(data) {
|
|
3593
|
+
if (data === undefined) {
|
|
3594
|
+
return;
|
|
3595
|
+
}
|
|
3596
|
+
if (data.color !== undefined) {
|
|
3597
|
+
this.color = OptionsColor.create(this.color, data.color);
|
|
3598
|
+
}
|
|
3599
|
+
if (data.enable !== undefined) {
|
|
3600
|
+
this.enable = data.enable;
|
|
3601
|
+
}
|
|
3602
|
+
if (data.frequency !== undefined) {
|
|
3603
|
+
this.frequency = data.frequency;
|
|
3604
|
+
}
|
|
3605
|
+
if (data.opacity !== undefined) {
|
|
3606
|
+
this.opacity = setRangeValue(data.opacity);
|
|
3607
|
+
}
|
|
3608
|
+
}
|
|
3609
|
+
}
|
|
3610
|
+
class Twinkle_Twinkle {
|
|
3611
|
+
constructor() {
|
|
3612
|
+
this.lines = new TwinkleValues;
|
|
3613
|
+
this.particles = new TwinkleValues;
|
|
3614
|
+
}
|
|
3615
|
+
load(data) {
|
|
3616
|
+
if (data === undefined) {
|
|
3617
|
+
return;
|
|
3618
|
+
}
|
|
3619
|
+
this.lines.load(data.lines);
|
|
3620
|
+
this.particles.load(data.particles);
|
|
3621
|
+
}
|
|
3622
|
+
}
|
|
3343
3623
|
class Wobble_Wobble {
|
|
3344
3624
|
constructor() {
|
|
3345
3625
|
this.distance = 5;
|
|
@@ -3737,6 +4017,7 @@
|
|
|
3737
4017
|
this.retina = {
|
|
3738
4018
|
maxDistance: {}
|
|
3739
4019
|
};
|
|
4020
|
+
this.ignoresResizeRatio = true;
|
|
3740
4021
|
const pxRatio = container.retina.pixelRatio;
|
|
3741
4022
|
const mainOptions = container.actualOptions;
|
|
3742
4023
|
const particlesOptions = new ParticlesOptions;
|
|
@@ -3776,7 +4057,7 @@
|
|
|
3776
4057
|
max: getRangeMax(sizeRange) * pxRatio,
|
|
3777
4058
|
min: getRangeMin(sizeRange) * pxRatio,
|
|
3778
4059
|
loops: 0,
|
|
3779
|
-
maxLoops: sizeOptions.animation.count
|
|
4060
|
+
maxLoops: getRangeValue(sizeOptions.animation.count)
|
|
3780
4061
|
};
|
|
3781
4062
|
const sizeAnimation = sizeOptions.animation;
|
|
3782
4063
|
if (sizeAnimation.enable) {
|
|
@@ -3810,6 +4091,12 @@
|
|
|
3810
4091
|
this.initialVelocity = this.calculateVelocity();
|
|
3811
4092
|
this.velocity = this.initialVelocity.copy();
|
|
3812
4093
|
this.moveDecay = 1 - getRangeValue(this.options.move.decay);
|
|
4094
|
+
const gravityOptions = this.options.move.gravity;
|
|
4095
|
+
this.gravity = {
|
|
4096
|
+
enable: gravityOptions.enable,
|
|
4097
|
+
acceleration: getRangeValue(gravityOptions.acceleration),
|
|
4098
|
+
inverse: gravityOptions.inverse
|
|
4099
|
+
};
|
|
3813
4100
|
this.position = this.calcPosition(container, position, clamp(zIndexValue, 0, container.zLayers));
|
|
3814
4101
|
this.initialPosition = this.position.copy();
|
|
3815
4102
|
this.offset = Vector.origin;
|
|
@@ -4017,12 +4304,7 @@
|
|
|
4017
4304
|
return overlaps;
|
|
4018
4305
|
}
|
|
4019
4306
|
calculateVelocity() {
|
|
4020
|
-
const baseVelocity = getParticleBaseVelocity(this.direction)
|
|
4021
|
-
const res = baseVelocity.copy();
|
|
4022
|
-
const moveOptions = this.options.move;
|
|
4023
|
-
const rad = Math.PI / 180 * moveOptions.angle.value;
|
|
4024
|
-
const radOffset = Math.PI / 180 * moveOptions.angle.offset;
|
|
4025
|
-
const range = {
|
|
4307
|
+
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 = {
|
|
4026
4308
|
left: radOffset - rad / 2,
|
|
4027
4309
|
right: radOffset + rad / 2
|
|
4028
4310
|
};
|
|
@@ -4172,10 +4454,11 @@
|
|
|
4172
4454
|
}
|
|
4173
4455
|
for (const particle of this.array) {
|
|
4174
4456
|
const resizeFactor = container.canvas.resizeFactor;
|
|
4175
|
-
if (resizeFactor) {
|
|
4457
|
+
if (resizeFactor && !particle.ignoresResizeRatio) {
|
|
4176
4458
|
particle.position.x *= resizeFactor.width;
|
|
4177
4459
|
particle.position.y *= resizeFactor.height;
|
|
4178
4460
|
}
|
|
4461
|
+
particle.ignoresResizeRatio = false;
|
|
4179
4462
|
particle.bubble.inRange = false;
|
|
4180
4463
|
for (const [, plugin] of this.container.plugins) {
|
|
4181
4464
|
if (particle.destroyed) {
|
|
@@ -4411,13 +4694,13 @@
|
|
|
4411
4694
|
container.canvas.size.height = element.offsetHeight * ratio;
|
|
4412
4695
|
}
|
|
4413
4696
|
const particles = options.particles;
|
|
4414
|
-
this.attractDistance = particles.move.attract.distance * ratio;
|
|
4697
|
+
this.attractDistance = getRangeValue(particles.move.attract.distance) * ratio;
|
|
4415
4698
|
this.linksDistance = particles.links.distance * ratio;
|
|
4416
4699
|
this.linksWidth = particles.links.width * ratio;
|
|
4417
|
-
this.sizeAnimationSpeed = particles.size.animation.speed * ratio;
|
|
4418
|
-
this.maxSpeed = particles.move.gravity.maxSpeed * ratio;
|
|
4700
|
+
this.sizeAnimationSpeed = getRangeValue(particles.size.animation.speed) * ratio;
|
|
4701
|
+
this.maxSpeed = getRangeValue(particles.move.gravity.maxSpeed) * ratio;
|
|
4419
4702
|
if (particles.orbit.radius !== undefined) {
|
|
4420
|
-
this.orbitRadius = particles.orbit.radius * this.container.retina.pixelRatio;
|
|
4703
|
+
this.orbitRadius = getRangeValue(particles.orbit.radius) * this.container.retina.pixelRatio;
|
|
4421
4704
|
}
|
|
4422
4705
|
const modes = options.interactivity.modes;
|
|
4423
4706
|
this.connectModeDistance = modes.connect.distance * ratio;
|
|
@@ -4437,19 +4720,19 @@
|
|
|
4437
4720
|
const ratio = this.pixelRatio;
|
|
4438
4721
|
const moveDistance = options.move.distance;
|
|
4439
4722
|
const props = particle.retina;
|
|
4440
|
-
props.attractDistance = options.move.attract.distance * ratio;
|
|
4723
|
+
props.attractDistance = getRangeValue(options.move.attract.distance) * ratio;
|
|
4441
4724
|
props.linksDistance = options.links.distance * ratio;
|
|
4442
4725
|
props.linksWidth = options.links.width * ratio;
|
|
4443
4726
|
props.moveDrift = getRangeValue(options.move.drift) * ratio;
|
|
4444
4727
|
props.moveSpeed = getRangeValue(options.move.speed) * ratio;
|
|
4445
|
-
props.sizeAnimationSpeed = options.size.animation.speed * ratio;
|
|
4728
|
+
props.sizeAnimationSpeed = getRangeValue(options.size.animation.speed) * ratio;
|
|
4446
4729
|
if (particle.spin) {
|
|
4447
4730
|
props.spinAcceleration = getRangeValue(options.move.spin.acceleration) * ratio;
|
|
4448
4731
|
}
|
|
4449
4732
|
const maxDistance = props.maxDistance;
|
|
4450
4733
|
maxDistance.horizontal = moveDistance.horizontal !== undefined ? moveDistance.horizontal * ratio : undefined;
|
|
4451
4734
|
maxDistance.vertical = moveDistance.vertical !== undefined ? moveDistance.vertical * ratio : undefined;
|
|
4452
|
-
props.maxSpeed = options.move.gravity.maxSpeed * ratio;
|
|
4735
|
+
props.maxSpeed = getRangeValue(options.move.gravity.maxSpeed) * ratio;
|
|
4453
4736
|
}
|
|
4454
4737
|
handleMotionChange(mediaQuery) {
|
|
4455
4738
|
const options = this.container.actualOptions;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! tsParticles v1.
|
|
1
|
+
/*! tsParticles v1.42.1 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 s=t();for(var n in s)("object"==typeof exports?exports:e)[n]=s[n]}}(window,(function(){return function(){"use strict";var e={d:function(t,s){for(var n in s)e.o(s,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:s[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 s(e,t){const s=e.x-t.x,n=e.y-t.y;return{dx:s,dy:n,distance:Math.sqrt(s*s+n*n)}}function n(e,t){switch(t){case"ease-out-quad":return 1-(1-e)**2;case"ease-out-cubic":return 1-(1-e)**3;case"ease-out-quart":return 1-(1-e)**4;case"ease-out-quint":return 1-(1-e)**5;case"ease-out-expo":return 1===e?1:1-Math.pow(2,-10*e);case"ease-out-sine":return Math.sin(e*Math.PI/2);case"ease-out-back":{const t=1.70158;return 1+(t+1)*Math.pow(e-1,3)+t*Math.pow(e-1,2)}case"ease-out-circ":return Math.sqrt(1-Math.pow(e-1,2));default:return e}}function i(e,t){if(t instanceof Array){for(const s of t)if(e.matches(s))return!0;return!1}return e.matches(t)}function o(e,t){return e===t||t instanceof Array&&t.indexOf(e)>-1}function r(e,t){const s=e.selectors;if(s instanceof Array)for(const n of s)t(n,e);else t(s,e)}e.r(t),e.d(t,{loadExternalRepulseInteraction:function(){return p}});class a{constructor(e,t){this.position={x:e,y:t}}}class c extends a{constructor(e,t,s){super(e,t),this.radius=s}contains(e){return t=e,n=this.position,s(t,n).distance<=this.radius;var t,n}intersects(e){const t=e,s=e,n=this.position,i=e.position,o=Math.abs(i.x-n.x),r=Math.abs(i.y-n.y),a=this.radius;if(void 0!==s.radius){return a+s.radius>Math.sqrt(o*o+r+r)}if(void 0!==t.size){const e=t.size.width,s=t.size.height,n=Math.pow(o-e,2)+Math.pow(r-s,2);return!(o>a+e||r>a+s)&&(o<=e||r<=s||n<=a*a)}return!1}}class u{}u.generatedAttribute="generated",u.randomColorValue="random",u.midColorValue="mid",u.touchEndEvent="touchend",u.mouseDownEvent="mousedown",u.mouseUpEvent="mouseup",u.mouseMoveEvent="mousemove",u.touchStartEvent="touchstart",u.touchMoveEvent="touchmove",u.mouseLeaveEvent="mouseleave",u.mouseOutEvent="mouseout",u.touchCancelEvent="touchcancel",u.resizeEvent="resize",u.visibilityChangeEvent="visibilitychange",u.noPolygonDataLoaded="No polygon data loaded.",u.noPolygonFound="No polygon found, you need to specify SVG url in config.";new WeakMap;new WeakMap;class l extends a{constructor(e,t,s,n){super(e,t),this.size={height:n,width:s}}contains(e){const t=this.size.width,s=this.size.height,n=this.position;return e.x>=n.x&&e.x<=n.x+t&&e.y>=n.y&&e.y<=n.y+s}intersects(e){const t=e,s=e,n=this.size.width,i=this.size.height,o=this.position,r=e.position;if(void 0!==s.radius)return s.intersects(this);if(void 0!==t.size){const e=t.size,s=e.width,a=e.height;return r.x<o.x+n&&r.x+s>o.x&&r.y<o.y+i&&r.y+a>o.y}return!1}}class h{constructor(e,t){let s,n;if(void 0===t){if("number"==typeof e)throw new Error("tsParticles - Vector not initialized correctly");const t=e;[s,n]=[t.x,t.y]}else[s,n]=[e,t];this.x=s,this.y=n}static clone(e){return h.create(e.x,e.y)}static create(e,t){return new h(e,t)}static get origin(){return h.create(0,0)}get angle(){return Math.atan2(this.y,this.x)}set angle(e){this.updateFromAngle(e,this.length)}get length(){return Math.sqrt(this.x**2+this.y**2)}set length(e){this.updateFromAngle(this.angle,e)}add(e){return h.create(this.x+e.x,this.y+e.y)}addTo(e){this.x+=e.x,this.y+=e.y}sub(e){return h.create(this.x-e.x,this.y-e.y)}subFrom(e){this.x-=e.x,this.y-=e.y}mult(e){return h.create(this.x*e,this.y*e)}multTo(e){this.x*=e,this.y*=e}div(e){return h.create(this.x/e,this.y/e)}divTo(e){this.x/=e,this.y/=e}distanceTo(e){return this.sub(e).length}getLengthSq(){return this.x**2+this.y**2}distanceToSq(e){return this.sub(e).getLengthSq()}manhattanDistanceTo(e){return Math.abs(e.x-this.x)+Math.abs(e.y-this.y)}copy(){return h.clone(this)}setTo(e){this.x=e.x,this.y=e.y}rotate(e){return h.create(this.x*Math.cos(e)-this.y*Math.sin(e),this.x*Math.sin(e)+this.y*Math.cos(e))}updateFromAngle(e,t){this.x=Math.cos(e)*t,this.y=Math.sin(e)*t}}new WeakMap,new WeakSet;new WeakMap;new WeakMap;new WeakMap;new WeakMap;class d extends class{constructor(e){this.container=e,this.type=0}}{constructor(e){super(e)}isEnabled(){const e=this.container,t=e.actualOptions,s=e.interactivity.mouse,n=t.interactivity.events,i=function(e,t){return t instanceof Array?!!t.find((t=>t.enable&&o(e,t.mode))):o(e,t.mode)}("repulse",n.onDiv);if(!(i||n.onHover.enable&&s.position||n.onClick.enable&&s.clickPosition))return!1;const r=n.onHover.mode,a=n.onClick.mode;return o("repulse",r)||o("repulse",a)||i}reset(){}async interact(){const e=this.container,t=e.actualOptions,s=e.interactivity.status===u.mouseMoveEvent,n=t.interactivity.events,i=n.onHover.enable,a=n.onHover.mode,c=n.onClick.enable,l=n.onClick.mode,h=n.onDiv;s&&i&&o("repulse",a)?this.hoverRepulse():c&&o("repulse",l)?this.clickRepulse():function(e,t,s){if(t instanceof Array)for(const n of t){const t=n.mode;n.enable&&o(e,t)&&r(n,s)}else{const n=t.mode;t.enable&&o(e,n)&&r(t,s)}}("repulse",h,((e,t)=>this.singleSelectorRepulse(e,t)))}singleSelectorRepulse(e,t){const s=this.container,n=document.querySelectorAll(e);n.length&&n.forEach((e=>{const n=e,o=s.retina.pixelRatio,r={x:(n.offsetLeft+n.offsetWidth/2)*o,y:(n.offsetTop+n.offsetHeight/2)*o},a=n.offsetWidth/2*o,u="circle"===t.type?new c(r.x,r.y,a):new l(n.offsetLeft*o,n.offsetTop*o,n.offsetWidth*o,n.offsetHeight*o),h=function(e,t){if(t&&e)return e instanceof Array?e.find((e=>i(t,e.selectors))):i(t,e.selectors)?e:void 0}(s.actualOptions.interactivity.modes.repulse.divs,n);this.processRepulse(r,a,u,h)}))}hoverRepulse(){const e=this.container,t=e.interactivity.mouse.position;if(!t)return;const s=e.retina.repulseModeDistance;this.processRepulse(t,s,new c(t.x,t.y,s))}processRepulse(e,t,i,o){var r;const a=this.container,c=a.particles.quadTree.query(i),u=a.actualOptions.interactivity.modes.repulse;for(const i of c){const{dx:a,dy:c,distance:f}=s(i.position,e),y=(null!==(r=null==o?void 0:o.speed)&&void 0!==r?r:u.speed)*u.factor,v=(l=n(1-f/t,u.easing)*y,d=0,p=u.maxSpeed,Math.min(Math.max(l,d),p)),x=h.create(0===f?y:a/f*v,0===f?y:c/f*v);i.position.addTo(x)}var l,d,p}clickRepulse(){const e=this.container;if(e.repulse.finish||(e.repulse.count||(e.repulse.count=0),e.repulse.count++,e.repulse.count===e.particles.count&&(e.repulse.finish=!0)),e.repulse.clicking){const t=e.retina.repulseModeDistance,n=Math.pow(t/6,3),i=e.interactivity.mouse.clickPosition;if(void 0===i)return;const o=new c(i.x,i.y,n),r=e.particles.quadTree.query(o);for(const t of r){const{dx:o,dy:r,distance:a}=s(i,t.position),c=a**2,u=e.actualOptions.interactivity.modes.repulse.speed,l=-n*u/c;if(c<=n){e.repulse.particles.push(t);const s=h.create(o,r);s.length=l,t.velocity.setTo(s)}}}else if(!1===e.repulse.clicking){for(const t of e.repulse.particles)t.velocity.setTo(t.initialVelocity);e.repulse.particles=[]}}}async function p(e){await e.addInteractor("externalRepulse",(e=>new d(e)))}return t}()}));
|