tsparticles 1.41.6 → 1.42.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Core/Canvas.d.ts +1 -1
- package/Core/Canvas.js +8 -4
- package/Core/Interfaces/ICoordinates.d.ts +8 -0
- package/Core/Interfaces/IParticleGravity.d.ts +5 -0
- package/Core/Interfaces/IParticleGravity.js +2 -0
- package/Core/Interfaces/index.d.ts +1 -0
- package/Core/Interfaces/index.js +1 -0
- package/Core/Particle.d.ts +2 -1
- package/Core/Particle.js +8 -7
- package/Core/Retina.js +7 -7
- package/Core/Utils/ParticlesMover.js +2 -2
- package/Interactions/Particles/Links/LinkInstance.js +1 -1
- package/Options/Classes/AnimatableGradient.d.ts +4 -4
- package/Options/Classes/AnimatableGradient.js +4 -4
- package/Options/Classes/AnimationOptions.d.ts +5 -5
- package/Options/Classes/AnimationOptions.js +3 -2
- package/Options/Classes/ColorAnimation.d.ts +2 -2
- package/Options/Classes/ColorAnimation.js +2 -2
- package/Options/Classes/Particles/Move/Attract.d.ts +2 -2
- package/Options/Classes/Particles/Move/Attract.js +2 -1
- package/Options/Classes/Particles/Move/MoveAngle.d.ts +3 -3
- package/Options/Classes/Particles/Move/MoveAngle.js +3 -2
- package/Options/Classes/Particles/Move/MoveGravity.d.ts +5 -5
- package/Options/Classes/Particles/Move/MoveGravity.js +3 -2
- package/Options/Classes/Particles/Orbit/Orbit.d.ts +4 -4
- package/Options/Classes/Particles/Orbit/Orbit.js +4 -3
- package/Options/Classes/Particles/Repulse/Repulse.d.ts +5 -5
- package/Options/Classes/Particles/Repulse/Repulse.js +5 -4
- package/Options/Classes/Particles/Roll/RollLight.d.ts +2 -2
- package/Options/Classes/Particles/Roll/RollLight.js +2 -1
- package/Options/Classes/Particles/Rotate/RotateAnimation.d.ts +2 -2
- package/Options/Classes/Particles/Rotate/RotateAnimation.js +2 -1
- package/Options/Classes/Particles/Tilt/TiltAnimation.d.ts +2 -2
- package/Options/Classes/Particles/Tilt/TiltAnimation.js +2 -1
- package/Options/Classes/Particles/Twinkle/TwinkleValues.d.ts +2 -2
- package/Options/Classes/Particles/Twinkle/TwinkleValues.js +2 -1
- package/Options/Interfaces/IAnimation.d.ts +3 -2
- package/Options/Interfaces/Particles/Move/IAttract.d.ts +3 -2
- package/Options/Interfaces/Particles/Move/IMoveAngle.d.ts +3 -2
- package/Options/Interfaces/Particles/Move/IMoveGravity.d.ts +3 -2
- package/Options/Interfaces/Particles/Orbit/IOrbit.d.ts +4 -3
- package/Options/Interfaces/Particles/Repulse/IRepulse.d.ts +5 -4
- package/Options/Interfaces/Particles/Roll/IRollLight.d.ts +2 -1
- package/Options/Interfaces/Particles/Rotate/IRotateAnimation.d.ts +2 -1
- package/Options/Interfaces/Particles/Tilt/ITiltAnimation.d.ts +2 -1
- package/Options/Interfaces/Particles/Twinkle/ITwinkleValues.d.ts +3 -2
- package/Plugins/Absorbers/AbsorberInstance.js +1 -1
- package/Plugins/Absorbers/Options/Classes/Absorber.d.ts +2 -2
- package/Plugins/Absorbers/Options/Classes/Absorber.js +8 -4
- package/Plugins/Absorbers/Options/Interfaces/IAbsorber.d.ts +2 -2
- package/Plugins/Emitters/EmitterInstance.js +3 -3
- package/Plugins/Emitters/Options/Classes/Emitter.d.ts +2 -2
- package/Plugins/Emitters/Options/Classes/Emitter.js +8 -5
- package/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +2 -2
- package/Updaters/Angle/AngleUpdater.js +2 -1
- package/Updaters/Opacity/OpacityUpdater.js +3 -2
- package/Updaters/Roll/RollUpdater.js +3 -3
- package/Updaters/Tilt/TiltUpdater.js +1 -1
- package/Utils/ColorUtils.js +1 -1
- package/browser/Core/Canvas.d.ts +1 -1
- package/browser/Core/Canvas.js +9 -5
- package/browser/Core/Interfaces/ICoordinates.d.ts +8 -0
- package/browser/Core/Interfaces/IParticleGravity.d.ts +5 -0
- package/browser/Core/Interfaces/IParticleGravity.js +1 -0
- package/browser/Core/Interfaces/index.d.ts +1 -0
- package/browser/Core/Interfaces/index.js +1 -0
- package/browser/Core/Particle.d.ts +2 -1
- package/browser/Core/Particle.js +8 -7
- package/browser/Core/Retina.js +7 -7
- package/browser/Core/Utils/ParticlesMover.js +2 -2
- package/browser/Interactions/Particles/Links/LinkInstance.js +2 -2
- package/browser/Options/Classes/AnimatableGradient.d.ts +4 -4
- package/browser/Options/Classes/AnimatableGradient.js +4 -4
- package/browser/Options/Classes/AnimationOptions.d.ts +5 -5
- package/browser/Options/Classes/AnimationOptions.js +3 -2
- package/browser/Options/Classes/ColorAnimation.d.ts +2 -2
- package/browser/Options/Classes/ColorAnimation.js +2 -2
- package/browser/Options/Classes/Particles/Move/Attract.d.ts +2 -2
- package/browser/Options/Classes/Particles/Move/Attract.js +2 -1
- package/browser/Options/Classes/Particles/Move/MoveAngle.d.ts +3 -3
- package/browser/Options/Classes/Particles/Move/MoveAngle.js +3 -2
- package/browser/Options/Classes/Particles/Move/MoveGravity.d.ts +5 -5
- package/browser/Options/Classes/Particles/Move/MoveGravity.js +3 -2
- package/browser/Options/Classes/Particles/Orbit/Orbit.d.ts +4 -4
- package/browser/Options/Classes/Particles/Orbit/Orbit.js +4 -3
- package/browser/Options/Classes/Particles/Repulse/Repulse.d.ts +5 -5
- package/browser/Options/Classes/Particles/Repulse/Repulse.js +5 -4
- package/browser/Options/Classes/Particles/Roll/RollLight.d.ts +2 -2
- package/browser/Options/Classes/Particles/Roll/RollLight.js +2 -1
- package/browser/Options/Classes/Particles/Rotate/RotateAnimation.d.ts +2 -2
- package/browser/Options/Classes/Particles/Rotate/RotateAnimation.js +2 -1
- package/browser/Options/Classes/Particles/Tilt/TiltAnimation.d.ts +2 -2
- package/browser/Options/Classes/Particles/Tilt/TiltAnimation.js +2 -1
- package/browser/Options/Classes/Particles/Twinkle/TwinkleValues.d.ts +2 -2
- package/browser/Options/Classes/Particles/Twinkle/TwinkleValues.js +2 -1
- package/browser/Options/Interfaces/IAnimation.d.ts +3 -2
- package/browser/Options/Interfaces/Particles/Move/IAttract.d.ts +3 -2
- package/browser/Options/Interfaces/Particles/Move/IMoveAngle.d.ts +3 -2
- package/browser/Options/Interfaces/Particles/Move/IMoveGravity.d.ts +3 -2
- package/browser/Options/Interfaces/Particles/Orbit/IOrbit.d.ts +4 -3
- package/browser/Options/Interfaces/Particles/Repulse/IRepulse.d.ts +5 -4
- package/browser/Options/Interfaces/Particles/Roll/IRollLight.d.ts +2 -1
- package/browser/Options/Interfaces/Particles/Rotate/IRotateAnimation.d.ts +2 -1
- package/browser/Options/Interfaces/Particles/Tilt/ITiltAnimation.d.ts +2 -1
- package/browser/Options/Interfaces/Particles/Twinkle/ITwinkleValues.d.ts +3 -2
- package/browser/Plugins/Absorbers/AbsorberInstance.js +1 -1
- package/browser/Plugins/Absorbers/Options/Classes/Absorber.d.ts +2 -2
- package/browser/Plugins/Absorbers/Options/Classes/Absorber.js +8 -4
- package/browser/Plugins/Absorbers/Options/Interfaces/IAbsorber.d.ts +2 -2
- package/browser/Plugins/Emitters/EmitterInstance.js +3 -3
- package/browser/Plugins/Emitters/Options/Classes/Emitter.d.ts +2 -2
- package/browser/Plugins/Emitters/Options/Classes/Emitter.js +8 -5
- package/browser/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +2 -2
- package/browser/Updaters/Angle/AngleUpdater.js +2 -1
- package/browser/Updaters/Opacity/OpacityUpdater.js +3 -2
- package/browser/Updaters/Roll/RollUpdater.js +3 -3
- package/browser/Updaters/Tilt/TiltUpdater.js +1 -1
- package/browser/Utils/ColorUtils.js +2 -2
- package/esm/Core/Canvas.d.ts +1 -1
- package/esm/Core/Canvas.js +9 -5
- package/esm/Core/Interfaces/ICoordinates.d.ts +8 -0
- package/esm/Core/Interfaces/IParticleGravity.d.ts +5 -0
- package/esm/Core/Interfaces/IParticleGravity.js +1 -0
- package/esm/Core/Interfaces/index.d.ts +1 -0
- package/esm/Core/Interfaces/index.js +1 -0
- package/esm/Core/Particle.d.ts +2 -1
- package/esm/Core/Particle.js +8 -7
- package/esm/Core/Retina.js +7 -7
- package/esm/Core/Utils/ParticlesMover.js +2 -2
- package/esm/Interactions/Particles/Links/LinkInstance.js +2 -2
- package/esm/Options/Classes/AnimatableGradient.d.ts +4 -4
- package/esm/Options/Classes/AnimatableGradient.js +4 -4
- package/esm/Options/Classes/AnimationOptions.d.ts +5 -5
- package/esm/Options/Classes/AnimationOptions.js +3 -2
- package/esm/Options/Classes/ColorAnimation.d.ts +2 -2
- package/esm/Options/Classes/ColorAnimation.js +2 -2
- package/esm/Options/Classes/Particles/Move/Attract.d.ts +2 -2
- package/esm/Options/Classes/Particles/Move/Attract.js +2 -1
- package/esm/Options/Classes/Particles/Move/MoveAngle.d.ts +3 -3
- package/esm/Options/Classes/Particles/Move/MoveAngle.js +3 -2
- package/esm/Options/Classes/Particles/Move/MoveGravity.d.ts +5 -5
- package/esm/Options/Classes/Particles/Move/MoveGravity.js +3 -2
- package/esm/Options/Classes/Particles/Orbit/Orbit.d.ts +4 -4
- package/esm/Options/Classes/Particles/Orbit/Orbit.js +4 -3
- package/esm/Options/Classes/Particles/Repulse/Repulse.d.ts +5 -5
- package/esm/Options/Classes/Particles/Repulse/Repulse.js +5 -4
- package/esm/Options/Classes/Particles/Roll/RollLight.d.ts +2 -2
- package/esm/Options/Classes/Particles/Roll/RollLight.js +2 -1
- package/esm/Options/Classes/Particles/Rotate/RotateAnimation.d.ts +2 -2
- package/esm/Options/Classes/Particles/Rotate/RotateAnimation.js +2 -1
- package/esm/Options/Classes/Particles/Tilt/TiltAnimation.d.ts +2 -2
- package/esm/Options/Classes/Particles/Tilt/TiltAnimation.js +2 -1
- package/esm/Options/Classes/Particles/Twinkle/TwinkleValues.d.ts +2 -2
- package/esm/Options/Classes/Particles/Twinkle/TwinkleValues.js +2 -1
- package/esm/Options/Interfaces/IAnimation.d.ts +3 -2
- package/esm/Options/Interfaces/Particles/Move/IAttract.d.ts +3 -2
- package/esm/Options/Interfaces/Particles/Move/IMoveAngle.d.ts +3 -2
- package/esm/Options/Interfaces/Particles/Move/IMoveGravity.d.ts +3 -2
- package/esm/Options/Interfaces/Particles/Orbit/IOrbit.d.ts +4 -3
- package/esm/Options/Interfaces/Particles/Repulse/IRepulse.d.ts +5 -4
- package/esm/Options/Interfaces/Particles/Roll/IRollLight.d.ts +2 -1
- package/esm/Options/Interfaces/Particles/Rotate/IRotateAnimation.d.ts +2 -1
- package/esm/Options/Interfaces/Particles/Tilt/ITiltAnimation.d.ts +2 -1
- package/esm/Options/Interfaces/Particles/Twinkle/ITwinkleValues.d.ts +3 -2
- package/esm/Plugins/Absorbers/AbsorberInstance.js +1 -1
- package/esm/Plugins/Absorbers/Options/Classes/Absorber.d.ts +2 -2
- package/esm/Plugins/Absorbers/Options/Classes/Absorber.js +8 -4
- package/esm/Plugins/Absorbers/Options/Interfaces/IAbsorber.d.ts +2 -2
- package/esm/Plugins/Emitters/EmitterInstance.js +3 -3
- package/esm/Plugins/Emitters/Options/Classes/Emitter.d.ts +2 -2
- package/esm/Plugins/Emitters/Options/Classes/Emitter.js +8 -5
- package/esm/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +2 -2
- package/esm/Updaters/Angle/AngleUpdater.js +2 -1
- package/esm/Updaters/Opacity/OpacityUpdater.js +3 -2
- package/esm/Updaters/Roll/RollUpdater.js +3 -3
- package/esm/Updaters/Tilt/TiltUpdater.js +1 -1
- package/esm/Utils/ColorUtils.js +2 -2
- package/package.json +15 -3
- package/report.html +2 -2
- package/report.slim.html +2 -2
- package/scripts/install.js +11 -2
- package/tsparticles.engine.js +48 -45
- package/tsparticles.engine.min.js +2 -2
- package/tsparticles.interaction.external.attract.js +320 -34
- package/tsparticles.interaction.external.attract.min.js +1 -1
- package/tsparticles.interaction.external.bounce.js +320 -34
- package/tsparticles.interaction.external.bounce.min.js +1 -1
- package/tsparticles.interaction.external.bubble.js +320 -34
- package/tsparticles.interaction.external.bubble.min.js +1 -1
- package/tsparticles.interaction.external.connect.js +320 -34
- package/tsparticles.interaction.external.connect.min.js +1 -1
- package/tsparticles.interaction.external.grab.js +320 -34
- package/tsparticles.interaction.external.grab.min.js +1 -1
- package/tsparticles.interaction.external.repulse.js +320 -34
- package/tsparticles.interaction.external.repulse.min.js +1 -1
- package/tsparticles.interaction.external.trail.js +320 -34
- package/tsparticles.interaction.external.trail.min.js +1 -1
- package/tsparticles.interaction.particles.attract.js +320 -34
- package/tsparticles.interaction.particles.attract.min.js +1 -1
- package/tsparticles.interaction.particles.collisions.js +320 -34
- package/tsparticles.interaction.particles.collisions.min.js +1 -1
- package/tsparticles.interaction.particles.links.js +321 -35
- package/tsparticles.interaction.particles.links.min.js +2 -2
- package/tsparticles.js +74 -65
- package/tsparticles.min.js +2 -2
- package/tsparticles.pathseg.min.js +1 -1
- package/tsparticles.plugins.absorbers.js +328 -39
- package/tsparticles.plugins.absorbers.min.js +2 -2
- package/tsparticles.plugins.emitters.js +431 -142
- package/tsparticles.plugins.emitters.min.js +2 -2
- package/tsparticles.plugins.polygonMask.js +320 -34
- package/tsparticles.plugins.polygonMask.min.js +1 -1
- package/tsparticles.shape.circle.min.js +1 -1
- package/tsparticles.shape.image.js +320 -34
- package/tsparticles.shape.image.min.js +1 -1
- package/tsparticles.shape.line.min.js +1 -1
- package/tsparticles.shape.polygon.min.js +1 -1
- package/tsparticles.shape.square.min.js +1 -1
- package/tsparticles.shape.star.min.js +1 -1
- package/tsparticles.shape.text.js +320 -34
- package/tsparticles.shape.text.min.js +1 -1
- package/tsparticles.slim.js +52 -49
- package/tsparticles.slim.min.js +2 -2
- package/tsparticles.updater.angle.js +321 -35
- package/tsparticles.updater.angle.min.js +2 -2
- package/tsparticles.updater.color.js +320 -34
- package/tsparticles.updater.color.min.js +2 -2
- package/tsparticles.updater.life.js +320 -34
- package/tsparticles.updater.life.min.js +1 -1
- package/tsparticles.updater.opacity.js +322 -36
- package/tsparticles.updater.opacity.min.js +2 -2
- package/tsparticles.updater.outModes.js +320 -34
- package/tsparticles.updater.outModes.min.js +1 -1
- package/tsparticles.updater.roll.js +323 -37
- package/tsparticles.updater.roll.min.js +2 -2
- package/tsparticles.updater.size.js +320 -34
- package/tsparticles.updater.size.min.js +1 -1
- package/tsparticles.updater.strokeColor.js +320 -34
- package/tsparticles.updater.strokeColor.min.js +2 -2
- package/tsparticles.updater.tilt.js +321 -35
- package/tsparticles.updater.tilt.min.js +2 -2
- package/tsparticles.updater.wobble.js +320 -34
- package/tsparticles.updater.wobble.min.js +1 -1
- package/umd/Core/Canvas.d.ts +1 -1
- package/umd/Core/Canvas.js +8 -4
- package/umd/Core/Interfaces/ICoordinates.d.ts +8 -0
- package/umd/Core/Interfaces/IParticleGravity.d.ts +5 -0
- package/umd/Core/Interfaces/IParticleGravity.js +12 -0
- package/umd/Core/Interfaces/index.d.ts +1 -0
- package/umd/Core/Interfaces/index.js +2 -1
- package/umd/Core/Particle.d.ts +2 -1
- package/umd/Core/Particle.js +8 -7
- package/umd/Core/Retina.js +7 -7
- package/umd/Core/Utils/ParticlesMover.js +2 -2
- package/umd/Interactions/Particles/Links/LinkInstance.js +1 -1
- package/umd/Options/Classes/AnimatableGradient.d.ts +4 -4
- package/umd/Options/Classes/AnimatableGradient.js +4 -4
- package/umd/Options/Classes/AnimationOptions.d.ts +5 -5
- package/umd/Options/Classes/AnimationOptions.js +4 -3
- package/umd/Options/Classes/ColorAnimation.d.ts +2 -2
- package/umd/Options/Classes/ColorAnimation.js +2 -2
- package/umd/Options/Classes/Particles/Move/Attract.d.ts +2 -2
- package/umd/Options/Classes/Particles/Move/Attract.js +3 -2
- package/umd/Options/Classes/Particles/Move/MoveAngle.d.ts +3 -3
- package/umd/Options/Classes/Particles/Move/MoveAngle.js +4 -3
- package/umd/Options/Classes/Particles/Move/MoveGravity.d.ts +5 -5
- package/umd/Options/Classes/Particles/Move/MoveGravity.js +4 -3
- package/umd/Options/Classes/Particles/Orbit/Orbit.d.ts +4 -4
- package/umd/Options/Classes/Particles/Orbit/Orbit.js +5 -4
- package/umd/Options/Classes/Particles/Repulse/Repulse.d.ts +5 -5
- package/umd/Options/Classes/Particles/Repulse/Repulse.js +6 -5
- package/umd/Options/Classes/Particles/Roll/RollLight.d.ts +2 -2
- package/umd/Options/Classes/Particles/Roll/RollLight.js +3 -2
- package/umd/Options/Classes/Particles/Rotate/RotateAnimation.d.ts +2 -2
- package/umd/Options/Classes/Particles/Rotate/RotateAnimation.js +3 -2
- package/umd/Options/Classes/Particles/Tilt/TiltAnimation.d.ts +2 -2
- package/umd/Options/Classes/Particles/Tilt/TiltAnimation.js +3 -2
- package/umd/Options/Classes/Particles/Twinkle/TwinkleValues.d.ts +2 -2
- package/umd/Options/Classes/Particles/Twinkle/TwinkleValues.js +3 -2
- package/umd/Options/Interfaces/IAnimation.d.ts +3 -2
- package/umd/Options/Interfaces/Particles/Move/IAttract.d.ts +3 -2
- package/umd/Options/Interfaces/Particles/Move/IMoveAngle.d.ts +3 -2
- package/umd/Options/Interfaces/Particles/Move/IMoveGravity.d.ts +3 -2
- package/umd/Options/Interfaces/Particles/Orbit/IOrbit.d.ts +4 -3
- package/umd/Options/Interfaces/Particles/Repulse/IRepulse.d.ts +5 -4
- package/umd/Options/Interfaces/Particles/Roll/IRollLight.d.ts +2 -1
- package/umd/Options/Interfaces/Particles/Rotate/IRotateAnimation.d.ts +2 -1
- package/umd/Options/Interfaces/Particles/Tilt/ITiltAnimation.d.ts +2 -1
- package/umd/Options/Interfaces/Particles/Twinkle/ITwinkleValues.d.ts +3 -2
- package/umd/Plugins/Absorbers/AbsorberInstance.js +1 -1
- package/umd/Plugins/Absorbers/Options/Classes/Absorber.d.ts +2 -2
- package/umd/Plugins/Absorbers/Options/Classes/Absorber.js +9 -5
- package/umd/Plugins/Absorbers/Options/Interfaces/IAbsorber.d.ts +2 -2
- package/umd/Plugins/Emitters/EmitterInstance.js +3 -3
- package/umd/Plugins/Emitters/Options/Classes/Emitter.d.ts +2 -2
- package/umd/Plugins/Emitters/Options/Classes/Emitter.js +9 -6
- package/umd/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +2 -2
- package/umd/Updaters/Angle/AngleUpdater.js +2 -1
- package/umd/Updaters/Opacity/OpacityUpdater.js +3 -2
- package/umd/Updaters/Roll/RollUpdater.js +3 -3
- package/umd/Updaters/Tilt/TiltUpdater.js +1 -1
- package/umd/Utils/ColorUtils.js +1 -1
|
@@ -799,7 +799,7 @@
|
|
|
799
799
|
function setColorAnimation(colorValue, colorAnimation, reduceFactor) {
|
|
800
800
|
colorValue.enable = colorAnimation.enable;
|
|
801
801
|
if (colorValue.enable) {
|
|
802
|
-
colorValue.velocity = colorAnimation.speed / 100 * reduceFactor;
|
|
802
|
+
colorValue.velocity = getRangeValue(colorAnimation.speed) / 100 * reduceFactor;
|
|
803
803
|
if (colorAnimation.sync) {
|
|
804
804
|
return;
|
|
805
805
|
}
|
|
@@ -1674,7 +1674,7 @@
|
|
|
1674
1674
|
}
|
|
1675
1675
|
const container = this.container, slowFactor = this.getProximitySpeedFactor(particle), baseSpeed = ((_a = (_d = particle.retina).moveSpeed) !== null && _a !== void 0 ? _a : _d.moveSpeed = getRangeValue(moveOptions.speed) * container.retina.pixelRatio) * container.retina.reduceFactor, moveDrift = (_b = (_e = particle.retina).moveDrift) !== null && _b !== void 0 ? _b : _e.moveDrift = getRangeValue(particle.options.move.drift) * container.retina.pixelRatio, maxSize = getRangeMax(particleOptions.size.value) * container.retina.pixelRatio, sizeFactor = moveOptions.size ? particle.getRadius() / maxSize : 1, diffFactor = 2, speedFactor = sizeFactor * slowFactor * (delta.factor || 1) / diffFactor, moveSpeed = baseSpeed * speedFactor;
|
|
1676
1676
|
this.applyPath(particle, delta);
|
|
1677
|
-
const gravityOptions =
|
|
1677
|
+
const gravityOptions = particle.gravity;
|
|
1678
1678
|
const gravityFactor = gravityOptions.enable && gravityOptions.inverse ? -1 : 1;
|
|
1679
1679
|
if (gravityOptions.enable && moveSpeed) {
|
|
1680
1680
|
particle.velocity.y += gravityFactor * (gravityOptions.acceleration * delta.factor) / (60 * moveSpeed);
|
|
@@ -1688,7 +1688,7 @@
|
|
|
1688
1688
|
}
|
|
1689
1689
|
const velocity = particle.velocity.mult(moveSpeed);
|
|
1690
1690
|
const maxSpeed = (_c = particle.retina.maxSpeed) !== null && _c !== void 0 ? _c : container.retina.maxSpeed;
|
|
1691
|
-
if (gravityOptions.enable &&
|
|
1691
|
+
if (gravityOptions.enable && maxSpeed > 0 && (!gravityOptions.inverse && velocity.y >= 0 && velocity.y >= maxSpeed || gravityOptions.inverse && velocity.y <= 0 && velocity.y <= -maxSpeed)) {
|
|
1692
1692
|
velocity.y = gravityFactor * maxSpeed;
|
|
1693
1693
|
if (moveSpeed) {
|
|
1694
1694
|
particle.velocity.y = velocity.y / moveSpeed;
|
|
@@ -2125,9 +2125,9 @@
|
|
|
2125
2125
|
paint() {
|
|
2126
2126
|
const options = this.container.actualOptions;
|
|
2127
2127
|
this.draw((ctx => {
|
|
2128
|
-
if (options.backgroundMask.enable && options.backgroundMask.cover
|
|
2128
|
+
if (options.backgroundMask.enable && options.backgroundMask.cover) {
|
|
2129
2129
|
clear(ctx, this.size);
|
|
2130
|
-
this.paintBase(
|
|
2130
|
+
this.paintBase(this.coverColorStyle);
|
|
2131
2131
|
} else {
|
|
2132
2132
|
this.paintBase();
|
|
2133
2133
|
}
|
|
@@ -2229,7 +2229,7 @@
|
|
|
2229
2229
|
const zIndexOptions = particle.options.zIndex;
|
|
2230
2230
|
const zOpacityFactor = (1 - particle.zIndexFactor) ** zIndexOptions.opacityRate;
|
|
2231
2231
|
const radius = particle.getRadius();
|
|
2232
|
-
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;
|
|
2233
2233
|
const strokeOpacity = (_f = (_e = particle.stroke) === null || _e === void 0 ? void 0 : _e.opacity) !== null && _f !== void 0 ? _f : opacity;
|
|
2234
2234
|
const zOpacity = opacity * zOpacityFactor;
|
|
2235
2235
|
const fillColorValue = fColor ? getStyleFromHsl(fColor, zOpacity) : undefined;
|
|
@@ -2298,12 +2298,14 @@
|
|
|
2298
2298
|
const color = cover.color;
|
|
2299
2299
|
const coverRgb = colorToRgb(color);
|
|
2300
2300
|
if (coverRgb) {
|
|
2301
|
-
|
|
2301
|
+
const coverColor = {
|
|
2302
2302
|
r: coverRgb.r,
|
|
2303
2303
|
g: coverRgb.g,
|
|
2304
2304
|
b: coverRgb.b,
|
|
2305
2305
|
a: cover.opacity
|
|
2306
2306
|
};
|
|
2307
|
+
this.coverColorStyle = getStyleFromRgb(coverColor, coverColor.a);
|
|
2308
|
+
console.log(this.coverColorStyle);
|
|
2307
2309
|
}
|
|
2308
2310
|
}
|
|
2309
2311
|
initTrail() {
|
|
@@ -2500,7 +2502,7 @@
|
|
|
2500
2502
|
return;
|
|
2501
2503
|
}
|
|
2502
2504
|
if (data.count !== undefined) {
|
|
2503
|
-
this.count = data.count;
|
|
2505
|
+
this.count = setRangeValue(data.count);
|
|
2504
2506
|
}
|
|
2505
2507
|
if (data.enable !== undefined) {
|
|
2506
2508
|
this.enable = data.enable;
|
|
@@ -2509,7 +2511,7 @@
|
|
|
2509
2511
|
this.offset = setRangeValue(data.offset);
|
|
2510
2512
|
}
|
|
2511
2513
|
if (data.speed !== undefined) {
|
|
2512
|
-
this.speed = data.speed;
|
|
2514
|
+
this.speed = setRangeValue(data.speed);
|
|
2513
2515
|
}
|
|
2514
2516
|
if (data.sync !== undefined) {
|
|
2515
2517
|
this.sync = data.sync;
|
|
@@ -2657,13 +2659,13 @@
|
|
|
2657
2659
|
return;
|
|
2658
2660
|
}
|
|
2659
2661
|
if (data.count !== undefined) {
|
|
2660
|
-
this.count = data.count;
|
|
2662
|
+
this.count = setRangeValue(data.count);
|
|
2661
2663
|
}
|
|
2662
2664
|
if (data.enable !== undefined) {
|
|
2663
2665
|
this.enable = data.enable;
|
|
2664
2666
|
}
|
|
2665
2667
|
if (data.speed !== undefined) {
|
|
2666
|
-
this.speed = data.speed;
|
|
2668
|
+
this.speed = setRangeValue(data.speed);
|
|
2667
2669
|
}
|
|
2668
2670
|
if (data.sync !== undefined) {
|
|
2669
2671
|
this.sync = data.sync;
|
|
@@ -2683,13 +2685,13 @@
|
|
|
2683
2685
|
return;
|
|
2684
2686
|
}
|
|
2685
2687
|
if (data.count !== undefined) {
|
|
2686
|
-
this.count = data.count;
|
|
2688
|
+
this.count = setRangeValue(data.count);
|
|
2687
2689
|
}
|
|
2688
2690
|
if (data.enable !== undefined) {
|
|
2689
2691
|
this.enable = data.enable;
|
|
2690
2692
|
}
|
|
2691
2693
|
if (data.speed !== undefined) {
|
|
2692
|
-
this.speed = data.speed;
|
|
2694
|
+
this.speed = setRangeValue(data.speed);
|
|
2693
2695
|
}
|
|
2694
2696
|
if (data.sync !== undefined) {
|
|
2695
2697
|
this.sync = data.sync;
|
|
@@ -2861,6 +2863,90 @@
|
|
|
2861
2863
|
this.duration.load(data.duration);
|
|
2862
2864
|
}
|
|
2863
2865
|
}
|
|
2866
|
+
class Attract_Attract {
|
|
2867
|
+
constructor() {
|
|
2868
|
+
this.distance = 200;
|
|
2869
|
+
this.enable = false;
|
|
2870
|
+
this.rotate = {
|
|
2871
|
+
x: 3e3,
|
|
2872
|
+
y: 3e3
|
|
2873
|
+
};
|
|
2874
|
+
}
|
|
2875
|
+
get rotateX() {
|
|
2876
|
+
return this.rotate.x;
|
|
2877
|
+
}
|
|
2878
|
+
set rotateX(value) {
|
|
2879
|
+
this.rotate.x = value;
|
|
2880
|
+
}
|
|
2881
|
+
get rotateY() {
|
|
2882
|
+
return this.rotate.y;
|
|
2883
|
+
}
|
|
2884
|
+
set rotateY(value) {
|
|
2885
|
+
this.rotate.y = value;
|
|
2886
|
+
}
|
|
2887
|
+
load(data) {
|
|
2888
|
+
var _a, _b, _c, _d;
|
|
2889
|
+
if (!data) {
|
|
2890
|
+
return;
|
|
2891
|
+
}
|
|
2892
|
+
if (data.distance !== undefined) {
|
|
2893
|
+
this.distance = setRangeValue(data.distance);
|
|
2894
|
+
}
|
|
2895
|
+
if (data.enable !== undefined) {
|
|
2896
|
+
this.enable = data.enable;
|
|
2897
|
+
}
|
|
2898
|
+
const rotateX = (_b = (_a = data.rotate) === null || _a === void 0 ? void 0 : _a.x) !== null && _b !== void 0 ? _b : data.rotateX;
|
|
2899
|
+
if (rotateX !== undefined) {
|
|
2900
|
+
this.rotate.x = rotateX;
|
|
2901
|
+
}
|
|
2902
|
+
const rotateY = (_d = (_c = data.rotate) === null || _c === void 0 ? void 0 : _c.y) !== null && _d !== void 0 ? _d : data.rotateY;
|
|
2903
|
+
if (rotateY !== undefined) {
|
|
2904
|
+
this.rotate.y = rotateY;
|
|
2905
|
+
}
|
|
2906
|
+
}
|
|
2907
|
+
}
|
|
2908
|
+
class MoveAngle_MoveAngle {
|
|
2909
|
+
constructor() {
|
|
2910
|
+
this.offset = 0;
|
|
2911
|
+
this.value = 90;
|
|
2912
|
+
}
|
|
2913
|
+
load(data) {
|
|
2914
|
+
if (data === undefined) {
|
|
2915
|
+
return;
|
|
2916
|
+
}
|
|
2917
|
+
if (data.offset !== undefined) {
|
|
2918
|
+
this.offset = setRangeValue(data.offset);
|
|
2919
|
+
}
|
|
2920
|
+
if (data.value !== undefined) {
|
|
2921
|
+
this.value = setRangeValue(data.value);
|
|
2922
|
+
}
|
|
2923
|
+
}
|
|
2924
|
+
}
|
|
2925
|
+
class MoveGravity_MoveGravity {
|
|
2926
|
+
constructor() {
|
|
2927
|
+
this.acceleration = 9.81;
|
|
2928
|
+
this.enable = false;
|
|
2929
|
+
this.inverse = false;
|
|
2930
|
+
this.maxSpeed = 50;
|
|
2931
|
+
}
|
|
2932
|
+
load(data) {
|
|
2933
|
+
if (!data) {
|
|
2934
|
+
return;
|
|
2935
|
+
}
|
|
2936
|
+
if (data.acceleration !== undefined) {
|
|
2937
|
+
this.acceleration = setRangeValue(data.acceleration);
|
|
2938
|
+
}
|
|
2939
|
+
if (data.enable !== undefined) {
|
|
2940
|
+
this.enable = data.enable;
|
|
2941
|
+
}
|
|
2942
|
+
if (data.inverse !== undefined) {
|
|
2943
|
+
this.inverse = data.inverse;
|
|
2944
|
+
}
|
|
2945
|
+
if (data.maxSpeed !== undefined) {
|
|
2946
|
+
this.maxSpeed = setRangeValue(data.maxSpeed);
|
|
2947
|
+
}
|
|
2948
|
+
}
|
|
2949
|
+
}
|
|
2864
2950
|
class PathDelay_PathDelay extends(null && ValueWithRandom){
|
|
2865
2951
|
constructor() {
|
|
2866
2952
|
super();
|
|
@@ -3022,6 +3108,70 @@
|
|
|
3022
3108
|
}
|
|
3023
3109
|
}
|
|
3024
3110
|
}
|
|
3111
|
+
class AnimationOptions_AnimationOptions {
|
|
3112
|
+
constructor() {
|
|
3113
|
+
this.count = 0;
|
|
3114
|
+
this.enable = false;
|
|
3115
|
+
this.speed = 1;
|
|
3116
|
+
this.sync = false;
|
|
3117
|
+
}
|
|
3118
|
+
load(data) {
|
|
3119
|
+
if (!data) {
|
|
3120
|
+
return;
|
|
3121
|
+
}
|
|
3122
|
+
if (data.count !== undefined) {
|
|
3123
|
+
this.count = setRangeValue(data.count);
|
|
3124
|
+
}
|
|
3125
|
+
if (data.enable !== undefined) {
|
|
3126
|
+
this.enable = data.enable;
|
|
3127
|
+
}
|
|
3128
|
+
if (data.speed !== undefined) {
|
|
3129
|
+
this.speed = setRangeValue(data.speed);
|
|
3130
|
+
}
|
|
3131
|
+
if (data.sync !== undefined) {
|
|
3132
|
+
this.sync = data.sync;
|
|
3133
|
+
}
|
|
3134
|
+
}
|
|
3135
|
+
}
|
|
3136
|
+
class OpacityAnimation_OpacityAnimation extends(null && AnimationOptions){
|
|
3137
|
+
constructor() {
|
|
3138
|
+
super();
|
|
3139
|
+
this.destroy = "none";
|
|
3140
|
+
this.enable = false;
|
|
3141
|
+
this.speed = 2;
|
|
3142
|
+
this.startValue = "random";
|
|
3143
|
+
this.sync = false;
|
|
3144
|
+
}
|
|
3145
|
+
get opacity_min() {
|
|
3146
|
+
return this.minimumValue;
|
|
3147
|
+
}
|
|
3148
|
+
set opacity_min(value) {
|
|
3149
|
+
this.minimumValue = value;
|
|
3150
|
+
}
|
|
3151
|
+
load(data) {
|
|
3152
|
+
var _a;
|
|
3153
|
+
if (data === undefined) {
|
|
3154
|
+
return;
|
|
3155
|
+
}
|
|
3156
|
+
super.load(data);
|
|
3157
|
+
if (data.destroy !== undefined) {
|
|
3158
|
+
this.destroy = data.destroy;
|
|
3159
|
+
}
|
|
3160
|
+
if (data.enable !== undefined) {
|
|
3161
|
+
this.enable = data.enable;
|
|
3162
|
+
}
|
|
3163
|
+
this.minimumValue = (_a = data.minimumValue) !== null && _a !== void 0 ? _a : data.opacity_min;
|
|
3164
|
+
if (data.speed !== undefined) {
|
|
3165
|
+
this.speed = data.speed;
|
|
3166
|
+
}
|
|
3167
|
+
if (data.startValue !== undefined) {
|
|
3168
|
+
this.startValue = data.startValue;
|
|
3169
|
+
}
|
|
3170
|
+
if (data.sync !== undefined) {
|
|
3171
|
+
this.sync = data.sync;
|
|
3172
|
+
}
|
|
3173
|
+
}
|
|
3174
|
+
}
|
|
3025
3175
|
class Opacity_Opacity extends(null && ValueWithRandom){
|
|
3026
3176
|
constructor() {
|
|
3027
3177
|
super();
|
|
@@ -3080,13 +3230,13 @@
|
|
|
3080
3230
|
this.enable = data.enable;
|
|
3081
3231
|
}
|
|
3082
3232
|
if (data.opacity !== undefined) {
|
|
3083
|
-
this.opacity = data.opacity;
|
|
3233
|
+
this.opacity = setRangeValue(data.opacity);
|
|
3084
3234
|
}
|
|
3085
3235
|
if (data.width !== undefined) {
|
|
3086
|
-
this.width = data.width;
|
|
3236
|
+
this.width = setRangeValue(data.width);
|
|
3087
3237
|
}
|
|
3088
3238
|
if (data.radius !== undefined) {
|
|
3089
|
-
this.radius = data.radius;
|
|
3239
|
+
this.radius = setRangeValue(data.radius);
|
|
3090
3240
|
}
|
|
3091
3241
|
if (data.color !== undefined) {
|
|
3092
3242
|
this.color = OptionsColor.create(this.color, data.color);
|
|
@@ -3111,16 +3261,33 @@
|
|
|
3111
3261
|
this.enabled = data.enabled;
|
|
3112
3262
|
}
|
|
3113
3263
|
if (data.distance !== undefined) {
|
|
3114
|
-
this.distance = data.distance;
|
|
3264
|
+
this.distance = setRangeValue(data.distance);
|
|
3115
3265
|
}
|
|
3116
3266
|
if (data.duration !== undefined) {
|
|
3117
|
-
this.duration = data.duration;
|
|
3267
|
+
this.duration = setRangeValue(data.duration);
|
|
3118
3268
|
}
|
|
3119
3269
|
if (data.factor !== undefined) {
|
|
3120
|
-
this.factor = data.factor;
|
|
3270
|
+
this.factor = setRangeValue(data.factor);
|
|
3121
3271
|
}
|
|
3122
3272
|
if (data.speed !== undefined) {
|
|
3123
|
-
this.speed = data.speed;
|
|
3273
|
+
this.speed = setRangeValue(data.speed);
|
|
3274
|
+
}
|
|
3275
|
+
}
|
|
3276
|
+
}
|
|
3277
|
+
class RollLight_RollLight {
|
|
3278
|
+
constructor() {
|
|
3279
|
+
this.enable = false;
|
|
3280
|
+
this.value = 0;
|
|
3281
|
+
}
|
|
3282
|
+
load(data) {
|
|
3283
|
+
if (!data) {
|
|
3284
|
+
return;
|
|
3285
|
+
}
|
|
3286
|
+
if (data.enable !== undefined) {
|
|
3287
|
+
this.enable = data.enable;
|
|
3288
|
+
}
|
|
3289
|
+
if (data.value !== undefined) {
|
|
3290
|
+
this.value = setRangeValue(data.value);
|
|
3124
3291
|
}
|
|
3125
3292
|
}
|
|
3126
3293
|
}
|
|
@@ -3152,6 +3319,27 @@
|
|
|
3152
3319
|
}
|
|
3153
3320
|
}
|
|
3154
3321
|
}
|
|
3322
|
+
class RotateAnimation_RotateAnimation {
|
|
3323
|
+
constructor() {
|
|
3324
|
+
this.enable = false;
|
|
3325
|
+
this.speed = 0;
|
|
3326
|
+
this.sync = false;
|
|
3327
|
+
}
|
|
3328
|
+
load(data) {
|
|
3329
|
+
if (data === undefined) {
|
|
3330
|
+
return;
|
|
3331
|
+
}
|
|
3332
|
+
if (data.enable !== undefined) {
|
|
3333
|
+
this.enable = data.enable;
|
|
3334
|
+
}
|
|
3335
|
+
if (data.speed !== undefined) {
|
|
3336
|
+
this.speed = setRangeValue(data.speed);
|
|
3337
|
+
}
|
|
3338
|
+
if (data.sync !== undefined) {
|
|
3339
|
+
this.sync = data.sync;
|
|
3340
|
+
}
|
|
3341
|
+
}
|
|
3342
|
+
}
|
|
3155
3343
|
class Rotate_Rotate extends(null && ValueWithRandom){
|
|
3156
3344
|
constructor() {
|
|
3157
3345
|
super();
|
|
@@ -3270,6 +3458,45 @@
|
|
|
3270
3458
|
}
|
|
3271
3459
|
}
|
|
3272
3460
|
}
|
|
3461
|
+
class SizeAnimation_SizeAnimation extends(null && AnimationOptions){
|
|
3462
|
+
constructor() {
|
|
3463
|
+
super();
|
|
3464
|
+
this.destroy = "none";
|
|
3465
|
+
this.enable = false;
|
|
3466
|
+
this.speed = 5;
|
|
3467
|
+
this.startValue = "random";
|
|
3468
|
+
this.sync = false;
|
|
3469
|
+
}
|
|
3470
|
+
get size_min() {
|
|
3471
|
+
return this.minimumValue;
|
|
3472
|
+
}
|
|
3473
|
+
set size_min(value) {
|
|
3474
|
+
this.minimumValue = value;
|
|
3475
|
+
}
|
|
3476
|
+
load(data) {
|
|
3477
|
+
var _a;
|
|
3478
|
+
if (data === undefined) {
|
|
3479
|
+
return;
|
|
3480
|
+
}
|
|
3481
|
+
super.load(data);
|
|
3482
|
+
if (data.destroy !== undefined) {
|
|
3483
|
+
this.destroy = data.destroy;
|
|
3484
|
+
}
|
|
3485
|
+
if (data.enable !== undefined) {
|
|
3486
|
+
this.enable = data.enable;
|
|
3487
|
+
}
|
|
3488
|
+
this.minimumValue = (_a = data.minimumValue) !== null && _a !== void 0 ? _a : data.size_min;
|
|
3489
|
+
if (data.speed !== undefined) {
|
|
3490
|
+
this.speed = data.speed;
|
|
3491
|
+
}
|
|
3492
|
+
if (data.startValue !== undefined) {
|
|
3493
|
+
this.startValue = data.startValue;
|
|
3494
|
+
}
|
|
3495
|
+
if (data.sync !== undefined) {
|
|
3496
|
+
this.sync = data.sync;
|
|
3497
|
+
}
|
|
3498
|
+
}
|
|
3499
|
+
}
|
|
3273
3500
|
class Size_Size extends(null && ValueWithRandom){
|
|
3274
3501
|
constructor() {
|
|
3275
3502
|
super();
|
|
@@ -3315,6 +3542,27 @@
|
|
|
3315
3542
|
}
|
|
3316
3543
|
}
|
|
3317
3544
|
}
|
|
3545
|
+
class TiltAnimation_TiltAnimation {
|
|
3546
|
+
constructor() {
|
|
3547
|
+
this.enable = false;
|
|
3548
|
+
this.speed = 0;
|
|
3549
|
+
this.sync = false;
|
|
3550
|
+
}
|
|
3551
|
+
load(data) {
|
|
3552
|
+
if (data === undefined) {
|
|
3553
|
+
return;
|
|
3554
|
+
}
|
|
3555
|
+
if (data.enable !== undefined) {
|
|
3556
|
+
this.enable = data.enable;
|
|
3557
|
+
}
|
|
3558
|
+
if (data.speed !== undefined) {
|
|
3559
|
+
this.speed = setRangeValue(data.speed);
|
|
3560
|
+
}
|
|
3561
|
+
if (data.sync !== undefined) {
|
|
3562
|
+
this.sync = data.sync;
|
|
3563
|
+
}
|
|
3564
|
+
}
|
|
3565
|
+
}
|
|
3318
3566
|
class Tilt_Tilt extends(null && ValueWithRandom){
|
|
3319
3567
|
constructor() {
|
|
3320
3568
|
super();
|
|
@@ -3337,6 +3585,43 @@
|
|
|
3337
3585
|
}
|
|
3338
3586
|
}
|
|
3339
3587
|
}
|
|
3588
|
+
class TwinkleValues_TwinkleValues {
|
|
3589
|
+
constructor() {
|
|
3590
|
+
this.enable = false;
|
|
3591
|
+
this.frequency = .05;
|
|
3592
|
+
this.opacity = 1;
|
|
3593
|
+
}
|
|
3594
|
+
load(data) {
|
|
3595
|
+
if (data === undefined) {
|
|
3596
|
+
return;
|
|
3597
|
+
}
|
|
3598
|
+
if (data.color !== undefined) {
|
|
3599
|
+
this.color = OptionsColor.create(this.color, data.color);
|
|
3600
|
+
}
|
|
3601
|
+
if (data.enable !== undefined) {
|
|
3602
|
+
this.enable = data.enable;
|
|
3603
|
+
}
|
|
3604
|
+
if (data.frequency !== undefined) {
|
|
3605
|
+
this.frequency = data.frequency;
|
|
3606
|
+
}
|
|
3607
|
+
if (data.opacity !== undefined) {
|
|
3608
|
+
this.opacity = setRangeValue(data.opacity);
|
|
3609
|
+
}
|
|
3610
|
+
}
|
|
3611
|
+
}
|
|
3612
|
+
class Twinkle_Twinkle {
|
|
3613
|
+
constructor() {
|
|
3614
|
+
this.lines = new TwinkleValues;
|
|
3615
|
+
this.particles = new TwinkleValues;
|
|
3616
|
+
}
|
|
3617
|
+
load(data) {
|
|
3618
|
+
if (data === undefined) {
|
|
3619
|
+
return;
|
|
3620
|
+
}
|
|
3621
|
+
this.lines.load(data.lines);
|
|
3622
|
+
this.particles.load(data.particles);
|
|
3623
|
+
}
|
|
3624
|
+
}
|
|
3340
3625
|
class Wobble_Wobble {
|
|
3341
3626
|
constructor() {
|
|
3342
3627
|
this.distance = 5;
|
|
@@ -3774,7 +4059,7 @@
|
|
|
3774
4059
|
max: getRangeMax(sizeRange) * pxRatio,
|
|
3775
4060
|
min: getRangeMin(sizeRange) * pxRatio,
|
|
3776
4061
|
loops: 0,
|
|
3777
|
-
maxLoops: sizeOptions.animation.count
|
|
4062
|
+
maxLoops: getRangeValue(sizeOptions.animation.count)
|
|
3778
4063
|
};
|
|
3779
4064
|
const sizeAnimation = sizeOptions.animation;
|
|
3780
4065
|
if (sizeAnimation.enable) {
|
|
@@ -3808,6 +4093,12 @@
|
|
|
3808
4093
|
this.initialVelocity = this.calculateVelocity();
|
|
3809
4094
|
this.velocity = this.initialVelocity.copy();
|
|
3810
4095
|
this.moveDecay = 1 - getRangeValue(this.options.move.decay);
|
|
4096
|
+
const gravityOptions = this.options.move.gravity;
|
|
4097
|
+
this.gravity = {
|
|
4098
|
+
enable: gravityOptions.enable,
|
|
4099
|
+
acceleration: getRangeValue(gravityOptions.acceleration),
|
|
4100
|
+
inverse: gravityOptions.inverse
|
|
4101
|
+
};
|
|
3811
4102
|
this.position = this.calcPosition(container, position, clamp(zIndexValue, 0, container.zLayers));
|
|
3812
4103
|
this.initialPosition = this.position.copy();
|
|
3813
4104
|
this.offset = Vector.origin;
|
|
@@ -4015,12 +4306,7 @@
|
|
|
4015
4306
|
return overlaps;
|
|
4016
4307
|
}
|
|
4017
4308
|
calculateVelocity() {
|
|
4018
|
-
const baseVelocity = getParticleBaseVelocity(this.direction)
|
|
4019
|
-
const res = baseVelocity.copy();
|
|
4020
|
-
const moveOptions = this.options.move;
|
|
4021
|
-
const rad = Math.PI / 180 * moveOptions.angle.value;
|
|
4022
|
-
const radOffset = Math.PI / 180 * moveOptions.angle.offset;
|
|
4023
|
-
const range = {
|
|
4309
|
+
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 = {
|
|
4024
4310
|
left: radOffset - rad / 2,
|
|
4025
4311
|
right: radOffset + rad / 2
|
|
4026
4312
|
};
|
|
@@ -4410,13 +4696,13 @@
|
|
|
4410
4696
|
container.canvas.size.height = element.offsetHeight * ratio;
|
|
4411
4697
|
}
|
|
4412
4698
|
const particles = options.particles;
|
|
4413
|
-
this.attractDistance = particles.move.attract.distance * ratio;
|
|
4699
|
+
this.attractDistance = getRangeValue(particles.move.attract.distance) * ratio;
|
|
4414
4700
|
this.linksDistance = particles.links.distance * ratio;
|
|
4415
4701
|
this.linksWidth = particles.links.width * ratio;
|
|
4416
|
-
this.sizeAnimationSpeed = particles.size.animation.speed * ratio;
|
|
4417
|
-
this.maxSpeed = particles.move.gravity.maxSpeed * ratio;
|
|
4702
|
+
this.sizeAnimationSpeed = getRangeValue(particles.size.animation.speed) * ratio;
|
|
4703
|
+
this.maxSpeed = getRangeValue(particles.move.gravity.maxSpeed) * ratio;
|
|
4418
4704
|
if (particles.orbit.radius !== undefined) {
|
|
4419
|
-
this.orbitRadius = particles.orbit.radius * this.container.retina.pixelRatio;
|
|
4705
|
+
this.orbitRadius = getRangeValue(particles.orbit.radius) * this.container.retina.pixelRatio;
|
|
4420
4706
|
}
|
|
4421
4707
|
const modes = options.interactivity.modes;
|
|
4422
4708
|
this.connectModeDistance = modes.connect.distance * ratio;
|
|
@@ -4436,19 +4722,19 @@
|
|
|
4436
4722
|
const ratio = this.pixelRatio;
|
|
4437
4723
|
const moveDistance = options.move.distance;
|
|
4438
4724
|
const props = particle.retina;
|
|
4439
|
-
props.attractDistance = options.move.attract.distance * ratio;
|
|
4725
|
+
props.attractDistance = getRangeValue(options.move.attract.distance) * ratio;
|
|
4440
4726
|
props.linksDistance = options.links.distance * ratio;
|
|
4441
4727
|
props.linksWidth = options.links.width * ratio;
|
|
4442
4728
|
props.moveDrift = getRangeValue(options.move.drift) * ratio;
|
|
4443
4729
|
props.moveSpeed = getRangeValue(options.move.speed) * ratio;
|
|
4444
|
-
props.sizeAnimationSpeed = options.size.animation.speed * ratio;
|
|
4730
|
+
props.sizeAnimationSpeed = getRangeValue(options.size.animation.speed) * ratio;
|
|
4445
4731
|
if (particle.spin) {
|
|
4446
4732
|
props.spinAcceleration = getRangeValue(options.move.spin.acceleration) * ratio;
|
|
4447
4733
|
}
|
|
4448
4734
|
const maxDistance = props.maxDistance;
|
|
4449
4735
|
maxDistance.horizontal = moveDistance.horizontal !== undefined ? moveDistance.horizontal * ratio : undefined;
|
|
4450
4736
|
maxDistance.vertical = moveDistance.vertical !== undefined ? moveDistance.vertical * ratio : undefined;
|
|
4451
|
-
props.maxSpeed = options.move.gravity.maxSpeed * ratio;
|
|
4737
|
+
props.maxSpeed = getRangeValue(options.move.gravity.maxSpeed) * ratio;
|
|
4452
4738
|
}
|
|
4453
4739
|
handleMotionChange(mediaQuery) {
|
|
4454
4740
|
const options = this.container.actualOptions;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! tsParticles v1.
|
|
1
|
+
/*! tsParticles v1.42.2 by Matteo Bruni */
|
|
2
2
|
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var o=e();for(var n in o)("object"==typeof exports?exports:t)[n]=o[n]}}(window,(function(){return function(){"use strict";var t={d:function(e,o){for(var n in o)t.o(o,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:o[n]})},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 o(t){return"number"==typeof t?t:function(t){const e=i(t);let o=n(t);return e===o&&(o=0),Math.random()*(e-o)+o}(t)}function n(t){return"number"==typeof t?t:t.min}function i(t){return"number"==typeof t?t:t.max}function s(t,e){if(t===e||void 0===e&&"number"==typeof t)return t;const o=n(t),r=i(t);return void 0!==e?{min:Math.min(o,e),max:Math.max(r,e)}:s(o,r)}function r(t){const e=t.random,{enable:n,minimumValue:i}="boolean"==typeof e?{enable:e,minimumValue:0}:e;return o(n?s(t.value,i):t.value)}function a(t,e){const o=t.x-e.x,n=t.y-e.y;return{dx:o,dy:n,distance:Math.sqrt(o*o+n*n)}}function c(t,e,o,n){return b.create(t.x*(o-n)/(o+n)+2*e.x*n/(o+n),t.y)}function u(t,e,o,n,i,s){const r={bounced:!1};return e.min>=n.min&&e.min<=n.max&&e.max>=n.min&&e.max<=n.max&&(t.max>=o.min&&t.max<=(o.max+o.min)/2&&i>0||t.min<=o.max&&t.min>(o.max+o.min)/2&&i<0)&&(r.velocity=i*-s,r.bounced=!0),r}function h(t,e){return t===e||e instanceof Array&&e.indexOf(t)>-1}function y(t,e){return{bottom:t.y+e,left:t.x-e,right:t.x+e,top:t.y-e}}function l(t,e){const o=t.selectors;if(o instanceof Array)for(const n of o)e(n,t);else e(o,t)}function f(t,e){const{x:o,y:n}=t.velocity.sub(e.velocity),[i,s]=[t.position,e.position],{dx:r,dy:u}=a(s,i);if(o*r+n*u>=0){const o=-Math.atan2(u,r),n=t.mass,i=e.mass,s=t.velocity.rotate(o),a=e.velocity.rotate(o),h=c(s,a,n,i),y=c(a,s,n,i),l=h.rotate(-o),f=y.rotate(-o);t.velocity.x=l.x*t.factor.x,t.velocity.y=l.y*t.factor.y,e.velocity.x=f.x*e.factor.x,e.velocity.y=f.y*e.factor.y}}function d(t,e){const o=y(t.getPosition(),t.getRadius()),n=u({min:o.left,max:o.right},{min:o.top,max:o.bottom},{min:e.left,max:e.right},{min:e.top,max:e.bottom},t.velocity.x,r(t.options.bounce.horizontal));n.bounced&&(void 0!==n.velocity&&(t.velocity.x=n.velocity),void 0!==n.position&&(t.position.x=n.position));const i=u({min:o.top,max:o.bottom},{min:o.left,max:o.right},{min:e.top,max:e.bottom},{min:e.left,max:e.right},t.velocity.y,r(t.options.bounce.vertical));i.bounced&&(void 0!==i.velocity&&(t.velocity.y=i.velocity),void 0!==i.position&&(t.position.y=i.position))}t.r(e),t.d(e,{loadExternalBounceInteraction:function(){return M}});class m{constructor(t,e){this.position={x:t,y:e}}}class x extends m{constructor(t,e,o){super(t,e),this.radius=o}contains(t){return e=t,o=this.position,a(e,o).distance<=this.radius;var e,o}intersects(t){const e=t,o=t,n=this.position,i=t.position,s=Math.abs(i.x-n.x),r=Math.abs(i.y-n.y),a=this.radius;if(void 0!==o.radius){return a+o.radius>Math.sqrt(s*s+r+r)}if(void 0!==e.size){const t=e.size.width,o=e.size.height,n=Math.pow(s-t,2)+Math.pow(r-o,2);return!(s>a+t||r>a+o)&&(s<=t||r<=o||n<=a*a)}return!1}}class p{}p.generatedAttribute="generated",p.randomColorValue="random",p.midColorValue="mid",p.touchEndEvent="touchend",p.mouseDownEvent="mousedown",p.mouseUpEvent="mouseup",p.mouseMoveEvent="mousemove",p.touchStartEvent="touchstart",p.touchMoveEvent="touchmove",p.mouseLeaveEvent="mouseleave",p.mouseOutEvent="mouseout",p.touchCancelEvent="touchcancel",p.resizeEvent="resize",p.visibilityChangeEvent="visibilitychange",p.noPolygonDataLoaded="No polygon data loaded.",p.noPolygonFound="No polygon found, you need to specify SVG url in config.";new WeakMap;new WeakMap;class v extends m{constructor(t,e,o,n){super(t,e),this.size={height:n,width:o}}contains(t){const e=this.size.width,o=this.size.height,n=this.position;return t.x>=n.x&&t.x<=n.x+e&&t.y>=n.y&&t.y<=n.y+o}intersects(t){const e=t,o=t,n=this.size.width,i=this.size.height,s=this.position,r=t.position;if(void 0!==o.radius)return o.intersects(this);if(void 0!==e.size){const t=e.size,o=t.width,a=t.height;return r.x<s.x+n&&r.x+o>s.x&&r.y<s.y+i&&r.y+a>s.y}return!1}}class b{constructor(t,e){let o,n;if(void 0===e){if("number"==typeof t)throw new Error("tsParticles - Vector not initialized correctly");const e=t;[o,n]=[e.x,e.y]}else[o,n]=[t,e];this.x=o,this.y=n}static clone(t){return b.create(t.x,t.y)}static create(t,e){return new b(t,e)}static get origin(){return b.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 b.create(this.x+t.x,this.y+t.y)}addTo(t){this.x+=t.x,this.y+=t.y}sub(t){return b.create(this.x-t.x,this.y-t.y)}subFrom(t){this.x-=t.x,this.y-=t.y}mult(t){return b.create(this.x*t,this.y*t)}multTo(t){this.x*=t,this.y*=t}div(t){return b.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 b.clone(this)}setTo(t){this.x=t.x,this.y=t.y}rotate(t){return b.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 g extends class{constructor(t){this.container=t,this.type=0}}{constructor(t){super(t)}isEnabled(){const t=this.container,e=t.actualOptions,o=t.interactivity.mouse,n=e.interactivity.events,i=n.onDiv;return o.position&&n.onHover.enable&&h("bounce",n.onHover.mode)||function(t,e){return e instanceof Array?!!e.find((e=>e.enable&&h(t,e.mode))):h(t,e.mode)}("bounce",i)}async interact(){const t=this.container,e=t.actualOptions.interactivity.events,o=t.interactivity.status===p.mouseMoveEvent,n=e.onHover.enable,i=e.onHover.mode,s=e.onDiv;o&&n&&h("bounce",i)?this.processMouseBounce():function(t,e,o){if(e instanceof Array)for(const n of e){const e=n.mode;n.enable&&h(t,e)&&l(n,o)}else{const n=e.mode;e.enable&&h(t,n)&&l(e,o)}}("bounce",s,((t,e)=>this.singleSelectorBounce(t,e)))}reset(){}processMouseBounce(){const t=this.container,e=10*t.retina.pixelRatio,o=t.interactivity.mouse.position,n=t.retina.bounceModeDistance;o&&this.processBounce(o,n,new x(o.x,o.y,n+e))}singleSelectorBounce(t,e){const o=this.container,n=document.querySelectorAll(t);n.length&&n.forEach((t=>{const n=t,i=o.retina.pixelRatio,s={x:(n.offsetLeft+n.offsetWidth/2)*i,y:(n.offsetTop+n.offsetHeight/2)*i},r=n.offsetWidth/2*i,a=10*i,c="circle"===e.type?new x(s.x,s.y,r+a):new v(n.offsetLeft*i-a,n.offsetTop*i-a,n.offsetWidth*i+2*a,n.offsetHeight*i+2*a);this.processBounce(s,r,c)}))}processBounce(t,e,o){const n=this.container.particles.quadTree.query(o);for(const s of n)o instanceof x?f({position:(i=s).getPosition(),radius:i.getRadius(),mass:i.getMass(),velocity:i.velocity,factor:b.create(r(i.options.bounce.horizontal),r(i.options.bounce.vertical))},{position:t,radius:e,mass:e**2*Math.PI/2,velocity:b.origin,factor:b.origin}):o instanceof v&&d(s,y(t,e));var i}}async function M(t){await t.addInteractor("externalBounce",(t=>new g(t)))}return e}()}));
|