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.
Files changed (302) hide show
  1. package/Core/Canvas.js +4 -5
  2. package/Core/Interfaces/ICoordinates.d.ts +8 -0
  3. package/Core/Interfaces/IParticleGravity.d.ts +5 -0
  4. package/Core/Interfaces/IParticleGravity.js +2 -0
  5. package/Core/Interfaces/index.d.ts +1 -0
  6. package/Core/Interfaces/index.js +1 -0
  7. package/Core/Particle.d.ts +3 -1
  8. package/Core/Particle.js +9 -7
  9. package/Core/Particles.js +2 -1
  10. package/Core/Retina.js +7 -7
  11. package/Core/Utils/ParticlesMover.js +2 -2
  12. package/Interactions/Particles/Links/LinkInstance.js +1 -1
  13. package/Options/Classes/AnimatableGradient.d.ts +4 -4
  14. package/Options/Classes/AnimatableGradient.js +4 -4
  15. package/Options/Classes/AnimationOptions.d.ts +5 -5
  16. package/Options/Classes/AnimationOptions.js +3 -2
  17. package/Options/Classes/ColorAnimation.d.ts +2 -2
  18. package/Options/Classes/ColorAnimation.js +2 -2
  19. package/Options/Classes/Particles/Move/Attract.d.ts +2 -2
  20. package/Options/Classes/Particles/Move/Attract.js +2 -1
  21. package/Options/Classes/Particles/Move/MoveAngle.d.ts +3 -3
  22. package/Options/Classes/Particles/Move/MoveAngle.js +3 -2
  23. package/Options/Classes/Particles/Move/MoveGravity.d.ts +5 -5
  24. package/Options/Classes/Particles/Move/MoveGravity.js +3 -2
  25. package/Options/Classes/Particles/Orbit/Orbit.d.ts +4 -4
  26. package/Options/Classes/Particles/Orbit/Orbit.js +4 -3
  27. package/Options/Classes/Particles/Repulse/Repulse.d.ts +5 -5
  28. package/Options/Classes/Particles/Repulse/Repulse.js +5 -4
  29. package/Options/Classes/Particles/Roll/RollLight.d.ts +2 -2
  30. package/Options/Classes/Particles/Roll/RollLight.js +2 -1
  31. package/Options/Classes/Particles/Rotate/RotateAnimation.d.ts +2 -2
  32. package/Options/Classes/Particles/Rotate/RotateAnimation.js +2 -1
  33. package/Options/Classes/Particles/Tilt/TiltAnimation.d.ts +2 -2
  34. package/Options/Classes/Particles/Tilt/TiltAnimation.js +2 -1
  35. package/Options/Classes/Particles/Twinkle/TwinkleValues.d.ts +2 -2
  36. package/Options/Classes/Particles/Twinkle/TwinkleValues.js +2 -1
  37. package/Options/Interfaces/IAnimation.d.ts +3 -2
  38. package/Options/Interfaces/Particles/Move/IAttract.d.ts +3 -2
  39. package/Options/Interfaces/Particles/Move/IMoveAngle.d.ts +3 -2
  40. package/Options/Interfaces/Particles/Move/IMoveGravity.d.ts +3 -2
  41. package/Options/Interfaces/Particles/Orbit/IOrbit.d.ts +4 -3
  42. package/Options/Interfaces/Particles/Repulse/IRepulse.d.ts +5 -4
  43. package/Options/Interfaces/Particles/Roll/IRollLight.d.ts +2 -1
  44. package/Options/Interfaces/Particles/Rotate/IRotateAnimation.d.ts +2 -1
  45. package/Options/Interfaces/Particles/Tilt/ITiltAnimation.d.ts +2 -1
  46. package/Options/Interfaces/Particles/Twinkle/ITwinkleValues.d.ts +3 -2
  47. package/Plugins/Absorbers/AbsorberInstance.js +1 -1
  48. package/Plugins/Absorbers/Options/Classes/Absorber.d.ts +2 -2
  49. package/Plugins/Absorbers/Options/Classes/Absorber.js +8 -4
  50. package/Plugins/Absorbers/Options/Interfaces/IAbsorber.d.ts +2 -2
  51. package/Plugins/Emitters/EmitterInstance.js +11 -10
  52. package/Plugins/Emitters/Options/Classes/Emitter.d.ts +2 -2
  53. package/Plugins/Emitters/Options/Classes/Emitter.js +8 -5
  54. package/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +2 -2
  55. package/Updaters/Angle/AngleUpdater.js +2 -1
  56. package/Updaters/Opacity/OpacityUpdater.js +3 -2
  57. package/Updaters/Roll/RollUpdater.js +3 -3
  58. package/Updaters/Tilt/TiltUpdater.js +1 -1
  59. package/Utils/ColorUtils.js +1 -1
  60. package/browser/Core/Canvas.js +5 -6
  61. package/browser/Core/Interfaces/ICoordinates.d.ts +8 -0
  62. package/browser/Core/Interfaces/IParticleGravity.d.ts +5 -0
  63. package/browser/Core/Interfaces/IParticleGravity.js +1 -0
  64. package/browser/Core/Interfaces/index.d.ts +1 -0
  65. package/browser/Core/Interfaces/index.js +1 -0
  66. package/browser/Core/Particle.d.ts +3 -1
  67. package/browser/Core/Particle.js +9 -7
  68. package/browser/Core/Particles.js +2 -1
  69. package/browser/Core/Retina.js +7 -7
  70. package/browser/Core/Utils/ParticlesMover.js +2 -2
  71. package/browser/Interactions/Particles/Links/LinkInstance.js +2 -2
  72. package/browser/Options/Classes/AnimatableGradient.d.ts +4 -4
  73. package/browser/Options/Classes/AnimatableGradient.js +4 -4
  74. package/browser/Options/Classes/AnimationOptions.d.ts +5 -5
  75. package/browser/Options/Classes/AnimationOptions.js +3 -2
  76. package/browser/Options/Classes/ColorAnimation.d.ts +2 -2
  77. package/browser/Options/Classes/ColorAnimation.js +2 -2
  78. package/browser/Options/Classes/Particles/Move/Attract.d.ts +2 -2
  79. package/browser/Options/Classes/Particles/Move/Attract.js +2 -1
  80. package/browser/Options/Classes/Particles/Move/MoveAngle.d.ts +3 -3
  81. package/browser/Options/Classes/Particles/Move/MoveAngle.js +3 -2
  82. package/browser/Options/Classes/Particles/Move/MoveGravity.d.ts +5 -5
  83. package/browser/Options/Classes/Particles/Move/MoveGravity.js +3 -2
  84. package/browser/Options/Classes/Particles/Orbit/Orbit.d.ts +4 -4
  85. package/browser/Options/Classes/Particles/Orbit/Orbit.js +4 -3
  86. package/browser/Options/Classes/Particles/Repulse/Repulse.d.ts +5 -5
  87. package/browser/Options/Classes/Particles/Repulse/Repulse.js +5 -4
  88. package/browser/Options/Classes/Particles/Roll/RollLight.d.ts +2 -2
  89. package/browser/Options/Classes/Particles/Roll/RollLight.js +2 -1
  90. package/browser/Options/Classes/Particles/Rotate/RotateAnimation.d.ts +2 -2
  91. package/browser/Options/Classes/Particles/Rotate/RotateAnimation.js +2 -1
  92. package/browser/Options/Classes/Particles/Tilt/TiltAnimation.d.ts +2 -2
  93. package/browser/Options/Classes/Particles/Tilt/TiltAnimation.js +2 -1
  94. package/browser/Options/Classes/Particles/Twinkle/TwinkleValues.d.ts +2 -2
  95. package/browser/Options/Classes/Particles/Twinkle/TwinkleValues.js +2 -1
  96. package/browser/Options/Interfaces/IAnimation.d.ts +3 -2
  97. package/browser/Options/Interfaces/Particles/Move/IAttract.d.ts +3 -2
  98. package/browser/Options/Interfaces/Particles/Move/IMoveAngle.d.ts +3 -2
  99. package/browser/Options/Interfaces/Particles/Move/IMoveGravity.d.ts +3 -2
  100. package/browser/Options/Interfaces/Particles/Orbit/IOrbit.d.ts +4 -3
  101. package/browser/Options/Interfaces/Particles/Repulse/IRepulse.d.ts +5 -4
  102. package/browser/Options/Interfaces/Particles/Roll/IRollLight.d.ts +2 -1
  103. package/browser/Options/Interfaces/Particles/Rotate/IRotateAnimation.d.ts +2 -1
  104. package/browser/Options/Interfaces/Particles/Tilt/ITiltAnimation.d.ts +2 -1
  105. package/browser/Options/Interfaces/Particles/Twinkle/ITwinkleValues.d.ts +3 -2
  106. package/browser/Plugins/Absorbers/AbsorberInstance.js +1 -1
  107. package/browser/Plugins/Absorbers/Options/Classes/Absorber.d.ts +2 -2
  108. package/browser/Plugins/Absorbers/Options/Classes/Absorber.js +8 -4
  109. package/browser/Plugins/Absorbers/Options/Interfaces/IAbsorber.d.ts +2 -2
  110. package/browser/Plugins/Emitters/EmitterInstance.js +11 -10
  111. package/browser/Plugins/Emitters/Options/Classes/Emitter.d.ts +2 -2
  112. package/browser/Plugins/Emitters/Options/Classes/Emitter.js +8 -5
  113. package/browser/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +2 -2
  114. package/browser/Updaters/Angle/AngleUpdater.js +2 -1
  115. package/browser/Updaters/Opacity/OpacityUpdater.js +3 -2
  116. package/browser/Updaters/Roll/RollUpdater.js +3 -3
  117. package/browser/Updaters/Tilt/TiltUpdater.js +1 -1
  118. package/browser/Utils/ColorUtils.js +2 -2
  119. package/esm/Core/Canvas.js +5 -6
  120. package/esm/Core/Interfaces/ICoordinates.d.ts +8 -0
  121. package/esm/Core/Interfaces/IParticleGravity.d.ts +5 -0
  122. package/esm/Core/Interfaces/IParticleGravity.js +1 -0
  123. package/esm/Core/Interfaces/index.d.ts +1 -0
  124. package/esm/Core/Interfaces/index.js +1 -0
  125. package/esm/Core/Particle.d.ts +3 -1
  126. package/esm/Core/Particle.js +9 -7
  127. package/esm/Core/Particles.js +2 -1
  128. package/esm/Core/Retina.js +7 -7
  129. package/esm/Core/Utils/ParticlesMover.js +2 -2
  130. package/esm/Interactions/Particles/Links/LinkInstance.js +2 -2
  131. package/esm/Options/Classes/AnimatableGradient.d.ts +4 -4
  132. package/esm/Options/Classes/AnimatableGradient.js +4 -4
  133. package/esm/Options/Classes/AnimationOptions.d.ts +5 -5
  134. package/esm/Options/Classes/AnimationOptions.js +3 -2
  135. package/esm/Options/Classes/ColorAnimation.d.ts +2 -2
  136. package/esm/Options/Classes/ColorAnimation.js +2 -2
  137. package/esm/Options/Classes/Particles/Move/Attract.d.ts +2 -2
  138. package/esm/Options/Classes/Particles/Move/Attract.js +2 -1
  139. package/esm/Options/Classes/Particles/Move/MoveAngle.d.ts +3 -3
  140. package/esm/Options/Classes/Particles/Move/MoveAngle.js +3 -2
  141. package/esm/Options/Classes/Particles/Move/MoveGravity.d.ts +5 -5
  142. package/esm/Options/Classes/Particles/Move/MoveGravity.js +3 -2
  143. package/esm/Options/Classes/Particles/Orbit/Orbit.d.ts +4 -4
  144. package/esm/Options/Classes/Particles/Orbit/Orbit.js +4 -3
  145. package/esm/Options/Classes/Particles/Repulse/Repulse.d.ts +5 -5
  146. package/esm/Options/Classes/Particles/Repulse/Repulse.js +5 -4
  147. package/esm/Options/Classes/Particles/Roll/RollLight.d.ts +2 -2
  148. package/esm/Options/Classes/Particles/Roll/RollLight.js +2 -1
  149. package/esm/Options/Classes/Particles/Rotate/RotateAnimation.d.ts +2 -2
  150. package/esm/Options/Classes/Particles/Rotate/RotateAnimation.js +2 -1
  151. package/esm/Options/Classes/Particles/Tilt/TiltAnimation.d.ts +2 -2
  152. package/esm/Options/Classes/Particles/Tilt/TiltAnimation.js +2 -1
  153. package/esm/Options/Classes/Particles/Twinkle/TwinkleValues.d.ts +2 -2
  154. package/esm/Options/Classes/Particles/Twinkle/TwinkleValues.js +2 -1
  155. package/esm/Options/Interfaces/IAnimation.d.ts +3 -2
  156. package/esm/Options/Interfaces/Particles/Move/IAttract.d.ts +3 -2
  157. package/esm/Options/Interfaces/Particles/Move/IMoveAngle.d.ts +3 -2
  158. package/esm/Options/Interfaces/Particles/Move/IMoveGravity.d.ts +3 -2
  159. package/esm/Options/Interfaces/Particles/Orbit/IOrbit.d.ts +4 -3
  160. package/esm/Options/Interfaces/Particles/Repulse/IRepulse.d.ts +5 -4
  161. package/esm/Options/Interfaces/Particles/Roll/IRollLight.d.ts +2 -1
  162. package/esm/Options/Interfaces/Particles/Rotate/IRotateAnimation.d.ts +2 -1
  163. package/esm/Options/Interfaces/Particles/Tilt/ITiltAnimation.d.ts +2 -1
  164. package/esm/Options/Interfaces/Particles/Twinkle/ITwinkleValues.d.ts +3 -2
  165. package/esm/Plugins/Absorbers/AbsorberInstance.js +1 -1
  166. package/esm/Plugins/Absorbers/Options/Classes/Absorber.d.ts +2 -2
  167. package/esm/Plugins/Absorbers/Options/Classes/Absorber.js +8 -4
  168. package/esm/Plugins/Absorbers/Options/Interfaces/IAbsorber.d.ts +2 -2
  169. package/esm/Plugins/Emitters/EmitterInstance.js +11 -10
  170. package/esm/Plugins/Emitters/Options/Classes/Emitter.d.ts +2 -2
  171. package/esm/Plugins/Emitters/Options/Classes/Emitter.js +8 -5
  172. package/esm/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +2 -2
  173. package/esm/Updaters/Angle/AngleUpdater.js +2 -1
  174. package/esm/Updaters/Opacity/OpacityUpdater.js +3 -2
  175. package/esm/Updaters/Roll/RollUpdater.js +3 -3
  176. package/esm/Updaters/Tilt/TiltUpdater.js +1 -1
  177. package/esm/Utils/ColorUtils.js +2 -2
  178. package/package.json +1 -1
  179. package/report.html +2 -2
  180. package/report.slim.html +2 -2
  181. package/scripts/install.js +11 -2
  182. package/tsparticles.engine.js +47 -47
  183. package/tsparticles.engine.min.js +2 -2
  184. package/tsparticles.interaction.external.attract.js +319 -36
  185. package/tsparticles.interaction.external.attract.min.js +1 -1
  186. package/tsparticles.interaction.external.bounce.js +319 -36
  187. package/tsparticles.interaction.external.bounce.min.js +1 -1
  188. package/tsparticles.interaction.external.bubble.js +319 -36
  189. package/tsparticles.interaction.external.bubble.min.js +1 -1
  190. package/tsparticles.interaction.external.connect.js +319 -36
  191. package/tsparticles.interaction.external.connect.min.js +1 -1
  192. package/tsparticles.interaction.external.grab.js +319 -36
  193. package/tsparticles.interaction.external.grab.min.js +1 -1
  194. package/tsparticles.interaction.external.repulse.js +319 -36
  195. package/tsparticles.interaction.external.repulse.min.js +1 -1
  196. package/tsparticles.interaction.external.trail.js +319 -36
  197. package/tsparticles.interaction.external.trail.min.js +1 -1
  198. package/tsparticles.interaction.particles.attract.js +319 -36
  199. package/tsparticles.interaction.particles.attract.min.js +1 -1
  200. package/tsparticles.interaction.particles.collisions.js +319 -36
  201. package/tsparticles.interaction.particles.collisions.min.js +1 -1
  202. package/tsparticles.interaction.particles.links.js +320 -37
  203. package/tsparticles.interaction.particles.links.min.js +2 -2
  204. package/tsparticles.js +81 -74
  205. package/tsparticles.min.js +2 -2
  206. package/tsparticles.pathseg.min.js +1 -1
  207. package/tsparticles.plugins.absorbers.js +327 -41
  208. package/tsparticles.plugins.absorbers.min.js +2 -2
  209. package/tsparticles.plugins.emitters.js +438 -151
  210. package/tsparticles.plugins.emitters.min.js +2 -2
  211. package/tsparticles.plugins.polygonMask.js +319 -36
  212. package/tsparticles.plugins.polygonMask.min.js +1 -1
  213. package/tsparticles.shape.circle.min.js +1 -1
  214. package/tsparticles.shape.image.js +319 -36
  215. package/tsparticles.shape.image.min.js +1 -1
  216. package/tsparticles.shape.line.min.js +1 -1
  217. package/tsparticles.shape.polygon.min.js +1 -1
  218. package/tsparticles.shape.square.min.js +1 -1
  219. package/tsparticles.shape.star.min.js +1 -1
  220. package/tsparticles.shape.text.js +319 -36
  221. package/tsparticles.shape.text.min.js +1 -1
  222. package/tsparticles.slim.js +51 -51
  223. package/tsparticles.slim.min.js +2 -2
  224. package/tsparticles.updater.angle.js +320 -37
  225. package/tsparticles.updater.angle.min.js +2 -2
  226. package/tsparticles.updater.color.js +319 -36
  227. package/tsparticles.updater.color.min.js +2 -2
  228. package/tsparticles.updater.life.js +319 -36
  229. package/tsparticles.updater.life.min.js +1 -1
  230. package/tsparticles.updater.opacity.js +321 -38
  231. package/tsparticles.updater.opacity.min.js +2 -2
  232. package/tsparticles.updater.outModes.js +319 -36
  233. package/tsparticles.updater.outModes.min.js +1 -1
  234. package/tsparticles.updater.roll.js +322 -39
  235. package/tsparticles.updater.roll.min.js +2 -2
  236. package/tsparticles.updater.size.js +319 -36
  237. package/tsparticles.updater.size.min.js +1 -1
  238. package/tsparticles.updater.strokeColor.js +319 -36
  239. package/tsparticles.updater.strokeColor.min.js +2 -2
  240. package/tsparticles.updater.tilt.js +320 -37
  241. package/tsparticles.updater.tilt.min.js +2 -2
  242. package/tsparticles.updater.wobble.js +319 -36
  243. package/tsparticles.updater.wobble.min.js +1 -1
  244. package/umd/Core/Canvas.js +4 -5
  245. package/umd/Core/Interfaces/ICoordinates.d.ts +8 -0
  246. package/umd/Core/Interfaces/IParticleGravity.d.ts +5 -0
  247. package/umd/Core/Interfaces/IParticleGravity.js +12 -0
  248. package/umd/Core/Interfaces/index.d.ts +1 -0
  249. package/umd/Core/Interfaces/index.js +2 -1
  250. package/umd/Core/Particle.d.ts +3 -1
  251. package/umd/Core/Particle.js +9 -7
  252. package/umd/Core/Particles.js +2 -1
  253. package/umd/Core/Retina.js +7 -7
  254. package/umd/Core/Utils/ParticlesMover.js +2 -2
  255. package/umd/Interactions/Particles/Links/LinkInstance.js +1 -1
  256. package/umd/Options/Classes/AnimatableGradient.d.ts +4 -4
  257. package/umd/Options/Classes/AnimatableGradient.js +4 -4
  258. package/umd/Options/Classes/AnimationOptions.d.ts +5 -5
  259. package/umd/Options/Classes/AnimationOptions.js +4 -3
  260. package/umd/Options/Classes/ColorAnimation.d.ts +2 -2
  261. package/umd/Options/Classes/ColorAnimation.js +2 -2
  262. package/umd/Options/Classes/Particles/Move/Attract.d.ts +2 -2
  263. package/umd/Options/Classes/Particles/Move/Attract.js +3 -2
  264. package/umd/Options/Classes/Particles/Move/MoveAngle.d.ts +3 -3
  265. package/umd/Options/Classes/Particles/Move/MoveAngle.js +4 -3
  266. package/umd/Options/Classes/Particles/Move/MoveGravity.d.ts +5 -5
  267. package/umd/Options/Classes/Particles/Move/MoveGravity.js +4 -3
  268. package/umd/Options/Classes/Particles/Orbit/Orbit.d.ts +4 -4
  269. package/umd/Options/Classes/Particles/Orbit/Orbit.js +5 -4
  270. package/umd/Options/Classes/Particles/Repulse/Repulse.d.ts +5 -5
  271. package/umd/Options/Classes/Particles/Repulse/Repulse.js +6 -5
  272. package/umd/Options/Classes/Particles/Roll/RollLight.d.ts +2 -2
  273. package/umd/Options/Classes/Particles/Roll/RollLight.js +3 -2
  274. package/umd/Options/Classes/Particles/Rotate/RotateAnimation.d.ts +2 -2
  275. package/umd/Options/Classes/Particles/Rotate/RotateAnimation.js +3 -2
  276. package/umd/Options/Classes/Particles/Tilt/TiltAnimation.d.ts +2 -2
  277. package/umd/Options/Classes/Particles/Tilt/TiltAnimation.js +3 -2
  278. package/umd/Options/Classes/Particles/Twinkle/TwinkleValues.d.ts +2 -2
  279. package/umd/Options/Classes/Particles/Twinkle/TwinkleValues.js +3 -2
  280. package/umd/Options/Interfaces/IAnimation.d.ts +3 -2
  281. package/umd/Options/Interfaces/Particles/Move/IAttract.d.ts +3 -2
  282. package/umd/Options/Interfaces/Particles/Move/IMoveAngle.d.ts +3 -2
  283. package/umd/Options/Interfaces/Particles/Move/IMoveGravity.d.ts +3 -2
  284. package/umd/Options/Interfaces/Particles/Orbit/IOrbit.d.ts +4 -3
  285. package/umd/Options/Interfaces/Particles/Repulse/IRepulse.d.ts +5 -4
  286. package/umd/Options/Interfaces/Particles/Roll/IRollLight.d.ts +2 -1
  287. package/umd/Options/Interfaces/Particles/Rotate/IRotateAnimation.d.ts +2 -1
  288. package/umd/Options/Interfaces/Particles/Tilt/ITiltAnimation.d.ts +2 -1
  289. package/umd/Options/Interfaces/Particles/Twinkle/ITwinkleValues.d.ts +3 -2
  290. package/umd/Plugins/Absorbers/AbsorberInstance.js +1 -1
  291. package/umd/Plugins/Absorbers/Options/Classes/Absorber.d.ts +2 -2
  292. package/umd/Plugins/Absorbers/Options/Classes/Absorber.js +9 -5
  293. package/umd/Plugins/Absorbers/Options/Interfaces/IAbsorber.d.ts +2 -2
  294. package/umd/Plugins/Emitters/EmitterInstance.js +11 -10
  295. package/umd/Plugins/Emitters/Options/Classes/Emitter.d.ts +2 -2
  296. package/umd/Plugins/Emitters/Options/Classes/Emitter.js +9 -6
  297. package/umd/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +2 -2
  298. package/umd/Updaters/Angle/AngleUpdater.js +2 -1
  299. package/umd/Updaters/Opacity/OpacityUpdater.js +3 -2
  300. package/umd/Updaters/Roll/RollUpdater.js +3 -3
  301. package/umd/Updaters/Tilt/TiltUpdater.js +1 -1
  302. package/umd/Utils/ColorUtils.js +1 -1
