tsparticles 1.41.6 → 1.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Core/Canvas.js +3 -1
- 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.js +4 -2
- 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.js +4 -2
- 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 +1 -1
- package/report.html +2 -2
- package/report.slim.html +2 -2
- package/scripts/install.js +11 -2
- package/tsparticles.engine.js +43 -42
- package/tsparticles.engine.min.js +2 -2
- package/tsparticles.interaction.external.attract.js +315 -31
- package/tsparticles.interaction.external.attract.min.js +1 -1
- package/tsparticles.interaction.external.bounce.js +315 -31
- package/tsparticles.interaction.external.bounce.min.js +1 -1
- package/tsparticles.interaction.external.bubble.js +315 -31
- package/tsparticles.interaction.external.bubble.min.js +1 -1
- package/tsparticles.interaction.external.connect.js +315 -31
- package/tsparticles.interaction.external.connect.min.js +1 -1
- package/tsparticles.interaction.external.grab.js +315 -31
- package/tsparticles.interaction.external.grab.min.js +1 -1
- package/tsparticles.interaction.external.repulse.js +315 -31
- package/tsparticles.interaction.external.repulse.min.js +1 -1
- package/tsparticles.interaction.external.trail.js +315 -31
- package/tsparticles.interaction.external.trail.min.js +1 -1
- package/tsparticles.interaction.particles.attract.js +315 -31
- package/tsparticles.interaction.particles.attract.min.js +1 -1
- package/tsparticles.interaction.particles.collisions.js +315 -31
- package/tsparticles.interaction.particles.collisions.min.js +1 -1
- package/tsparticles.interaction.particles.links.js +316 -32
- package/tsparticles.interaction.particles.links.min.js +2 -2
- package/tsparticles.js +69 -62
- package/tsparticles.min.js +2 -2
- package/tsparticles.pathseg.min.js +1 -1
- package/tsparticles.plugins.absorbers.js +323 -36
- package/tsparticles.plugins.absorbers.min.js +2 -2
- package/tsparticles.plugins.emitters.js +426 -139
- package/tsparticles.plugins.emitters.min.js +2 -2
- package/tsparticles.plugins.polygonMask.js +315 -31
- package/tsparticles.plugins.polygonMask.min.js +1 -1
- package/tsparticles.shape.circle.min.js +1 -1
- package/tsparticles.shape.image.js +315 -31
- 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 +315 -31
- package/tsparticles.shape.text.min.js +1 -1
- package/tsparticles.slim.js +47 -46
- package/tsparticles.slim.min.js +2 -2
- package/tsparticles.updater.angle.js +316 -32
- package/tsparticles.updater.angle.min.js +2 -2
- package/tsparticles.updater.color.js +315 -31
- package/tsparticles.updater.color.min.js +2 -2
- package/tsparticles.updater.life.js +315 -31
- package/tsparticles.updater.life.min.js +1 -1
- package/tsparticles.updater.opacity.js +317 -33
- package/tsparticles.updater.opacity.min.js +2 -2
- package/tsparticles.updater.outModes.js +315 -31
- package/tsparticles.updater.outModes.min.js +1 -1
- package/tsparticles.updater.roll.js +318 -34
- package/tsparticles.updater.roll.min.js +2 -2
- package/tsparticles.updater.size.js +315 -31
- package/tsparticles.updater.size.min.js +1 -1
- package/tsparticles.updater.strokeColor.js +315 -31
- package/tsparticles.updater.strokeColor.min.js +2 -2
- package/tsparticles.updater.tilt.js +316 -32
- package/tsparticles.updater.tilt.min.js +2 -2
- package/tsparticles.updater.wobble.js +315 -31
- package/tsparticles.updater.wobble.min.js +1 -1
- package/umd/Core/Canvas.js +3 -1
- 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;
|
|
@@ -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;
|
|
@@ -1316,7 +1316,7 @@
|
|
|
1316
1316
|
return;
|
|
1317
1317
|
}
|
|
1318
1318
|
if (data.count !== undefined) {
|
|
1319
|
-
this.count = data.count;
|
|
1319
|
+
this.count = setRangeValue(data.count);
|
|
1320
1320
|
}
|
|
1321
1321
|
if (data.enable !== undefined) {
|
|
1322
1322
|
this.enable = data.enable;
|
|
@@ -1325,7 +1325,7 @@
|
|
|
1325
1325
|
this.offset = setRangeValue(data.offset);
|
|
1326
1326
|
}
|
|
1327
1327
|
if (data.speed !== undefined) {
|
|
1328
|
-
this.speed = data.speed;
|
|
1328
|
+
this.speed = setRangeValue(data.speed);
|
|
1329
1329
|
}
|
|
1330
1330
|
if (data.sync !== undefined) {
|
|
1331
1331
|
this.sync = data.sync;
|
|
@@ -1473,13 +1473,13 @@
|
|
|
1473
1473
|
return;
|
|
1474
1474
|
}
|
|
1475
1475
|
if (data.count !== undefined) {
|
|
1476
|
-
this.count = data.count;
|
|
1476
|
+
this.count = setRangeValue(data.count);
|
|
1477
1477
|
}
|
|
1478
1478
|
if (data.enable !== undefined) {
|
|
1479
1479
|
this.enable = data.enable;
|
|
1480
1480
|
}
|
|
1481
1481
|
if (data.speed !== undefined) {
|
|
1482
|
-
this.speed = data.speed;
|
|
1482
|
+
this.speed = setRangeValue(data.speed);
|
|
1483
1483
|
}
|
|
1484
1484
|
if (data.sync !== undefined) {
|
|
1485
1485
|
this.sync = data.sync;
|
|
@@ -1499,13 +1499,13 @@
|
|
|
1499
1499
|
return;
|
|
1500
1500
|
}
|
|
1501
1501
|
if (data.count !== undefined) {
|
|
1502
|
-
this.count = data.count;
|
|
1502
|
+
this.count = setRangeValue(data.count);
|
|
1503
1503
|
}
|
|
1504
1504
|
if (data.enable !== undefined) {
|
|
1505
1505
|
this.enable = data.enable;
|
|
1506
1506
|
}
|
|
1507
1507
|
if (data.speed !== undefined) {
|
|
1508
|
-
this.speed = data.speed;
|
|
1508
|
+
this.speed = setRangeValue(data.speed);
|
|
1509
1509
|
}
|
|
1510
1510
|
if (data.sync !== undefined) {
|
|
1511
1511
|
this.sync = data.sync;
|
|
@@ -1677,6 +1677,90 @@
|
|
|
1677
1677
|
this.duration.load(data.duration);
|
|
1678
1678
|
}
|
|
1679
1679
|
}
|
|
1680
|
+
class Attract_Attract {
|
|
1681
|
+
constructor() {
|
|
1682
|
+
this.distance = 200;
|
|
1683
|
+
this.enable = false;
|
|
1684
|
+
this.rotate = {
|
|
1685
|
+
x: 3e3,
|
|
1686
|
+
y: 3e3
|
|
1687
|
+
};
|
|
1688
|
+
}
|
|
1689
|
+
get rotateX() {
|
|
1690
|
+
return this.rotate.x;
|
|
1691
|
+
}
|
|
1692
|
+
set rotateX(value) {
|
|
1693
|
+
this.rotate.x = value;
|
|
1694
|
+
}
|
|
1695
|
+
get rotateY() {
|
|
1696
|
+
return this.rotate.y;
|
|
1697
|
+
}
|
|
1698
|
+
set rotateY(value) {
|
|
1699
|
+
this.rotate.y = value;
|
|
1700
|
+
}
|
|
1701
|
+
load(data) {
|
|
1702
|
+
var _a, _b, _c, _d;
|
|
1703
|
+
if (!data) {
|
|
1704
|
+
return;
|
|
1705
|
+
}
|
|
1706
|
+
if (data.distance !== undefined) {
|
|
1707
|
+
this.distance = setRangeValue(data.distance);
|
|
1708
|
+
}
|
|
1709
|
+
if (data.enable !== undefined) {
|
|
1710
|
+
this.enable = data.enable;
|
|
1711
|
+
}
|
|
1712
|
+
const rotateX = (_b = (_a = data.rotate) === null || _a === void 0 ? void 0 : _a.x) !== null && _b !== void 0 ? _b : data.rotateX;
|
|
1713
|
+
if (rotateX !== undefined) {
|
|
1714
|
+
this.rotate.x = rotateX;
|
|
1715
|
+
}
|
|
1716
|
+
const rotateY = (_d = (_c = data.rotate) === null || _c === void 0 ? void 0 : _c.y) !== null && _d !== void 0 ? _d : data.rotateY;
|
|
1717
|
+
if (rotateY !== undefined) {
|
|
1718
|
+
this.rotate.y = rotateY;
|
|
1719
|
+
}
|
|
1720
|
+
}
|
|
1721
|
+
}
|
|
1722
|
+
class MoveAngle_MoveAngle {
|
|
1723
|
+
constructor() {
|
|
1724
|
+
this.offset = 0;
|
|
1725
|
+
this.value = 90;
|
|
1726
|
+
}
|
|
1727
|
+
load(data) {
|
|
1728
|
+
if (data === undefined) {
|
|
1729
|
+
return;
|
|
1730
|
+
}
|
|
1731
|
+
if (data.offset !== undefined) {
|
|
1732
|
+
this.offset = setRangeValue(data.offset);
|
|
1733
|
+
}
|
|
1734
|
+
if (data.value !== undefined) {
|
|
1735
|
+
this.value = setRangeValue(data.value);
|
|
1736
|
+
}
|
|
1737
|
+
}
|
|
1738
|
+
}
|
|
1739
|
+
class MoveGravity_MoveGravity {
|
|
1740
|
+
constructor() {
|
|
1741
|
+
this.acceleration = 9.81;
|
|
1742
|
+
this.enable = false;
|
|
1743
|
+
this.inverse = false;
|
|
1744
|
+
this.maxSpeed = 50;
|
|
1745
|
+
}
|
|
1746
|
+
load(data) {
|
|
1747
|
+
if (!data) {
|
|
1748
|
+
return;
|
|
1749
|
+
}
|
|
1750
|
+
if (data.acceleration !== undefined) {
|
|
1751
|
+
this.acceleration = setRangeValue(data.acceleration);
|
|
1752
|
+
}
|
|
1753
|
+
if (data.enable !== undefined) {
|
|
1754
|
+
this.enable = data.enable;
|
|
1755
|
+
}
|
|
1756
|
+
if (data.inverse !== undefined) {
|
|
1757
|
+
this.inverse = data.inverse;
|
|
1758
|
+
}
|
|
1759
|
+
if (data.maxSpeed !== undefined) {
|
|
1760
|
+
this.maxSpeed = setRangeValue(data.maxSpeed);
|
|
1761
|
+
}
|
|
1762
|
+
}
|
|
1763
|
+
}
|
|
1680
1764
|
class PathDelay_PathDelay extends(null && ValueWithRandom){
|
|
1681
1765
|
constructor() {
|
|
1682
1766
|
super();
|
|
@@ -1838,6 +1922,70 @@
|
|
|
1838
1922
|
}
|
|
1839
1923
|
}
|
|
1840
1924
|
}
|
|
1925
|
+
class AnimationOptions_AnimationOptions {
|
|
1926
|
+
constructor() {
|
|
1927
|
+
this.count = 0;
|
|
1928
|
+
this.enable = false;
|
|
1929
|
+
this.speed = 1;
|
|
1930
|
+
this.sync = false;
|
|
1931
|
+
}
|
|
1932
|
+
load(data) {
|
|
1933
|
+
if (!data) {
|
|
1934
|
+
return;
|
|
1935
|
+
}
|
|
1936
|
+
if (data.count !== undefined) {
|
|
1937
|
+
this.count = setRangeValue(data.count);
|
|
1938
|
+
}
|
|
1939
|
+
if (data.enable !== undefined) {
|
|
1940
|
+
this.enable = data.enable;
|
|
1941
|
+
}
|
|
1942
|
+
if (data.speed !== undefined) {
|
|
1943
|
+
this.speed = setRangeValue(data.speed);
|
|
1944
|
+
}
|
|
1945
|
+
if (data.sync !== undefined) {
|
|
1946
|
+
this.sync = data.sync;
|
|
1947
|
+
}
|
|
1948
|
+
}
|
|
1949
|
+
}
|
|
1950
|
+
class OpacityAnimation_OpacityAnimation extends(null && AnimationOptions){
|
|
1951
|
+
constructor() {
|
|
1952
|
+
super();
|
|
1953
|
+
this.destroy = "none";
|
|
1954
|
+
this.enable = false;
|
|
1955
|
+
this.speed = 2;
|
|
1956
|
+
this.startValue = "random";
|
|
1957
|
+
this.sync = false;
|
|
1958
|
+
}
|
|
1959
|
+
get opacity_min() {
|
|
1960
|
+
return this.minimumValue;
|
|
1961
|
+
}
|
|
1962
|
+
set opacity_min(value) {
|
|
1963
|
+
this.minimumValue = value;
|
|
1964
|
+
}
|
|
1965
|
+
load(data) {
|
|
1966
|
+
var _a;
|
|
1967
|
+
if (data === undefined) {
|
|
1968
|
+
return;
|
|
1969
|
+
}
|
|
1970
|
+
super.load(data);
|
|
1971
|
+
if (data.destroy !== undefined) {
|
|
1972
|
+
this.destroy = data.destroy;
|
|
1973
|
+
}
|
|
1974
|
+
if (data.enable !== undefined) {
|
|
1975
|
+
this.enable = data.enable;
|
|
1976
|
+
}
|
|
1977
|
+
this.minimumValue = (_a = data.minimumValue) !== null && _a !== void 0 ? _a : data.opacity_min;
|
|
1978
|
+
if (data.speed !== undefined) {
|
|
1979
|
+
this.speed = data.speed;
|
|
1980
|
+
}
|
|
1981
|
+
if (data.startValue !== undefined) {
|
|
1982
|
+
this.startValue = data.startValue;
|
|
1983
|
+
}
|
|
1984
|
+
if (data.sync !== undefined) {
|
|
1985
|
+
this.sync = data.sync;
|
|
1986
|
+
}
|
|
1987
|
+
}
|
|
1988
|
+
}
|
|
1841
1989
|
class Opacity_Opacity extends(null && ValueWithRandom){
|
|
1842
1990
|
constructor() {
|
|
1843
1991
|
super();
|
|
@@ -1896,13 +2044,13 @@
|
|
|
1896
2044
|
this.enable = data.enable;
|
|
1897
2045
|
}
|
|
1898
2046
|
if (data.opacity !== undefined) {
|
|
1899
|
-
this.opacity = data.opacity;
|
|
2047
|
+
this.opacity = setRangeValue(data.opacity);
|
|
1900
2048
|
}
|
|
1901
2049
|
if (data.width !== undefined) {
|
|
1902
|
-
this.width = data.width;
|
|
2050
|
+
this.width = setRangeValue(data.width);
|
|
1903
2051
|
}
|
|
1904
2052
|
if (data.radius !== undefined) {
|
|
1905
|
-
this.radius = data.radius;
|
|
2053
|
+
this.radius = setRangeValue(data.radius);
|
|
1906
2054
|
}
|
|
1907
2055
|
if (data.color !== undefined) {
|
|
1908
2056
|
this.color = OptionsColor.create(this.color, data.color);
|
|
@@ -1927,16 +2075,33 @@
|
|
|
1927
2075
|
this.enabled = data.enabled;
|
|
1928
2076
|
}
|
|
1929
2077
|
if (data.distance !== undefined) {
|
|
1930
|
-
this.distance = data.distance;
|
|
2078
|
+
this.distance = setRangeValue(data.distance);
|
|
1931
2079
|
}
|
|
1932
2080
|
if (data.duration !== undefined) {
|
|
1933
|
-
this.duration = data.duration;
|
|
2081
|
+
this.duration = setRangeValue(data.duration);
|
|
1934
2082
|
}
|
|
1935
2083
|
if (data.factor !== undefined) {
|
|
1936
|
-
this.factor = data.factor;
|
|
2084
|
+
this.factor = setRangeValue(data.factor);
|
|
1937
2085
|
}
|
|
1938
2086
|
if (data.speed !== undefined) {
|
|
1939
|
-
this.speed = data.speed;
|
|
2087
|
+
this.speed = setRangeValue(data.speed);
|
|
2088
|
+
}
|
|
2089
|
+
}
|
|
2090
|
+
}
|
|
2091
|
+
class RollLight_RollLight {
|
|
2092
|
+
constructor() {
|
|
2093
|
+
this.enable = false;
|
|
2094
|
+
this.value = 0;
|
|
2095
|
+
}
|
|
2096
|
+
load(data) {
|
|
2097
|
+
if (!data) {
|
|
2098
|
+
return;
|
|
2099
|
+
}
|
|
2100
|
+
if (data.enable !== undefined) {
|
|
2101
|
+
this.enable = data.enable;
|
|
2102
|
+
}
|
|
2103
|
+
if (data.value !== undefined) {
|
|
2104
|
+
this.value = setRangeValue(data.value);
|
|
1940
2105
|
}
|
|
1941
2106
|
}
|
|
1942
2107
|
}
|
|
@@ -1968,6 +2133,27 @@
|
|
|
1968
2133
|
}
|
|
1969
2134
|
}
|
|
1970
2135
|
}
|
|
2136
|
+
class RotateAnimation_RotateAnimation {
|
|
2137
|
+
constructor() {
|
|
2138
|
+
this.enable = false;
|
|
2139
|
+
this.speed = 0;
|
|
2140
|
+
this.sync = false;
|
|
2141
|
+
}
|
|
2142
|
+
load(data) {
|
|
2143
|
+
if (data === undefined) {
|
|
2144
|
+
return;
|
|
2145
|
+
}
|
|
2146
|
+
if (data.enable !== undefined) {
|
|
2147
|
+
this.enable = data.enable;
|
|
2148
|
+
}
|
|
2149
|
+
if (data.speed !== undefined) {
|
|
2150
|
+
this.speed = setRangeValue(data.speed);
|
|
2151
|
+
}
|
|
2152
|
+
if (data.sync !== undefined) {
|
|
2153
|
+
this.sync = data.sync;
|
|
2154
|
+
}
|
|
2155
|
+
}
|
|
2156
|
+
}
|
|
1971
2157
|
class Rotate_Rotate extends(null && ValueWithRandom){
|
|
1972
2158
|
constructor() {
|
|
1973
2159
|
super();
|
|
@@ -2086,6 +2272,45 @@
|
|
|
2086
2272
|
}
|
|
2087
2273
|
}
|
|
2088
2274
|
}
|
|
2275
|
+
class SizeAnimation_SizeAnimation extends(null && AnimationOptions){
|
|
2276
|
+
constructor() {
|
|
2277
|
+
super();
|
|
2278
|
+
this.destroy = "none";
|
|
2279
|
+
this.enable = false;
|
|
2280
|
+
this.speed = 5;
|
|
2281
|
+
this.startValue = "random";
|
|
2282
|
+
this.sync = false;
|
|
2283
|
+
}
|
|
2284
|
+
get size_min() {
|
|
2285
|
+
return this.minimumValue;
|
|
2286
|
+
}
|
|
2287
|
+
set size_min(value) {
|
|
2288
|
+
this.minimumValue = value;
|
|
2289
|
+
}
|
|
2290
|
+
load(data) {
|
|
2291
|
+
var _a;
|
|
2292
|
+
if (data === undefined) {
|
|
2293
|
+
return;
|
|
2294
|
+
}
|
|
2295
|
+
super.load(data);
|
|
2296
|
+
if (data.destroy !== undefined) {
|
|
2297
|
+
this.destroy = data.destroy;
|
|
2298
|
+
}
|
|
2299
|
+
if (data.enable !== undefined) {
|
|
2300
|
+
this.enable = data.enable;
|
|
2301
|
+
}
|
|
2302
|
+
this.minimumValue = (_a = data.minimumValue) !== null && _a !== void 0 ? _a : data.size_min;
|
|
2303
|
+
if (data.speed !== undefined) {
|
|
2304
|
+
this.speed = data.speed;
|
|
2305
|
+
}
|
|
2306
|
+
if (data.startValue !== undefined) {
|
|
2307
|
+
this.startValue = data.startValue;
|
|
2308
|
+
}
|
|
2309
|
+
if (data.sync !== undefined) {
|
|
2310
|
+
this.sync = data.sync;
|
|
2311
|
+
}
|
|
2312
|
+
}
|
|
2313
|
+
}
|
|
2089
2314
|
class Size_Size extends(null && ValueWithRandom){
|
|
2090
2315
|
constructor() {
|
|
2091
2316
|
super();
|
|
@@ -2131,6 +2356,27 @@
|
|
|
2131
2356
|
}
|
|
2132
2357
|
}
|
|
2133
2358
|
}
|
|
2359
|
+
class TiltAnimation_TiltAnimation {
|
|
2360
|
+
constructor() {
|
|
2361
|
+
this.enable = false;
|
|
2362
|
+
this.speed = 0;
|
|
2363
|
+
this.sync = false;
|
|
2364
|
+
}
|
|
2365
|
+
load(data) {
|
|
2366
|
+
if (data === undefined) {
|
|
2367
|
+
return;
|
|
2368
|
+
}
|
|
2369
|
+
if (data.enable !== undefined) {
|
|
2370
|
+
this.enable = data.enable;
|
|
2371
|
+
}
|
|
2372
|
+
if (data.speed !== undefined) {
|
|
2373
|
+
this.speed = setRangeValue(data.speed);
|
|
2374
|
+
}
|
|
2375
|
+
if (data.sync !== undefined) {
|
|
2376
|
+
this.sync = data.sync;
|
|
2377
|
+
}
|
|
2378
|
+
}
|
|
2379
|
+
}
|
|
2134
2380
|
class Tilt_Tilt extends(null && ValueWithRandom){
|
|
2135
2381
|
constructor() {
|
|
2136
2382
|
super();
|
|
@@ -2153,6 +2399,43 @@
|
|
|
2153
2399
|
}
|
|
2154
2400
|
}
|
|
2155
2401
|
}
|
|
2402
|
+
class TwinkleValues_TwinkleValues {
|
|
2403
|
+
constructor() {
|
|
2404
|
+
this.enable = false;
|
|
2405
|
+
this.frequency = .05;
|
|
2406
|
+
this.opacity = 1;
|
|
2407
|
+
}
|
|
2408
|
+
load(data) {
|
|
2409
|
+
if (data === undefined) {
|
|
2410
|
+
return;
|
|
2411
|
+
}
|
|
2412
|
+
if (data.color !== undefined) {
|
|
2413
|
+
this.color = OptionsColor.create(this.color, data.color);
|
|
2414
|
+
}
|
|
2415
|
+
if (data.enable !== undefined) {
|
|
2416
|
+
this.enable = data.enable;
|
|
2417
|
+
}
|
|
2418
|
+
if (data.frequency !== undefined) {
|
|
2419
|
+
this.frequency = data.frequency;
|
|
2420
|
+
}
|
|
2421
|
+
if (data.opacity !== undefined) {
|
|
2422
|
+
this.opacity = setRangeValue(data.opacity);
|
|
2423
|
+
}
|
|
2424
|
+
}
|
|
2425
|
+
}
|
|
2426
|
+
class Twinkle_Twinkle {
|
|
2427
|
+
constructor() {
|
|
2428
|
+
this.lines = new TwinkleValues;
|
|
2429
|
+
this.particles = new TwinkleValues;
|
|
2430
|
+
}
|
|
2431
|
+
load(data) {
|
|
2432
|
+
if (data === undefined) {
|
|
2433
|
+
return;
|
|
2434
|
+
}
|
|
2435
|
+
this.lines.load(data.lines);
|
|
2436
|
+
this.particles.load(data.particles);
|
|
2437
|
+
}
|
|
2438
|
+
}
|
|
2156
2439
|
class Wobble_Wobble {
|
|
2157
2440
|
constructor() {
|
|
2158
2441
|
this.distance = 5;
|
|
@@ -2590,7 +2873,7 @@
|
|
|
2590
2873
|
max: getRangeMax(sizeRange) * pxRatio,
|
|
2591
2874
|
min: getRangeMin(sizeRange) * pxRatio,
|
|
2592
2875
|
loops: 0,
|
|
2593
|
-
maxLoops: sizeOptions.animation.count
|
|
2876
|
+
maxLoops: getRangeValue(sizeOptions.animation.count)
|
|
2594
2877
|
};
|
|
2595
2878
|
const sizeAnimation = sizeOptions.animation;
|
|
2596
2879
|
if (sizeAnimation.enable) {
|
|
@@ -2624,6 +2907,12 @@
|
|
|
2624
2907
|
this.initialVelocity = this.calculateVelocity();
|
|
2625
2908
|
this.velocity = this.initialVelocity.copy();
|
|
2626
2909
|
this.moveDecay = 1 - getRangeValue(this.options.move.decay);
|
|
2910
|
+
const gravityOptions = this.options.move.gravity;
|
|
2911
|
+
this.gravity = {
|
|
2912
|
+
enable: gravityOptions.enable,
|
|
2913
|
+
acceleration: getRangeValue(gravityOptions.acceleration),
|
|
2914
|
+
inverse: gravityOptions.inverse
|
|
2915
|
+
};
|
|
2627
2916
|
this.position = this.calcPosition(container, position, clamp(zIndexValue, 0, container.zLayers));
|
|
2628
2917
|
this.initialPosition = this.position.copy();
|
|
2629
2918
|
this.offset = Vector.origin;
|
|
@@ -2831,12 +3120,7 @@
|
|
|
2831
3120
|
return overlaps;
|
|
2832
3121
|
}
|
|
2833
3122
|
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 = {
|
|
3123
|
+
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
3124
|
left: radOffset - rad / 2,
|
|
2841
3125
|
right: radOffset + rad / 2
|
|
2842
3126
|
};
|
|
@@ -3226,13 +3510,13 @@
|
|
|
3226
3510
|
container.canvas.size.height = element.offsetHeight * ratio;
|
|
3227
3511
|
}
|
|
3228
3512
|
const particles = options.particles;
|
|
3229
|
-
this.attractDistance = particles.move.attract.distance * ratio;
|
|
3513
|
+
this.attractDistance = getRangeValue(particles.move.attract.distance) * ratio;
|
|
3230
3514
|
this.linksDistance = particles.links.distance * ratio;
|
|
3231
3515
|
this.linksWidth = particles.links.width * ratio;
|
|
3232
|
-
this.sizeAnimationSpeed = particles.size.animation.speed * ratio;
|
|
3233
|
-
this.maxSpeed = particles.move.gravity.maxSpeed * ratio;
|
|
3516
|
+
this.sizeAnimationSpeed = getRangeValue(particles.size.animation.speed) * ratio;
|
|
3517
|
+
this.maxSpeed = getRangeValue(particles.move.gravity.maxSpeed) * ratio;
|
|
3234
3518
|
if (particles.orbit.radius !== undefined) {
|
|
3235
|
-
this.orbitRadius = particles.orbit.radius * this.container.retina.pixelRatio;
|
|
3519
|
+
this.orbitRadius = getRangeValue(particles.orbit.radius) * this.container.retina.pixelRatio;
|
|
3236
3520
|
}
|
|
3237
3521
|
const modes = options.interactivity.modes;
|
|
3238
3522
|
this.connectModeDistance = modes.connect.distance * ratio;
|
|
@@ -3252,19 +3536,19 @@
|
|
|
3252
3536
|
const ratio = this.pixelRatio;
|
|
3253
3537
|
const moveDistance = options.move.distance;
|
|
3254
3538
|
const props = particle.retina;
|
|
3255
|
-
props.attractDistance = options.move.attract.distance * ratio;
|
|
3539
|
+
props.attractDistance = getRangeValue(options.move.attract.distance) * ratio;
|
|
3256
3540
|
props.linksDistance = options.links.distance * ratio;
|
|
3257
3541
|
props.linksWidth = options.links.width * ratio;
|
|
3258
3542
|
props.moveDrift = getRangeValue(options.move.drift) * ratio;
|
|
3259
3543
|
props.moveSpeed = getRangeValue(options.move.speed) * ratio;
|
|
3260
|
-
props.sizeAnimationSpeed = options.size.animation.speed * ratio;
|
|
3544
|
+
props.sizeAnimationSpeed = getRangeValue(options.size.animation.speed) * ratio;
|
|
3261
3545
|
if (particle.spin) {
|
|
3262
3546
|
props.spinAcceleration = getRangeValue(options.move.spin.acceleration) * ratio;
|
|
3263
3547
|
}
|
|
3264
3548
|
const maxDistance = props.maxDistance;
|
|
3265
3549
|
maxDistance.horizontal = moveDistance.horizontal !== undefined ? moveDistance.horizontal * ratio : undefined;
|
|
3266
3550
|
maxDistance.vertical = moveDistance.vertical !== undefined ? moveDistance.vertical * ratio : undefined;
|
|
3267
|
-
props.maxSpeed = options.move.gravity.maxSpeed * ratio;
|
|
3551
|
+
props.maxSpeed = getRangeValue(options.move.gravity.maxSpeed) * ratio;
|
|
3268
3552
|
}
|
|
3269
3553
|
handleMotionChange(mediaQuery) {
|
|
3270
3554
|
const options = this.container.actualOptions;
|
|
@@ -4596,7 +4880,7 @@
|
|
|
4596
4880
|
function setColorAnimation(colorValue, colorAnimation, reduceFactor) {
|
|
4597
4881
|
colorValue.enable = colorAnimation.enable;
|
|
4598
4882
|
if (colorValue.enable) {
|
|
4599
|
-
colorValue.velocity = colorAnimation.speed / 100 * reduceFactor;
|
|
4883
|
+
colorValue.velocity = getRangeValue(colorAnimation.speed) / 100 * reduceFactor;
|
|
4600
4884
|
if (colorAnimation.sync) {
|
|
4601
4885
|
return;
|
|
4602
4886
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! tsParticles v1.
|
|
1
|
+
/*! tsParticles v1.42.0 by Matteo Bruni */
|
|
2
2
|
!function(e,o){if("object"==typeof exports&&"object"==typeof module)module.exports=o();else if("function"==typeof define&&define.amd)define([],o);else{var n=o();for(var t in n)("object"==typeof exports?exports:e)[t]=n[t]}}(window,(function(){return function(){"use strict";var e={d:function(o,n){for(var t in n)e.o(n,t)&&!e.o(o,t)&&Object.defineProperty(o,t,{enumerable:!0,get:n[t]})},o:function(e,o){return Object.prototype.hasOwnProperty.call(e,o)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},o={};e.r(o),e.d(o,{loadWobbleUpdater:function(){return u}});class n{}n.generatedAttribute="generated",n.randomColorValue="random",n.midColorValue="mid",n.touchEndEvent="touchend",n.mouseDownEvent="mousedown",n.mouseUpEvent="mouseup",n.mouseMoveEvent="mousemove",n.touchStartEvent="touchstart",n.touchMoveEvent="touchmove",n.mouseLeaveEvent="mouseleave",n.mouseOutEvent="mouseout",n.touchCancelEvent="touchcancel",n.resizeEvent="resize",n.visibilityChangeEvent="visibilitychange",n.noPolygonDataLoaded="No polygon data loaded.",n.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 t(e){return"number"==typeof e?e:function(e){const o=i(e);let n=a(e);return o===n&&(n=0),Math.random()*(o-n)+n}(e)}function a(e){return"number"==typeof e?e:e.min}function i(e){return"number"==typeof e?e:e.max}new WeakMap;class r{constructor(e){this.container=e}init(e){const o=e.options.wobble;o.enable?e.wobble={angle:Math.random()*Math.PI*2,speed:t(o.speed)/360}:e.wobble={angle:0,speed:0},e.retina.wobbleDistance=t(o.distance)*this.container.retina.pixelRatio}isEnabled(e){return!e.destroyed&&!e.spawning&&e.options.wobble.enable}update(e,o){this.isEnabled(e)&&function(e,o){var n;if(!e.options.wobble.enable||!e.wobble)return;const t=e.wobble.speed*o.factor,a=(null!==(n=e.retina.wobbleDistance)&&void 0!==n?n:0)*o.factor/(1e3/60),i=2*Math.PI;e.wobble.angle+=t,e.wobble.angle>i&&(e.wobble.angle-=i),e.position.x+=a*Math.cos(e.wobble.angle),e.position.y+=a*Math.abs(Math.sin(e.wobble.angle))}(e,o)}}async function u(e){await e.addParticleUpdater("wobble",(e=>new r(e)))}return o}()}));
|
package/umd/Core/Canvas.js
CHANGED
|
@@ -166,7 +166,9 @@
|
|
|
166
166
|
const zIndexOptions = particle.options.zIndex;
|
|
167
167
|
const zOpacityFactor = (1 - particle.zIndexFactor) ** zIndexOptions.opacityRate;
|
|
168
168
|
const radius = particle.getRadius();
|
|
169
|
-
const opacity = twinkling
|
|
169
|
+
const opacity = twinkling
|
|
170
|
+
? (0, Utils_1.getRangeValue)(twinkle.opacity)
|
|
171
|
+
: (_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;
|
|
170
172
|
const strokeOpacity = (_f = (_e = particle.stroke) === null || _e === void 0 ? void 0 : _e.opacity) !== null && _f !== void 0 ? _f : opacity;
|
|
171
173
|
const zOpacity = opacity * zOpacityFactor;
|
|
172
174
|
const fillColorValue = fColor ? (0, Utils_1.getStyleFromHsl)(fColor, zOpacity) : undefined;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { RangeValue } from "../../Types";
|
|
1
2
|
export interface ICoordinates {
|
|
2
3
|
x: number;
|
|
3
4
|
y: number;
|
|
@@ -5,3 +6,10 @@ export interface ICoordinates {
|
|
|
5
6
|
export interface ICoordinates3d extends ICoordinates {
|
|
6
7
|
z: number;
|
|
7
8
|
}
|
|
9
|
+
export interface IRangedCoordinates {
|
|
10
|
+
x: RangeValue;
|
|
11
|
+
y: RangeValue;
|
|
12
|
+
}
|
|
13
|
+
export interface IRangedCoordinates3d extends IRangedCoordinates {
|
|
14
|
+
z: RangeValue;
|
|
15
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
(function (factory) {
|
|
2
|
+
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
|
+
var v = factory(require, exports);
|
|
4
|
+
if (v !== undefined) module.exports = v;
|
|
5
|
+
}
|
|
6
|
+
else if (typeof define === "function" && define.amd) {
|
|
7
|
+
define(["require", "exports"], factory);
|
|
8
|
+
}
|
|
9
|
+
})(function (require, exports) {
|
|
10
|
+
"use strict";
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
});
|
|
@@ -18,6 +18,7 @@ export * from "./IMovePathGenerator";
|
|
|
18
18
|
export * from "./IParticle";
|
|
19
19
|
export * from "./IParticleGradientAnimation";
|
|
20
20
|
export * from "./IParticleGradientColorAnimation";
|
|
21
|
+
export * from "./IParticleGravity";
|
|
21
22
|
export * from "./IParticleHslAnimation";
|
|
22
23
|
export * from "./IParticlesInteractor";
|
|
23
24
|
export * from "./IParticleLife";
|
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
if (v !== undefined) module.exports = v;
|
|
15
15
|
}
|
|
16
16
|
else if (typeof define === "function" && define.amd) {
|
|
17
|
-
define(["require", "exports", "./Colors", "./Gradients", "./IAttract", "./IBounds", "./IBubble", "./IBubbleParticleData", "./ICircleBouncer", "./IContainerInteractivity", "./IContainerPlugin", "./ICoordinates", "./IDelta", "./IDimension", "./IDistance", "./IExternalInteractor", "./IInteractor", "./IMouseData", "./IMovePathGenerator", "./IParticle", "./IParticleGradientAnimation", "./IParticleGradientColorAnimation", "./IParticleHslAnimation", "./IParticlesInteractor", "./IParticleLife", "./IParticleLoops", "./IParticleRetinaProps", "./IParticleRoll", "./IParticleSpin", "./IParticleUpdater", "./IParticleValueAnimation", "./IParticleWobble", "./IPlugin", "./IRangeValue", "./IRectSideResult", "./IRepulse", "./IShapeDrawer", "./IShapeValues"], factory);
|
|
17
|
+
define(["require", "exports", "./Colors", "./Gradients", "./IAttract", "./IBounds", "./IBubble", "./IBubbleParticleData", "./ICircleBouncer", "./IContainerInteractivity", "./IContainerPlugin", "./ICoordinates", "./IDelta", "./IDimension", "./IDistance", "./IExternalInteractor", "./IInteractor", "./IMouseData", "./IMovePathGenerator", "./IParticle", "./IParticleGradientAnimation", "./IParticleGradientColorAnimation", "./IParticleGravity", "./IParticleHslAnimation", "./IParticlesInteractor", "./IParticleLife", "./IParticleLoops", "./IParticleRetinaProps", "./IParticleRoll", "./IParticleSpin", "./IParticleUpdater", "./IParticleValueAnimation", "./IParticleWobble", "./IPlugin", "./IRangeValue", "./IRectSideResult", "./IRepulse", "./IShapeDrawer", "./IShapeValues"], factory);
|
|
18
18
|
}
|
|
19
19
|
})(function (require, exports) {
|
|
20
20
|
"use strict";
|
|
@@ -39,6 +39,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
39
39
|
__exportStar(require("./IParticle"), exports);
|
|
40
40
|
__exportStar(require("./IParticleGradientAnimation"), exports);
|
|
41
41
|
__exportStar(require("./IParticleGradientColorAnimation"), exports);
|
|
42
|
+
__exportStar(require("./IParticleGravity"), exports);
|
|
42
43
|
__exportStar(require("./IParticleHslAnimation"), exports);
|
|
43
44
|
__exportStar(require("./IParticlesInteractor"), exports);
|
|
44
45
|
__exportStar(require("./IParticleLife"), exports);
|
package/umd/Core/Particle.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ShapeType } from "../Enums";
|
|
2
|
-
import type { IBubbleParticleData, ICoordinates, ICoordinates3d, IDelta, IHsl, IParticle, IParticleGradientAnimation, IParticleHslAnimation, IParticleLife, IParticleNumericValueAnimation, IParticleRetinaProps, IParticleRoll, IParticleSpin, IParticleTiltValueAnimation, IParticleValueAnimation, IParticleWobble, IRgb, IShapeValues } from "./Interfaces";
|
|
2
|
+
import type { IBubbleParticleData, ICoordinates, ICoordinates3d, IDelta, IHsl, IParticle, IParticleGradientAnimation, IParticleGravity, IParticleHslAnimation, IParticleLife, IParticleNumericValueAnimation, IParticleRetinaProps, IParticleRoll, IParticleSpin, IParticleTiltValueAnimation, IParticleValueAnimation, IParticleWobble, IRgb, IShapeValues } from "./Interfaces";
|
|
3
3
|
import { Vector, Vector3d } from "./Utils";
|
|
4
4
|
import type { Container } from "./Container";
|
|
5
5
|
import type { Engine } from "../engine";
|
|
@@ -37,6 +37,7 @@ export declare class Particle implements IParticle {
|
|
|
37
37
|
strokeWidth?: number;
|
|
38
38
|
stroke?: Stroke;
|
|
39
39
|
strokeColor?: IParticleHslAnimation;
|
|
40
|
+
readonly gravity: IParticleGravity;
|
|
40
41
|
readonly moveDecay: number;
|
|
41
42
|
readonly direction: number;
|
|
42
43
|
readonly position: Vector3d;
|
package/umd/Core/Particle.js
CHANGED
|
@@ -98,7 +98,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
98
98
|
max: (0, Utils_2.getRangeMax)(sizeRange) * pxRatio,
|
|
99
99
|
min: (0, Utils_2.getRangeMin)(sizeRange) * pxRatio,
|
|
100
100
|
loops: 0,
|
|
101
|
-
maxLoops: sizeOptions.animation.count,
|
|
101
|
+
maxLoops: (0, Utils_2.getRangeValue)(sizeOptions.animation.count),
|
|
102
102
|
};
|
|
103
103
|
const sizeAnimation = sizeOptions.animation;
|
|
104
104
|
if (sizeAnimation.enable) {
|
|
@@ -132,6 +132,12 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
132
132
|
this.initialVelocity = this.calculateVelocity();
|
|
133
133
|
this.velocity = this.initialVelocity.copy();
|
|
134
134
|
this.moveDecay = 1 - (0, Utils_2.getRangeValue)(this.options.move.decay);
|
|
135
|
+
const gravityOptions = this.options.move.gravity;
|
|
136
|
+
this.gravity = {
|
|
137
|
+
enable: gravityOptions.enable,
|
|
138
|
+
acceleration: (0, Utils_2.getRangeValue)(gravityOptions.acceleration),
|
|
139
|
+
inverse: gravityOptions.inverse,
|
|
140
|
+
};
|
|
135
141
|
this.position = this.calcPosition(container, position, (0, Utils_2.clamp)(zIndexValue, 0, container.zLayers));
|
|
136
142
|
this.initialPosition = this.position.copy();
|
|
137
143
|
this.offset = Utils_1.Vector.origin;
|
|
@@ -339,12 +345,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
339
345
|
return overlaps;
|
|
340
346
|
}
|
|
341
347
|
calculateVelocity() {
|
|
342
|
-
const baseVelocity = (0, Utils_2.getParticleBaseVelocity)(this.direction)
|
|
343
|
-
const res = baseVelocity.copy();
|
|
344
|
-
const moveOptions = this.options.move;
|
|
345
|
-
const rad = (Math.PI / 180) * moveOptions.angle.value;
|
|
346
|
-
const radOffset = (Math.PI / 180) * moveOptions.angle.offset;
|
|
347
|
-
const range = {
|
|
348
|
+
const baseVelocity = (0, Utils_2.getParticleBaseVelocity)(this.direction), res = baseVelocity.copy(), moveOptions = this.options.move, rad = (Math.PI / 180) * (0, Utils_2.getRangeValue)(moveOptions.angle.value), radOffset = (Math.PI / 180) * (0, Utils_2.getRangeValue)(moveOptions.angle.offset), range = {
|
|
348
349
|
left: radOffset - rad / 2,
|
|
349
350
|
right: radOffset + rad / 2,
|
|
350
351
|
};
|