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
|
@@ -613,7 +613,7 @@
|
|
|
613
613
|
}
|
|
614
614
|
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;
|
|
615
615
|
this.applyPath(particle, delta);
|
|
616
|
-
const gravityOptions =
|
|
616
|
+
const gravityOptions = particle.gravity;
|
|
617
617
|
const gravityFactor = gravityOptions.enable && gravityOptions.inverse ? -1 : 1;
|
|
618
618
|
if (gravityOptions.enable && moveSpeed) {
|
|
619
619
|
particle.velocity.y += gravityFactor * (gravityOptions.acceleration * delta.factor) / (60 * moveSpeed);
|
|
@@ -627,7 +627,7 @@
|
|
|
627
627
|
}
|
|
628
628
|
const velocity = particle.velocity.mult(moveSpeed);
|
|
629
629
|
const maxSpeed = (_c = particle.retina.maxSpeed) !== null && _c !== void 0 ? _c : container.retina.maxSpeed;
|
|
630
|
-
if (gravityOptions.enable &&
|
|
630
|
+
if (gravityOptions.enable && maxSpeed > 0 && (!gravityOptions.inverse && velocity.y >= 0 && velocity.y >= maxSpeed || gravityOptions.inverse && velocity.y <= 0 && velocity.y <= -maxSpeed)) {
|
|
631
631
|
velocity.y = gravityFactor * maxSpeed;
|
|
632
632
|
if (moveSpeed) {
|
|
633
633
|
particle.velocity.y = velocity.y / moveSpeed;
|
|
@@ -941,9 +941,9 @@
|
|
|
941
941
|
paint() {
|
|
942
942
|
const options = this.container.actualOptions;
|
|
943
943
|
this.draw((ctx => {
|
|
944
|
-
if (options.backgroundMask.enable && options.backgroundMask.cover
|
|
944
|
+
if (options.backgroundMask.enable && options.backgroundMask.cover) {
|
|
945
945
|
clear(ctx, this.size);
|
|
946
|
-
this.paintBase(
|
|
946
|
+
this.paintBase(this.coverColorStyle);
|
|
947
947
|
} else {
|
|
948
948
|
this.paintBase();
|
|
949
949
|
}
|
|
@@ -1045,7 +1045,7 @@
|
|
|
1045
1045
|
const zIndexOptions = particle.options.zIndex;
|
|
1046
1046
|
const zOpacityFactor = (1 - particle.zIndexFactor) ** zIndexOptions.opacityRate;
|
|
1047
1047
|
const radius = particle.getRadius();
|
|
1048
|
-
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;
|
|
1048
|
+
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;
|
|
1049
1049
|
const strokeOpacity = (_f = (_e = particle.stroke) === null || _e === void 0 ? void 0 : _e.opacity) !== null && _f !== void 0 ? _f : opacity;
|
|
1050
1050
|
const zOpacity = opacity * zOpacityFactor;
|
|
1051
1051
|
const fillColorValue = fColor ? getStyleFromHsl(fColor, zOpacity) : undefined;
|
|
@@ -1114,12 +1114,14 @@
|
|
|
1114
1114
|
const color = cover.color;
|
|
1115
1115
|
const coverRgb = colorToRgb(color);
|
|
1116
1116
|
if (coverRgb) {
|
|
1117
|
-
|
|
1117
|
+
const coverColor = {
|
|
1118
1118
|
r: coverRgb.r,
|
|
1119
1119
|
g: coverRgb.g,
|
|
1120
1120
|
b: coverRgb.b,
|
|
1121
1121
|
a: cover.opacity
|
|
1122
1122
|
};
|
|
1123
|
+
this.coverColorStyle = getStyleFromRgb(coverColor, coverColor.a);
|
|
1124
|
+
console.log(this.coverColorStyle);
|
|
1123
1125
|
}
|
|
1124
1126
|
}
|
|
1125
1127
|
initTrail() {
|
|
@@ -1316,7 +1318,7 @@
|
|
|
1316
1318
|
return;
|
|
1317
1319
|
}
|
|
1318
1320
|
if (data.count !== undefined) {
|
|
1319
|
-
this.count = data.count;
|
|
1321
|
+
this.count = setRangeValue(data.count);
|
|
1320
1322
|
}
|
|
1321
1323
|
if (data.enable !== undefined) {
|
|
1322
1324
|
this.enable = data.enable;
|
|
@@ -1325,7 +1327,7 @@
|
|
|
1325
1327
|
this.offset = setRangeValue(data.offset);
|
|
1326
1328
|
}
|
|
1327
1329
|
if (data.speed !== undefined) {
|
|
1328
|
-
this.speed = data.speed;
|
|
1330
|
+
this.speed = setRangeValue(data.speed);
|
|
1329
1331
|
}
|
|
1330
1332
|
if (data.sync !== undefined) {
|
|
1331
1333
|
this.sync = data.sync;
|
|
@@ -1473,13 +1475,13 @@
|
|
|
1473
1475
|
return;
|
|
1474
1476
|
}
|
|
1475
1477
|
if (data.count !== undefined) {
|
|
1476
|
-
this.count = data.count;
|
|
1478
|
+
this.count = setRangeValue(data.count);
|
|
1477
1479
|
}
|
|
1478
1480
|
if (data.enable !== undefined) {
|
|
1479
1481
|
this.enable = data.enable;
|
|
1480
1482
|
}
|
|
1481
1483
|
if (data.speed !== undefined) {
|
|
1482
|
-
this.speed = data.speed;
|
|
1484
|
+
this.speed = setRangeValue(data.speed);
|
|
1483
1485
|
}
|
|
1484
1486
|
if (data.sync !== undefined) {
|
|
1485
1487
|
this.sync = data.sync;
|
|
@@ -1499,13 +1501,13 @@
|
|
|
1499
1501
|
return;
|
|
1500
1502
|
}
|
|
1501
1503
|
if (data.count !== undefined) {
|
|
1502
|
-
this.count = data.count;
|
|
1504
|
+
this.count = setRangeValue(data.count);
|
|
1503
1505
|
}
|
|
1504
1506
|
if (data.enable !== undefined) {
|
|
1505
1507
|
this.enable = data.enable;
|
|
1506
1508
|
}
|
|
1507
1509
|
if (data.speed !== undefined) {
|
|
1508
|
-
this.speed = data.speed;
|
|
1510
|
+
this.speed = setRangeValue(data.speed);
|
|
1509
1511
|
}
|
|
1510
1512
|
if (data.sync !== undefined) {
|
|
1511
1513
|
this.sync = data.sync;
|
|
@@ -1677,6 +1679,90 @@
|
|
|
1677
1679
|
this.duration.load(data.duration);
|
|
1678
1680
|
}
|
|
1679
1681
|
}
|
|
1682
|
+
class Attract_Attract {
|
|
1683
|
+
constructor() {
|
|
1684
|
+
this.distance = 200;
|
|
1685
|
+
this.enable = false;
|
|
1686
|
+
this.rotate = {
|
|
1687
|
+
x: 3e3,
|
|
1688
|
+
y: 3e3
|
|
1689
|
+
};
|
|
1690
|
+
}
|
|
1691
|
+
get rotateX() {
|
|
1692
|
+
return this.rotate.x;
|
|
1693
|
+
}
|
|
1694
|
+
set rotateX(value) {
|
|
1695
|
+
this.rotate.x = value;
|
|
1696
|
+
}
|
|
1697
|
+
get rotateY() {
|
|
1698
|
+
return this.rotate.y;
|
|
1699
|
+
}
|
|
1700
|
+
set rotateY(value) {
|
|
1701
|
+
this.rotate.y = value;
|
|
1702
|
+
}
|
|
1703
|
+
load(data) {
|
|
1704
|
+
var _a, _b, _c, _d;
|
|
1705
|
+
if (!data) {
|
|
1706
|
+
return;
|
|
1707
|
+
}
|
|
1708
|
+
if (data.distance !== undefined) {
|
|
1709
|
+
this.distance = setRangeValue(data.distance);
|
|
1710
|
+
}
|
|
1711
|
+
if (data.enable !== undefined) {
|
|
1712
|
+
this.enable = data.enable;
|
|
1713
|
+
}
|
|
1714
|
+
const rotateX = (_b = (_a = data.rotate) === null || _a === void 0 ? void 0 : _a.x) !== null && _b !== void 0 ? _b : data.rotateX;
|
|
1715
|
+
if (rotateX !== undefined) {
|
|
1716
|
+
this.rotate.x = rotateX;
|
|
1717
|
+
}
|
|
1718
|
+
const rotateY = (_d = (_c = data.rotate) === null || _c === void 0 ? void 0 : _c.y) !== null && _d !== void 0 ? _d : data.rotateY;
|
|
1719
|
+
if (rotateY !== undefined) {
|
|
1720
|
+
this.rotate.y = rotateY;
|
|
1721
|
+
}
|
|
1722
|
+
}
|
|
1723
|
+
}
|
|
1724
|
+
class MoveAngle_MoveAngle {
|
|
1725
|
+
constructor() {
|
|
1726
|
+
this.offset = 0;
|
|
1727
|
+
this.value = 90;
|
|
1728
|
+
}
|
|
1729
|
+
load(data) {
|
|
1730
|
+
if (data === undefined) {
|
|
1731
|
+
return;
|
|
1732
|
+
}
|
|
1733
|
+
if (data.offset !== undefined) {
|
|
1734
|
+
this.offset = setRangeValue(data.offset);
|
|
1735
|
+
}
|
|
1736
|
+
if (data.value !== undefined) {
|
|
1737
|
+
this.value = setRangeValue(data.value);
|
|
1738
|
+
}
|
|
1739
|
+
}
|
|
1740
|
+
}
|
|
1741
|
+
class MoveGravity_MoveGravity {
|
|
1742
|
+
constructor() {
|
|
1743
|
+
this.acceleration = 9.81;
|
|
1744
|
+
this.enable = false;
|
|
1745
|
+
this.inverse = false;
|
|
1746
|
+
this.maxSpeed = 50;
|
|
1747
|
+
}
|
|
1748
|
+
load(data) {
|
|
1749
|
+
if (!data) {
|
|
1750
|
+
return;
|
|
1751
|
+
}
|
|
1752
|
+
if (data.acceleration !== undefined) {
|
|
1753
|
+
this.acceleration = setRangeValue(data.acceleration);
|
|
1754
|
+
}
|
|
1755
|
+
if (data.enable !== undefined) {
|
|
1756
|
+
this.enable = data.enable;
|
|
1757
|
+
}
|
|
1758
|
+
if (data.inverse !== undefined) {
|
|
1759
|
+
this.inverse = data.inverse;
|
|
1760
|
+
}
|
|
1761
|
+
if (data.maxSpeed !== undefined) {
|
|
1762
|
+
this.maxSpeed = setRangeValue(data.maxSpeed);
|
|
1763
|
+
}
|
|
1764
|
+
}
|
|
1765
|
+
}
|
|
1680
1766
|
class PathDelay_PathDelay extends(null && ValueWithRandom){
|
|
1681
1767
|
constructor() {
|
|
1682
1768
|
super();
|
|
@@ -1838,6 +1924,70 @@
|
|
|
1838
1924
|
}
|
|
1839
1925
|
}
|
|
1840
1926
|
}
|
|
1927
|
+
class AnimationOptions_AnimationOptions {
|
|
1928
|
+
constructor() {
|
|
1929
|
+
this.count = 0;
|
|
1930
|
+
this.enable = false;
|
|
1931
|
+
this.speed = 1;
|
|
1932
|
+
this.sync = false;
|
|
1933
|
+
}
|
|
1934
|
+
load(data) {
|
|
1935
|
+
if (!data) {
|
|
1936
|
+
return;
|
|
1937
|
+
}
|
|
1938
|
+
if (data.count !== undefined) {
|
|
1939
|
+
this.count = setRangeValue(data.count);
|
|
1940
|
+
}
|
|
1941
|
+
if (data.enable !== undefined) {
|
|
1942
|
+
this.enable = data.enable;
|
|
1943
|
+
}
|
|
1944
|
+
if (data.speed !== undefined) {
|
|
1945
|
+
this.speed = setRangeValue(data.speed);
|
|
1946
|
+
}
|
|
1947
|
+
if (data.sync !== undefined) {
|
|
1948
|
+
this.sync = data.sync;
|
|
1949
|
+
}
|
|
1950
|
+
}
|
|
1951
|
+
}
|
|
1952
|
+
class OpacityAnimation_OpacityAnimation extends(null && AnimationOptions){
|
|
1953
|
+
constructor() {
|
|
1954
|
+
super();
|
|
1955
|
+
this.destroy = "none";
|
|
1956
|
+
this.enable = false;
|
|
1957
|
+
this.speed = 2;
|
|
1958
|
+
this.startValue = "random";
|
|
1959
|
+
this.sync = false;
|
|
1960
|
+
}
|
|
1961
|
+
get opacity_min() {
|
|
1962
|
+
return this.minimumValue;
|
|
1963
|
+
}
|
|
1964
|
+
set opacity_min(value) {
|
|
1965
|
+
this.minimumValue = value;
|
|
1966
|
+
}
|
|
1967
|
+
load(data) {
|
|
1968
|
+
var _a;
|
|
1969
|
+
if (data === undefined) {
|
|
1970
|
+
return;
|
|
1971
|
+
}
|
|
1972
|
+
super.load(data);
|
|
1973
|
+
if (data.destroy !== undefined) {
|
|
1974
|
+
this.destroy = data.destroy;
|
|
1975
|
+
}
|
|
1976
|
+
if (data.enable !== undefined) {
|
|
1977
|
+
this.enable = data.enable;
|
|
1978
|
+
}
|
|
1979
|
+
this.minimumValue = (_a = data.minimumValue) !== null && _a !== void 0 ? _a : data.opacity_min;
|
|
1980
|
+
if (data.speed !== undefined) {
|
|
1981
|
+
this.speed = data.speed;
|
|
1982
|
+
}
|
|
1983
|
+
if (data.startValue !== undefined) {
|
|
1984
|
+
this.startValue = data.startValue;
|
|
1985
|
+
}
|
|
1986
|
+
if (data.sync !== undefined) {
|
|
1987
|
+
this.sync = data.sync;
|
|
1988
|
+
}
|
|
1989
|
+
}
|
|
1990
|
+
}
|
|
1841
1991
|
class Opacity_Opacity extends(null && ValueWithRandom){
|
|
1842
1992
|
constructor() {
|
|
1843
1993
|
super();
|
|
@@ -1896,13 +2046,13 @@
|
|
|
1896
2046
|
this.enable = data.enable;
|
|
1897
2047
|
}
|
|
1898
2048
|
if (data.opacity !== undefined) {
|
|
1899
|
-
this.opacity = data.opacity;
|
|
2049
|
+
this.opacity = setRangeValue(data.opacity);
|
|
1900
2050
|
}
|
|
1901
2051
|
if (data.width !== undefined) {
|
|
1902
|
-
this.width = data.width;
|
|
2052
|
+
this.width = setRangeValue(data.width);
|
|
1903
2053
|
}
|
|
1904
2054
|
if (data.radius !== undefined) {
|
|
1905
|
-
this.radius = data.radius;
|
|
2055
|
+
this.radius = setRangeValue(data.radius);
|
|
1906
2056
|
}
|
|
1907
2057
|
if (data.color !== undefined) {
|
|
1908
2058
|
this.color = OptionsColor.create(this.color, data.color);
|
|
@@ -1927,16 +2077,33 @@
|
|
|
1927
2077
|
this.enabled = data.enabled;
|
|
1928
2078
|
}
|
|
1929
2079
|
if (data.distance !== undefined) {
|
|
1930
|
-
this.distance = data.distance;
|
|
2080
|
+
this.distance = setRangeValue(data.distance);
|
|
1931
2081
|
}
|
|
1932
2082
|
if (data.duration !== undefined) {
|
|
1933
|
-
this.duration = data.duration;
|
|
2083
|
+
this.duration = setRangeValue(data.duration);
|
|
1934
2084
|
}
|
|
1935
2085
|
if (data.factor !== undefined) {
|
|
1936
|
-
this.factor = data.factor;
|
|
2086
|
+
this.factor = setRangeValue(data.factor);
|
|
1937
2087
|
}
|
|
1938
2088
|
if (data.speed !== undefined) {
|
|
1939
|
-
this.speed = data.speed;
|
|
2089
|
+
this.speed = setRangeValue(data.speed);
|
|
2090
|
+
}
|
|
2091
|
+
}
|
|
2092
|
+
}
|
|
2093
|
+
class RollLight_RollLight {
|
|
2094
|
+
constructor() {
|
|
2095
|
+
this.enable = false;
|
|
2096
|
+
this.value = 0;
|
|
2097
|
+
}
|
|
2098
|
+
load(data) {
|
|
2099
|
+
if (!data) {
|
|
2100
|
+
return;
|
|
2101
|
+
}
|
|
2102
|
+
if (data.enable !== undefined) {
|
|
2103
|
+
this.enable = data.enable;
|
|
2104
|
+
}
|
|
2105
|
+
if (data.value !== undefined) {
|
|
2106
|
+
this.value = setRangeValue(data.value);
|
|
1940
2107
|
}
|
|
1941
2108
|
}
|
|
1942
2109
|
}
|
|
@@ -1968,6 +2135,27 @@
|
|
|
1968
2135
|
}
|
|
1969
2136
|
}
|
|
1970
2137
|
}
|
|
2138
|
+
class RotateAnimation_RotateAnimation {
|
|
2139
|
+
constructor() {
|
|
2140
|
+
this.enable = false;
|
|
2141
|
+
this.speed = 0;
|
|
2142
|
+
this.sync = false;
|
|
2143
|
+
}
|
|
2144
|
+
load(data) {
|
|
2145
|
+
if (data === undefined) {
|
|
2146
|
+
return;
|
|
2147
|
+
}
|
|
2148
|
+
if (data.enable !== undefined) {
|
|
2149
|
+
this.enable = data.enable;
|
|
2150
|
+
}
|
|
2151
|
+
if (data.speed !== undefined) {
|
|
2152
|
+
this.speed = setRangeValue(data.speed);
|
|
2153
|
+
}
|
|
2154
|
+
if (data.sync !== undefined) {
|
|
2155
|
+
this.sync = data.sync;
|
|
2156
|
+
}
|
|
2157
|
+
}
|
|
2158
|
+
}
|
|
1971
2159
|
class Rotate_Rotate extends(null && ValueWithRandom){
|
|
1972
2160
|
constructor() {
|
|
1973
2161
|
super();
|
|
@@ -2086,6 +2274,45 @@
|
|
|
2086
2274
|
}
|
|
2087
2275
|
}
|
|
2088
2276
|
}
|
|
2277
|
+
class SizeAnimation_SizeAnimation extends(null && AnimationOptions){
|
|
2278
|
+
constructor() {
|
|
2279
|
+
super();
|
|
2280
|
+
this.destroy = "none";
|
|
2281
|
+
this.enable = false;
|
|
2282
|
+
this.speed = 5;
|
|
2283
|
+
this.startValue = "random";
|
|
2284
|
+
this.sync = false;
|
|
2285
|
+
}
|
|
2286
|
+
get size_min() {
|
|
2287
|
+
return this.minimumValue;
|
|
2288
|
+
}
|
|
2289
|
+
set size_min(value) {
|
|
2290
|
+
this.minimumValue = value;
|
|
2291
|
+
}
|
|
2292
|
+
load(data) {
|
|
2293
|
+
var _a;
|
|
2294
|
+
if (data === undefined) {
|
|
2295
|
+
return;
|
|
2296
|
+
}
|
|
2297
|
+
super.load(data);
|
|
2298
|
+
if (data.destroy !== undefined) {
|
|
2299
|
+
this.destroy = data.destroy;
|
|
2300
|
+
}
|
|
2301
|
+
if (data.enable !== undefined) {
|
|
2302
|
+
this.enable = data.enable;
|
|
2303
|
+
}
|
|
2304
|
+
this.minimumValue = (_a = data.minimumValue) !== null && _a !== void 0 ? _a : data.size_min;
|
|
2305
|
+
if (data.speed !== undefined) {
|
|
2306
|
+
this.speed = data.speed;
|
|
2307
|
+
}
|
|
2308
|
+
if (data.startValue !== undefined) {
|
|
2309
|
+
this.startValue = data.startValue;
|
|
2310
|
+
}
|
|
2311
|
+
if (data.sync !== undefined) {
|
|
2312
|
+
this.sync = data.sync;
|
|
2313
|
+
}
|
|
2314
|
+
}
|
|
2315
|
+
}
|
|
2089
2316
|
class Size_Size extends(null && ValueWithRandom){
|
|
2090
2317
|
constructor() {
|
|
2091
2318
|
super();
|
|
@@ -2131,6 +2358,27 @@
|
|
|
2131
2358
|
}
|
|
2132
2359
|
}
|
|
2133
2360
|
}
|
|
2361
|
+
class TiltAnimation_TiltAnimation {
|
|
2362
|
+
constructor() {
|
|
2363
|
+
this.enable = false;
|
|
2364
|
+
this.speed = 0;
|
|
2365
|
+
this.sync = false;
|
|
2366
|
+
}
|
|
2367
|
+
load(data) {
|
|
2368
|
+
if (data === undefined) {
|
|
2369
|
+
return;
|
|
2370
|
+
}
|
|
2371
|
+
if (data.enable !== undefined) {
|
|
2372
|
+
this.enable = data.enable;
|
|
2373
|
+
}
|
|
2374
|
+
if (data.speed !== undefined) {
|
|
2375
|
+
this.speed = setRangeValue(data.speed);
|
|
2376
|
+
}
|
|
2377
|
+
if (data.sync !== undefined) {
|
|
2378
|
+
this.sync = data.sync;
|
|
2379
|
+
}
|
|
2380
|
+
}
|
|
2381
|
+
}
|
|
2134
2382
|
class Tilt_Tilt extends(null && ValueWithRandom){
|
|
2135
2383
|
constructor() {
|
|
2136
2384
|
super();
|
|
@@ -2153,6 +2401,43 @@
|
|
|
2153
2401
|
}
|
|
2154
2402
|
}
|
|
2155
2403
|
}
|
|
2404
|
+
class TwinkleValues_TwinkleValues {
|
|
2405
|
+
constructor() {
|
|
2406
|
+
this.enable = false;
|
|
2407
|
+
this.frequency = .05;
|
|
2408
|
+
this.opacity = 1;
|
|
2409
|
+
}
|
|
2410
|
+
load(data) {
|
|
2411
|
+
if (data === undefined) {
|
|
2412
|
+
return;
|
|
2413
|
+
}
|
|
2414
|
+
if (data.color !== undefined) {
|
|
2415
|
+
this.color = OptionsColor.create(this.color, data.color);
|
|
2416
|
+
}
|
|
2417
|
+
if (data.enable !== undefined) {
|
|
2418
|
+
this.enable = data.enable;
|
|
2419
|
+
}
|
|
2420
|
+
if (data.frequency !== undefined) {
|
|
2421
|
+
this.frequency = data.frequency;
|
|
2422
|
+
}
|
|
2423
|
+
if (data.opacity !== undefined) {
|
|
2424
|
+
this.opacity = setRangeValue(data.opacity);
|
|
2425
|
+
}
|
|
2426
|
+
}
|
|
2427
|
+
}
|
|
2428
|
+
class Twinkle_Twinkle {
|
|
2429
|
+
constructor() {
|
|
2430
|
+
this.lines = new TwinkleValues;
|
|
2431
|
+
this.particles = new TwinkleValues;
|
|
2432
|
+
}
|
|
2433
|
+
load(data) {
|
|
2434
|
+
if (data === undefined) {
|
|
2435
|
+
return;
|
|
2436
|
+
}
|
|
2437
|
+
this.lines.load(data.lines);
|
|
2438
|
+
this.particles.load(data.particles);
|
|
2439
|
+
}
|
|
2440
|
+
}
|
|
2156
2441
|
class Wobble_Wobble {
|
|
2157
2442
|
constructor() {
|
|
2158
2443
|
this.distance = 5;
|
|
@@ -2590,7 +2875,7 @@
|
|
|
2590
2875
|
max: getRangeMax(sizeRange) * pxRatio,
|
|
2591
2876
|
min: getRangeMin(sizeRange) * pxRatio,
|
|
2592
2877
|
loops: 0,
|
|
2593
|
-
maxLoops: sizeOptions.animation.count
|
|
2878
|
+
maxLoops: getRangeValue(sizeOptions.animation.count)
|
|
2594
2879
|
};
|
|
2595
2880
|
const sizeAnimation = sizeOptions.animation;
|
|
2596
2881
|
if (sizeAnimation.enable) {
|
|
@@ -2624,6 +2909,12 @@
|
|
|
2624
2909
|
this.initialVelocity = this.calculateVelocity();
|
|
2625
2910
|
this.velocity = this.initialVelocity.copy();
|
|
2626
2911
|
this.moveDecay = 1 - getRangeValue(this.options.move.decay);
|
|
2912
|
+
const gravityOptions = this.options.move.gravity;
|
|
2913
|
+
this.gravity = {
|
|
2914
|
+
enable: gravityOptions.enable,
|
|
2915
|
+
acceleration: getRangeValue(gravityOptions.acceleration),
|
|
2916
|
+
inverse: gravityOptions.inverse
|
|
2917
|
+
};
|
|
2627
2918
|
this.position = this.calcPosition(container, position, clamp(zIndexValue, 0, container.zLayers));
|
|
2628
2919
|
this.initialPosition = this.position.copy();
|
|
2629
2920
|
this.offset = Vector.origin;
|
|
@@ -2831,12 +3122,7 @@
|
|
|
2831
3122
|
return overlaps;
|
|
2832
3123
|
}
|
|
2833
3124
|
calculateVelocity() {
|
|
2834
|
-
const baseVelocity = getParticleBaseVelocity(this.direction)
|
|
2835
|
-
const res = baseVelocity.copy();
|
|
2836
|
-
const moveOptions = this.options.move;
|
|
2837
|
-
const rad = Math.PI / 180 * moveOptions.angle.value;
|
|
2838
|
-
const radOffset = Math.PI / 180 * moveOptions.angle.offset;
|
|
2839
|
-
const range = {
|
|
3125
|
+
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 = {
|
|
2840
3126
|
left: radOffset - rad / 2,
|
|
2841
3127
|
right: radOffset + rad / 2
|
|
2842
3128
|
};
|
|
@@ -3226,13 +3512,13 @@
|
|
|
3226
3512
|
container.canvas.size.height = element.offsetHeight * ratio;
|
|
3227
3513
|
}
|
|
3228
3514
|
const particles = options.particles;
|
|
3229
|
-
this.attractDistance = particles.move.attract.distance * ratio;
|
|
3515
|
+
this.attractDistance = getRangeValue(particles.move.attract.distance) * ratio;
|
|
3230
3516
|
this.linksDistance = particles.links.distance * ratio;
|
|
3231
3517
|
this.linksWidth = particles.links.width * ratio;
|
|
3232
|
-
this.sizeAnimationSpeed = particles.size.animation.speed * ratio;
|
|
3233
|
-
this.maxSpeed = particles.move.gravity.maxSpeed * ratio;
|
|
3518
|
+
this.sizeAnimationSpeed = getRangeValue(particles.size.animation.speed) * ratio;
|
|
3519
|
+
this.maxSpeed = getRangeValue(particles.move.gravity.maxSpeed) * ratio;
|
|
3234
3520
|
if (particles.orbit.radius !== undefined) {
|
|
3235
|
-
this.orbitRadius = particles.orbit.radius * this.container.retina.pixelRatio;
|
|
3521
|
+
this.orbitRadius = getRangeValue(particles.orbit.radius) * this.container.retina.pixelRatio;
|
|
3236
3522
|
}
|
|
3237
3523
|
const modes = options.interactivity.modes;
|
|
3238
3524
|
this.connectModeDistance = modes.connect.distance * ratio;
|
|
@@ -3252,19 +3538,19 @@
|
|
|
3252
3538
|
const ratio = this.pixelRatio;
|
|
3253
3539
|
const moveDistance = options.move.distance;
|
|
3254
3540
|
const props = particle.retina;
|
|
3255
|
-
props.attractDistance = options.move.attract.distance * ratio;
|
|
3541
|
+
props.attractDistance = getRangeValue(options.move.attract.distance) * ratio;
|
|
3256
3542
|
props.linksDistance = options.links.distance * ratio;
|
|
3257
3543
|
props.linksWidth = options.links.width * ratio;
|
|
3258
3544
|
props.moveDrift = getRangeValue(options.move.drift) * ratio;
|
|
3259
3545
|
props.moveSpeed = getRangeValue(options.move.speed) * ratio;
|
|
3260
|
-
props.sizeAnimationSpeed = options.size.animation.speed * ratio;
|
|
3546
|
+
props.sizeAnimationSpeed = getRangeValue(options.size.animation.speed) * ratio;
|
|
3261
3547
|
if (particle.spin) {
|
|
3262
3548
|
props.spinAcceleration = getRangeValue(options.move.spin.acceleration) * ratio;
|
|
3263
3549
|
}
|
|
3264
3550
|
const maxDistance = props.maxDistance;
|
|
3265
3551
|
maxDistance.horizontal = moveDistance.horizontal !== undefined ? moveDistance.horizontal * ratio : undefined;
|
|
3266
3552
|
maxDistance.vertical = moveDistance.vertical !== undefined ? moveDistance.vertical * ratio : undefined;
|
|
3267
|
-
props.maxSpeed = options.move.gravity.maxSpeed * ratio;
|
|
3553
|
+
props.maxSpeed = getRangeValue(options.move.gravity.maxSpeed) * ratio;
|
|
3268
3554
|
}
|
|
3269
3555
|
handleMotionChange(mediaQuery) {
|
|
3270
3556
|
const options = this.container.actualOptions;
|
|
@@ -4596,7 +4882,7 @@
|
|
|
4596
4882
|
function setColorAnimation(colorValue, colorAnimation, reduceFactor) {
|
|
4597
4883
|
colorValue.enable = colorAnimation.enable;
|
|
4598
4884
|
if (colorValue.enable) {
|
|
4599
|
-
colorValue.velocity = colorAnimation.speed / 100 * reduceFactor;
|
|
4885
|
+
colorValue.velocity = getRangeValue(colorAnimation.speed) / 100 * reduceFactor;
|
|
4600
4886
|
if (colorAnimation.sync) {
|
|
4601
4887
|
return;
|
|
4602
4888
|
}
|
|
@@ -4954,7 +5240,7 @@
|
|
|
4954
5240
|
min: NumberUtils_getRangeMin(opacityOptions.value),
|
|
4955
5241
|
value: NumberUtils_getRangeValue(opacityOptions.value),
|
|
4956
5242
|
loops: 0,
|
|
4957
|
-
maxLoops: opacityOptions.animation.count
|
|
5243
|
+
maxLoops: NumberUtils_getRangeValue(opacityOptions.animation.count)
|
|
4958
5244
|
};
|
|
4959
5245
|
const opacityAnimation = opacityOptions.animation;
|
|
4960
5246
|
if (opacityAnimation.enable) {
|
|
@@ -4979,7 +5265,7 @@
|
|
|
4979
5265
|
particle.opacity.status = 1;
|
|
4980
5266
|
break;
|
|
4981
5267
|
}
|
|
4982
|
-
particle.opacity.velocity = opacityAnimation.speed / 100 * this.container.retina.reduceFactor;
|
|
5268
|
+
particle.opacity.velocity = NumberUtils_getRangeValue(opacityAnimation.speed) / 100 * this.container.retina.reduceFactor;
|
|
4983
5269
|
if (!opacityAnimation.sync) {
|
|
4984
5270
|
particle.opacity.velocity *= Math.random();
|
|
4985
5271
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! tsParticles v1.
|
|
2
|
-
!function(o,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e=t();for(var a in e)("object"==typeof exports?exports:o)[a]=e[a]}}(window,(function(){return function(){"use strict";var o={d:function(t,e){for(var a in e)o.o(e,a)&&!o.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:e[a]})},o:function(o,t){return Object.prototype.hasOwnProperty.call(o,t)},r:function(o){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})}},t={};o.r(t),o.d(t,{loadOpacityUpdater:function(){return s}});class e{}e.generatedAttribute="generated",e.randomColorValue="random",e.midColorValue="mid",e.touchEndEvent="touchend",e.mouseDownEvent="mousedown",e.mouseUpEvent="mouseup",e.mouseMoveEvent="mousemove",e.touchStartEvent="touchstart",e.touchMoveEvent="touchmove",e.mouseLeaveEvent="mouseleave",e.mouseOutEvent="mouseout",e.touchCancelEvent="touchcancel",e.resizeEvent="resize",e.visibilityChangeEvent="visibilitychange",e.noPolygonDataLoaded="No polygon data loaded.",e.noPolygonFound="No polygon found, you need to specify SVG url in config.";new WeakMap;new WeakMap;new WeakMap,new WeakSet;new WeakMap;new WeakMap;new WeakMap;function a(o){const t=c(o);let e=i(o);return t===e&&(e=0),Math.random()*(t-e)+e}function n(o){return"number"==typeof o?o:a(o)}function i(o){return"number"==typeof o?o:o.min}function c(o){return"number"==typeof o?o:o.max}function p(o,t){var e,a,n,i,c;if(!o.opacity)return;const p=o.opacity.min,u=o.opacity.max;if(!(o.destroyed||!o.opacity.enable||(null!==(e=o.opacity.maxLoops)&&void 0!==e?e:0)>0&&(null!==(a=o.opacity.loops)&&void 0!==a?a:0)>(null!==(n=o.opacity.maxLoops)&&void 0!==n?n:0))){switch(o.opacity.status){case 0:o.opacity.value>=u?(o.opacity.status=1,o.opacity.loops||(o.opacity.loops=0),o.opacity.loops++):o.opacity.value+=(null!==(i=o.opacity.velocity)&&void 0!==i?i:0)*t.factor;break;case 1:o.opacity.value<=p?(o.opacity.status=0,o.opacity.loops||(o.opacity.loops=0),o.opacity.loops++):o.opacity.value-=(null!==(c=o.opacity.velocity)&&void 0!==c?c:0)*t.factor}var s,r,l;!function(o,t,e,a){switch(o.options.opacity.animation.destroy){case"max":t>=a&&o.destroy();break;case"min":t<=e&&o.destroy()}}(o,o.opacity.value,p,u),o.destroyed||(o.opacity.value=(s=o.opacity.value,r=p,l=u,Math.min(Math.max(s,r),l)))}}new WeakMap;class u{constructor(o){this.container=o}init(o){const t=o.options.opacity;o.opacity={enable:t.animation.enable,max:c(t.value),min:i(t.value),value:n(t.value),loops:0,maxLoops:t.animation.count};const e=t.animation;if(e.enable){o.opacity.status=0;const
|
|
1
|
+
/*! tsParticles v1.42.2 by Matteo Bruni */
|
|
2
|
+
!function(o,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e=t();for(var a in e)("object"==typeof exports?exports:o)[a]=e[a]}}(window,(function(){return function(){"use strict";var o={d:function(t,e){for(var a in e)o.o(e,a)&&!o.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:e[a]})},o:function(o,t){return Object.prototype.hasOwnProperty.call(o,t)},r:function(o){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})}},t={};o.r(t),o.d(t,{loadOpacityUpdater:function(){return s}});class e{}e.generatedAttribute="generated",e.randomColorValue="random",e.midColorValue="mid",e.touchEndEvent="touchend",e.mouseDownEvent="mousedown",e.mouseUpEvent="mouseup",e.mouseMoveEvent="mousemove",e.touchStartEvent="touchstart",e.touchMoveEvent="touchmove",e.mouseLeaveEvent="mouseleave",e.mouseOutEvent="mouseout",e.touchCancelEvent="touchcancel",e.resizeEvent="resize",e.visibilityChangeEvent="visibilitychange",e.noPolygonDataLoaded="No polygon data loaded.",e.noPolygonFound="No polygon found, you need to specify SVG url in config.";new WeakMap;new WeakMap;new WeakMap,new WeakSet;new WeakMap;new WeakMap;new WeakMap;function a(o){const t=c(o);let e=i(o);return t===e&&(e=0),Math.random()*(t-e)+e}function n(o){return"number"==typeof o?o:a(o)}function i(o){return"number"==typeof o?o:o.min}function c(o){return"number"==typeof o?o:o.max}function p(o,t){var e,a,n,i,c;if(!o.opacity)return;const p=o.opacity.min,u=o.opacity.max;if(!(o.destroyed||!o.opacity.enable||(null!==(e=o.opacity.maxLoops)&&void 0!==e?e:0)>0&&(null!==(a=o.opacity.loops)&&void 0!==a?a:0)>(null!==(n=o.opacity.maxLoops)&&void 0!==n?n:0))){switch(o.opacity.status){case 0:o.opacity.value>=u?(o.opacity.status=1,o.opacity.loops||(o.opacity.loops=0),o.opacity.loops++):o.opacity.value+=(null!==(i=o.opacity.velocity)&&void 0!==i?i:0)*t.factor;break;case 1:o.opacity.value<=p?(o.opacity.status=0,o.opacity.loops||(o.opacity.loops=0),o.opacity.loops++):o.opacity.value-=(null!==(c=o.opacity.velocity)&&void 0!==c?c:0)*t.factor}var s,r,l;!function(o,t,e,a){switch(o.options.opacity.animation.destroy){case"max":t>=a&&o.destroy();break;case"min":t<=e&&o.destroy()}}(o,o.opacity.value,p,u),o.destroyed||(o.opacity.value=(s=o.opacity.value,r=p,l=u,Math.min(Math.max(s,r),l)))}}new WeakMap;class u{constructor(o){this.container=o}init(o){const t=o.options.opacity;o.opacity={enable:t.animation.enable,max:c(t.value),min:i(t.value),value:n(t.value),loops:0,maxLoops:n(t.animation.count)};const e=t.animation;if(e.enable){o.opacity.status=0;const p=t.value;switch(o.opacity.min=i(p),o.opacity.max=c(p),e.startValue){case"min":o.opacity.value=o.opacity.min,o.opacity.status=0;break;case"random":o.opacity.value=a(o.opacity),o.opacity.status=Math.random()>=.5?0:1;break;case"max":default:o.opacity.value=o.opacity.max,o.opacity.status=1}o.opacity.velocity=n(e.speed)/100*this.container.retina.reduceFactor,e.sync||(o.opacity.velocity*=Math.random())}}isEnabled(o){var t,e,a,n;return!o.destroyed&&!o.spawning&&!!o.opacity&&o.opacity.enable&&((null!==(t=o.opacity.maxLoops)&&void 0!==t?t:0)<=0||(null!==(e=o.opacity.maxLoops)&&void 0!==e?e:0)>0&&(null!==(a=o.opacity.loops)&&void 0!==a?a:0)<(null!==(n=o.opacity.maxLoops)&&void 0!==n?n:0))}update(o,t){this.isEnabled(o)&&p(o,t)}}async function s(o){await o.addParticleUpdater("opacity",(o=>new u(o)))}return t}()}));
|