tsparticles 1.41.6 → 1.42.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Core/Canvas.d.ts +1 -1
- package/Core/Canvas.js +8 -4
- package/Core/Interfaces/ICoordinates.d.ts +8 -0
- package/Core/Interfaces/IParticleGravity.d.ts +5 -0
- package/Core/Interfaces/IParticleGravity.js +2 -0
- package/Core/Interfaces/index.d.ts +1 -0
- package/Core/Interfaces/index.js +1 -0
- package/Core/Particle.d.ts +2 -1
- package/Core/Particle.js +8 -7
- package/Core/Retina.js +7 -7
- package/Core/Utils/ParticlesMover.js +2 -2
- package/Interactions/Particles/Links/LinkInstance.js +1 -1
- package/Options/Classes/AnimatableGradient.d.ts +4 -4
- package/Options/Classes/AnimatableGradient.js +4 -4
- package/Options/Classes/AnimationOptions.d.ts +5 -5
- package/Options/Classes/AnimationOptions.js +3 -2
- package/Options/Classes/ColorAnimation.d.ts +2 -2
- package/Options/Classes/ColorAnimation.js +2 -2
- package/Options/Classes/Particles/Move/Attract.d.ts +2 -2
- package/Options/Classes/Particles/Move/Attract.js +2 -1
- package/Options/Classes/Particles/Move/MoveAngle.d.ts +3 -3
- package/Options/Classes/Particles/Move/MoveAngle.js +3 -2
- package/Options/Classes/Particles/Move/MoveGravity.d.ts +5 -5
- package/Options/Classes/Particles/Move/MoveGravity.js +3 -2
- package/Options/Classes/Particles/Orbit/Orbit.d.ts +4 -4
- package/Options/Classes/Particles/Orbit/Orbit.js +4 -3
- package/Options/Classes/Particles/Repulse/Repulse.d.ts +5 -5
- package/Options/Classes/Particles/Repulse/Repulse.js +5 -4
- package/Options/Classes/Particles/Roll/RollLight.d.ts +2 -2
- package/Options/Classes/Particles/Roll/RollLight.js +2 -1
- package/Options/Classes/Particles/Rotate/RotateAnimation.d.ts +2 -2
- package/Options/Classes/Particles/Rotate/RotateAnimation.js +2 -1
- package/Options/Classes/Particles/Tilt/TiltAnimation.d.ts +2 -2
- package/Options/Classes/Particles/Tilt/TiltAnimation.js +2 -1
- package/Options/Classes/Particles/Twinkle/TwinkleValues.d.ts +2 -2
- package/Options/Classes/Particles/Twinkle/TwinkleValues.js +2 -1
- package/Options/Interfaces/IAnimation.d.ts +3 -2
- package/Options/Interfaces/Particles/Move/IAttract.d.ts +3 -2
- package/Options/Interfaces/Particles/Move/IMoveAngle.d.ts +3 -2
- package/Options/Interfaces/Particles/Move/IMoveGravity.d.ts +3 -2
- package/Options/Interfaces/Particles/Orbit/IOrbit.d.ts +4 -3
- package/Options/Interfaces/Particles/Repulse/IRepulse.d.ts +5 -4
- package/Options/Interfaces/Particles/Roll/IRollLight.d.ts +2 -1
- package/Options/Interfaces/Particles/Rotate/IRotateAnimation.d.ts +2 -1
- package/Options/Interfaces/Particles/Tilt/ITiltAnimation.d.ts +2 -1
- package/Options/Interfaces/Particles/Twinkle/ITwinkleValues.d.ts +3 -2
- package/Plugins/Absorbers/AbsorberInstance.js +1 -1
- package/Plugins/Absorbers/Options/Classes/Absorber.d.ts +2 -2
- package/Plugins/Absorbers/Options/Classes/Absorber.js +8 -4
- package/Plugins/Absorbers/Options/Interfaces/IAbsorber.d.ts +2 -2
- package/Plugins/Emitters/EmitterInstance.js +3 -3
- package/Plugins/Emitters/Options/Classes/Emitter.d.ts +2 -2
- package/Plugins/Emitters/Options/Classes/Emitter.js +8 -5
- package/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +2 -2
- package/Updaters/Angle/AngleUpdater.js +2 -1
- package/Updaters/Opacity/OpacityUpdater.js +3 -2
- package/Updaters/Roll/RollUpdater.js +3 -3
- package/Updaters/Tilt/TiltUpdater.js +1 -1
- package/Utils/ColorUtils.js +1 -1
- package/browser/Core/Canvas.d.ts +1 -1
- package/browser/Core/Canvas.js +9 -5
- package/browser/Core/Interfaces/ICoordinates.d.ts +8 -0
- package/browser/Core/Interfaces/IParticleGravity.d.ts +5 -0
- package/browser/Core/Interfaces/IParticleGravity.js +1 -0
- package/browser/Core/Interfaces/index.d.ts +1 -0
- package/browser/Core/Interfaces/index.js +1 -0
- package/browser/Core/Particle.d.ts +2 -1
- package/browser/Core/Particle.js +8 -7
- package/browser/Core/Retina.js +7 -7
- package/browser/Core/Utils/ParticlesMover.js +2 -2
- package/browser/Interactions/Particles/Links/LinkInstance.js +2 -2
- package/browser/Options/Classes/AnimatableGradient.d.ts +4 -4
- package/browser/Options/Classes/AnimatableGradient.js +4 -4
- package/browser/Options/Classes/AnimationOptions.d.ts +5 -5
- package/browser/Options/Classes/AnimationOptions.js +3 -2
- package/browser/Options/Classes/ColorAnimation.d.ts +2 -2
- package/browser/Options/Classes/ColorAnimation.js +2 -2
- package/browser/Options/Classes/Particles/Move/Attract.d.ts +2 -2
- package/browser/Options/Classes/Particles/Move/Attract.js +2 -1
- package/browser/Options/Classes/Particles/Move/MoveAngle.d.ts +3 -3
- package/browser/Options/Classes/Particles/Move/MoveAngle.js +3 -2
- package/browser/Options/Classes/Particles/Move/MoveGravity.d.ts +5 -5
- package/browser/Options/Classes/Particles/Move/MoveGravity.js +3 -2
- package/browser/Options/Classes/Particles/Orbit/Orbit.d.ts +4 -4
- package/browser/Options/Classes/Particles/Orbit/Orbit.js +4 -3
- package/browser/Options/Classes/Particles/Repulse/Repulse.d.ts +5 -5
- package/browser/Options/Classes/Particles/Repulse/Repulse.js +5 -4
- package/browser/Options/Classes/Particles/Roll/RollLight.d.ts +2 -2
- package/browser/Options/Classes/Particles/Roll/RollLight.js +2 -1
- package/browser/Options/Classes/Particles/Rotate/RotateAnimation.d.ts +2 -2
- package/browser/Options/Classes/Particles/Rotate/RotateAnimation.js +2 -1
- package/browser/Options/Classes/Particles/Tilt/TiltAnimation.d.ts +2 -2
- package/browser/Options/Classes/Particles/Tilt/TiltAnimation.js +2 -1
- package/browser/Options/Classes/Particles/Twinkle/TwinkleValues.d.ts +2 -2
- package/browser/Options/Classes/Particles/Twinkle/TwinkleValues.js +2 -1
- package/browser/Options/Interfaces/IAnimation.d.ts +3 -2
- package/browser/Options/Interfaces/Particles/Move/IAttract.d.ts +3 -2
- package/browser/Options/Interfaces/Particles/Move/IMoveAngle.d.ts +3 -2
- package/browser/Options/Interfaces/Particles/Move/IMoveGravity.d.ts +3 -2
- package/browser/Options/Interfaces/Particles/Orbit/IOrbit.d.ts +4 -3
- package/browser/Options/Interfaces/Particles/Repulse/IRepulse.d.ts +5 -4
- package/browser/Options/Interfaces/Particles/Roll/IRollLight.d.ts +2 -1
- package/browser/Options/Interfaces/Particles/Rotate/IRotateAnimation.d.ts +2 -1
- package/browser/Options/Interfaces/Particles/Tilt/ITiltAnimation.d.ts +2 -1
- package/browser/Options/Interfaces/Particles/Twinkle/ITwinkleValues.d.ts +3 -2
- package/browser/Plugins/Absorbers/AbsorberInstance.js +1 -1
- package/browser/Plugins/Absorbers/Options/Classes/Absorber.d.ts +2 -2
- package/browser/Plugins/Absorbers/Options/Classes/Absorber.js +8 -4
- package/browser/Plugins/Absorbers/Options/Interfaces/IAbsorber.d.ts +2 -2
- package/browser/Plugins/Emitters/EmitterInstance.js +3 -3
- package/browser/Plugins/Emitters/Options/Classes/Emitter.d.ts +2 -2
- package/browser/Plugins/Emitters/Options/Classes/Emitter.js +8 -5
- package/browser/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +2 -2
- package/browser/Updaters/Angle/AngleUpdater.js +2 -1
- package/browser/Updaters/Opacity/OpacityUpdater.js +3 -2
- package/browser/Updaters/Roll/RollUpdater.js +3 -3
- package/browser/Updaters/Tilt/TiltUpdater.js +1 -1
- package/browser/Utils/ColorUtils.js +2 -2
- package/esm/Core/Canvas.d.ts +1 -1
- package/esm/Core/Canvas.js +9 -5
- package/esm/Core/Interfaces/ICoordinates.d.ts +8 -0
- package/esm/Core/Interfaces/IParticleGravity.d.ts +5 -0
- package/esm/Core/Interfaces/IParticleGravity.js +1 -0
- package/esm/Core/Interfaces/index.d.ts +1 -0
- package/esm/Core/Interfaces/index.js +1 -0
- package/esm/Core/Particle.d.ts +2 -1
- package/esm/Core/Particle.js +8 -7
- package/esm/Core/Retina.js +7 -7
- package/esm/Core/Utils/ParticlesMover.js +2 -2
- package/esm/Interactions/Particles/Links/LinkInstance.js +2 -2
- package/esm/Options/Classes/AnimatableGradient.d.ts +4 -4
- package/esm/Options/Classes/AnimatableGradient.js +4 -4
- package/esm/Options/Classes/AnimationOptions.d.ts +5 -5
- package/esm/Options/Classes/AnimationOptions.js +3 -2
- package/esm/Options/Classes/ColorAnimation.d.ts +2 -2
- package/esm/Options/Classes/ColorAnimation.js +2 -2
- package/esm/Options/Classes/Particles/Move/Attract.d.ts +2 -2
- package/esm/Options/Classes/Particles/Move/Attract.js +2 -1
- package/esm/Options/Classes/Particles/Move/MoveAngle.d.ts +3 -3
- package/esm/Options/Classes/Particles/Move/MoveAngle.js +3 -2
- package/esm/Options/Classes/Particles/Move/MoveGravity.d.ts +5 -5
- package/esm/Options/Classes/Particles/Move/MoveGravity.js +3 -2
- package/esm/Options/Classes/Particles/Orbit/Orbit.d.ts +4 -4
- package/esm/Options/Classes/Particles/Orbit/Orbit.js +4 -3
- package/esm/Options/Classes/Particles/Repulse/Repulse.d.ts +5 -5
- package/esm/Options/Classes/Particles/Repulse/Repulse.js +5 -4
- package/esm/Options/Classes/Particles/Roll/RollLight.d.ts +2 -2
- package/esm/Options/Classes/Particles/Roll/RollLight.js +2 -1
- package/esm/Options/Classes/Particles/Rotate/RotateAnimation.d.ts +2 -2
- package/esm/Options/Classes/Particles/Rotate/RotateAnimation.js +2 -1
- package/esm/Options/Classes/Particles/Tilt/TiltAnimation.d.ts +2 -2
- package/esm/Options/Classes/Particles/Tilt/TiltAnimation.js +2 -1
- package/esm/Options/Classes/Particles/Twinkle/TwinkleValues.d.ts +2 -2
- package/esm/Options/Classes/Particles/Twinkle/TwinkleValues.js +2 -1
- package/esm/Options/Interfaces/IAnimation.d.ts +3 -2
- package/esm/Options/Interfaces/Particles/Move/IAttract.d.ts +3 -2
- package/esm/Options/Interfaces/Particles/Move/IMoveAngle.d.ts +3 -2
- package/esm/Options/Interfaces/Particles/Move/IMoveGravity.d.ts +3 -2
- package/esm/Options/Interfaces/Particles/Orbit/IOrbit.d.ts +4 -3
- package/esm/Options/Interfaces/Particles/Repulse/IRepulse.d.ts +5 -4
- package/esm/Options/Interfaces/Particles/Roll/IRollLight.d.ts +2 -1
- package/esm/Options/Interfaces/Particles/Rotate/IRotateAnimation.d.ts +2 -1
- package/esm/Options/Interfaces/Particles/Tilt/ITiltAnimation.d.ts +2 -1
- package/esm/Options/Interfaces/Particles/Twinkle/ITwinkleValues.d.ts +3 -2
- package/esm/Plugins/Absorbers/AbsorberInstance.js +1 -1
- package/esm/Plugins/Absorbers/Options/Classes/Absorber.d.ts +2 -2
- package/esm/Plugins/Absorbers/Options/Classes/Absorber.js +8 -4
- package/esm/Plugins/Absorbers/Options/Interfaces/IAbsorber.d.ts +2 -2
- package/esm/Plugins/Emitters/EmitterInstance.js +3 -3
- package/esm/Plugins/Emitters/Options/Classes/Emitter.d.ts +2 -2
- package/esm/Plugins/Emitters/Options/Classes/Emitter.js +8 -5
- package/esm/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +2 -2
- package/esm/Updaters/Angle/AngleUpdater.js +2 -1
- package/esm/Updaters/Opacity/OpacityUpdater.js +3 -2
- package/esm/Updaters/Roll/RollUpdater.js +3 -3
- package/esm/Updaters/Tilt/TiltUpdater.js +1 -1
- package/esm/Utils/ColorUtils.js +2 -2
- package/package.json +15 -3
- package/report.html +2 -2
- package/report.slim.html +2 -2
- package/scripts/install.js +11 -2
- package/tsparticles.engine.js +48 -45
- package/tsparticles.engine.min.js +2 -2
- package/tsparticles.interaction.external.attract.js +320 -34
- package/tsparticles.interaction.external.attract.min.js +1 -1
- package/tsparticles.interaction.external.bounce.js +320 -34
- package/tsparticles.interaction.external.bounce.min.js +1 -1
- package/tsparticles.interaction.external.bubble.js +320 -34
- package/tsparticles.interaction.external.bubble.min.js +1 -1
- package/tsparticles.interaction.external.connect.js +320 -34
- package/tsparticles.interaction.external.connect.min.js +1 -1
- package/tsparticles.interaction.external.grab.js +320 -34
- package/tsparticles.interaction.external.grab.min.js +1 -1
- package/tsparticles.interaction.external.repulse.js +320 -34
- package/tsparticles.interaction.external.repulse.min.js +1 -1
- package/tsparticles.interaction.external.trail.js +320 -34
- package/tsparticles.interaction.external.trail.min.js +1 -1
- package/tsparticles.interaction.particles.attract.js +320 -34
- package/tsparticles.interaction.particles.attract.min.js +1 -1
- package/tsparticles.interaction.particles.collisions.js +320 -34
- package/tsparticles.interaction.particles.collisions.min.js +1 -1
- package/tsparticles.interaction.particles.links.js +321 -35
- package/tsparticles.interaction.particles.links.min.js +2 -2
- package/tsparticles.js +74 -65
- package/tsparticles.min.js +2 -2
- package/tsparticles.pathseg.min.js +1 -1
- package/tsparticles.plugins.absorbers.js +328 -39
- package/tsparticles.plugins.absorbers.min.js +2 -2
- package/tsparticles.plugins.emitters.js +431 -142
- package/tsparticles.plugins.emitters.min.js +2 -2
- package/tsparticles.plugins.polygonMask.js +320 -34
- package/tsparticles.plugins.polygonMask.min.js +1 -1
- package/tsparticles.shape.circle.min.js +1 -1
- package/tsparticles.shape.image.js +320 -34
- package/tsparticles.shape.image.min.js +1 -1
- package/tsparticles.shape.line.min.js +1 -1
- package/tsparticles.shape.polygon.min.js +1 -1
- package/tsparticles.shape.square.min.js +1 -1
- package/tsparticles.shape.star.min.js +1 -1
- package/tsparticles.shape.text.js +320 -34
- package/tsparticles.shape.text.min.js +1 -1
- package/tsparticles.slim.js +52 -49
- package/tsparticles.slim.min.js +2 -2
- package/tsparticles.updater.angle.js +321 -35
- package/tsparticles.updater.angle.min.js +2 -2
- package/tsparticles.updater.color.js +320 -34
- package/tsparticles.updater.color.min.js +2 -2
- package/tsparticles.updater.life.js +320 -34
- package/tsparticles.updater.life.min.js +1 -1
- package/tsparticles.updater.opacity.js +322 -36
- package/tsparticles.updater.opacity.min.js +2 -2
- package/tsparticles.updater.outModes.js +320 -34
- package/tsparticles.updater.outModes.min.js +1 -1
- package/tsparticles.updater.roll.js +323 -37
- package/tsparticles.updater.roll.min.js +2 -2
- package/tsparticles.updater.size.js +320 -34
- package/tsparticles.updater.size.min.js +1 -1
- package/tsparticles.updater.strokeColor.js +320 -34
- package/tsparticles.updater.strokeColor.min.js +2 -2
- package/tsparticles.updater.tilt.js +321 -35
- package/tsparticles.updater.tilt.min.js +2 -2
- package/tsparticles.updater.wobble.js +320 -34
- package/tsparticles.updater.wobble.min.js +1 -1
- package/umd/Core/Canvas.d.ts +1 -1
- package/umd/Core/Canvas.js +8 -4
- package/umd/Core/Interfaces/ICoordinates.d.ts +8 -0
- package/umd/Core/Interfaces/IParticleGravity.d.ts +5 -0
- package/umd/Core/Interfaces/IParticleGravity.js +12 -0
- package/umd/Core/Interfaces/index.d.ts +1 -0
- package/umd/Core/Interfaces/index.js +2 -1
- package/umd/Core/Particle.d.ts +2 -1
- package/umd/Core/Particle.js +8 -7
- package/umd/Core/Retina.js +7 -7
- package/umd/Core/Utils/ParticlesMover.js +2 -2
- package/umd/Interactions/Particles/Links/LinkInstance.js +1 -1
- package/umd/Options/Classes/AnimatableGradient.d.ts +4 -4
- package/umd/Options/Classes/AnimatableGradient.js +4 -4
- package/umd/Options/Classes/AnimationOptions.d.ts +5 -5
- package/umd/Options/Classes/AnimationOptions.js +4 -3
- package/umd/Options/Classes/ColorAnimation.d.ts +2 -2
- package/umd/Options/Classes/ColorAnimation.js +2 -2
- package/umd/Options/Classes/Particles/Move/Attract.d.ts +2 -2
- package/umd/Options/Classes/Particles/Move/Attract.js +3 -2
- package/umd/Options/Classes/Particles/Move/MoveAngle.d.ts +3 -3
- package/umd/Options/Classes/Particles/Move/MoveAngle.js +4 -3
- package/umd/Options/Classes/Particles/Move/MoveGravity.d.ts +5 -5
- package/umd/Options/Classes/Particles/Move/MoveGravity.js +4 -3
- package/umd/Options/Classes/Particles/Orbit/Orbit.d.ts +4 -4
- package/umd/Options/Classes/Particles/Orbit/Orbit.js +5 -4
- package/umd/Options/Classes/Particles/Repulse/Repulse.d.ts +5 -5
- package/umd/Options/Classes/Particles/Repulse/Repulse.js +6 -5
- package/umd/Options/Classes/Particles/Roll/RollLight.d.ts +2 -2
- package/umd/Options/Classes/Particles/Roll/RollLight.js +3 -2
- package/umd/Options/Classes/Particles/Rotate/RotateAnimation.d.ts +2 -2
- package/umd/Options/Classes/Particles/Rotate/RotateAnimation.js +3 -2
- package/umd/Options/Classes/Particles/Tilt/TiltAnimation.d.ts +2 -2
- package/umd/Options/Classes/Particles/Tilt/TiltAnimation.js +3 -2
- package/umd/Options/Classes/Particles/Twinkle/TwinkleValues.d.ts +2 -2
- package/umd/Options/Classes/Particles/Twinkle/TwinkleValues.js +3 -2
- package/umd/Options/Interfaces/IAnimation.d.ts +3 -2
- package/umd/Options/Interfaces/Particles/Move/IAttract.d.ts +3 -2
- package/umd/Options/Interfaces/Particles/Move/IMoveAngle.d.ts +3 -2
- package/umd/Options/Interfaces/Particles/Move/IMoveGravity.d.ts +3 -2
- package/umd/Options/Interfaces/Particles/Orbit/IOrbit.d.ts +4 -3
- package/umd/Options/Interfaces/Particles/Repulse/IRepulse.d.ts +5 -4
- package/umd/Options/Interfaces/Particles/Roll/IRollLight.d.ts +2 -1
- package/umd/Options/Interfaces/Particles/Rotate/IRotateAnimation.d.ts +2 -1
- package/umd/Options/Interfaces/Particles/Tilt/ITiltAnimation.d.ts +2 -1
- package/umd/Options/Interfaces/Particles/Twinkle/ITwinkleValues.d.ts +3 -2
- package/umd/Plugins/Absorbers/AbsorberInstance.js +1 -1
- package/umd/Plugins/Absorbers/Options/Classes/Absorber.d.ts +2 -2
- package/umd/Plugins/Absorbers/Options/Classes/Absorber.js +9 -5
- package/umd/Plugins/Absorbers/Options/Interfaces/IAbsorber.d.ts +2 -2
- package/umd/Plugins/Emitters/EmitterInstance.js +3 -3
- package/umd/Plugins/Emitters/Options/Classes/Emitter.d.ts +2 -2
- package/umd/Plugins/Emitters/Options/Classes/Emitter.js +9 -6
- package/umd/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +2 -2
- package/umd/Updaters/Angle/AngleUpdater.js +2 -1
- package/umd/Updaters/Opacity/OpacityUpdater.js +3 -2
- package/umd/Updaters/Roll/RollUpdater.js +3 -3
- package/umd/Updaters/Tilt/TiltUpdater.js +1 -1
- package/umd/Utils/ColorUtils.js +1 -1
|
@@ -4,13 +4,14 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "../../OptionsColor"], factory);
|
|
7
|
+
define(["require", "exports", "../../OptionsColor", "../../../../Utils"], factory);
|
|
8
8
|
}
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.TwinkleValues = void 0;
|
|
13
13
|
const OptionsColor_1 = require("../../OptionsColor");
|
|
14
|
+
const Utils_1 = require("../../../../Utils");
|
|
14
15
|
class TwinkleValues {
|
|
15
16
|
constructor() {
|
|
16
17
|
this.enable = false;
|
|
@@ -31,7 +32,7 @@
|
|
|
31
32
|
this.frequency = data.frequency;
|
|
32
33
|
}
|
|
33
34
|
if (data.opacity !== undefined) {
|
|
34
|
-
this.opacity = data.opacity;
|
|
35
|
+
this.opacity = (0, Utils_1.setRangeValue)(data.opacity);
|
|
35
36
|
}
|
|
36
37
|
}
|
|
37
38
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { ICoordinates } from "../../../../Core
|
|
1
|
+
import type { ICoordinates } from "../../../../Core";
|
|
2
|
+
import type { RangeValue } from "../../../../Types";
|
|
2
3
|
export interface IAttract {
|
|
3
|
-
distance:
|
|
4
|
+
distance: RangeValue;
|
|
4
5
|
enable: boolean;
|
|
5
6
|
rotateX: number;
|
|
6
7
|
rotateY: number;
|
|
@@ -2,11 +2,12 @@ import type { IAnimatable } from "../../IAnimatable";
|
|
|
2
2
|
import type { IAnimation } from "../../IAnimation";
|
|
3
3
|
import type { IColor } from "../../../../Core";
|
|
4
4
|
import type { IValueWithRandom } from "../../IValueWithRandom";
|
|
5
|
+
import type { RangeValue } from "../../../../Types";
|
|
5
6
|
export interface IOrbit extends IAnimatable<IAnimation> {
|
|
6
7
|
color?: string | IColor;
|
|
7
8
|
enable: boolean;
|
|
8
|
-
radius?:
|
|
9
|
+
radius?: RangeValue;
|
|
9
10
|
rotation: IValueWithRandom;
|
|
10
|
-
opacity:
|
|
11
|
-
width:
|
|
11
|
+
opacity: RangeValue;
|
|
12
|
+
width: RangeValue;
|
|
12
13
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { IValueWithRandom } from "../../IValueWithRandom";
|
|
2
|
+
import type { RangeValue } from "../../../../Types";
|
|
2
3
|
export interface IRepulse extends IValueWithRandom {
|
|
3
4
|
enabled: boolean;
|
|
4
|
-
distance:
|
|
5
|
-
duration:
|
|
6
|
-
factor:
|
|
7
|
-
speed:
|
|
5
|
+
distance: RangeValue;
|
|
6
|
+
duration: RangeValue;
|
|
7
|
+
factor: RangeValue;
|
|
8
|
+
speed: RangeValue;
|
|
8
9
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { IColor } from "../../../../Core
|
|
1
|
+
import type { IColor } from "../../../../Core";
|
|
2
|
+
import type { RangeValue } from "../../../../Types";
|
|
2
3
|
export interface ITwinkleValues {
|
|
3
4
|
color?: string | IColor;
|
|
4
5
|
enable: boolean;
|
|
5
6
|
frequency: number;
|
|
6
|
-
opacity:
|
|
7
|
+
opacity: RangeValue;
|
|
7
8
|
}
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
var _a, _b;
|
|
115
115
|
const container = this.container;
|
|
116
116
|
const percentPosition = this.options.position;
|
|
117
|
-
return Core_1.Vector.create((((_a = percentPosition === null || percentPosition === void 0 ? void 0 : percentPosition.x) !== null && _a !== void 0 ? _a : Math.random() * 100) / 100) * container.canvas.size.width, (((_b = percentPosition === null || percentPosition === void 0 ? void 0 : percentPosition.y) !== null && _b !== void 0 ? _b : Math.random() * 100) / 100) * container.canvas.size.height);
|
|
117
|
+
return Core_1.Vector.create(((0, Utils_1.getRangeValue)((_a = percentPosition === null || percentPosition === void 0 ? void 0 : percentPosition.x) !== null && _a !== void 0 ? _a : Math.random() * 100) / 100) * container.canvas.size.width, ((0, Utils_1.getRangeValue)((_b = percentPosition === null || percentPosition === void 0 ? void 0 : percentPosition.y) !== null && _b !== void 0 ? _b : Math.random() * 100) / 100) * container.canvas.size.height);
|
|
118
118
|
}
|
|
119
119
|
updateParticlePosition(particle, v) {
|
|
120
120
|
var _a;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AbsorberSize } from "./AbsorberSize";
|
|
2
2
|
import type { IAbsorber } from "../Interfaces/IAbsorber";
|
|
3
|
-
import type { ICoordinates } from "../../../../Core";
|
|
4
3
|
import type { IOptionLoader } from "../../../../Options/Interfaces/IOptionLoader";
|
|
4
|
+
import type { IRangedCoordinates } from "../../../../Core";
|
|
5
5
|
import { OptionsColor } from "../../../../Options/Classes/OptionsColor";
|
|
6
6
|
import type { RecursivePartial } from "../../../../Types";
|
|
7
7
|
export declare class Absorber implements IAbsorber, IOptionLoader<IAbsorber> {
|
|
@@ -9,7 +9,7 @@ export declare class Absorber implements IAbsorber, IOptionLoader<IAbsorber> {
|
|
|
9
9
|
draggable: boolean;
|
|
10
10
|
name?: string;
|
|
11
11
|
opacity: number;
|
|
12
|
-
position?: RecursivePartial<
|
|
12
|
+
position?: RecursivePartial<IRangedCoordinates>;
|
|
13
13
|
size: AbsorberSize;
|
|
14
14
|
destroy: boolean;
|
|
15
15
|
orbits: boolean;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "./AbsorberSize", "../../../../Options/Classes/OptionsColor"], factory);
|
|
7
|
+
define(["require", "exports", "./AbsorberSize", "../../../../Options/Classes/OptionsColor", "../../../../Utils"], factory);
|
|
8
8
|
}
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
exports.Absorber = void 0;
|
|
13
13
|
const AbsorberSize_1 = require("./AbsorberSize");
|
|
14
14
|
const OptionsColor_1 = require("../../../../Options/Classes/OptionsColor");
|
|
15
|
+
const Utils_1 = require("../../../../Utils");
|
|
15
16
|
class Absorber {
|
|
16
17
|
constructor() {
|
|
17
18
|
this.color = new OptionsColor_1.OptionsColor();
|
|
@@ -37,10 +38,13 @@
|
|
|
37
38
|
this.opacity = data.opacity;
|
|
38
39
|
}
|
|
39
40
|
if (data.position !== undefined) {
|
|
40
|
-
this.position = {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
41
|
+
this.position = {};
|
|
42
|
+
if (data.position.x !== undefined) {
|
|
43
|
+
this.position.x = (0, Utils_1.setRangeValue)(data.position.x);
|
|
44
|
+
}
|
|
45
|
+
if (data.position.y !== undefined) {
|
|
46
|
+
this.position.y = (0, Utils_1.setRangeValue)(data.position.y);
|
|
47
|
+
}
|
|
44
48
|
}
|
|
45
49
|
if (data.size !== undefined) {
|
|
46
50
|
this.size.load(data.size);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { IColor,
|
|
1
|
+
import type { IColor, IRangedCoordinates } from "../../../../Core";
|
|
2
2
|
import type { IAbsorberSize } from "./IAbsorberSize";
|
|
3
3
|
import { RecursivePartial } from "../../../../Types";
|
|
4
4
|
export interface IAbsorber {
|
|
5
5
|
color: IColor | string;
|
|
6
6
|
name?: string;
|
|
7
7
|
opacity: number;
|
|
8
|
-
position?: RecursivePartial<
|
|
8
|
+
position?: RecursivePartial<IRangedCoordinates>;
|
|
9
9
|
size: IAbsorberSize;
|
|
10
10
|
draggable: boolean;
|
|
11
11
|
destroy: boolean;
|
|
@@ -220,8 +220,8 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
220
220
|
const container = this.container;
|
|
221
221
|
const percentPosition = this.options.position;
|
|
222
222
|
return {
|
|
223
|
-
x: (((_a = percentPosition === null || percentPosition === void 0 ? void 0 : percentPosition.x) !== null && _a !== void 0 ? _a : Math.random() * 100) / 100) * container.canvas.size.width,
|
|
224
|
-
y: (((_b = percentPosition === null || percentPosition === void 0 ? void 0 : percentPosition.y) !== null && _b !== void 0 ? _b : Math.random() * 100) / 100) * container.canvas.size.height,
|
|
223
|
+
x: ((0, Utils_1.getRangeValue)((_a = percentPosition === null || percentPosition === void 0 ? void 0 : percentPosition.x) !== null && _a !== void 0 ? _a : Math.random() * 100) / 100) * container.canvas.size.width,
|
|
224
|
+
y: ((0, Utils_1.getRangeValue)((_b = percentPosition === null || percentPosition === void 0 ? void 0 : percentPosition.y) !== null && _b !== void 0 ? _b : Math.random() * 100) / 100) * container.canvas.size.height,
|
|
225
225
|
};
|
|
226
226
|
}
|
|
227
227
|
emit() {
|
|
@@ -270,7 +270,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
270
270
|
const colorOffset = (0, Utils_1.randomInRange)(animation.offset);
|
|
271
271
|
const delay = (0, Utils_1.getRangeValue)(this.options.rate.delay);
|
|
272
272
|
const emitFactor = (1000 * delay) / container.retina.reduceFactor;
|
|
273
|
-
const colorSpeed = (_a = animation.speed) !== null && _a !== void 0 ? _a : 0;
|
|
273
|
+
const colorSpeed = (0, Utils_1.getRangeValue)((_a = animation.speed) !== null && _a !== void 0 ? _a : 0);
|
|
274
274
|
return (initValue + (colorSpeed * container.fpsLimit) / emitFactor + colorOffset * 3.6) % maxValue;
|
|
275
275
|
}
|
|
276
276
|
}
|
|
@@ -4,10 +4,10 @@ import { EmitterLife } from "./EmitterLife";
|
|
|
4
4
|
import { EmitterRate } from "./EmitterRate";
|
|
5
5
|
import { EmitterShapeType } from "../../Enums";
|
|
6
6
|
import { EmitterSize } from "./EmitterSize";
|
|
7
|
-
import type { ICoordinates } from "../../../../Core";
|
|
8
7
|
import type { IEmitter } from "../Interfaces/IEmitter";
|
|
9
8
|
import type { IOptionLoader } from "../../../../Options/Interfaces/IOptionLoader";
|
|
10
9
|
import type { IParticles } from "../../../../Options/Interfaces/Particles/IParticles";
|
|
10
|
+
import type { IRangedCoordinates } from "../../../../Core";
|
|
11
11
|
import type { RecursivePartial } from "../../../../Types";
|
|
12
12
|
export declare class Emitter implements IEmitter, IOptionLoader<IEmitter> {
|
|
13
13
|
autoPlay: boolean;
|
|
@@ -18,7 +18,7 @@ export declare class Emitter implements IEmitter, IOptionLoader<IEmitter> {
|
|
|
18
18
|
life: EmitterLife;
|
|
19
19
|
name?: string;
|
|
20
20
|
particles?: RecursivePartial<IParticles>;
|
|
21
|
-
position?: RecursivePartial<
|
|
21
|
+
position?: RecursivePartial<IRangedCoordinates>;
|
|
22
22
|
rate: EmitterRate;
|
|
23
23
|
shape: EmitterShapeType | keyof typeof EmitterShapeType;
|
|
24
24
|
spawnColor?: AnimatableColor;
|
|
@@ -4,17 +4,17 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "../../../../Options/Classes/AnimatableColor", "./EmitterLife", "./EmitterRate", "./EmitterSize"
|
|
7
|
+
define(["require", "exports", "../../../../Utils", "../../../../Options/Classes/AnimatableColor", "./EmitterLife", "./EmitterRate", "./EmitterSize"], factory);
|
|
8
8
|
}
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.Emitter = void 0;
|
|
13
|
+
const Utils_1 = require("../../../../Utils");
|
|
13
14
|
const AnimatableColor_1 = require("../../../../Options/Classes/AnimatableColor");
|
|
14
15
|
const EmitterLife_1 = require("./EmitterLife");
|
|
15
16
|
const EmitterRate_1 = require("./EmitterRate");
|
|
16
17
|
const EmitterSize_1 = require("./EmitterSize");
|
|
17
|
-
const Utils_1 = require("../../../../Utils");
|
|
18
18
|
class Emitter {
|
|
19
19
|
constructor() {
|
|
20
20
|
this.autoPlay = true;
|
|
@@ -54,10 +54,13 @@
|
|
|
54
54
|
this.shape = data.shape;
|
|
55
55
|
}
|
|
56
56
|
if (data.position !== undefined) {
|
|
57
|
-
this.position = {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
57
|
+
this.position = {};
|
|
58
|
+
if (data.position.x !== undefined) {
|
|
59
|
+
this.position.x = (0, Utils_1.setRangeValue)(data.position.x);
|
|
60
|
+
}
|
|
61
|
+
if (data.position.y !== undefined) {
|
|
62
|
+
this.position.y = (0, Utils_1.setRangeValue)(data.position.y);
|
|
63
|
+
}
|
|
61
64
|
}
|
|
62
65
|
if (data.spawnColor !== undefined) {
|
|
63
66
|
if (this.spawnColor === undefined) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { MoveDirection, MoveDirectionAlt } from "../../../../Enums";
|
|
2
2
|
import type { EmitterShapeType } from "../../Enums";
|
|
3
3
|
import type { IAnimatableColor } from "../../../../Options/Interfaces/IAnimatableColor";
|
|
4
|
-
import type { ICoordinates } from "../../../../Core";
|
|
5
4
|
import type { IEmitterLife } from "./IEmitterLife";
|
|
6
5
|
import type { IEmitterRate } from "./IEmitterRate";
|
|
7
6
|
import type { IEmitterSize } from "./IEmitterSize";
|
|
8
7
|
import type { IParticles } from "../../../../Options/Interfaces/Particles/IParticles";
|
|
8
|
+
import type { IRangedCoordinates } from "../../../../Core";
|
|
9
9
|
import type { RecursivePartial } from "../../../../Types";
|
|
10
10
|
export interface IEmitter {
|
|
11
11
|
autoPlay: boolean;
|
|
@@ -16,7 +16,7 @@ export interface IEmitter {
|
|
|
16
16
|
life: IEmitterLife;
|
|
17
17
|
name?: string;
|
|
18
18
|
particles?: RecursivePartial<IParticles>;
|
|
19
|
-
position?: RecursivePartial<
|
|
19
|
+
position?: RecursivePartial<IRangedCoordinates>;
|
|
20
20
|
rate: IEmitterRate;
|
|
21
21
|
shape: EmitterShapeType | keyof typeof EmitterShapeType;
|
|
22
22
|
spawnColor?: IAnimatableColor;
|
|
@@ -66,7 +66,8 @@
|
|
|
66
66
|
}
|
|
67
67
|
const rotateAnimation = particle.options.rotate.animation;
|
|
68
68
|
if (rotateAnimation.enable) {
|
|
69
|
-
particle.rotate.velocity =
|
|
69
|
+
particle.rotate.velocity =
|
|
70
|
+
((0, Utils_1.getRangeValue)(rotateAnimation.speed) / 360) * this.container.retina.reduceFactor;
|
|
70
71
|
if (!rotateAnimation.sync) {
|
|
71
72
|
particle.rotate.velocity *= Math.random();
|
|
72
73
|
}
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
min: (0, Utils_1.getRangeMin)(opacityOptions.value),
|
|
81
81
|
value: (0, Utils_1.getRangeValue)(opacityOptions.value),
|
|
82
82
|
loops: 0,
|
|
83
|
-
maxLoops: opacityOptions.animation.count,
|
|
83
|
+
maxLoops: (0, Utils_1.getRangeValue)(opacityOptions.animation.count),
|
|
84
84
|
};
|
|
85
85
|
const opacityAnimation = opacityOptions.animation;
|
|
86
86
|
if (opacityAnimation.enable) {
|
|
@@ -104,7 +104,8 @@
|
|
|
104
104
|
particle.opacity.status = 1;
|
|
105
105
|
break;
|
|
106
106
|
}
|
|
107
|
-
particle.opacity.velocity =
|
|
107
|
+
particle.opacity.velocity =
|
|
108
|
+
((0, Utils_1.getRangeValue)(opacityAnimation.speed) / 100) * this.container.retina.reduceFactor;
|
|
108
109
|
if (!opacityAnimation.sync) {
|
|
109
110
|
particle.opacity.velocity *= Math.random();
|
|
110
111
|
}
|
|
@@ -38,19 +38,19 @@
|
|
|
38
38
|
const alterType = Math.random() >= 0.5 ? "darken" : "enlighten";
|
|
39
39
|
particle.roll.alter = {
|
|
40
40
|
type: alterType,
|
|
41
|
-
value: alterType === "darken" ? rollOpt.darken.value : rollOpt.enlighten.value,
|
|
41
|
+
value: (0, Utils_1.getRangeValue)(alterType === "darken" ? rollOpt.darken.value : rollOpt.enlighten.value),
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
44
|
else if (rollOpt.darken.enable) {
|
|
45
45
|
particle.roll.alter = {
|
|
46
46
|
type: "darken",
|
|
47
|
-
value: rollOpt.darken.value,
|
|
47
|
+
value: (0, Utils_1.getRangeValue)(rollOpt.darken.value),
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
50
|
else if (rollOpt.enlighten.enable) {
|
|
51
51
|
particle.roll.alter = {
|
|
52
52
|
type: "enlighten",
|
|
53
|
-
value: rollOpt.enlighten.value,
|
|
53
|
+
value: (0, Utils_1.getRangeValue)(rollOpt.enlighten.value),
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
56
|
}
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
}
|
|
68
68
|
const tiltAnimation = particle.options.tilt.animation;
|
|
69
69
|
if (tiltAnimation.enable) {
|
|
70
|
-
particle.tilt.velocity = (tiltAnimation.speed / 360) * this.container.retina.reduceFactor;
|
|
70
|
+
particle.tilt.velocity = ((0, Utils_1.getRangeValue)(tiltAnimation.speed) / 360) * this.container.retina.reduceFactor;
|
|
71
71
|
if (!tiltAnimation.sync) {
|
|
72
72
|
particle.tilt.velocity *= Math.random();
|
|
73
73
|
}
|
package/umd/Utils/ColorUtils.js
CHANGED
|
@@ -469,7 +469,7 @@
|
|
|
469
469
|
function setColorAnimation(colorValue, colorAnimation, reduceFactor) {
|
|
470
470
|
colorValue.enable = colorAnimation.enable;
|
|
471
471
|
if (colorValue.enable) {
|
|
472
|
-
colorValue.velocity = (colorAnimation.speed / 100) * reduceFactor;
|
|
472
|
+
colorValue.velocity = ((0, NumberUtils_1.getRangeValue)(colorAnimation.speed) / 100) * reduceFactor;
|
|
473
473
|
if (colorAnimation.sync) {
|
|
474
474
|
return;
|
|
475
475
|
}
|