@@ -1,3 +1,4 @@
1
+ import { setRangeValue } from "../../Utils";
1
2
  export class AnimationOptions {
2
3
  constructor() {
3
4
  this.count = 0;
@@ -10,13 +11,13 @@ export class AnimationOptions {
10
11
  return;
11
12
  }
12
13
  if (data.count !== undefined) {
13
- this.count = data.count;
14
+ this.count = setRangeValue(data.count);
14
15
  }
15
16
  if (data.enable !== undefined) {
16
17
  this.enable = data.enable;
17
18
  }
18
19
  if (data.speed !== undefined) {
19
- this.speed = data.speed;
20
+ this.speed = setRangeValue(data.speed);
20
21
  }
21
22
  if (data.sync !== undefined) {
22
23
  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: number;
5
+ count: RangeValue;
6
6
  enable: boolean;
7
7
  offset: RangeValue;
8
- speed: number;
8
+ speed: RangeValue;
9
9
  sync: boolean;
10
10
  constructor();
11
11
  load(data?: RecursivePartial<IColorAnimation>): void;
@@ -12,7 +12,7 @@ export class ColorAnimation {
12
12
  return;
13
13
  }
14
14
  if (data.count !== undefined) {
15
- this.count = data.count;
15
+ this.count = setRangeValue(data.count);
16
16
  }
17
17
  if (data.enable !== undefined) {
18
18
  this.enable = data.enable;
@@ -21,7 +21,7 @@ export class ColorAnimation {
21
21
  this.offset = setRangeValue(data.offset);
22
22
  }
23
23
  if (data.speed !== undefined) {
24
- this.speed = data.speed;
24
+ this.speed = setRangeValue(data.speed);
25
25
  }
26
26
  if (data.sync !== undefined) {
27
27
  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: number;
10
+ distance: RangeValue;
11
11
  enable: boolean;
12
12
  rotate: ICoordinates;
13
13
  constructor();
@@ -1,3 +1,4 @@
1
+ import { setRangeValue } from "../../../../Utils";
1
2
  export class Attract {
2
3
  constructor() {
3
4
  this.distance = 200;
@@ -25,7 +26,7 @@ export class Attract {
25
26
  return;
26
27
  }
27
28
  if (data.distance !== undefined) {
28
- this.distance = data.distance;
29
+ this.distance = setRangeValue(data.distance);
29
30
  }
30
31
  if (data.enable !== undefined) {
31
32
  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: number;
6
- value: number;
5
+ offset: RangeValue;
6
+ value: RangeValue;
7
7
  constructor();
8
8
  load(data?: RecursivePartial<IMoveAngle>): void;
9
9
  }
@@ -1,3 +1,4 @@
1
+ import { setRangeValue } from "../../../../Utils";
1
2
  export class MoveAngle {
2
3
  constructor() {
3
4
  this.offset = 0;
@@ -8,10 +9,10 @@ export class MoveAngle {
8
9
  return;
9
10
  }
10
11
  if (data.offset !== undefined) {
11
- this.offset = data.offset;
12
+ this.offset = setRangeValue(data.offset);
12
13
  }
13
14
  if (data.value !== undefined) {
14
- this.value = data.value;
15
+ this.value = setRangeValue(data.value);
15
16
  }
16
17
  }
17
18
  }
@@ -1,11 +1,11 @@
1
- import { IMoveGravity } from "../../../Interfaces/Particles/Move/IMoveGravity";
2
- import { IOptionLoader } from "../../../Interfaces/IOptionLoader";
3
- import { RecursivePartial } from "../../../../Types";
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: number;
5
+ acceleration: RangeValue;
6
6
  enable: boolean;
7
7
  inverse: boolean;
8
- maxSpeed: number;
8
+ maxSpeed: RangeValue;
9
9
  constructor();
10
10
  load(data?: RecursivePartial<IMoveGravity>): void;
11
11
  }
@@ -1,3 +1,4 @@
1
+ import { setRangeValue } from "../../../../Utils";
1
2
  export class MoveGravity {
2
3
  constructor() {
3
4
  this.acceleration = 9.81;
@@ -10,7 +11,7 @@ export class MoveGravity {
10
11
  return;
11
12
  }
12
13
  if (data.acceleration !== undefined) {
13
- this.acceleration = data.acceleration;
14
+ this.acceleration = setRangeValue(data.acceleration);
14
15
  }
15
16
  if (data.enable !== undefined) {
16
17
  this.enable = data.enable;
@@ -19,7 +20,7 @@ export class MoveGravity {
19
20
  this.inverse = data.inverse;
20
21
  }
21
22
  if (data.maxSpeed !== undefined) {
22
- this.maxSpeed = data.maxSpeed;
23
+ this.maxSpeed = setRangeValue(data.maxSpeed);
23
24
  }
24
25
  }
25
26
  }
@@ -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: number;
12
- width: number;
11
+ opacity: RangeValue;
12
+ width: RangeValue;
13
13
  color?: OptionsColor;
14
- radius?: number;
14
+ radius?: RangeValue;
15
15
  rotation: OrbitRotation;
16
16
  constructor();
17
17
  load(data?: RecursivePartial<IOrbit>): void;
@@ -1,6 +1,7 @@
1
1
  import { AnimationOptions } from "../../AnimationOptions";
2
2
  import { OptionsColor } from "../../OptionsColor";
3
3
  import { OrbitRotation } from "./OrbitRotation";
4
+ import { setRangeValue } from "../../../../Utils";
4
5
  export class Orbit {
5
6
  constructor() {
6
7
  this.animation = new AnimationOptions();
@@ -19,13 +20,13 @@ export class Orbit {
19
20
  this.enable = data.enable;
20
21
  }
21
22
  if (data.opacity !== undefined) {
22
- this.opacity = data.opacity;
23
+ this.opacity = setRangeValue(data.opacity);
23
24
  }
24
25
  if (data.width !== undefined) {
25
- this.width = data.width;
26
+ this.width = setRangeValue(data.width);
26
27
  }
27
28
  if (data.radius !== undefined) {
28
- this.radius = data.radius;
29
+ this.radius = setRangeValue(data.radius);
29
30
  }
30
31
  if (data.color !== undefined) {
31
32
  this.color = 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: number;
8
- duration: number;
9
- factor: number;
10
- speed: number;
7
+ distance: RangeValue;
8
+ duration: RangeValue;
9
+ factor: RangeValue;
10
+ speed: RangeValue;
11
11
  constructor();
12
12
  load(data?: RecursivePartial<IRepulse>): void;
13
13
  }
@@ -1,4 +1,5 @@
1
1
  import { ValueWithRandom } from "../../ValueWithRandom";
2
+ import { setRangeValue } from "../../../../Utils";
2
3
  export class Repulse extends ValueWithRandom {
3
4
  constructor() {
4
5
  super();
@@ -17,16 +18,16 @@ export class Repulse extends ValueWithRandom {
17
18
  this.enabled = data.enabled;
18
19
  }
19
20
  if (data.distance !== undefined) {
20
- this.distance = data.distance;
21
+ this.distance = setRangeValue(data.distance);
21
22
  }
22
23
  if (data.duration !== undefined) {
23
- this.duration = data.duration;
24
+ this.duration = setRangeValue(data.duration);
24
25
  }
25
26
  if (data.factor !== undefined) {
26
- this.factor = data.factor;
27
+ this.factor = setRangeValue(data.factor);
27
28
  }
28
29
  if (data.speed !== undefined) {
29
- this.speed = data.speed;
30
+ this.speed = setRangeValue(data.speed);
30
31
  }
31
32
  }
32
33
  }
@@ -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: number;
6
+ value: RangeValue;
7
7
  constructor();
8
8
  load(data?: RecursivePartial<IRollLight>): void;
9
9
  }
@@ -1,3 +1,4 @@
1
+ import { setRangeValue } from "../../../../Utils";
1
2
  export class RollLight {
2
3
  constructor() {
3
4
  this.enable = false;
@@ -11,7 +12,7 @@ export class RollLight {
11
12
  this.enable = data.enable;
12
13
  }
13
14
  if (data.value !== undefined) {
14
- this.value = data.value;
15
+ this.value = setRangeValue(data.value);
15
16
  }
16
17
  }
17
18
  }
@@ -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: number;
6
+ speed: RangeValue;
7
7
  sync: boolean;
8
8
  constructor();
9
9
  load(data?: RecursivePartial<IRotateAnimation>): void;
@@ -1,3 +1,4 @@
1
+ import { setRangeValue } from "../../../../Utils";
1
2
  export class RotateAnimation {
2
3
  constructor() {
3
4
  this.enable = false;
@@ -12,7 +13,7 @@ export class RotateAnimation {
12
13
  this.enable = data.enable;
13
14
  }
14
15
  if (data.speed !== undefined) {
15
- this.speed = data.speed;
16
+ this.speed = setRangeValue(data.speed);
16
17
  }
17
18
  if (data.sync !== undefined) {
18
19
  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: number;
6
+ speed: RangeValue;
7
7
  sync: boolean;
8
8
  constructor();
9
9
  load(data?: RecursivePartial<ITiltAnimation>): void;
@@ -1,3 +1,4 @@
1
+ import { setRangeValue } from "../../../../Utils";
1
2
  export class TiltAnimation {
2
3
  constructor() {
3
4
  this.enable = false;
@@ -12,7 +13,7 @@ export class TiltAnimation {
12
13
  this.enable = data.enable;
13
14
  }
14
15
  if (data.speed !== undefined) {
15
- this.speed = data.speed;
16
+ this.speed = setRangeValue(data.speed);
16
17
  }
17
18
  if (data.sync !== undefined) {
18
19
  this.sync = data.sync;
@@ -1,12 +1,12 @@
1
+ import type { RangeValue, RecursivePartial } from "../../../../Types";
1
2
  import type { IOptionLoader } from "../../../Interfaces/IOptionLoader";
2
3
  import type { ITwinkleValues } from "../../../Interfaces/Particles/Twinkle/ITwinkleValues";
3
4
  import { OptionsColor } from "../../OptionsColor";
4
- import type { RecursivePartial } from "../../../../Types";
5
5
  export declare class TwinkleValues implements ITwinkleValues, IOptionLoader<ITwinkleValues> {
6
6
  color?: OptionsColor;
7
7
  enable: boolean;
8
8
  frequency: number;
9
- opacity: number;
9
+ opacity: RangeValue;
10
10
  constructor();
11
11
  load(data?: RecursivePartial<ITwinkleValues>): void;
12
12
  }
@@ -1,4 +1,5 @@
1
1
  import { OptionsColor } from "../../OptionsColor";
2
+ import { setRangeValue } from "../../../../Utils";
2
3
  export class TwinkleValues {
3
4
  constructor() {
4
5
  this.enable = false;
@@ -19,7 +20,7 @@ export class TwinkleValues {
19
20
  this.frequency = data.frequency;
20
21
  }
21
22
  if (data.opacity !== undefined) {
22
- this.opacity = data.opacity;
23
+ this.opacity = setRangeValue(data.opacity);
23
24
  }
24
25
  }
25
26
  }
@@ -1,6 +1,7 @@
1
+ import { RangeValue } from "../../Types";
1
2
  export interface IAnimation {
2
- count: number;
3
+ count: RangeValue;
3
4
  enable: boolean;
4
- speed: number;
5
+ speed: RangeValue;
5
6
  sync: boolean;
6
7
  }
@@ -1,6 +1,7 @@
1
- import type { ICoordinates } from "../../../../Core/Interfaces/ICoordinates";
1
+ import type { ICoordinates } from "../../../../Core";
2
+ import type { RangeValue } from "../../../../Types";
2
3
  export interface IAttract {
3
- distance: number;
4
+ distance: RangeValue;
4
5
  enable: boolean;
5
6
  rotateX: number;
6
7
  rotateY: number;
@@ -1,4 +1,5 @@
1
+ import type { RangeValue } from "../../../../Types";
1
2
  export interface IMoveAngle {
2
- offset: number;
3
- value: number;
3
+ offset: RangeValue;
4
+ value: RangeValue;
4
5
  }
@@ -1,6 +1,7 @@
1
+ import type { RangeValue } from "../../../../Types";
1
2
  export interface IMoveGravity {
2
- acceleration: number;
3
+ acceleration: RangeValue;
3
4
  enable: boolean;
4
5
  inverse: boolean;
5
- maxSpeed: number;
6
+ maxSpeed: RangeValue;
6
7
  }
@@ -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?: number;
9
+ radius?: RangeValue;
9
10
  rotation: IValueWithRandom;
10
- opacity: number;
11
- width: number;
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: number;
5
- duration: number;
6
- factor: number;
7
- speed: number;
5
+ distance: RangeValue;
6
+ duration: RangeValue;
7
+ factor: RangeValue;
8
+ speed: RangeValue;
8
9
  }
@@ -1,4 +1,5 @@
1
+ import type { RangeValue } from "../../../../Types";
1
2
  export interface IRollLight {
2
3
  enable: boolean;
3
- value: number;
4
+ value: RangeValue;
4
5
  }
@@ -1,5 +1,6 @@
1
+ import type { RangeValue } from "../../../../Types";
1
2
  export interface IRotateAnimation {
2
3
  enable: boolean;
3
- speed: number;
4
+ speed: RangeValue;
4
5
  sync: boolean;
5
6
  }
@@ -1,5 +1,6 @@
1
+ import type { RangeValue } from "../../../../Types";
1
2
  export interface ITiltAnimation {
2
3
  enable: boolean;
3
- speed: number;
4
+ speed: RangeValue;
4
5
  sync: boolean;
5
6
  }
@@ -1,7 +1,8 @@
1
- import type { IColor } from "../../../../Core/Interfaces/Colors";
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: number;
7
+ opacity: RangeValue;
7
8
  }
@@ -102,7 +102,7 @@ export class AbsorberInstance {
102
102
  var _a, _b;
103
103
  const container = this.container;
104
104
  const percentPosition = this.options.position;
105
- return 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);
105
+ return Vector.create((getRangeValue((_a = percentPosition === null || percentPosition === void 0 ? void 0 : percentPosition.x) !== null && _a !== void 0 ? _a : Math.random() * 100) / 100) * container.canvas.size.width, (getRangeValue((_b = percentPosition === null || percentPosition === void 0 ? void 0 : percentPosition.y) !== null && _b !== void 0 ? _b : Math.random() * 100) / 100) * container.canvas.size.height);
106
106
  }
107
107
  updateParticlePosition(particle, v) {
108
108
  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<ICoordinates>;
12
+ position?: RecursivePartial<IRangedCoordinates>;
13
13
  size: AbsorberSize;
14
14
  destroy: boolean;
15
15
  orbits: boolean;
@@ -1,5 +1,6 @@
1
1
  import { AbsorberSize } from "./AbsorberSize";
2
2
  import { OptionsColor } from "../../../../Options/Classes/OptionsColor";
3
+ import { setRangeValue } from "../../../../Utils";
3
4
  export class Absorber {
4
5
  constructor() {
5
6
  this.color = new OptionsColor();
@@ -25,10 +26,13 @@ export class Absorber {
25
26
  this.opacity = data.opacity;
26
27
  }
27
28
  if (data.position !== undefined) {
28
- this.position = {
29
- x: data.position.x,
30
- y: data.position.y,
31
- };
29
+ this.position = {};
30
+ if (data.position.x !== undefined) {
31
+ this.position.x = setRangeValue(data.position.x);
32
+ }
33
+ if (data.position.y !== undefined) {
34
+ this.position.y = setRangeValue(data.position.y);
35
+ }
32
36
  }
33
37
  if (data.size !== undefined) {
34
38
  this.size.load(data.size);
@@ -1,11 +1,11 @@
1
- import type { IColor, ICoordinates } from "../../../../Core";
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<ICoordinates>;
8
+ position?: RecursivePartial<IRangedCoordinates>;
9
9
  size: IAbsorberSize;
10
10
  draggable: boolean;
11
11
  destroy: boolean;
@@ -15,8 +15,8 @@ import { Emitter } from "./Options/Classes/Emitter";
15
15
  import { EmitterSize } from "./Options/Classes/EmitterSize";
16
16
  export class EmitterInstance {
17
17
  constructor(engine, emitters, container, options, position) {
18
- var _a, _b, _c, _d, _e, _f;
19
- var _g;
18
+ var _a, _b, _c, _d, _e, _f, _g;
19
+ var _h;
20
20
  this.emitters = emitters;
21
21
  this.container = container;
22
22
  _EmitterInstance_firstSpawn.set(this, void 0);
@@ -35,22 +35,23 @@ export class EmitterInstance {
35
35
  this.options.load(options);
36
36
  }
37
37
  this.spawnDelay = (((_a = this.options.life.delay) !== null && _a !== void 0 ? _a : 0) * 1000) / this.container.retina.reduceFactor;
38
+ this.position = (_b = this.initialPosition) !== null && _b !== void 0 ? _b : this.calcPosition();
38
39
  this.name = this.options.name;
39
- this.shape = (_b = __classPrivateFieldGet(this, _EmitterInstance_engine, "f").emitterShapeManager) === null || _b === void 0 ? void 0 : _b.getShape(this.options.shape);
40
+ this.shape = (_c = __classPrivateFieldGet(this, _EmitterInstance_engine, "f").emitterShapeManager) === null || _c === void 0 ? void 0 : _c.getShape(this.options.shape);
40
41
  this.fill = this.options.fill;
41
42
  __classPrivateFieldSet(this, _EmitterInstance_firstSpawn, !this.options.life.wait, "f");
42
43
  __classPrivateFieldSet(this, _EmitterInstance_startParticlesAdded, false, "f");
43
44
  let particlesOptions = deepExtend({}, this.options.particles);
44
45
  particlesOptions !== null && particlesOptions !== void 0 ? particlesOptions : (particlesOptions = {});
45
- (_c = particlesOptions.move) !== null && _c !== void 0 ? _c : (particlesOptions.move = {});
46
- (_d = (_g = particlesOptions.move).direction) !== null && _d !== void 0 ? _d : (_g.direction = this.options.direction);
46
+ (_d = particlesOptions.move) !== null && _d !== void 0 ? _d : (particlesOptions.move = {});
47
+ (_e = (_h = particlesOptions.move).direction) !== null && _e !== void 0 ? _e : (_h.direction = this.options.direction);
47
48
  if (this.options.spawnColor) {
48
49
  this.spawnColor = colorToHsl(this.options.spawnColor);
49
50
  }
50
51
  this.paused = !this.options.autoPlay;
51
52
  this.particlesOptions = particlesOptions;
52
53
  this.size =
53
- (_e = this.options.size) !== null && _e !== void 0 ? _e : (() => {
54
+ (_f = this.options.size) !== null && _f !== void 0 ? _f : (() => {
54
55
  const size = new EmitterSize();
55
56
  size.load({
56
57
  height: 0,
@@ -59,7 +60,7 @@ export class EmitterInstance {
59
60
  });
60
61
  return size;
61
62
  })();
62
- this.lifeCount = (_f = this.options.life.count) !== null && _f !== void 0 ? _f : -1;
63
+ this.lifeCount = (_g = this.options.life.count) !== null && _g !== void 0 ? _g : -1;
63
64
  this.immortal = this.lifeCount <= 0;
64
65
  this.play();
65
66
  }
@@ -207,8 +208,8 @@ export class EmitterInstance {
207
208
  const container = this.container;
208
209
  const percentPosition = this.options.position;
209
210
  return {
210
- x: (((_a = percentPosition === null || percentPosition === void 0 ? void 0 : percentPosition.x) !== null && _a !== void 0 ? _a : Math.random() * 100) / 100) * container.canvas.size.width,
211
- y: (((_b = percentPosition === null || percentPosition === void 0 ? void 0 : percentPosition.y) !== null && _b !== void 0 ? _b : Math.random() * 100) / 100) * container.canvas.size.height,
211
+ x: (getRangeValue((_a = percentPosition === null || percentPosition === void 0 ? void 0 : percentPosition.x) !== null && _a !== void 0 ? _a : Math.random() * 100) / 100) * container.canvas.size.width,
212
+ y: (getRangeValue((_b = percentPosition === null || percentPosition === void 0 ? void 0 : percentPosition.y) !== null && _b !== void 0 ? _b : Math.random() * 100) / 100) * container.canvas.size.height,
212
213
  };
213
214
  }
214
215
  emit() {
@@ -257,7 +258,7 @@ export class EmitterInstance {
257
258
  const colorOffset = randomInRange(animation.offset);
258
259
  const delay = getRangeValue(this.options.rate.delay);
259
260
  const emitFactor = (1000 * delay) / container.retina.reduceFactor;
260
- const colorSpeed = (_a = animation.speed) !== null && _a !== void 0 ? _a : 0;
261
+ const colorSpeed = getRangeValue((_a = animation.speed) !== null && _a !== void 0 ? _a : 0);
261
262
  return (initValue + (colorSpeed * container.fpsLimit) / emitFactor + colorOffset * 3.6) % maxValue;
262
263
  }
263
264
  }