tsparticles 1.41.4 → 1.42.0
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 +11 -10
- 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 +11 -10
- 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 +11 -10
- 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 +81 -74
- 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 +438 -151
- 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 +11 -10
- 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;
|
|
@@ -2138,10 +2138,7 @@
|
|
|
2138
2138
|
const container = this.container;
|
|
2139
2139
|
const pxRatio = container.retina.pixelRatio;
|
|
2140
2140
|
const size = container.canvas.size;
|
|
2141
|
-
const oldSize = {
|
|
2142
|
-
width: size.width,
|
|
2143
|
-
height: size.height
|
|
2144
|
-
};
|
|
2141
|
+
const oldSize = Object.assign({}, size);
|
|
2145
2142
|
size.width = this.element.offsetWidth * pxRatio;
|
|
2146
2143
|
size.height = this.element.offsetHeight * pxRatio;
|
|
2147
2144
|
this.element.width = size.width;
|
|
@@ -2200,7 +2197,7 @@
|
|
|
2200
2197
|
const zIndexOptions = particle.options.zIndex;
|
|
2201
2198
|
const zOpacityFactor = (1 - particle.zIndexFactor) ** zIndexOptions.opacityRate;
|
|
2202
2199
|
const radius = particle.getRadius();
|
|
2203
|
-
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;
|
|
2200
|
+
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;
|
|
2204
2201
|
const strokeOpacity = (_f = (_e = particle.stroke) === null || _e === void 0 ? void 0 : _e.opacity) !== null && _f !== void 0 ? _f : opacity;
|
|
2205
2202
|
const zOpacity = opacity * zOpacityFactor;
|
|
2206
2203
|
const fillColorValue = fColor ? getStyleFromHsl(fColor, zOpacity) : undefined;
|
|
@@ -2471,7 +2468,7 @@
|
|
|
2471
2468
|
return;
|
|
2472
2469
|
}
|
|
2473
2470
|
if (data.count !== undefined) {
|
|
2474
|
-
this.count = data.count;
|
|
2471
|
+
this.count = setRangeValue(data.count);
|
|
2475
2472
|
}
|
|
2476
2473
|
if (data.enable !== undefined) {
|
|
2477
2474
|
this.enable = data.enable;
|
|
@@ -2480,7 +2477,7 @@
|
|
|
2480
2477
|
this.offset = setRangeValue(data.offset);
|
|
2481
2478
|
}
|
|
2482
2479
|
if (data.speed !== undefined) {
|
|
2483
|
-
this.speed = data.speed;
|
|
2480
|
+
this.speed = setRangeValue(data.speed);
|
|
2484
2481
|
}
|
|
2485
2482
|
if (data.sync !== undefined) {
|
|
2486
2483
|
this.sync = data.sync;
|
|
@@ -2628,13 +2625,13 @@
|
|
|
2628
2625
|
return;
|
|
2629
2626
|
}
|
|
2630
2627
|
if (data.count !== undefined) {
|
|
2631
|
-
this.count = data.count;
|
|
2628
|
+
this.count = setRangeValue(data.count);
|
|
2632
2629
|
}
|
|
2633
2630
|
if (data.enable !== undefined) {
|
|
2634
2631
|
this.enable = data.enable;
|
|
2635
2632
|
}
|
|
2636
2633
|
if (data.speed !== undefined) {
|
|
2637
|
-
this.speed = data.speed;
|
|
2634
|
+
this.speed = setRangeValue(data.speed);
|
|
2638
2635
|
}
|
|
2639
2636
|
if (data.sync !== undefined) {
|
|
2640
2637
|
this.sync = data.sync;
|
|
@@ -2654,13 +2651,13 @@
|
|
|
2654
2651
|
return;
|
|
2655
2652
|
}
|
|
2656
2653
|
if (data.count !== undefined) {
|
|
2657
|
-
this.count = data.count;
|
|
2654
|
+
this.count = setRangeValue(data.count);
|
|
2658
2655
|
}
|
|
2659
2656
|
if (data.enable !== undefined) {
|
|
2660
2657
|
this.enable = data.enable;
|
|
2661
2658
|
}
|
|
2662
2659
|
if (data.speed !== undefined) {
|
|
2663
|
-
this.speed = data.speed;
|
|
2660
|
+
this.speed = setRangeValue(data.speed);
|
|
2664
2661
|
}
|
|
2665
2662
|
if (data.sync !== undefined) {
|
|
2666
2663
|
this.sync = data.sync;
|
|
@@ -2832,6 +2829,90 @@
|
|
|
2832
2829
|
this.duration.load(data.duration);
|
|
2833
2830
|
}
|
|
2834
2831
|
}
|
|
2832
|
+
class Attract_Attract {
|
|
2833
|
+
constructor() {
|
|
2834
|
+
this.distance = 200;
|
|
2835
|
+
this.enable = false;
|
|
2836
|
+
this.rotate = {
|
|
2837
|
+
x: 3e3,
|
|
2838
|
+
y: 3e3
|
|
2839
|
+
};
|
|
2840
|
+
}
|
|
2841
|
+
get rotateX() {
|
|
2842
|
+
return this.rotate.x;
|
|
2843
|
+
}
|
|
2844
|
+
set rotateX(value) {
|
|
2845
|
+
this.rotate.x = value;
|
|
2846
|
+
}
|
|
2847
|
+
get rotateY() {
|
|
2848
|
+
return this.rotate.y;
|
|
2849
|
+
}
|
|
2850
|
+
set rotateY(value) {
|
|
2851
|
+
this.rotate.y = value;
|
|
2852
|
+
}
|
|
2853
|
+
load(data) {
|
|
2854
|
+
var _a, _b, _c, _d;
|
|
2855
|
+
if (!data) {
|
|
2856
|
+
return;
|
|
2857
|
+
}
|
|
2858
|
+
if (data.distance !== undefined) {
|
|
2859
|
+
this.distance = setRangeValue(data.distance);
|
|
2860
|
+
}
|
|
2861
|
+
if (data.enable !== undefined) {
|
|
2862
|
+
this.enable = data.enable;
|
|
2863
|
+
}
|
|
2864
|
+
const rotateX = (_b = (_a = data.rotate) === null || _a === void 0 ? void 0 : _a.x) !== null && _b !== void 0 ? _b : data.rotateX;
|
|
2865
|
+
if (rotateX !== undefined) {
|
|
2866
|
+
this.rotate.x = rotateX;
|
|
2867
|
+
}
|
|
2868
|
+
const rotateY = (_d = (_c = data.rotate) === null || _c === void 0 ? void 0 : _c.y) !== null && _d !== void 0 ? _d : data.rotateY;
|
|
2869
|
+
if (rotateY !== undefined) {
|
|
2870
|
+
this.rotate.y = rotateY;
|
|
2871
|
+
}
|
|
2872
|
+
}
|
|
2873
|
+
}
|
|
2874
|
+
class MoveAngle_MoveAngle {
|
|
2875
|
+
constructor() {
|
|
2876
|
+
this.offset = 0;
|
|
2877
|
+
this.value = 90;
|
|
2878
|
+
}
|
|
2879
|
+
load(data) {
|
|
2880
|
+
if (data === undefined) {
|
|
2881
|
+
return;
|
|
2882
|
+
}
|
|
2883
|
+
if (data.offset !== undefined) {
|
|
2884
|
+
this.offset = setRangeValue(data.offset);
|
|
2885
|
+
}
|
|
2886
|
+
if (data.value !== undefined) {
|
|
2887
|
+
this.value = setRangeValue(data.value);
|
|
2888
|
+
}
|
|
2889
|
+
}
|
|
2890
|
+
}
|
|
2891
|
+
class MoveGravity_MoveGravity {
|
|
2892
|
+
constructor() {
|
|
2893
|
+
this.acceleration = 9.81;
|
|
2894
|
+
this.enable = false;
|
|
2895
|
+
this.inverse = false;
|
|
2896
|
+
this.maxSpeed = 50;
|
|
2897
|
+
}
|
|
2898
|
+
load(data) {
|
|
2899
|
+
if (!data) {
|
|
2900
|
+
return;
|
|
2901
|
+
}
|
|
2902
|
+
if (data.acceleration !== undefined) {
|
|
2903
|
+
this.acceleration = setRangeValue(data.acceleration);
|
|
2904
|
+
}
|
|
2905
|
+
if (data.enable !== undefined) {
|
|
2906
|
+
this.enable = data.enable;
|
|
2907
|
+
}
|
|
2908
|
+
if (data.inverse !== undefined) {
|
|
2909
|
+
this.inverse = data.inverse;
|
|
2910
|
+
}
|
|
2911
|
+
if (data.maxSpeed !== undefined) {
|
|
2912
|
+
this.maxSpeed = setRangeValue(data.maxSpeed);
|
|
2913
|
+
}
|
|
2914
|
+
}
|
|
2915
|
+
}
|
|
2835
2916
|
class PathDelay_PathDelay extends(null && ValueWithRandom){
|
|
2836
2917
|
constructor() {
|
|
2837
2918
|
super();
|
|
@@ -2993,6 +3074,70 @@
|
|
|
2993
3074
|
}
|
|
2994
3075
|
}
|
|
2995
3076
|
}
|
|
3077
|
+
class AnimationOptions_AnimationOptions {
|
|
3078
|
+
constructor() {
|
|
3079
|
+
this.count = 0;
|
|
3080
|
+
this.enable = false;
|
|
3081
|
+
this.speed = 1;
|
|
3082
|
+
this.sync = false;
|
|
3083
|
+
}
|
|
3084
|
+
load(data) {
|
|
3085
|
+
if (!data) {
|
|
3086
|
+
return;
|
|
3087
|
+
}
|
|
3088
|
+
if (data.count !== undefined) {
|
|
3089
|
+
this.count = setRangeValue(data.count);
|
|
3090
|
+
}
|
|
3091
|
+
if (data.enable !== undefined) {
|
|
3092
|
+
this.enable = data.enable;
|
|
3093
|
+
}
|
|
3094
|
+
if (data.speed !== undefined) {
|
|
3095
|
+
this.speed = setRangeValue(data.speed);
|
|
3096
|
+
}
|
|
3097
|
+
if (data.sync !== undefined) {
|
|
3098
|
+
this.sync = data.sync;
|
|
3099
|
+
}
|
|
3100
|
+
}
|
|
3101
|
+
}
|
|
3102
|
+
class OpacityAnimation_OpacityAnimation extends(null && AnimationOptions){
|
|
3103
|
+
constructor() {
|
|
3104
|
+
super();
|
|
3105
|
+
this.destroy = "none";
|
|
3106
|
+
this.enable = false;
|
|
3107
|
+
this.speed = 2;
|
|
3108
|
+
this.startValue = "random";
|
|
3109
|
+
this.sync = false;
|
|
3110
|
+
}
|
|
3111
|
+
get opacity_min() {
|
|
3112
|
+
return this.minimumValue;
|
|
3113
|
+
}
|
|
3114
|
+
set opacity_min(value) {
|
|
3115
|
+
this.minimumValue = value;
|
|
3116
|
+
}
|
|
3117
|
+
load(data) {
|
|
3118
|
+
var _a;
|
|
3119
|
+
if (data === undefined) {
|
|
3120
|
+
return;
|
|
3121
|
+
}
|
|
3122
|
+
super.load(data);
|
|
3123
|
+
if (data.destroy !== undefined) {
|
|
3124
|
+
this.destroy = data.destroy;
|
|
3125
|
+
}
|
|
3126
|
+
if (data.enable !== undefined) {
|
|
3127
|
+
this.enable = data.enable;
|
|
3128
|
+
}
|
|
3129
|
+
this.minimumValue = (_a = data.minimumValue) !== null && _a !== void 0 ? _a : data.opacity_min;
|
|
3130
|
+
if (data.speed !== undefined) {
|
|
3131
|
+
this.speed = data.speed;
|
|
3132
|
+
}
|
|
3133
|
+
if (data.startValue !== undefined) {
|
|
3134
|
+
this.startValue = data.startValue;
|
|
3135
|
+
}
|
|
3136
|
+
if (data.sync !== undefined) {
|
|
3137
|
+
this.sync = data.sync;
|
|
3138
|
+
}
|
|
3139
|
+
}
|
|
3140
|
+
}
|
|
2996
3141
|
class Opacity_Opacity extends(null && ValueWithRandom){
|
|
2997
3142
|
constructor() {
|
|
2998
3143
|
super();
|
|
@@ -3051,13 +3196,13 @@
|
|
|
3051
3196
|
this.enable = data.enable;
|
|
3052
3197
|
}
|
|
3053
3198
|
if (data.opacity !== undefined) {
|
|
3054
|
-
this.opacity = data.opacity;
|
|
3199
|
+
this.opacity = setRangeValue(data.opacity);
|
|
3055
3200
|
}
|
|
3056
3201
|
if (data.width !== undefined) {
|
|
3057
|
-
this.width = data.width;
|
|
3202
|
+
this.width = setRangeValue(data.width);
|
|
3058
3203
|
}
|
|
3059
3204
|
if (data.radius !== undefined) {
|
|
3060
|
-
this.radius = data.radius;
|
|
3205
|
+
this.radius = setRangeValue(data.radius);
|
|
3061
3206
|
}
|
|
3062
3207
|
if (data.color !== undefined) {
|
|
3063
3208
|
this.color = OptionsColor.create(this.color, data.color);
|
|
@@ -3082,16 +3227,33 @@
|
|
|
3082
3227
|
this.enabled = data.enabled;
|
|
3083
3228
|
}
|
|
3084
3229
|
if (data.distance !== undefined) {
|
|
3085
|
-
this.distance = data.distance;
|
|
3230
|
+
this.distance = setRangeValue(data.distance);
|
|
3086
3231
|
}
|
|
3087
3232
|
if (data.duration !== undefined) {
|
|
3088
|
-
this.duration = data.duration;
|
|
3233
|
+
this.duration = setRangeValue(data.duration);
|
|
3089
3234
|
}
|
|
3090
3235
|
if (data.factor !== undefined) {
|
|
3091
|
-
this.factor = data.factor;
|
|
3236
|
+
this.factor = setRangeValue(data.factor);
|
|
3092
3237
|
}
|
|
3093
3238
|
if (data.speed !== undefined) {
|
|
3094
|
-
this.speed = data.speed;
|
|
3239
|
+
this.speed = setRangeValue(data.speed);
|
|
3240
|
+
}
|
|
3241
|
+
}
|
|
3242
|
+
}
|
|
3243
|
+
class RollLight_RollLight {
|
|
3244
|
+
constructor() {
|
|
3245
|
+
this.enable = false;
|
|
3246
|
+
this.value = 0;
|
|
3247
|
+
}
|
|
3248
|
+
load(data) {
|
|
3249
|
+
if (!data) {
|
|
3250
|
+
return;
|
|
3251
|
+
}
|
|
3252
|
+
if (data.enable !== undefined) {
|
|
3253
|
+
this.enable = data.enable;
|
|
3254
|
+
}
|
|
3255
|
+
if (data.value !== undefined) {
|
|
3256
|
+
this.value = setRangeValue(data.value);
|
|
3095
3257
|
}
|
|
3096
3258
|
}
|
|
3097
3259
|
}
|
|
@@ -3123,6 +3285,27 @@
|
|
|
3123
3285
|
}
|
|
3124
3286
|
}
|
|
3125
3287
|
}
|
|
3288
|
+
class RotateAnimation_RotateAnimation {
|
|
3289
|
+
constructor() {
|
|
3290
|
+
this.enable = false;
|
|
3291
|
+
this.speed = 0;
|
|
3292
|
+
this.sync = false;
|
|
3293
|
+
}
|
|
3294
|
+
load(data) {
|
|
3295
|
+
if (data === undefined) {
|
|
3296
|
+
return;
|
|
3297
|
+
}
|
|
3298
|
+
if (data.enable !== undefined) {
|
|
3299
|
+
this.enable = data.enable;
|
|
3300
|
+
}
|
|
3301
|
+
if (data.speed !== undefined) {
|
|
3302
|
+
this.speed = setRangeValue(data.speed);
|
|
3303
|
+
}
|
|
3304
|
+
if (data.sync !== undefined) {
|
|
3305
|
+
this.sync = data.sync;
|
|
3306
|
+
}
|
|
3307
|
+
}
|
|
3308
|
+
}
|
|
3126
3309
|
class Rotate_Rotate extends(null && ValueWithRandom){
|
|
3127
3310
|
constructor() {
|
|
3128
3311
|
super();
|
|
@@ -3241,6 +3424,45 @@
|
|
|
3241
3424
|
}
|
|
3242
3425
|
}
|
|
3243
3426
|
}
|
|
3427
|
+
class SizeAnimation_SizeAnimation extends(null && AnimationOptions){
|
|
3428
|
+
constructor() {
|
|
3429
|
+
super();
|
|
3430
|
+
this.destroy = "none";
|
|
3431
|
+
this.enable = false;
|
|
3432
|
+
this.speed = 5;
|
|
3433
|
+
this.startValue = "random";
|
|
3434
|
+
this.sync = false;
|
|
3435
|
+
}
|
|
3436
|
+
get size_min() {
|
|
3437
|
+
return this.minimumValue;
|
|
3438
|
+
}
|
|
3439
|
+
set size_min(value) {
|
|
3440
|
+
this.minimumValue = value;
|
|
3441
|
+
}
|
|
3442
|
+
load(data) {
|
|
3443
|
+
var _a;
|
|
3444
|
+
if (data === undefined) {
|
|
3445
|
+
return;
|
|
3446
|
+
}
|
|
3447
|
+
super.load(data);
|
|
3448
|
+
if (data.destroy !== undefined) {
|
|
3449
|
+
this.destroy = data.destroy;
|
|
3450
|
+
}
|
|
3451
|
+
if (data.enable !== undefined) {
|
|
3452
|
+
this.enable = data.enable;
|
|
3453
|
+
}
|
|
3454
|
+
this.minimumValue = (_a = data.minimumValue) !== null && _a !== void 0 ? _a : data.size_min;
|
|
3455
|
+
if (data.speed !== undefined) {
|
|
3456
|
+
this.speed = data.speed;
|
|
3457
|
+
}
|
|
3458
|
+
if (data.startValue !== undefined) {
|
|
3459
|
+
this.startValue = data.startValue;
|
|
3460
|
+
}
|
|
3461
|
+
if (data.sync !== undefined) {
|
|
3462
|
+
this.sync = data.sync;
|
|
3463
|
+
}
|
|
3464
|
+
}
|
|
3465
|
+
}
|
|
3244
3466
|
class Size_Size extends(null && ValueWithRandom){
|
|
3245
3467
|
constructor() {
|
|
3246
3468
|
super();
|
|
@@ -3286,6 +3508,27 @@
|
|
|
3286
3508
|
}
|
|
3287
3509
|
}
|
|
3288
3510
|
}
|
|
3511
|
+
class TiltAnimation_TiltAnimation {
|
|
3512
|
+
constructor() {
|
|
3513
|
+
this.enable = false;
|
|
3514
|
+
this.speed = 0;
|
|
3515
|
+
this.sync = false;
|
|
3516
|
+
}
|
|
3517
|
+
load(data) {
|
|
3518
|
+
if (data === undefined) {
|
|
3519
|
+
return;
|
|
3520
|
+
}
|
|
3521
|
+
if (data.enable !== undefined) {
|
|
3522
|
+
this.enable = data.enable;
|
|
3523
|
+
}
|
|
3524
|
+
if (data.speed !== undefined) {
|
|
3525
|
+
this.speed = setRangeValue(data.speed);
|
|
3526
|
+
}
|
|
3527
|
+
if (data.sync !== undefined) {
|
|
3528
|
+
this.sync = data.sync;
|
|
3529
|
+
}
|
|
3530
|
+
}
|
|
3531
|
+
}
|
|
3289
3532
|
class Tilt_Tilt extends(null && ValueWithRandom){
|
|
3290
3533
|
constructor() {
|
|
3291
3534
|
super();
|
|
@@ -3308,6 +3551,43 @@
|
|
|
3308
3551
|
}
|
|
3309
3552
|
}
|
|
3310
3553
|
}
|
|
3554
|
+
class TwinkleValues_TwinkleValues {
|
|
3555
|
+
constructor() {
|
|
3556
|
+
this.enable = false;
|
|
3557
|
+
this.frequency = .05;
|
|
3558
|
+
this.opacity = 1;
|
|
3559
|
+
}
|
|
3560
|
+
load(data) {
|
|
3561
|
+
if (data === undefined) {
|
|
3562
|
+
return;
|
|
3563
|
+
}
|
|
3564
|
+
if (data.color !== undefined) {
|
|
3565
|
+
this.color = OptionsColor.create(this.color, data.color);
|
|
3566
|
+
}
|
|
3567
|
+
if (data.enable !== undefined) {
|
|
3568
|
+
this.enable = data.enable;
|
|
3569
|
+
}
|
|
3570
|
+
if (data.frequency !== undefined) {
|
|
3571
|
+
this.frequency = data.frequency;
|
|
3572
|
+
}
|
|
3573
|
+
if (data.opacity !== undefined) {
|
|
3574
|
+
this.opacity = setRangeValue(data.opacity);
|
|
3575
|
+
}
|
|
3576
|
+
}
|
|
3577
|
+
}
|
|
3578
|
+
class Twinkle_Twinkle {
|
|
3579
|
+
constructor() {
|
|
3580
|
+
this.lines = new TwinkleValues;
|
|
3581
|
+
this.particles = new TwinkleValues;
|
|
3582
|
+
}
|
|
3583
|
+
load(data) {
|
|
3584
|
+
if (data === undefined) {
|
|
3585
|
+
return;
|
|
3586
|
+
}
|
|
3587
|
+
this.lines.load(data.lines);
|
|
3588
|
+
this.particles.load(data.particles);
|
|
3589
|
+
}
|
|
3590
|
+
}
|
|
3311
3591
|
class Wobble_Wobble {
|
|
3312
3592
|
constructor() {
|
|
3313
3593
|
this.distance = 5;
|
|
@@ -3705,6 +3985,7 @@
|
|
|
3705
3985
|
this.retina = {
|
|
3706
3986
|
maxDistance: {}
|
|
3707
3987
|
};
|
|
3988
|
+
this.ignoresResizeRatio = true;
|
|
3708
3989
|
const pxRatio = container.retina.pixelRatio;
|
|
3709
3990
|
const mainOptions = container.actualOptions;
|
|
3710
3991
|
const particlesOptions = new ParticlesOptions;
|
|
@@ -3744,7 +4025,7 @@
|
|
|
3744
4025
|
max: getRangeMax(sizeRange) * pxRatio,
|
|
3745
4026
|
min: getRangeMin(sizeRange) * pxRatio,
|
|
3746
4027
|
loops: 0,
|
|
3747
|
-
maxLoops: sizeOptions.animation.count
|
|
4028
|
+
maxLoops: getRangeValue(sizeOptions.animation.count)
|
|
3748
4029
|
};
|
|
3749
4030
|
const sizeAnimation = sizeOptions.animation;
|
|
3750
4031
|
if (sizeAnimation.enable) {
|
|
@@ -3778,6 +4059,12 @@
|
|
|
3778
4059
|
this.initialVelocity = this.calculateVelocity();
|
|
3779
4060
|
this.velocity = this.initialVelocity.copy();
|
|
3780
4061
|
this.moveDecay = 1 - getRangeValue(this.options.move.decay);
|
|
4062
|
+
const gravityOptions = this.options.move.gravity;
|
|
4063
|
+
this.gravity = {
|
|
4064
|
+
enable: gravityOptions.enable,
|
|
4065
|
+
acceleration: getRangeValue(gravityOptions.acceleration),
|
|
4066
|
+
inverse: gravityOptions.inverse
|
|
4067
|
+
};
|
|
3781
4068
|
this.position = this.calcPosition(container, position, clamp(zIndexValue, 0, container.zLayers));
|
|
3782
4069
|
this.initialPosition = this.position.copy();
|
|
3783
4070
|
this.offset = Vector.origin;
|
|
@@ -3985,12 +4272,7 @@
|
|
|
3985
4272
|
return overlaps;
|
|
3986
4273
|
}
|
|
3987
4274
|
calculateVelocity() {
|
|
3988
|
-
const baseVelocity = getParticleBaseVelocity(this.direction)
|
|
3989
|
-
const res = baseVelocity.copy();
|
|
3990
|
-
const moveOptions = this.options.move;
|
|
3991
|
-
const rad = Math.PI / 180 * moveOptions.angle.value;
|
|
3992
|
-
const radOffset = Math.PI / 180 * moveOptions.angle.offset;
|
|
3993
|
-
const range = {
|
|
4275
|
+
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 = {
|
|
3994
4276
|
left: radOffset - rad / 2,
|
|
3995
4277
|
right: radOffset + rad / 2
|
|
3996
4278
|
};
|
|
@@ -4140,10 +4422,11 @@
|
|
|
4140
4422
|
}
|
|
4141
4423
|
for (const particle of this.array) {
|
|
4142
4424
|
const resizeFactor = container.canvas.resizeFactor;
|
|
4143
|
-
if (resizeFactor) {
|
|
4425
|
+
if (resizeFactor && !particle.ignoresResizeRatio) {
|
|
4144
4426
|
particle.position.x *= resizeFactor.width;
|
|
4145
4427
|
particle.position.y *= resizeFactor.height;
|
|
4146
4428
|
}
|
|
4429
|
+
particle.ignoresResizeRatio = false;
|
|
4147
4430
|
particle.bubble.inRange = false;
|
|
4148
4431
|
for (const [, plugin] of this.container.plugins) {
|
|
4149
4432
|
if (particle.destroyed) {
|
|
@@ -4379,13 +4662,13 @@
|
|
|
4379
4662
|
container.canvas.size.height = element.offsetHeight * ratio;
|
|
4380
4663
|
}
|
|
4381
4664
|
const particles = options.particles;
|
|
4382
|
-
this.attractDistance = particles.move.attract.distance * ratio;
|
|
4665
|
+
this.attractDistance = getRangeValue(particles.move.attract.distance) * ratio;
|
|
4383
4666
|
this.linksDistance = particles.links.distance * ratio;
|
|
4384
4667
|
this.linksWidth = particles.links.width * ratio;
|
|
4385
|
-
this.sizeAnimationSpeed = particles.size.animation.speed * ratio;
|
|
4386
|
-
this.maxSpeed = particles.move.gravity.maxSpeed * ratio;
|
|
4668
|
+
this.sizeAnimationSpeed = getRangeValue(particles.size.animation.speed) * ratio;
|
|
4669
|
+
this.maxSpeed = getRangeValue(particles.move.gravity.maxSpeed) * ratio;
|
|
4387
4670
|
if (particles.orbit.radius !== undefined) {
|
|
4388
|
-
this.orbitRadius = particles.orbit.radius * this.container.retina.pixelRatio;
|
|
4671
|
+
this.orbitRadius = getRangeValue(particles.orbit.radius) * this.container.retina.pixelRatio;
|
|
4389
4672
|
}
|
|
4390
4673
|
const modes = options.interactivity.modes;
|
|
4391
4674
|
this.connectModeDistance = modes.connect.distance * ratio;
|
|
@@ -4405,19 +4688,19 @@
|
|
|
4405
4688
|
const ratio = this.pixelRatio;
|
|
4406
4689
|
const moveDistance = options.move.distance;
|
|
4407
4690
|
const props = particle.retina;
|
|
4408
|
-
props.attractDistance = options.move.attract.distance * ratio;
|
|
4691
|
+
props.attractDistance = getRangeValue(options.move.attract.distance) * ratio;
|
|
4409
4692
|
props.linksDistance = options.links.distance * ratio;
|
|
4410
4693
|
props.linksWidth = options.links.width * ratio;
|
|
4411
4694
|
props.moveDrift = getRangeValue(options.move.drift) * ratio;
|
|
4412
4695
|
props.moveSpeed = getRangeValue(options.move.speed) * ratio;
|
|
4413
|
-
props.sizeAnimationSpeed = options.size.animation.speed * ratio;
|
|
4696
|
+
props.sizeAnimationSpeed = getRangeValue(options.size.animation.speed) * ratio;
|
|
4414
4697
|
if (particle.spin) {
|
|
4415
4698
|
props.spinAcceleration = getRangeValue(options.move.spin.acceleration) * ratio;
|
|
4416
4699
|
}
|
|
4417
4700
|
const maxDistance = props.maxDistance;
|
|
4418
4701
|
maxDistance.horizontal = moveDistance.horizontal !== undefined ? moveDistance.horizontal * ratio : undefined;
|
|
4419
4702
|
maxDistance.vertical = moveDistance.vertical !== undefined ? moveDistance.vertical * ratio : undefined;
|
|
4420
|
-
props.maxSpeed = options.move.gravity.maxSpeed * ratio;
|
|
4703
|
+
props.maxSpeed = getRangeValue(options.move.gravity.maxSpeed) * ratio;
|
|
4421
4704
|
}
|
|
4422
4705
|
handleMotionChange(mediaQuery) {
|
|
4423
4706
|
const options = this.container.actualOptions;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! tsParticles v1.
|
|
1
|
+
/*! tsParticles v1.42.0 by Matteo Bruni */
|
|
2
2
|
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var o in n)("object"==typeof exports?exports:t)[o]=n[o]}}(window,(function(){return function(){"use strict";var t={d:function(e,n){for(var o in n)t.o(n,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:n[o]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r:function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t,e){const n=t.x-e.x,o=t.y-e.y;return{dx:n,dy:o,distance:Math.sqrt(n*n+o*o)}}function o(t,e){switch(e){case"ease-out-quad":return 1-(1-t)**2;case"ease-out-cubic":return 1-(1-t)**3;case"ease-out-quart":return 1-(1-t)**4;case"ease-out-quint":return 1-(1-t)**5;case"ease-out-expo":return 1===t?1:1-Math.pow(2,-10*t);case"ease-out-sine":return Math.sin(t*Math.PI/2);case"ease-out-back":{const e=1.70158;return 1+(e+1)*Math.pow(t-1,3)+e*Math.pow(t-1,2)}case"ease-out-circ":return Math.sqrt(1-Math.pow(t-1,2));default:return t}}function a(t,e){return t===e||e instanceof Array&&e.indexOf(t)>-1}t.r(e),t.d(e,{loadExternalAttractInteraction:function(){return u}});class i extends class{constructor(t,e){this.position={x:t,y:e}}}{constructor(t,e,n){super(t,e),this.radius=n}contains(t){return e=t,o=this.position,n(e,o).distance<=this.radius;var e,o}intersects(t){const e=t,n=t,o=this.position,a=t.position,i=Math.abs(a.x-o.x),r=Math.abs(a.y-o.y),s=this.radius;if(void 0!==n.radius){return s+n.radius>Math.sqrt(i*i+r+r)}if(void 0!==e.size){const t=e.size.width,n=e.size.height,o=Math.pow(i-t,2)+Math.pow(r-n,2);return!(i>s+t||r>s+n)&&(i<=t||r<=n||o<=s*s)}return!1}}class r{}r.generatedAttribute="generated",r.randomColorValue="random",r.midColorValue="mid",r.touchEndEvent="touchend",r.mouseDownEvent="mousedown",r.mouseUpEvent="mouseup",r.mouseMoveEvent="mousemove",r.touchStartEvent="touchstart",r.touchMoveEvent="touchmove",r.mouseLeaveEvent="mouseleave",r.mouseOutEvent="mouseout",r.touchCancelEvent="touchcancel",r.resizeEvent="resize",r.visibilityChangeEvent="visibilitychange",r.noPolygonDataLoaded="No polygon data loaded.",r.noPolygonFound="No polygon found, you need to specify SVG url in config.";new WeakMap;new WeakMap;class s{constructor(t,e){let n,o;if(void 0===e){if("number"==typeof t)throw new Error("tsParticles - Vector not initialized correctly");const e=t;[n,o]=[e.x,e.y]}else[n,o]=[t,e];this.x=n,this.y=o}static clone(t){return s.create(t.x,t.y)}static create(t,e){return new s(t,e)}static get origin(){return s.create(0,0)}get angle(){return Math.atan2(this.y,this.x)}set angle(t){this.updateFromAngle(t,this.length)}get length(){return Math.sqrt(this.x**2+this.y**2)}set length(t){this.updateFromAngle(this.angle,t)}add(t){return s.create(this.x+t.x,this.y+t.y)}addTo(t){this.x+=t.x,this.y+=t.y}sub(t){return s.create(this.x-t.x,this.y-t.y)}subFrom(t){this.x-=t.x,this.y-=t.y}mult(t){return s.create(this.x*t,this.y*t)}multTo(t){this.x*=t,this.y*=t}div(t){return s.create(this.x/t,this.y/t)}divTo(t){this.x/=t,this.y/=t}distanceTo(t){return this.sub(t).length}getLengthSq(){return this.x**2+this.y**2}distanceToSq(t){return this.sub(t).getLengthSq()}manhattanDistanceTo(t){return Math.abs(t.x-this.x)+Math.abs(t.y-this.y)}copy(){return s.clone(this)}setTo(t){this.x=t.x,this.y=t.y}rotate(t){return s.create(this.x*Math.cos(t)-this.y*Math.sin(t),this.x*Math.sin(t)+this.y*Math.cos(t))}updateFromAngle(t,e){this.x=Math.cos(t)*e,this.y=Math.sin(t)*e}}new WeakMap,new WeakSet;new WeakMap;new WeakMap;new WeakMap;new WeakMap;class c extends class{constructor(t){this.container=t,this.type=0}}{constructor(t){super(t)}isEnabled(){const t=this.container,e=t.actualOptions,n=t.interactivity.mouse,o=e.interactivity.events;if(!(n.position&&o.onHover.enable||n.clickPosition&&o.onClick.enable))return!1;const i=o.onHover.mode,r=o.onClick.mode;return a("attract",i)||a("attract",r)}reset(){}async interact(){const t=this.container,e=t.actualOptions,n=t.interactivity.status===r.mouseMoveEvent,o=e.interactivity.events,i=o.onHover.enable,s=o.onHover.mode,c=o.onClick.enable,u=o.onClick.mode;n&&i&&a("attract",s)?this.hoverAttract():c&&a("attract",u)&&this.clickAttract()}hoverAttract(){const t=this.container,e=t.interactivity.mouse.position;if(!e)return;const n=t.retina.attractModeDistance;this.processAttract(e,n,new i(e.x,e.y,n))}processAttract(t,e,a){const i=this.container,r=i.actualOptions.interactivity.modes.attract,c=i.particles.quadTree.query(a);for(const a of c){const{dx:i,dy:c,distance:l}=n(a.position,t),y=r.speed*r.factor,p=(u=o(1-l/e,r.easing)*y,h=0,d=r.maxSpeed,Math.min(Math.max(u,h),d)),v=s.create(0===l?y:i/l*p,0===l?y:c/l*p);a.position.subFrom(v)}var u,h,d}clickAttract(){const t=this.container;if(t.attract.finish||(t.attract.count||(t.attract.count=0),t.attract.count++,t.attract.count===t.particles.count&&(t.attract.finish=!0)),t.attract.clicking){const e=t.interactivity.mouse.clickPosition;if(!e)return;const n=t.retina.attractModeDistance;this.processAttract(e,n,new i(e.x,e.y,n))}else!1===t.attract.clicking&&(t.attract.particles=[])}}async function u(t){await t.addInteractor("externalAttract",(t=>new c(t)))}return e}()}));
|