tsparticles 1.41.4 → 1.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Core/Canvas.js +4 -5
- package/Core/Interfaces/ICoordinates.d.ts +8 -0
- package/Core/Interfaces/IParticleGravity.d.ts +5 -0
- package/Core/Interfaces/IParticleGravity.js +2 -0
- package/Core/Interfaces/index.d.ts +1 -0
- package/Core/Interfaces/index.js +1 -0
- package/Core/Particle.d.ts +3 -1
- package/Core/Particle.js +9 -7
- package/Core/Particles.js +2 -1
- package/Core/Retina.js +7 -7
- package/Core/Utils/ParticlesMover.js +2 -2
- package/Interactions/Particles/Links/LinkInstance.js +1 -1
- package/Options/Classes/AnimatableGradient.d.ts +4 -4
- package/Options/Classes/AnimatableGradient.js +4 -4
- package/Options/Classes/AnimationOptions.d.ts +5 -5
- package/Options/Classes/AnimationOptions.js +3 -2
- package/Options/Classes/ColorAnimation.d.ts +2 -2
- package/Options/Classes/ColorAnimation.js +2 -2
- package/Options/Classes/Particles/Move/Attract.d.ts +2 -2
- package/Options/Classes/Particles/Move/Attract.js +2 -1
- package/Options/Classes/Particles/Move/MoveAngle.d.ts +3 -3
- package/Options/Classes/Particles/Move/MoveAngle.js +3 -2
- package/Options/Classes/Particles/Move/MoveGravity.d.ts +5 -5
- package/Options/Classes/Particles/Move/MoveGravity.js +3 -2
- package/Options/Classes/Particles/Orbit/Orbit.d.ts +4 -4
- package/Options/Classes/Particles/Orbit/Orbit.js +4 -3
- package/Options/Classes/Particles/Repulse/Repulse.d.ts +5 -5
- package/Options/Classes/Particles/Repulse/Repulse.js +5 -4
- package/Options/Classes/Particles/Roll/RollLight.d.ts +2 -2
- package/Options/Classes/Particles/Roll/RollLight.js +2 -1
- package/Options/Classes/Particles/Rotate/RotateAnimation.d.ts +2 -2
- package/Options/Classes/Particles/Rotate/RotateAnimation.js +2 -1
- package/Options/Classes/Particles/Tilt/TiltAnimation.d.ts +2 -2
- package/Options/Classes/Particles/Tilt/TiltAnimation.js +2 -1
- package/Options/Classes/Particles/Twinkle/TwinkleValues.d.ts +2 -2
- package/Options/Classes/Particles/Twinkle/TwinkleValues.js +2 -1
- package/Options/Interfaces/IAnimation.d.ts +3 -2
- package/Options/Interfaces/Particles/Move/IAttract.d.ts +3 -2
- package/Options/Interfaces/Particles/Move/IMoveAngle.d.ts +3 -2
- package/Options/Interfaces/Particles/Move/IMoveGravity.d.ts +3 -2
- package/Options/Interfaces/Particles/Orbit/IOrbit.d.ts +4 -3
- package/Options/Interfaces/Particles/Repulse/IRepulse.d.ts +5 -4
- package/Options/Interfaces/Particles/Roll/IRollLight.d.ts +2 -1
- package/Options/Interfaces/Particles/Rotate/IRotateAnimation.d.ts +2 -1
- package/Options/Interfaces/Particles/Tilt/ITiltAnimation.d.ts +2 -1
- package/Options/Interfaces/Particles/Twinkle/ITwinkleValues.d.ts +3 -2
- package/Plugins/Absorbers/AbsorberInstance.js +1 -1
- package/Plugins/Absorbers/Options/Classes/Absorber.d.ts +2 -2
- package/Plugins/Absorbers/Options/Classes/Absorber.js +8 -4
- package/Plugins/Absorbers/Options/Interfaces/IAbsorber.d.ts +2 -2
- package/Plugins/Emitters/EmitterInstance.js +11 -10
- package/Plugins/Emitters/Options/Classes/Emitter.d.ts +2 -2
- package/Plugins/Emitters/Options/Classes/Emitter.js +8 -5
- package/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +2 -2
- package/Updaters/Angle/AngleUpdater.js +2 -1
- package/Updaters/Opacity/OpacityUpdater.js +3 -2
- package/Updaters/Roll/RollUpdater.js +3 -3
- package/Updaters/Tilt/TiltUpdater.js +1 -1
- package/Utils/ColorUtils.js +1 -1
- package/browser/Core/Canvas.js +5 -6
- package/browser/Core/Interfaces/ICoordinates.d.ts +8 -0
- package/browser/Core/Interfaces/IParticleGravity.d.ts +5 -0
- package/browser/Core/Interfaces/IParticleGravity.js +1 -0
- package/browser/Core/Interfaces/index.d.ts +1 -0
- package/browser/Core/Interfaces/index.js +1 -0
- package/browser/Core/Particle.d.ts +3 -1
- package/browser/Core/Particle.js +9 -7
- package/browser/Core/Particles.js +2 -1
- package/browser/Core/Retina.js +7 -7
- package/browser/Core/Utils/ParticlesMover.js +2 -2
- package/browser/Interactions/Particles/Links/LinkInstance.js +2 -2
- package/browser/Options/Classes/AnimatableGradient.d.ts +4 -4
- package/browser/Options/Classes/AnimatableGradient.js +4 -4
- package/browser/Options/Classes/AnimationOptions.d.ts +5 -5
- package/browser/Options/Classes/AnimationOptions.js +3 -2
- package/browser/Options/Classes/ColorAnimation.d.ts +2 -2
- package/browser/Options/Classes/ColorAnimation.js +2 -2
- package/browser/Options/Classes/Particles/Move/Attract.d.ts +2 -2
- package/browser/Options/Classes/Particles/Move/Attract.js +2 -1
- package/browser/Options/Classes/Particles/Move/MoveAngle.d.ts +3 -3
- package/browser/Options/Classes/Particles/Move/MoveAngle.js +3 -2
- package/browser/Options/Classes/Particles/Move/MoveGravity.d.ts +5 -5
- package/browser/Options/Classes/Particles/Move/MoveGravity.js +3 -2
- package/browser/Options/Classes/Particles/Orbit/Orbit.d.ts +4 -4
- package/browser/Options/Classes/Particles/Orbit/Orbit.js +4 -3
- package/browser/Options/Classes/Particles/Repulse/Repulse.d.ts +5 -5
- package/browser/Options/Classes/Particles/Repulse/Repulse.js +5 -4
- package/browser/Options/Classes/Particles/Roll/RollLight.d.ts +2 -2
- package/browser/Options/Classes/Particles/Roll/RollLight.js +2 -1
- package/browser/Options/Classes/Particles/Rotate/RotateAnimation.d.ts +2 -2
- package/browser/Options/Classes/Particles/Rotate/RotateAnimation.js +2 -1
- package/browser/Options/Classes/Particles/Tilt/TiltAnimation.d.ts +2 -2
- package/browser/Options/Classes/Particles/Tilt/TiltAnimation.js +2 -1
- package/browser/Options/Classes/Particles/Twinkle/TwinkleValues.d.ts +2 -2
- package/browser/Options/Classes/Particles/Twinkle/TwinkleValues.js +2 -1
- package/browser/Options/Interfaces/IAnimation.d.ts +3 -2
- package/browser/Options/Interfaces/Particles/Move/IAttract.d.ts +3 -2
- package/browser/Options/Interfaces/Particles/Move/IMoveAngle.d.ts +3 -2
- package/browser/Options/Interfaces/Particles/Move/IMoveGravity.d.ts +3 -2
- package/browser/Options/Interfaces/Particles/Orbit/IOrbit.d.ts +4 -3
- package/browser/Options/Interfaces/Particles/Repulse/IRepulse.d.ts +5 -4
- package/browser/Options/Interfaces/Particles/Roll/IRollLight.d.ts +2 -1
- package/browser/Options/Interfaces/Particles/Rotate/IRotateAnimation.d.ts +2 -1
- package/browser/Options/Interfaces/Particles/Tilt/ITiltAnimation.d.ts +2 -1
- package/browser/Options/Interfaces/Particles/Twinkle/ITwinkleValues.d.ts +3 -2
- package/browser/Plugins/Absorbers/AbsorberInstance.js +1 -1
- package/browser/Plugins/Absorbers/Options/Classes/Absorber.d.ts +2 -2
- package/browser/Plugins/Absorbers/Options/Classes/Absorber.js +8 -4
- package/browser/Plugins/Absorbers/Options/Interfaces/IAbsorber.d.ts +2 -2
- package/browser/Plugins/Emitters/EmitterInstance.js +11 -10
- package/browser/Plugins/Emitters/Options/Classes/Emitter.d.ts +2 -2
- package/browser/Plugins/Emitters/Options/Classes/Emitter.js +8 -5
- package/browser/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +2 -2
- package/browser/Updaters/Angle/AngleUpdater.js +2 -1
- package/browser/Updaters/Opacity/OpacityUpdater.js +3 -2
- package/browser/Updaters/Roll/RollUpdater.js +3 -3
- package/browser/Updaters/Tilt/TiltUpdater.js +1 -1
- package/browser/Utils/ColorUtils.js +2 -2
- package/esm/Core/Canvas.js +5 -6
- package/esm/Core/Interfaces/ICoordinates.d.ts +8 -0
- package/esm/Core/Interfaces/IParticleGravity.d.ts +5 -0
- package/esm/Core/Interfaces/IParticleGravity.js +1 -0
- package/esm/Core/Interfaces/index.d.ts +1 -0
- package/esm/Core/Interfaces/index.js +1 -0
- package/esm/Core/Particle.d.ts +3 -1
- package/esm/Core/Particle.js +9 -7
- package/esm/Core/Particles.js +2 -1
- package/esm/Core/Retina.js +7 -7
- package/esm/Core/Utils/ParticlesMover.js +2 -2
- package/esm/Interactions/Particles/Links/LinkInstance.js +2 -2
- package/esm/Options/Classes/AnimatableGradient.d.ts +4 -4
- package/esm/Options/Classes/AnimatableGradient.js +4 -4
- package/esm/Options/Classes/AnimationOptions.d.ts +5 -5
- package/esm/Options/Classes/AnimationOptions.js +3 -2
- package/esm/Options/Classes/ColorAnimation.d.ts +2 -2
- package/esm/Options/Classes/ColorAnimation.js +2 -2
- package/esm/Options/Classes/Particles/Move/Attract.d.ts +2 -2
- package/esm/Options/Classes/Particles/Move/Attract.js +2 -1
- package/esm/Options/Classes/Particles/Move/MoveAngle.d.ts +3 -3
- package/esm/Options/Classes/Particles/Move/MoveAngle.js +3 -2
- package/esm/Options/Classes/Particles/Move/MoveGravity.d.ts +5 -5
- package/esm/Options/Classes/Particles/Move/MoveGravity.js +3 -2
- package/esm/Options/Classes/Particles/Orbit/Orbit.d.ts +4 -4
- package/esm/Options/Classes/Particles/Orbit/Orbit.js +4 -3
- package/esm/Options/Classes/Particles/Repulse/Repulse.d.ts +5 -5
- package/esm/Options/Classes/Particles/Repulse/Repulse.js +5 -4
- package/esm/Options/Classes/Particles/Roll/RollLight.d.ts +2 -2
- package/esm/Options/Classes/Particles/Roll/RollLight.js +2 -1
- package/esm/Options/Classes/Particles/Rotate/RotateAnimation.d.ts +2 -2
- package/esm/Options/Classes/Particles/Rotate/RotateAnimation.js +2 -1
- package/esm/Options/Classes/Particles/Tilt/TiltAnimation.d.ts +2 -2
- package/esm/Options/Classes/Particles/Tilt/TiltAnimation.js +2 -1
- package/esm/Options/Classes/Particles/Twinkle/TwinkleValues.d.ts +2 -2
- package/esm/Options/Classes/Particles/Twinkle/TwinkleValues.js +2 -1
- package/esm/Options/Interfaces/IAnimation.d.ts +3 -2
- package/esm/Options/Interfaces/Particles/Move/IAttract.d.ts +3 -2
- package/esm/Options/Interfaces/Particles/Move/IMoveAngle.d.ts +3 -2
- package/esm/Options/Interfaces/Particles/Move/IMoveGravity.d.ts +3 -2
- package/esm/Options/Interfaces/Particles/Orbit/IOrbit.d.ts +4 -3
- package/esm/Options/Interfaces/Particles/Repulse/IRepulse.d.ts +5 -4
- package/esm/Options/Interfaces/Particles/Roll/IRollLight.d.ts +2 -1
- package/esm/Options/Interfaces/Particles/Rotate/IRotateAnimation.d.ts +2 -1
- package/esm/Options/Interfaces/Particles/Tilt/ITiltAnimation.d.ts +2 -1
- package/esm/Options/Interfaces/Particles/Twinkle/ITwinkleValues.d.ts +3 -2
- package/esm/Plugins/Absorbers/AbsorberInstance.js +1 -1
- package/esm/Plugins/Absorbers/Options/Classes/Absorber.d.ts +2 -2
- package/esm/Plugins/Absorbers/Options/Classes/Absorber.js +8 -4
- package/esm/Plugins/Absorbers/Options/Interfaces/IAbsorber.d.ts +2 -2
- package/esm/Plugins/Emitters/EmitterInstance.js +11 -10
- package/esm/Plugins/Emitters/Options/Classes/Emitter.d.ts +2 -2
- package/esm/Plugins/Emitters/Options/Classes/Emitter.js +8 -5
- package/esm/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +2 -2
- package/esm/Updaters/Angle/AngleUpdater.js +2 -1
- package/esm/Updaters/Opacity/OpacityUpdater.js +3 -2
- package/esm/Updaters/Roll/RollUpdater.js +3 -3
- package/esm/Updaters/Tilt/TiltUpdater.js +1 -1
- package/esm/Utils/ColorUtils.js +2 -2
- package/package.json +1 -1
- package/report.html +2 -2
- package/report.slim.html +2 -2
- package/scripts/install.js +11 -2
- package/tsparticles.engine.js +47 -47
- package/tsparticles.engine.min.js +2 -2
- package/tsparticles.interaction.external.attract.js +319 -36
- package/tsparticles.interaction.external.attract.min.js +1 -1
- package/tsparticles.interaction.external.bounce.js +319 -36
- package/tsparticles.interaction.external.bounce.min.js +1 -1
- package/tsparticles.interaction.external.bubble.js +319 -36
- package/tsparticles.interaction.external.bubble.min.js +1 -1
- package/tsparticles.interaction.external.connect.js +319 -36
- package/tsparticles.interaction.external.connect.min.js +1 -1
- package/tsparticles.interaction.external.grab.js +319 -36
- package/tsparticles.interaction.external.grab.min.js +1 -1
- package/tsparticles.interaction.external.repulse.js +319 -36
- package/tsparticles.interaction.external.repulse.min.js +1 -1
- package/tsparticles.interaction.external.trail.js +319 -36
- package/tsparticles.interaction.external.trail.min.js +1 -1
- package/tsparticles.interaction.particles.attract.js +319 -36
- package/tsparticles.interaction.particles.attract.min.js +1 -1
- package/tsparticles.interaction.particles.collisions.js +319 -36
- package/tsparticles.interaction.particles.collisions.min.js +1 -1
- package/tsparticles.interaction.particles.links.js +320 -37
- package/tsparticles.interaction.particles.links.min.js +2 -2
- package/tsparticles.js +81 -74
- package/tsparticles.min.js +2 -2
- package/tsparticles.pathseg.min.js +1 -1
- package/tsparticles.plugins.absorbers.js +327 -41
- package/tsparticles.plugins.absorbers.min.js +2 -2
- package/tsparticles.plugins.emitters.js +438 -151
- package/tsparticles.plugins.emitters.min.js +2 -2
- package/tsparticles.plugins.polygonMask.js +319 -36
- package/tsparticles.plugins.polygonMask.min.js +1 -1
- package/tsparticles.shape.circle.min.js +1 -1
- package/tsparticles.shape.image.js +319 -36
- package/tsparticles.shape.image.min.js +1 -1
- package/tsparticles.shape.line.min.js +1 -1
- package/tsparticles.shape.polygon.min.js +1 -1
- package/tsparticles.shape.square.min.js +1 -1
- package/tsparticles.shape.star.min.js +1 -1
- package/tsparticles.shape.text.js +319 -36
- package/tsparticles.shape.text.min.js +1 -1
- package/tsparticles.slim.js +51 -51
- package/tsparticles.slim.min.js +2 -2
- package/tsparticles.updater.angle.js +320 -37
- package/tsparticles.updater.angle.min.js +2 -2
- package/tsparticles.updater.color.js +319 -36
- package/tsparticles.updater.color.min.js +2 -2
- package/tsparticles.updater.life.js +319 -36
- package/tsparticles.updater.life.min.js +1 -1
- package/tsparticles.updater.opacity.js +321 -38
- package/tsparticles.updater.opacity.min.js +2 -2
- package/tsparticles.updater.outModes.js +319 -36
- package/tsparticles.updater.outModes.min.js +1 -1
- package/tsparticles.updater.roll.js +322 -39
- package/tsparticles.updater.roll.min.js +2 -2
- package/tsparticles.updater.size.js +319 -36
- package/tsparticles.updater.size.min.js +1 -1
- package/tsparticles.updater.strokeColor.js +319 -36
- package/tsparticles.updater.strokeColor.min.js +2 -2
- package/tsparticles.updater.tilt.js +320 -37
- package/tsparticles.updater.tilt.min.js +2 -2
- package/tsparticles.updater.wobble.js +319 -36
- package/tsparticles.updater.wobble.min.js +1 -1
- package/umd/Core/Canvas.js +4 -5
- package/umd/Core/Interfaces/ICoordinates.d.ts +8 -0
- package/umd/Core/Interfaces/IParticleGravity.d.ts +5 -0
- package/umd/Core/Interfaces/IParticleGravity.js +12 -0
- package/umd/Core/Interfaces/index.d.ts +1 -0
- package/umd/Core/Interfaces/index.js +2 -1
- package/umd/Core/Particle.d.ts +3 -1
- package/umd/Core/Particle.js +9 -7
- package/umd/Core/Particles.js +2 -1
- package/umd/Core/Retina.js +7 -7
- package/umd/Core/Utils/ParticlesMover.js +2 -2
- package/umd/Interactions/Particles/Links/LinkInstance.js +1 -1
- package/umd/Options/Classes/AnimatableGradient.d.ts +4 -4
- package/umd/Options/Classes/AnimatableGradient.js +4 -4
- package/umd/Options/Classes/AnimationOptions.d.ts +5 -5
- package/umd/Options/Classes/AnimationOptions.js +4 -3
- package/umd/Options/Classes/ColorAnimation.d.ts +2 -2
- package/umd/Options/Classes/ColorAnimation.js +2 -2
- package/umd/Options/Classes/Particles/Move/Attract.d.ts +2 -2
- package/umd/Options/Classes/Particles/Move/Attract.js +3 -2
- package/umd/Options/Classes/Particles/Move/MoveAngle.d.ts +3 -3
- package/umd/Options/Classes/Particles/Move/MoveAngle.js +4 -3
- package/umd/Options/Classes/Particles/Move/MoveGravity.d.ts +5 -5
- package/umd/Options/Classes/Particles/Move/MoveGravity.js +4 -3
- package/umd/Options/Classes/Particles/Orbit/Orbit.d.ts +4 -4
- package/umd/Options/Classes/Particles/Orbit/Orbit.js +5 -4
- package/umd/Options/Classes/Particles/Repulse/Repulse.d.ts +5 -5
- package/umd/Options/Classes/Particles/Repulse/Repulse.js +6 -5
- package/umd/Options/Classes/Particles/Roll/RollLight.d.ts +2 -2
- package/umd/Options/Classes/Particles/Roll/RollLight.js +3 -2
- package/umd/Options/Classes/Particles/Rotate/RotateAnimation.d.ts +2 -2
- package/umd/Options/Classes/Particles/Rotate/RotateAnimation.js +3 -2
- package/umd/Options/Classes/Particles/Tilt/TiltAnimation.d.ts +2 -2
- package/umd/Options/Classes/Particles/Tilt/TiltAnimation.js +3 -2
- package/umd/Options/Classes/Particles/Twinkle/TwinkleValues.d.ts +2 -2
- package/umd/Options/Classes/Particles/Twinkle/TwinkleValues.js +3 -2
- package/umd/Options/Interfaces/IAnimation.d.ts +3 -2
- package/umd/Options/Interfaces/Particles/Move/IAttract.d.ts +3 -2
- package/umd/Options/Interfaces/Particles/Move/IMoveAngle.d.ts +3 -2
- package/umd/Options/Interfaces/Particles/Move/IMoveGravity.d.ts +3 -2
- package/umd/Options/Interfaces/Particles/Orbit/IOrbit.d.ts +4 -3
- package/umd/Options/Interfaces/Particles/Repulse/IRepulse.d.ts +5 -4
- package/umd/Options/Interfaces/Particles/Roll/IRollLight.d.ts +2 -1
- package/umd/Options/Interfaces/Particles/Rotate/IRotateAnimation.d.ts +2 -1
- package/umd/Options/Interfaces/Particles/Tilt/ITiltAnimation.d.ts +2 -1
- package/umd/Options/Interfaces/Particles/Twinkle/ITwinkleValues.d.ts +3 -2
- package/umd/Plugins/Absorbers/AbsorberInstance.js +1 -1
- package/umd/Plugins/Absorbers/Options/Classes/Absorber.d.ts +2 -2
- package/umd/Plugins/Absorbers/Options/Classes/Absorber.js +9 -5
- package/umd/Plugins/Absorbers/Options/Interfaces/IAbsorber.d.ts +2 -2
- package/umd/Plugins/Emitters/EmitterInstance.js +11 -10
- package/umd/Plugins/Emitters/Options/Classes/Emitter.d.ts +2 -2
- package/umd/Plugins/Emitters/Options/Classes/Emitter.js +9 -6
- package/umd/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +2 -2
- package/umd/Updaters/Angle/AngleUpdater.js +2 -1
- package/umd/Updaters/Opacity/OpacityUpdater.js +3 -2
- package/umd/Updaters/Roll/RollUpdater.js +3 -3
- package/umd/Updaters/Tilt/TiltUpdater.js +1 -1
- package/umd/Utils/ColorUtils.js +1 -1
package/Core/Canvas.js
CHANGED
|
@@ -98,10 +98,7 @@ class Canvas {
|
|
|
98
98
|
const container = this.container;
|
|
99
99
|
const pxRatio = container.retina.pixelRatio;
|
|
100
100
|
const size = container.canvas.size;
|
|
101
|
-
const oldSize = {
|
|
102
|
-
width: size.width,
|
|
103
|
-
height: size.height,
|
|
104
|
-
};
|
|
101
|
+
const oldSize = Object.assign({}, size);
|
|
105
102
|
size.width = this.element.offsetWidth * pxRatio;
|
|
106
103
|
size.height = this.element.offsetHeight * pxRatio;
|
|
107
104
|
this.element.width = size.width;
|
|
@@ -160,7 +157,9 @@ class Canvas {
|
|
|
160
157
|
const zIndexOptions = particle.options.zIndex;
|
|
161
158
|
const zOpacityFactor = (1 - particle.zIndexFactor) ** zIndexOptions.opacityRate;
|
|
162
159
|
const radius = particle.getRadius();
|
|
163
|
-
const opacity = twinkling
|
|
160
|
+
const opacity = twinkling
|
|
161
|
+
? (0, Utils_1.getRangeValue)(twinkle.opacity)
|
|
162
|
+
: (_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;
|
|
164
163
|
const strokeOpacity = (_f = (_e = particle.stroke) === null || _e === void 0 ? void 0 : _e.opacity) !== null && _f !== void 0 ? _f : opacity;
|
|
165
164
|
const zOpacity = opacity * zOpacityFactor;
|
|
166
165
|
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
|
+
}
|
|
@@ -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";
|
package/Core/Interfaces/index.js
CHANGED
|
@@ -30,6 +30,7 @@ __exportStar(require("./IMovePathGenerator"), exports);
|
|
|
30
30
|
__exportStar(require("./IParticle"), exports);
|
|
31
31
|
__exportStar(require("./IParticleGradientAnimation"), exports);
|
|
32
32
|
__exportStar(require("./IParticleGradientColorAnimation"), exports);
|
|
33
|
+
__exportStar(require("./IParticleGravity"), exports);
|
|
33
34
|
__exportStar(require("./IParticleHslAnimation"), exports);
|
|
34
35
|
__exportStar(require("./IParticlesInteractor"), exports);
|
|
35
36
|
__exportStar(require("./IParticleLife"), exports);
|
package/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";
|
|
@@ -13,6 +13,7 @@ export declare class Particle implements IParticle {
|
|
|
13
13
|
readonly container: Container;
|
|
14
14
|
readonly group?: string | undefined;
|
|
15
15
|
destroyed: boolean;
|
|
16
|
+
ignoresResizeRatio: boolean;
|
|
16
17
|
lastPathTime: number;
|
|
17
18
|
misplaced: boolean;
|
|
18
19
|
spawning: boolean;
|
|
@@ -36,6 +37,7 @@ export declare class Particle implements IParticle {
|
|
|
36
37
|
strokeWidth?: number;
|
|
37
38
|
stroke?: Stroke;
|
|
38
39
|
strokeColor?: IParticleHslAnimation;
|
|
40
|
+
readonly gravity: IParticleGravity;
|
|
39
41
|
readonly moveDecay: number;
|
|
40
42
|
readonly direction: number;
|
|
41
43
|
readonly position: Vector3d;
|
package/Core/Particle.js
CHANGED
|
@@ -45,6 +45,7 @@ class Particle {
|
|
|
45
45
|
this.retina = {
|
|
46
46
|
maxDistance: {},
|
|
47
47
|
};
|
|
48
|
+
this.ignoresResizeRatio = true;
|
|
48
49
|
const pxRatio = container.retina.pixelRatio;
|
|
49
50
|
const mainOptions = container.actualOptions;
|
|
50
51
|
const particlesOptions = new ParticlesOptions_1.ParticlesOptions();
|
|
@@ -88,7 +89,7 @@ class Particle {
|
|
|
88
89
|
max: (0, Utils_2.getRangeMax)(sizeRange) * pxRatio,
|
|
89
90
|
min: (0, Utils_2.getRangeMin)(sizeRange) * pxRatio,
|
|
90
91
|
loops: 0,
|
|
91
|
-
maxLoops: sizeOptions.animation.count,
|
|
92
|
+
maxLoops: (0, Utils_2.getRangeValue)(sizeOptions.animation.count),
|
|
92
93
|
};
|
|
93
94
|
const sizeAnimation = sizeOptions.animation;
|
|
94
95
|
if (sizeAnimation.enable) {
|
|
@@ -122,6 +123,12 @@ class Particle {
|
|
|
122
123
|
this.initialVelocity = this.calculateVelocity();
|
|
123
124
|
this.velocity = this.initialVelocity.copy();
|
|
124
125
|
this.moveDecay = 1 - (0, Utils_2.getRangeValue)(this.options.move.decay);
|
|
126
|
+
const gravityOptions = this.options.move.gravity;
|
|
127
|
+
this.gravity = {
|
|
128
|
+
enable: gravityOptions.enable,
|
|
129
|
+
acceleration: (0, Utils_2.getRangeValue)(gravityOptions.acceleration),
|
|
130
|
+
inverse: gravityOptions.inverse,
|
|
131
|
+
};
|
|
125
132
|
this.position = this.calcPosition(container, position, (0, Utils_2.clamp)(zIndexValue, 0, container.zLayers));
|
|
126
133
|
this.initialPosition = this.position.copy();
|
|
127
134
|
this.offset = Utils_1.Vector.origin;
|
|
@@ -329,12 +336,7 @@ class Particle {
|
|
|
329
336
|
return overlaps;
|
|
330
337
|
}
|
|
331
338
|
calculateVelocity() {
|
|
332
|
-
const baseVelocity = (0, Utils_2.getParticleBaseVelocity)(this.direction)
|
|
333
|
-
const res = baseVelocity.copy();
|
|
334
|
-
const moveOptions = this.options.move;
|
|
335
|
-
const rad = (Math.PI / 180) * moveOptions.angle.value;
|
|
336
|
-
const radOffset = (Math.PI / 180) * moveOptions.angle.offset;
|
|
337
|
-
const range = {
|
|
339
|
+
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 = {
|
|
338
340
|
left: radOffset - rad / 2,
|
|
339
341
|
right: radOffset + rad / 2,
|
|
340
342
|
};
|
package/Core/Particles.js
CHANGED
|
@@ -111,10 +111,11 @@ class Particles {
|
|
|
111
111
|
}
|
|
112
112
|
for (const particle of this.array) {
|
|
113
113
|
const resizeFactor = container.canvas.resizeFactor;
|
|
114
|
-
if (resizeFactor) {
|
|
114
|
+
if (resizeFactor && !particle.ignoresResizeRatio) {
|
|
115
115
|
particle.position.x *= resizeFactor.width;
|
|
116
116
|
particle.position.y *= resizeFactor.height;
|
|
117
117
|
}
|
|
118
|
+
particle.ignoresResizeRatio = false;
|
|
118
119
|
particle.bubble.inRange = false;
|
|
119
120
|
for (const [, plugin] of this.container.plugins) {
|
|
120
121
|
if (particle.destroyed) {
|
package/Core/Retina.js
CHANGED
|
@@ -43,13 +43,13 @@ class Retina {
|
|
|
43
43
|
container.canvas.size.height = element.offsetHeight * ratio;
|
|
44
44
|
}
|
|
45
45
|
const particles = options.particles;
|
|
46
|
-
this.attractDistance = particles.move.attract.distance * ratio;
|
|
46
|
+
this.attractDistance = (0, Utils_1.getRangeValue)(particles.move.attract.distance) * ratio;
|
|
47
47
|
this.linksDistance = particles.links.distance * ratio;
|
|
48
48
|
this.linksWidth = particles.links.width * ratio;
|
|
49
|
-
this.sizeAnimationSpeed = particles.size.animation.speed * ratio;
|
|
50
|
-
this.maxSpeed = particles.move.gravity.maxSpeed * ratio;
|
|
49
|
+
this.sizeAnimationSpeed = (0, Utils_1.getRangeValue)(particles.size.animation.speed) * ratio;
|
|
50
|
+
this.maxSpeed = (0, Utils_1.getRangeValue)(particles.move.gravity.maxSpeed) * ratio;
|
|
51
51
|
if (particles.orbit.radius !== undefined) {
|
|
52
|
-
this.orbitRadius = particles.orbit.radius * this.container.retina.pixelRatio;
|
|
52
|
+
this.orbitRadius = (0, Utils_1.getRangeValue)(particles.orbit.radius) * this.container.retina.pixelRatio;
|
|
53
53
|
}
|
|
54
54
|
const modes = options.interactivity.modes;
|
|
55
55
|
this.connectModeDistance = modes.connect.distance * ratio;
|
|
@@ -69,19 +69,19 @@ class Retina {
|
|
|
69
69
|
const ratio = this.pixelRatio;
|
|
70
70
|
const moveDistance = options.move.distance;
|
|
71
71
|
const props = particle.retina;
|
|
72
|
-
props.attractDistance = options.move.attract.distance * ratio;
|
|
72
|
+
props.attractDistance = (0, Utils_1.getRangeValue)(options.move.attract.distance) * ratio;
|
|
73
73
|
props.linksDistance = options.links.distance * ratio;
|
|
74
74
|
props.linksWidth = options.links.width * ratio;
|
|
75
75
|
props.moveDrift = (0, Utils_1.getRangeValue)(options.move.drift) * ratio;
|
|
76
76
|
props.moveSpeed = (0, Utils_1.getRangeValue)(options.move.speed) * ratio;
|
|
77
|
-
props.sizeAnimationSpeed = options.size.animation.speed * ratio;
|
|
77
|
+
props.sizeAnimationSpeed = (0, Utils_1.getRangeValue)(options.size.animation.speed) * ratio;
|
|
78
78
|
if (particle.spin) {
|
|
79
79
|
props.spinAcceleration = (0, Utils_1.getRangeValue)(options.move.spin.acceleration) * ratio;
|
|
80
80
|
}
|
|
81
81
|
const maxDistance = props.maxDistance;
|
|
82
82
|
maxDistance.horizontal = moveDistance.horizontal !== undefined ? moveDistance.horizontal * ratio : undefined;
|
|
83
83
|
maxDistance.vertical = moveDistance.vertical !== undefined ? moveDistance.vertical * ratio : undefined;
|
|
84
|
-
props.maxSpeed = options.move.gravity.maxSpeed * ratio;
|
|
84
|
+
props.maxSpeed = (0, Utils_1.getRangeValue)(options.move.gravity.maxSpeed) * ratio;
|
|
85
85
|
}
|
|
86
86
|
handleMotionChange(mediaQuery) {
|
|
87
87
|
const options = this.container.actualOptions;
|
|
@@ -55,7 +55,7 @@ class ParticlesMover {
|
|
|
55
55
|
const container = this.container, slowFactor = this.getProximitySpeedFactor(particle), baseSpeed = ((_a = (_d = particle.retina).moveSpeed) !== null && _a !== void 0 ? _a : (_d.moveSpeed = (0, Utils_1.getRangeValue)(moveOptions.speed) * container.retina.pixelRatio)) *
|
|
56
56
|
container.retina.reduceFactor, moveDrift = ((_b = (_e = particle.retina).moveDrift) !== null && _b !== void 0 ? _b : (_e.moveDrift = (0, Utils_1.getRangeValue)(particle.options.move.drift) * container.retina.pixelRatio)), maxSize = (0, Utils_1.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;
|
|
57
57
|
this.applyPath(particle, delta);
|
|
58
|
-
const gravityOptions =
|
|
58
|
+
const gravityOptions = particle.gravity;
|
|
59
59
|
const gravityFactor = gravityOptions.enable && gravityOptions.inverse ? -1 : 1;
|
|
60
60
|
if (gravityOptions.enable && moveSpeed) {
|
|
61
61
|
particle.velocity.y += (gravityFactor * (gravityOptions.acceleration * delta.factor)) / (60 * moveSpeed);
|
|
@@ -70,7 +70,7 @@ class ParticlesMover {
|
|
|
70
70
|
const velocity = particle.velocity.mult(moveSpeed);
|
|
71
71
|
const maxSpeed = (_c = particle.retina.maxSpeed) !== null && _c !== void 0 ? _c : container.retina.maxSpeed;
|
|
72
72
|
if (gravityOptions.enable &&
|
|
73
|
-
|
|
73
|
+
maxSpeed > 0 &&
|
|
74
74
|
((!gravityOptions.inverse && velocity.y >= 0 && velocity.y >= maxSpeed) ||
|
|
75
75
|
(gravityOptions.inverse && velocity.y <= 0 && velocity.y <= -maxSpeed))) {
|
|
76
76
|
velocity.y = gravityFactor * maxSpeed;
|
|
@@ -102,7 +102,7 @@ class LinkInstance {
|
|
|
102
102
|
const twinkling = Math.random() < twinkleFreq;
|
|
103
103
|
if (twinkling && twinkleRgb !== undefined) {
|
|
104
104
|
colorLine = twinkleRgb;
|
|
105
|
-
opacity = twinkle.opacity;
|
|
105
|
+
opacity = (0, Utils_1.getRangeValue)(twinkle.opacity);
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
if (!colorLine) {
|
|
@@ -35,17 +35,17 @@ export declare class AnimatableGradientColor implements IAnimatableGradientColor
|
|
|
35
35
|
load(data?: RecursivePartial<IAnimatableGradientColor>): void;
|
|
36
36
|
}
|
|
37
37
|
export declare class GradientAngleAnimation implements IAnimation, IOptionLoader<IAnimation> {
|
|
38
|
-
count:
|
|
38
|
+
count: RangeValue;
|
|
39
39
|
enable: boolean;
|
|
40
|
-
speed:
|
|
40
|
+
speed: RangeValue;
|
|
41
41
|
sync: boolean;
|
|
42
42
|
constructor();
|
|
43
43
|
load(data?: RecursivePartial<IAnimation>): void;
|
|
44
44
|
}
|
|
45
45
|
export declare class GradientColorOpacityAnimation implements IGradientColorOpacityAnimation, IOptionLoader<IGradientColorOpacityAnimation> {
|
|
46
|
-
count:
|
|
46
|
+
count: RangeValue;
|
|
47
47
|
enable: boolean;
|
|
48
|
-
speed:
|
|
48
|
+
speed: RangeValue;
|
|
49
49
|
sync: boolean;
|
|
50
50
|
startValue: StartValueType | keyof typeof StartValueType;
|
|
51
51
|
constructor();
|
|
@@ -100,13 +100,13 @@ class GradientAngleAnimation {
|
|
|
100
100
|
return;
|
|
101
101
|
}
|
|
102
102
|
if (data.count !== undefined) {
|
|
103
|
-
this.count = data.count;
|
|
103
|
+
this.count = (0, Utils_1.setRangeValue)(data.count);
|
|
104
104
|
}
|
|
105
105
|
if (data.enable !== undefined) {
|
|
106
106
|
this.enable = data.enable;
|
|
107
107
|
}
|
|
108
108
|
if (data.speed !== undefined) {
|
|
109
|
-
this.speed = data.speed;
|
|
109
|
+
this.speed = (0, Utils_1.setRangeValue)(data.speed);
|
|
110
110
|
}
|
|
111
111
|
if (data.sync !== undefined) {
|
|
112
112
|
this.sync = data.sync;
|
|
@@ -127,13 +127,13 @@ class GradientColorOpacityAnimation {
|
|
|
127
127
|
return;
|
|
128
128
|
}
|
|
129
129
|
if (data.count !== undefined) {
|
|
130
|
-
this.count = data.count;
|
|
130
|
+
this.count = (0, Utils_1.setRangeValue)(data.count);
|
|
131
131
|
}
|
|
132
132
|
if (data.enable !== undefined) {
|
|
133
133
|
this.enable = data.enable;
|
|
134
134
|
}
|
|
135
135
|
if (data.speed !== undefined) {
|
|
136
|
-
this.speed = data.speed;
|
|
136
|
+
this.speed = (0, Utils_1.setRangeValue)(data.speed);
|
|
137
137
|
}
|
|
138
138
|
if (data.sync !== undefined) {
|
|
139
139
|
this.sync = data.sync;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import type { RangeValue, RecursivePartial } from "../../Types";
|
|
2
|
+
import type { IAnimation } from "../Interfaces/IAnimation";
|
|
3
|
+
import type { IOptionLoader } from "../Interfaces/IOptionLoader";
|
|
4
4
|
export declare class AnimationOptions implements IAnimation, IOptionLoader<IAnimation> {
|
|
5
|
-
count:
|
|
5
|
+
count: RangeValue;
|
|
6
6
|
enable: boolean;
|
|
7
|
-
speed:
|
|
7
|
+
speed: RangeValue;
|
|
8
8
|
sync: boolean;
|
|
9
9
|
constructor();
|
|
10
10
|
load(data?: RecursivePartial<IAnimation>): void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AnimationOptions = void 0;
|
|
4
|
+
const Utils_1 = require("../../Utils");
|
|
4
5
|
class AnimationOptions {
|
|
5
6
|
constructor() {
|
|
6
7
|
this.count = 0;
|
|
@@ -13,13 +14,13 @@ class AnimationOptions {
|
|
|
13
14
|
return;
|
|
14
15
|
}
|
|
15
16
|
if (data.count !== undefined) {
|
|
16
|
-
this.count = data.count;
|
|
17
|
+
this.count = (0, Utils_1.setRangeValue)(data.count);
|
|
17
18
|
}
|
|
18
19
|
if (data.enable !== undefined) {
|
|
19
20
|
this.enable = data.enable;
|
|
20
21
|
}
|
|
21
22
|
if (data.speed !== undefined) {
|
|
22
|
-
this.speed = data.speed;
|
|
23
|
+
this.speed = (0, Utils_1.setRangeValue)(data.speed);
|
|
23
24
|
}
|
|
24
25
|
if (data.sync !== undefined) {
|
|
25
26
|
this.sync = data.sync;
|
|
@@ -2,10 +2,10 @@ import type { RangeValue, RecursivePartial } from "../../Types";
|
|
|
2
2
|
import type { IColorAnimation } from "../Interfaces/IColorAnimation";
|
|
3
3
|
import type { IOptionLoader } from "../Interfaces/IOptionLoader";
|
|
4
4
|
export declare class ColorAnimation implements IColorAnimation, IOptionLoader<IColorAnimation> {
|
|
5
|
-
count:
|
|
5
|
+
count: RangeValue;
|
|
6
6
|
enable: boolean;
|
|
7
7
|
offset: RangeValue;
|
|
8
|
-
speed:
|
|
8
|
+
speed: RangeValue;
|
|
9
9
|
sync: boolean;
|
|
10
10
|
constructor();
|
|
11
11
|
load(data?: RecursivePartial<IColorAnimation>): void;
|
|
@@ -15,7 +15,7 @@ class ColorAnimation {
|
|
|
15
15
|
return;
|
|
16
16
|
}
|
|
17
17
|
if (data.count !== undefined) {
|
|
18
|
-
this.count = data.count;
|
|
18
|
+
this.count = (0, Utils_1.setRangeValue)(data.count);
|
|
19
19
|
}
|
|
20
20
|
if (data.enable !== undefined) {
|
|
21
21
|
this.enable = data.enable;
|
|
@@ -24,7 +24,7 @@ class ColorAnimation {
|
|
|
24
24
|
this.offset = (0, Utils_1.setRangeValue)(data.offset);
|
|
25
25
|
}
|
|
26
26
|
if (data.speed !== undefined) {
|
|
27
|
-
this.speed = data.speed;
|
|
27
|
+
this.speed = (0, Utils_1.setRangeValue)(data.speed);
|
|
28
28
|
}
|
|
29
29
|
if (data.sync !== undefined) {
|
|
30
30
|
this.sync = data.sync;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
+
import type { RangeValue, RecursivePartial } from "../../../../Types";
|
|
1
2
|
import type { IAttract } from "../../../Interfaces/Particles/Move/IAttract";
|
|
2
3
|
import type { ICoordinates } from "../../../../Core";
|
|
3
4
|
import type { IOptionLoader } from "../../../Interfaces/IOptionLoader";
|
|
4
|
-
import type { RecursivePartial } from "../../../../Types";
|
|
5
5
|
export declare class Attract implements IAttract, IOptionLoader<IAttract> {
|
|
6
6
|
get rotateX(): number;
|
|
7
7
|
set rotateX(value: number);
|
|
8
8
|
get rotateY(): number;
|
|
9
9
|
set rotateY(value: number);
|
|
10
|
-
distance:
|
|
10
|
+
distance: RangeValue;
|
|
11
11
|
enable: boolean;
|
|
12
12
|
rotate: ICoordinates;
|
|
13
13
|
constructor();
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Attract = void 0;
|
|
4
|
+
const Utils_1 = require("../../../../Utils");
|
|
4
5
|
class Attract {
|
|
5
6
|
constructor() {
|
|
6
7
|
this.distance = 200;
|
|
@@ -28,7 +29,7 @@ class Attract {
|
|
|
28
29
|
return;
|
|
29
30
|
}
|
|
30
31
|
if (data.distance !== undefined) {
|
|
31
|
-
this.distance = data.distance;
|
|
32
|
+
this.distance = (0, Utils_1.setRangeValue)(data.distance);
|
|
32
33
|
}
|
|
33
34
|
if (data.enable !== undefined) {
|
|
34
35
|
this.enable = data.enable;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import type { RangeValue, RecursivePartial } from "../../../../Types";
|
|
1
2
|
import type { IMoveAngle } from "../../../Interfaces/Particles/Move/IMoveAngle";
|
|
2
3
|
import type { IOptionLoader } from "../../../Interfaces/IOptionLoader";
|
|
3
|
-
import type { RecursivePartial } from "../../../../Types";
|
|
4
4
|
export declare class MoveAngle implements IMoveAngle, IOptionLoader<IMoveAngle> {
|
|
5
|
-
offset:
|
|
6
|
-
value:
|
|
5
|
+
offset: RangeValue;
|
|
6
|
+
value: RangeValue;
|
|
7
7
|
constructor();
|
|
8
8
|
load(data?: RecursivePartial<IMoveAngle>): void;
|
|
9
9
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MoveAngle = void 0;
|
|
4
|
+
const Utils_1 = require("../../../../Utils");
|
|
4
5
|
class MoveAngle {
|
|
5
6
|
constructor() {
|
|
6
7
|
this.offset = 0;
|
|
@@ -11,10 +12,10 @@ class MoveAngle {
|
|
|
11
12
|
return;
|
|
12
13
|
}
|
|
13
14
|
if (data.offset !== undefined) {
|
|
14
|
-
this.offset = data.offset;
|
|
15
|
+
this.offset = (0, Utils_1.setRangeValue)(data.offset);
|
|
15
16
|
}
|
|
16
17
|
if (data.value !== undefined) {
|
|
17
|
-
this.value = data.value;
|
|
18
|
+
this.value = (0, Utils_1.setRangeValue)(data.value);
|
|
18
19
|
}
|
|
19
20
|
}
|
|
20
21
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import type { RangeValue, RecursivePartial } from "../../../../Types";
|
|
2
|
+
import type { IMoveGravity } from "../../../Interfaces/Particles/Move/IMoveGravity";
|
|
3
|
+
import type { IOptionLoader } from "../../../Interfaces/IOptionLoader";
|
|
4
4
|
export declare class MoveGravity implements IMoveGravity, IOptionLoader<IMoveGravity> {
|
|
5
|
-
acceleration:
|
|
5
|
+
acceleration: RangeValue;
|
|
6
6
|
enable: boolean;
|
|
7
7
|
inverse: boolean;
|
|
8
|
-
maxSpeed:
|
|
8
|
+
maxSpeed: RangeValue;
|
|
9
9
|
constructor();
|
|
10
10
|
load(data?: RecursivePartial<IMoveGravity>): void;
|
|
11
11
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MoveGravity = void 0;
|
|
4
|
+
const Utils_1 = require("../../../../Utils");
|
|
4
5
|
class MoveGravity {
|
|
5
6
|
constructor() {
|
|
6
7
|
this.acceleration = 9.81;
|
|
@@ -13,7 +14,7 @@ class MoveGravity {
|
|
|
13
14
|
return;
|
|
14
15
|
}
|
|
15
16
|
if (data.acceleration !== undefined) {
|
|
16
|
-
this.acceleration = data.acceleration;
|
|
17
|
+
this.acceleration = (0, Utils_1.setRangeValue)(data.acceleration);
|
|
17
18
|
}
|
|
18
19
|
if (data.enable !== undefined) {
|
|
19
20
|
this.enable = data.enable;
|
|
@@ -22,7 +23,7 @@ class MoveGravity {
|
|
|
22
23
|
this.inverse = data.inverse;
|
|
23
24
|
}
|
|
24
25
|
if (data.maxSpeed !== undefined) {
|
|
25
|
-
this.maxSpeed = data.maxSpeed;
|
|
26
|
+
this.maxSpeed = (0, Utils_1.setRangeValue)(data.maxSpeed);
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
+
import type { RangeValue, RecursivePartial } from "../../../../Types";
|
|
1
2
|
import { AnimationOptions } from "../../AnimationOptions";
|
|
2
3
|
import type { IAnimatable } from "../../../Interfaces/IAnimatable";
|
|
3
4
|
import type { IOptionLoader } from "../../../Interfaces/IOptionLoader";
|
|
4
5
|
import type { IOrbit } from "../../../Interfaces/Particles/Orbit/IOrbit";
|
|
5
6
|
import { OptionsColor } from "../../OptionsColor";
|
|
6
7
|
import { OrbitRotation } from "./OrbitRotation";
|
|
7
|
-
import type { RecursivePartial } from "../../../../Types";
|
|
8
8
|
export declare class Orbit implements IOrbit, IOptionLoader<IOrbit>, IAnimatable<AnimationOptions> {
|
|
9
9
|
animation: AnimationOptions;
|
|
10
10
|
enable: boolean;
|
|
11
|
-
opacity:
|
|
12
|
-
width:
|
|
11
|
+
opacity: RangeValue;
|
|
12
|
+
width: RangeValue;
|
|
13
13
|
color?: OptionsColor;
|
|
14
|
-
radius?:
|
|
14
|
+
radius?: RangeValue;
|
|
15
15
|
rotation: OrbitRotation;
|
|
16
16
|
constructor();
|
|
17
17
|
load(data?: RecursivePartial<IOrbit>): void;
|
|
@@ -4,6 +4,7 @@ exports.Orbit = void 0;
|
|
|
4
4
|
const AnimationOptions_1 = require("../../AnimationOptions");
|
|
5
5
|
const OptionsColor_1 = require("../../OptionsColor");
|
|
6
6
|
const OrbitRotation_1 = require("./OrbitRotation");
|
|
7
|
+
const Utils_1 = require("../../../../Utils");
|
|
7
8
|
class Orbit {
|
|
8
9
|
constructor() {
|
|
9
10
|
this.animation = new AnimationOptions_1.AnimationOptions();
|
|
@@ -22,13 +23,13 @@ class Orbit {
|
|
|
22
23
|
this.enable = data.enable;
|
|
23
24
|
}
|
|
24
25
|
if (data.opacity !== undefined) {
|
|
25
|
-
this.opacity = data.opacity;
|
|
26
|
+
this.opacity = (0, Utils_1.setRangeValue)(data.opacity);
|
|
26
27
|
}
|
|
27
28
|
if (data.width !== undefined) {
|
|
28
|
-
this.width = data.width;
|
|
29
|
+
this.width = (0, Utils_1.setRangeValue)(data.width);
|
|
29
30
|
}
|
|
30
31
|
if (data.radius !== undefined) {
|
|
31
|
-
this.radius = data.radius;
|
|
32
|
+
this.radius = (0, Utils_1.setRangeValue)(data.radius);
|
|
32
33
|
}
|
|
33
34
|
if (data.color !== undefined) {
|
|
34
35
|
this.color = OptionsColor_1.OptionsColor.create(this.color, data.color);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
+
import type { RangeValue, RecursivePartial } from "../../../../Types";
|
|
1
2
|
import type { IOptionLoader } from "../../../Interfaces/IOptionLoader";
|
|
2
3
|
import type { IRepulse } from "../../../Interfaces/Particles/Repulse/IRepulse";
|
|
3
|
-
import type { RecursivePartial } from "../../../../Types";
|
|
4
4
|
import { ValueWithRandom } from "../../ValueWithRandom";
|
|
5
5
|
export declare class Repulse extends ValueWithRandom implements IRepulse, IOptionLoader<IRepulse> {
|
|
6
6
|
enabled: boolean;
|
|
7
|
-
distance:
|
|
8
|
-
duration:
|
|
9
|
-
factor:
|
|
10
|
-
speed:
|
|
7
|
+
distance: RangeValue;
|
|
8
|
+
duration: RangeValue;
|
|
9
|
+
factor: RangeValue;
|
|
10
|
+
speed: RangeValue;
|
|
11
11
|
constructor();
|
|
12
12
|
load(data?: RecursivePartial<IRepulse>): void;
|
|
13
13
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Repulse = void 0;
|
|
4
4
|
const ValueWithRandom_1 = require("../../ValueWithRandom");
|
|
5
|
+
const Utils_1 = require("../../../../Utils");
|
|
5
6
|
class Repulse extends ValueWithRandom_1.ValueWithRandom {
|
|
6
7
|
constructor() {
|
|
7
8
|
super();
|
|
@@ -20,16 +21,16 @@ class Repulse extends ValueWithRandom_1.ValueWithRandom {
|
|
|
20
21
|
this.enabled = data.enabled;
|
|
21
22
|
}
|
|
22
23
|
if (data.distance !== undefined) {
|
|
23
|
-
this.distance = data.distance;
|
|
24
|
+
this.distance = (0, Utils_1.setRangeValue)(data.distance);
|
|
24
25
|
}
|
|
25
26
|
if (data.duration !== undefined) {
|
|
26
|
-
this.duration = data.duration;
|
|
27
|
+
this.duration = (0, Utils_1.setRangeValue)(data.duration);
|
|
27
28
|
}
|
|
28
29
|
if (data.factor !== undefined) {
|
|
29
|
-
this.factor = data.factor;
|
|
30
|
+
this.factor = (0, Utils_1.setRangeValue)(data.factor);
|
|
30
31
|
}
|
|
31
32
|
if (data.speed !== undefined) {
|
|
32
|
-
this.speed = data.speed;
|
|
33
|
+
this.speed = (0, Utils_1.setRangeValue)(data.speed);
|
|
33
34
|
}
|
|
34
35
|
}
|
|
35
36
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import type { RangeValue, RecursivePartial } from "../../../../Types";
|
|
1
2
|
import type { IOptionLoader } from "../../../Interfaces/IOptionLoader";
|
|
2
3
|
import type { IRollLight } from "../../../Interfaces/Particles/Roll/IRollLight";
|
|
3
|
-
import type { RecursivePartial } from "../../../../Types";
|
|
4
4
|
export declare class RollLight implements IRollLight, IOptionLoader<IRollLight> {
|
|
5
5
|
enable: boolean;
|
|
6
|
-
value:
|
|
6
|
+
value: RangeValue;
|
|
7
7
|
constructor();
|
|
8
8
|
load(data?: RecursivePartial<IRollLight>): void;
|
|
9
9
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RollLight = void 0;
|
|
4
|
+
const Utils_1 = require("../../../../Utils");
|
|
4
5
|
class RollLight {
|
|
5
6
|
constructor() {
|
|
6
7
|
this.enable = false;
|
|
@@ -14,7 +15,7 @@ class RollLight {
|
|
|
14
15
|
this.enable = data.enable;
|
|
15
16
|
}
|
|
16
17
|
if (data.value !== undefined) {
|
|
17
|
-
this.value = data.value;
|
|
18
|
+
this.value = (0, Utils_1.setRangeValue)(data.value);
|
|
18
19
|
}
|
|
19
20
|
}
|
|
20
21
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import type { RangeValue, RecursivePartial } from "../../../../Types";
|
|
1
2
|
import type { IOptionLoader } from "../../../Interfaces/IOptionLoader";
|
|
2
3
|
import type { IRotateAnimation } from "../../../Interfaces/Particles/Rotate/IRotateAnimation";
|
|
3
|
-
import type { RecursivePartial } from "../../../../Types";
|
|
4
4
|
export declare class RotateAnimation implements IRotateAnimation, IOptionLoader<IRotateAnimation> {
|
|
5
5
|
enable: boolean;
|
|
6
|
-
speed:
|
|
6
|
+
speed: RangeValue;
|
|
7
7
|
sync: boolean;
|
|
8
8
|
constructor();
|
|
9
9
|
load(data?: RecursivePartial<IRotateAnimation>): void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RotateAnimation = void 0;
|
|
4
|
+
const Utils_1 = require("../../../../Utils");
|
|
4
5
|
class RotateAnimation {
|
|
5
6
|
constructor() {
|
|
6
7
|
this.enable = false;
|
|
@@ -15,7 +16,7 @@ class RotateAnimation {
|
|
|
15
16
|
this.enable = data.enable;
|
|
16
17
|
}
|
|
17
18
|
if (data.speed !== undefined) {
|
|
18
|
-
this.speed = data.speed;
|
|
19
|
+
this.speed = (0, Utils_1.setRangeValue)(data.speed);
|
|
19
20
|
}
|
|
20
21
|
if (data.sync !== undefined) {
|
|
21
22
|
this.sync = data.sync;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import type { RangeValue, RecursivePartial } from "../../../../Types";
|
|
1
2
|
import type { IOptionLoader } from "../../../Interfaces/IOptionLoader";
|
|
2
3
|
import type { ITiltAnimation } from "../../../Interfaces/Particles/Tilt/ITiltAnimation";
|
|
3
|
-
import type { RecursivePartial } from "../../../../Types";
|
|
4
4
|
export declare class TiltAnimation implements ITiltAnimation, IOptionLoader<ITiltAnimation> {
|
|
5
5
|
enable: boolean;
|
|
6
|
-
speed:
|
|
6
|
+
speed: RangeValue;
|
|
7
7
|
sync: boolean;
|
|
8
8
|
constructor();
|
|
9
9
|
load(data?: RecursivePartial<ITiltAnimation>): void;
|