@tsparticles/engine 3.0.0-alpha.0 → 3.0.0-beta.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 (336) hide show
  1. package/README.md +246 -211
  2. package/browser/Core/Canvas.js +271 -241
  3. package/browser/Core/Container.js +90 -106
  4. package/browser/Core/Engine.js +271 -0
  5. package/browser/Core/Particle.js +158 -162
  6. package/browser/Core/Particles.js +148 -134
  7. package/browser/Core/Retina.js +15 -13
  8. package/browser/Core/Utils/Circle.js +10 -6
  9. package/browser/Core/Utils/Constants.js +4 -3
  10. package/browser/Core/Utils/EventListeners.js +259 -220
  11. package/browser/Core/Utils/InteractionManager.js +6 -16
  12. package/browser/Core/Utils/QuadTree.js +14 -20
  13. package/browser/Core/Utils/Vector3d.js +17 -9
  14. package/browser/Options/Classes/AnimatableColor.js +2 -1
  15. package/browser/Options/Classes/AnimationOptions.js +7 -2
  16. package/browser/Options/Classes/BackgroundMask/BackgroundMask.js +2 -1
  17. package/browser/Options/Classes/ColorAnimation.js +4 -0
  18. package/browser/Options/Classes/Interactivity/Events/DivEvent.js +0 -24
  19. package/browser/Options/Classes/Interactivity/Events/Events.js +5 -24
  20. package/browser/Options/Classes/Interactivity/Interactivity.js +1 -8
  21. package/browser/Options/Classes/Interactivity/Modes/Modes.js +11 -8
  22. package/browser/Options/Classes/ManualParticle.js +5 -5
  23. package/browser/Options/Classes/Options.js +19 -39
  24. package/browser/Options/Classes/OptionsColor.js +3 -2
  25. package/browser/Options/Classes/Particles/Collisions/Collisions.js +5 -0
  26. package/browser/Options/Classes/Particles/Move/Move.js +11 -41
  27. package/browser/Options/Classes/Particles/Move/MoveAttract.js +9 -20
  28. package/browser/Options/Classes/Particles/Move/MoveTrail.js +2 -8
  29. package/browser/Options/Classes/Particles/Move/OutModes.js +4 -5
  30. package/browser/Options/Classes/Particles/Move/Spin.js +3 -1
  31. package/browser/Options/Classes/Particles/Number/ParticlesDensity.js +2 -21
  32. package/browser/Options/Classes/Particles/Number/ParticlesNumber.js +2 -9
  33. package/browser/Options/Classes/Particles/Opacity/Opacity.js +11 -7
  34. package/browser/Options/Classes/Particles/Opacity/OpacityAnimation.js +0 -9
  35. package/browser/Options/Classes/Particles/ParticlesOptions.js +6 -11
  36. package/browser/Options/Classes/Particles/Shape/Shape.js +9 -2
  37. package/browser/Options/Classes/Particles/Size/Size.js +11 -7
  38. package/browser/Options/Classes/Particles/Size/SizeAnimation.js +0 -9
  39. package/browser/Options/Classes/ValueWithRandom.js +4 -17
  40. package/browser/Utils/CanvasUtils.js +18 -54
  41. package/browser/Utils/ColorUtils.js +17 -19
  42. package/browser/Utils/EventDispatcher.js +7 -6
  43. package/browser/Utils/HslColorManager.js +2 -4
  44. package/browser/Utils/NumberUtils.js +41 -45
  45. package/browser/Utils/RgbColorManager.js +2 -4
  46. package/browser/Utils/Utils.js +150 -59
  47. package/browser/bundle.js +4 -96
  48. package/browser/export-types.js +97 -0
  49. package/browser/exports.js +89 -0
  50. package/browser/index.js +8 -198
  51. package/browser/init.js +12 -0
  52. package/cjs/Core/Canvas.js +269 -239
  53. package/cjs/Core/Container.js +90 -106
  54. package/cjs/Core/Engine.js +275 -0
  55. package/cjs/Core/Particle.js +157 -161
  56. package/cjs/Core/Particles.js +148 -134
  57. package/cjs/Core/Retina.js +15 -13
  58. package/cjs/Core/Utils/Circle.js +10 -6
  59. package/cjs/Core/Utils/Constants.js +5 -4
  60. package/cjs/Core/Utils/EventListeners.js +258 -219
  61. package/cjs/Core/Utils/InteractionManager.js +6 -16
  62. package/cjs/Core/Utils/QuadTree.js +14 -20
  63. package/cjs/Core/Utils/Vector3d.js +17 -9
  64. package/cjs/Options/Classes/AnimatableColor.js +2 -1
  65. package/cjs/Options/Classes/AnimationOptions.js +7 -2
  66. package/cjs/Options/Classes/BackgroundMask/BackgroundMask.js +2 -1
  67. package/cjs/Options/Classes/ColorAnimation.js +4 -0
  68. package/cjs/Options/Classes/Interactivity/Events/DivEvent.js +0 -24
  69. package/cjs/Options/Classes/Interactivity/Events/Events.js +5 -24
  70. package/cjs/Options/Classes/Interactivity/Interactivity.js +1 -8
  71. package/cjs/Options/Classes/Interactivity/Modes/Modes.js +11 -8
  72. package/cjs/Options/Classes/ManualParticle.js +5 -5
  73. package/cjs/Options/Classes/Options.js +18 -38
  74. package/cjs/Options/Classes/OptionsColor.js +3 -2
  75. package/cjs/Options/Classes/Particles/Collisions/Collisions.js +5 -0
  76. package/cjs/Options/Classes/Particles/Move/Move.js +11 -41
  77. package/cjs/Options/Classes/Particles/Move/MoveAttract.js +9 -20
  78. package/cjs/Options/Classes/Particles/Move/MoveTrail.js +2 -8
  79. package/cjs/Options/Classes/Particles/Move/OutModes.js +4 -5
  80. package/cjs/Options/Classes/Particles/Move/Spin.js +3 -1
  81. package/cjs/Options/Classes/Particles/Number/ParticlesDensity.js +2 -21
  82. package/cjs/Options/Classes/Particles/Number/ParticlesNumber.js +2 -9
  83. package/cjs/Options/Classes/Particles/Opacity/Opacity.js +10 -6
  84. package/cjs/Options/Classes/Particles/Opacity/OpacityAnimation.js +0 -9
  85. package/cjs/Options/Classes/Particles/ParticlesOptions.js +6 -11
  86. package/cjs/Options/Classes/Particles/Shape/Shape.js +9 -2
  87. package/cjs/Options/Classes/Particles/Size/Size.js +11 -7
  88. package/cjs/Options/Classes/Particles/Size/SizeAnimation.js +0 -9
  89. package/cjs/Options/Classes/ValueWithRandom.js +4 -17
  90. package/cjs/Utils/CanvasUtils.js +21 -58
  91. package/cjs/Utils/ColorUtils.js +16 -18
  92. package/cjs/Utils/EventDispatcher.js +7 -6
  93. package/cjs/Utils/HslColorManager.js +2 -4
  94. package/cjs/Utils/NumberUtils.js +41 -45
  95. package/cjs/Utils/RgbColorManager.js +2 -4
  96. package/cjs/Utils/Utils.js +163 -63
  97. package/cjs/bundle.js +4 -96
  98. package/cjs/export-types.js +113 -0
  99. package/cjs/exports.js +105 -0
  100. package/cjs/index.js +8 -198
  101. package/cjs/init.js +16 -0
  102. package/esm/Core/Canvas.js +271 -241
  103. package/esm/Core/Container.js +90 -106
  104. package/esm/Core/Engine.js +271 -0
  105. package/esm/Core/Particle.js +158 -162
  106. package/esm/Core/Particles.js +148 -134
  107. package/esm/Core/Retina.js +15 -13
  108. package/esm/Core/Utils/Circle.js +10 -6
  109. package/esm/Core/Utils/Constants.js +4 -3
  110. package/esm/Core/Utils/EventListeners.js +259 -220
  111. package/esm/Core/Utils/InteractionManager.js +6 -16
  112. package/esm/Core/Utils/QuadTree.js +14 -20
  113. package/esm/Core/Utils/Vector3d.js +17 -9
  114. package/esm/Options/Classes/AnimatableColor.js +2 -1
  115. package/esm/Options/Classes/AnimationOptions.js +7 -2
  116. package/esm/Options/Classes/BackgroundMask/BackgroundMask.js +2 -1
  117. package/esm/Options/Classes/ColorAnimation.js +4 -0
  118. package/esm/Options/Classes/Interactivity/Events/DivEvent.js +0 -24
  119. package/esm/Options/Classes/Interactivity/Events/Events.js +5 -24
  120. package/esm/Options/Classes/Interactivity/Interactivity.js +1 -8
  121. package/esm/Options/Classes/Interactivity/Modes/Modes.js +11 -8
  122. package/esm/Options/Classes/ManualParticle.js +5 -5
  123. package/esm/Options/Classes/Options.js +19 -39
  124. package/esm/Options/Classes/OptionsColor.js +3 -2
  125. package/esm/Options/Classes/Particles/Collisions/Collisions.js +5 -0
  126. package/esm/Options/Classes/Particles/Move/Move.js +11 -41
  127. package/esm/Options/Classes/Particles/Move/MoveAttract.js +9 -20
  128. package/esm/Options/Classes/Particles/Move/MoveTrail.js +2 -8
  129. package/esm/Options/Classes/Particles/Move/OutModes.js +4 -5
  130. package/esm/Options/Classes/Particles/Move/Spin.js +3 -1
  131. package/esm/Options/Classes/Particles/Number/ParticlesDensity.js +2 -21
  132. package/esm/Options/Classes/Particles/Number/ParticlesNumber.js +2 -9
  133. package/esm/Options/Classes/Particles/Opacity/Opacity.js +11 -7
  134. package/esm/Options/Classes/Particles/Opacity/OpacityAnimation.js +0 -9
  135. package/esm/Options/Classes/Particles/ParticlesOptions.js +6 -11
  136. package/esm/Options/Classes/Particles/Shape/Shape.js +9 -2
  137. package/esm/Options/Classes/Particles/Size/Size.js +11 -7
  138. package/esm/Options/Classes/Particles/Size/SizeAnimation.js +0 -9
  139. package/esm/Options/Classes/ValueWithRandom.js +4 -17
  140. package/esm/Utils/CanvasUtils.js +18 -54
  141. package/esm/Utils/ColorUtils.js +17 -19
  142. package/esm/Utils/EventDispatcher.js +7 -6
  143. package/esm/Utils/HslColorManager.js +2 -4
  144. package/esm/Utils/NumberUtils.js +41 -45
  145. package/esm/Utils/RgbColorManager.js +2 -4
  146. package/esm/Utils/Utils.js +150 -59
  147. package/esm/bundle.js +4 -96
  148. package/esm/export-types.js +97 -0
  149. package/esm/exports.js +89 -0
  150. package/esm/index.js +8 -198
  151. package/esm/init.js +12 -0
  152. package/package.json +17 -2
  153. package/report.html +4 -4
  154. package/scripts/install.js +90 -33
  155. package/tsparticles.engine.js +1848 -1961
  156. package/tsparticles.engine.min.js +1 -1
  157. package/tsparticles.engine.min.js.LICENSE.txt +1 -10
  158. package/types/Core/Canvas.d.ts +20 -16
  159. package/types/Core/Container.d.ts +10 -14
  160. package/types/Core/Engine.d.ts +71 -0
  161. package/types/Core/Interfaces/IContainerPlugin.d.ts +2 -0
  162. package/types/Core/Interfaces/ICoordinates.d.ts +5 -3
  163. package/types/Core/Interfaces/IDimension.d.ts +4 -0
  164. package/types/Core/Interfaces/IMovePathGenerator.d.ts +2 -1
  165. package/types/Core/Interfaces/IParticleUpdater.d.ts +0 -2
  166. package/types/Core/Interfaces/IParticleValueAnimation.d.ts +2 -0
  167. package/types/Core/Interfaces/IPlugin.d.ts +4 -3
  168. package/types/Core/Particle.d.ts +7 -7
  169. package/types/Core/Particles.d.ts +14 -10
  170. package/types/Core/Utils/Constants.d.ts +4 -3
  171. package/types/Core/Utils/EventListeners.d.ts +20 -14
  172. package/types/Core/Utils/InteractionManager.d.ts +1 -1
  173. package/types/Core/Utils/QuadTree.d.ts +2 -5
  174. package/types/Core/Utils/Vector3d.d.ts +2 -1
  175. package/types/Enums/Modes/AnimationMode.d.ts +6 -0
  176. package/types/Enums/Modes/{SizeMode.d.ts → PixelMode.d.ts} +1 -1
  177. package/types/Options/Classes/AnimationOptions.d.ts +3 -1
  178. package/types/Options/Classes/ColorAnimation.d.ts +1 -0
  179. package/types/Options/Classes/Interactivity/Events/DivEvent.d.ts +0 -6
  180. package/types/Options/Classes/Interactivity/Events/Events.d.ts +0 -6
  181. package/types/Options/Classes/Interactivity/Interactivity.d.ts +1 -3
  182. package/types/Options/Classes/Interactivity/Modes/Modes.d.ts +1 -1
  183. package/types/Options/Classes/ManualParticle.d.ts +2 -2
  184. package/types/Options/Classes/Options.d.ts +5 -12
  185. package/types/Options/Classes/Particles/Collisions/Collisions.d.ts +2 -0
  186. package/types/Options/Classes/Particles/Move/Move.d.ts +0 -11
  187. package/types/Options/Classes/Particles/Move/MoveAttract.d.ts +0 -4
  188. package/types/Options/Classes/Particles/Move/MoveCenter.d.ts +2 -2
  189. package/types/Options/Classes/Particles/Move/MoveTrail.d.ts +0 -3
  190. package/types/Options/Classes/Particles/Move/Spin.d.ts +2 -2
  191. package/types/Options/Classes/Particles/Number/ParticlesDensity.d.ts +0 -6
  192. package/types/Options/Classes/Particles/Number/ParticlesNumber.d.ts +0 -2
  193. package/types/Options/Classes/Particles/Opacity/Opacity.d.ts +4 -4
  194. package/types/Options/Classes/Particles/Opacity/OpacityAnimation.d.ts +0 -2
  195. package/types/Options/Classes/Particles/ParticlesOptions.d.ts +1 -1
  196. package/types/Options/Classes/Particles/Shape/Shape.d.ts +2 -0
  197. package/types/Options/Classes/Particles/Size/Size.d.ts +4 -4
  198. package/types/Options/Classes/Particles/Size/SizeAnimation.d.ts +0 -2
  199. package/types/Options/Classes/Responsive.d.ts +3 -3
  200. package/types/Options/Classes/Theme/Theme.d.ts +2 -2
  201. package/types/Options/Classes/ValueWithRandom.d.ts +2 -6
  202. package/types/Options/Interfaces/IAnimation.d.ts +3 -1
  203. package/types/Options/Interfaces/IManualParticle.d.ts +2 -2
  204. package/types/Options/Interfaces/IOptions.d.ts +1 -4
  205. package/types/Options/Interfaces/IResponsive.d.ts +4 -3
  206. package/types/Options/Interfaces/Interactivity/Events/IDivEvent.d.ts +0 -3
  207. package/types/Options/Interfaces/Interactivity/Events/IEvents.d.ts +0 -3
  208. package/types/Options/Interfaces/Interactivity/IInteractivity.d.ts +0 -1
  209. package/types/Options/Interfaces/Interactivity/Modes/IModeDiv.d.ts +0 -1
  210. package/types/Options/Interfaces/Particles/Collisions/ICollisions.d.ts +2 -0
  211. package/types/Options/Interfaces/Particles/IStroke.d.ts +2 -1
  212. package/types/Options/Interfaces/Particles/Move/IMove.d.ts +0 -5
  213. package/types/Options/Interfaces/Particles/Move/IMoveAttract.d.ts +0 -2
  214. package/types/Options/Interfaces/Particles/Move/IMoveTrail.d.ts +0 -2
  215. package/types/Options/Interfaces/Particles/Move/ISpin.d.ts +2 -2
  216. package/types/Options/Interfaces/Particles/Number/IParticlesDensity.d.ts +0 -3
  217. package/types/Options/Interfaces/Particles/Number/IParticlesNumber.d.ts +0 -1
  218. package/types/Options/Interfaces/Particles/Opacity/IOpacity.d.ts +0 -1
  219. package/types/Options/Interfaces/Particles/Opacity/IOpacityAnimation.d.ts +0 -1
  220. package/types/Options/Interfaces/Particles/Shape/IShape.d.ts +2 -0
  221. package/types/Options/Interfaces/Particles/Size/ISize.d.ts +0 -1
  222. package/types/Options/Interfaces/Particles/Size/ISizeAnimation.d.ts +0 -1
  223. package/types/Options/Interfaces/Theme/ITheme.d.ts +3 -2
  224. package/types/Types/ExportResult.d.ts +5 -0
  225. package/types/Utils/CanvasUtils.d.ts +2 -5
  226. package/types/Utils/OptionsUtils.d.ts +1 -1
  227. package/types/Utils/Utils.d.ts +22 -4
  228. package/types/bundle.d.ts +2 -90
  229. package/types/export-types.d.ts +107 -0
  230. package/types/exports.d.ts +89 -0
  231. package/types/index.d.ts +3 -203
  232. package/types/init.d.ts +2 -0
  233. package/umd/Core/Canvas.js +269 -239
  234. package/umd/Core/Container.js +91 -107
  235. package/umd/Core/Engine.js +285 -0
  236. package/umd/Core/Particle.js +158 -162
  237. package/umd/Core/Particles.js +149 -135
  238. package/umd/Core/Retina.js +15 -13
  239. package/umd/Core/Utils/Circle.js +11 -7
  240. package/umd/Core/Utils/Constants.js +5 -4
  241. package/umd/Core/Utils/EventListeners.js +258 -219
  242. package/umd/Core/Utils/InteractionManager.js +6 -16
  243. package/umd/Core/Utils/QuadTree.js +14 -20
  244. package/umd/Core/Utils/Vector3d.js +18 -10
  245. package/umd/Options/Classes/AnimatableColor.js +3 -2
  246. package/umd/Options/Classes/AnimationOptions.js +7 -2
  247. package/umd/Options/Classes/BackgroundMask/BackgroundMask.js +3 -2
  248. package/umd/Options/Classes/ColorAnimation.js +4 -0
  249. package/umd/Options/Classes/Interactivity/Events/DivEvent.js +1 -25
  250. package/umd/Options/Classes/Interactivity/Events/Events.js +6 -25
  251. package/umd/Options/Classes/Interactivity/Interactivity.js +1 -8
  252. package/umd/Options/Classes/Interactivity/Modes/Modes.js +11 -8
  253. package/umd/Options/Classes/ManualParticle.js +5 -5
  254. package/umd/Options/Classes/Options.js +18 -38
  255. package/umd/Options/Classes/OptionsColor.js +4 -3
  256. package/umd/Options/Classes/Particles/Collisions/Collisions.js +6 -1
  257. package/umd/Options/Classes/Particles/Move/Move.js +12 -42
  258. package/umd/Options/Classes/Particles/Move/MoveAttract.js +9 -20
  259. package/umd/Options/Classes/Particles/Move/MoveTrail.js +2 -8
  260. package/umd/Options/Classes/Particles/Move/OutModes.js +4 -5
  261. package/umd/Options/Classes/Particles/Move/Spin.js +3 -1
  262. package/umd/Options/Classes/Particles/Number/ParticlesDensity.js +2 -21
  263. package/umd/Options/Classes/Particles/Number/ParticlesNumber.js +2 -9
  264. package/umd/Options/Classes/Particles/Opacity/Opacity.js +10 -6
  265. package/umd/Options/Classes/Particles/Opacity/OpacityAnimation.js +0 -9
  266. package/umd/Options/Classes/Particles/ParticlesOptions.js +6 -11
  267. package/umd/Options/Classes/Particles/Shape/Shape.js +9 -2
  268. package/umd/Options/Classes/Particles/Size/Size.js +12 -8
  269. package/umd/Options/Classes/Particles/Size/SizeAnimation.js +0 -9
  270. package/umd/Options/Classes/ValueWithRandom.js +5 -18
  271. package/umd/Utils/CanvasUtils.js +21 -58
  272. package/umd/Utils/ColorUtils.js +16 -18
  273. package/umd/Utils/EventDispatcher.js +7 -6
  274. package/umd/Utils/HslColorManager.js +2 -4
  275. package/umd/Utils/NumberUtils.js +42 -46
  276. package/umd/Utils/RgbColorManager.js +2 -4
  277. package/umd/Utils/Utils.js +163 -63
  278. package/umd/bundle.js +5 -97
  279. package/umd/export-types.js +123 -0
  280. package/umd/exports.js +115 -0
  281. package/umd/index.js +9 -199
  282. package/umd/init.js +26 -0
  283. package/browser/Core/Utils/FrameManager.js +0 -42
  284. package/browser/Core/Utils/Plugins.js +0 -112
  285. package/browser/Options/Interfaces/Particles/Shape/IShapeValues.js +0 -1
  286. package/browser/Options/Interfaces/Particles/Shape/IStarShape.js +0 -1
  287. package/browser/engine.js +0 -175
  288. package/cjs/Core/Utils/FrameManager.js +0 -46
  289. package/cjs/Core/Utils/Plugins.js +0 -116
  290. package/cjs/Options/Interfaces/Particles/Shape/ICharacterShape.js +0 -2
  291. package/cjs/Options/Interfaces/Particles/Shape/IImageShape.js +0 -2
  292. package/cjs/Options/Interfaces/Particles/Shape/IPolygonShape.js +0 -2
  293. package/cjs/Options/Interfaces/Particles/Shape/IShapeValues.js +0 -17
  294. package/cjs/Options/Interfaces/Particles/Shape/IStarShape.js +0 -2
  295. package/cjs/engine.js +0 -179
  296. package/esm/Core/Interfaces/IParticleOverride.js +0 -1
  297. package/esm/Core/Interfaces/IParticlesMover.js +0 -1
  298. package/esm/Core/Utils/FrameManager.js +0 -42
  299. package/esm/Core/Utils/Plugins.js +0 -112
  300. package/esm/Enums/Modes/SizeMode.js +0 -1
  301. package/esm/Options/Interfaces/Particles/Shape/ICharacterShape.js +0 -1
  302. package/esm/Options/Interfaces/Particles/Shape/IImageShape.js +0 -1
  303. package/esm/Options/Interfaces/Particles/Shape/IPolygonShape.js +0 -1
  304. package/esm/Options/Interfaces/Particles/Shape/IShapeValues.js +0 -1
  305. package/esm/Options/Interfaces/Particles/Shape/IStarShape.js +0 -1
  306. package/esm/engine.js +0 -175
  307. package/types/Core/Interfaces/IParticleOverride.d.ts +0 -6
  308. package/types/Core/Interfaces/IParticlesMover.d.ts +0 -7
  309. package/types/Core/Utils/FrameManager.d.ts +0 -6
  310. package/types/Core/Utils/Plugins.d.ts +0 -51
  311. package/types/Options/Interfaces/Particles/Shape/ICharacterShape.d.ts +0 -8
  312. package/types/Options/Interfaces/Particles/Shape/IImageShape.d.ts +0 -8
  313. package/types/Options/Interfaces/Particles/Shape/IPolygonShape.d.ts +0 -5
  314. package/types/Options/Interfaces/Particles/Shape/IShapeValues.d.ts +0 -1
  315. package/types/Options/Interfaces/Particles/Shape/IStarShape.d.ts +0 -6
  316. package/types/engine.d.ts +0 -39
  317. package/umd/Core/Utils/FrameManager.js +0 -56
  318. package/umd/Core/Utils/Plugins.js +0 -126
  319. package/umd/Options/Interfaces/Particles/Shape/ICharacterShape.js +0 -12
  320. package/umd/Options/Interfaces/Particles/Shape/IImageShape.js +0 -12
  321. package/umd/Options/Interfaces/Particles/Shape/IPolygonShape.js +0 -12
  322. package/umd/Options/Interfaces/Particles/Shape/IShapeValues.js +0 -27
  323. package/umd/Options/Interfaces/Particles/Shape/IStarShape.js +0 -12
  324. package/umd/engine.js +0 -189
  325. /package/browser/{Core/Interfaces/IParticleOverride.js → Enums/Modes/AnimationMode.js} +0 -0
  326. /package/browser/{Core/Interfaces/IParticlesMover.js → Enums/Modes/PixelMode.js} +0 -0
  327. /package/browser/{Enums/Modes/SizeMode.js → Types/ExportResult.js} +0 -0
  328. /package/cjs/{Core/Interfaces/IParticleOverride.js → Enums/Modes/AnimationMode.js} +0 -0
  329. /package/cjs/{Core/Interfaces/IParticlesMover.js → Enums/Modes/PixelMode.js} +0 -0
  330. /package/cjs/{Enums/Modes/SizeMode.js → Types/ExportResult.js} +0 -0
  331. /package/{browser/Options/Interfaces/Particles/Shape/ICharacterShape.js → esm/Enums/Modes/AnimationMode.js} +0 -0
  332. /package/{browser/Options/Interfaces/Particles/Shape/IImageShape.js → esm/Enums/Modes/PixelMode.js} +0 -0
  333. /package/{browser/Options/Interfaces/Particles/Shape/IPolygonShape.js → esm/Types/ExportResult.js} +0 -0
  334. /package/umd/{Core/Interfaces/IParticleOverride.js → Enums/Modes/AnimationMode.js} +0 -0
  335. /package/umd/{Core/Interfaces/IParticlesMover.js → Enums/Modes/PixelMode.js} +0 -0
  336. /package/umd/{Enums/Modes/SizeMode.js → Types/ExportResult.js} +0 -0
@@ -4,15 +4,21 @@
4
4
  if (v !== undefined) module.exports = v;
5
5
  }
6
6
  else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports"], factory);
7
+ define(["require", "exports", "./Constants", "../../Utils/Utils"], factory);
8
8
  }
9
9
  })(function (require, exports) {
10
10
  "use strict";
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.Vector3d = void 0;
13
+ const Constants_1 = require("./Constants");
14
+ const Utils_1 = require("../../Utils/Utils");
13
15
  class Vector3d {
14
16
  constructor(xOrCoords, y, z) {
15
- if (typeof xOrCoords !== "number" && xOrCoords) {
17
+ this._updateFromAngle = (angle, length) => {
18
+ this.x = Math.cos(angle) * length;
19
+ this.y = Math.sin(angle) * length;
20
+ };
21
+ if (!(0, Utils_1.isNumber)(xOrCoords) && xOrCoords) {
16
22
  this.x = xOrCoords.x;
17
23
  this.y = xOrCoords.y;
18
24
  const coords3d = xOrCoords;
@@ -21,10 +27,10 @@
21
27
  else if (xOrCoords !== undefined && y !== undefined) {
22
28
  this.x = xOrCoords;
23
29
  this.y = y;
24
- this.z = z !== null && z !== void 0 ? z : 0;
30
+ this.z = z ?? 0;
25
31
  }
26
32
  else {
27
- throw new Error("tsParticles - Vector3d not initialized correctly");
33
+ throw new Error(`${Constants_1.errorPrefix} Vector3d not initialized correctly`);
28
34
  }
29
35
  }
30
36
  static get origin() {
@@ -34,13 +40,13 @@
34
40
  return Math.atan2(this.y, this.x);
35
41
  }
36
42
  set angle(angle) {
37
- this.updateFromAngle(angle, this.length);
43
+ this._updateFromAngle(angle, this.length);
38
44
  }
39
45
  get length() {
40
46
  return Math.sqrt(this.getLengthSq());
41
47
  }
42
48
  set length(length) {
43
- this.updateFromAngle(this.angle, length);
49
+ this._updateFromAngle(this.angle, length);
44
50
  }
45
51
  static clone(source) {
46
52
  return Vector3d.create(source.x, source.y, source.z);
@@ -84,6 +90,12 @@
84
90
  this.y *= n;
85
91
  this.z *= n;
86
92
  }
93
+ normalize() {
94
+ const length = this.length;
95
+ if (length != 0) {
96
+ this.multTo(1.0 / length);
97
+ }
98
+ }
87
99
  rotate(angle) {
88
100
  return Vector3d.create(this.x * Math.cos(angle) - this.y * Math.sin(angle), this.x * Math.sin(angle) + this.y * Math.cos(angle), 0);
89
101
  }
@@ -101,10 +113,6 @@
101
113
  this.y -= v.y;
102
114
  this.z -= v.z;
103
115
  }
104
- updateFromAngle(angle, length) {
105
- this.x = Math.cos(angle) * length;
106
- this.y = Math.sin(angle) * length;
107
- }
108
116
  }
109
117
  exports.Vector3d = Vector3d;
110
118
  });
@@ -4,12 +4,13 @@
4
4
  if (v !== undefined) module.exports = v;
5
5
  }
6
6
  else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "./HslAnimation", "./OptionsColor"], factory);
7
+ define(["require", "exports", "../../Utils/Utils", "./HslAnimation", "./OptionsColor"], factory);
8
8
  }
9
9
  })(function (require, exports) {
10
10
  "use strict";
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.AnimatableColor = void 0;
13
+ const Utils_1 = require("../../Utils/Utils");
13
14
  const HslAnimation_1 = require("./HslAnimation");
14
15
  const OptionsColor_1 = require("./OptionsColor");
15
16
  class AnimatableColor extends OptionsColor_1.OptionsColor {
@@ -21,7 +22,7 @@
21
22
  const color = new AnimatableColor();
22
23
  color.load(source);
23
24
  if (data !== undefined) {
24
- if (typeof data === "string" || data instanceof Array) {
25
+ if ((0, Utils_1.isString)(data) || (0, Utils_1.isArray)(data)) {
25
26
  color.load({ value: data });
26
27
  }
27
28
  else {
@@ -17,6 +17,7 @@
17
17
  this.enable = false;
18
18
  this.speed = 1;
19
19
  this.decay = 0;
20
+ this.delay = 0;
20
21
  this.sync = false;
21
22
  }
22
23
  load(data) {
@@ -35,6 +36,9 @@
35
36
  if (data.decay !== undefined) {
36
37
  this.decay = (0, NumberUtils_1.setRangeValue)(data.decay);
37
38
  }
39
+ if (data.delay !== undefined) {
40
+ this.delay = (0, NumberUtils_1.setRangeValue)(data.delay);
41
+ }
38
42
  if (data.sync !== undefined) {
39
43
  this.sync = data.sync;
40
44
  }
@@ -44,6 +48,7 @@
44
48
  class RangedAnimationOptions extends AnimationOptions {
45
49
  constructor() {
46
50
  super();
51
+ this.mode = "auto";
47
52
  this.startValue = "random";
48
53
  }
49
54
  load(data) {
@@ -51,8 +56,8 @@
51
56
  if (!data) {
52
57
  return;
53
58
  }
54
- if (data.minimumValue !== undefined) {
55
- this.minimumValue = data.minimumValue;
59
+ if (data.mode !== undefined) {
60
+ this.mode = data.mode;
56
61
  }
57
62
  if (data.startValue !== undefined) {
58
63
  this.startValue = data.startValue;
@@ -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", "./BackgroundMaskCover"], factory);
7
+ define(["require", "exports", "./BackgroundMaskCover", "../../../Utils/Utils"], factory);
8
8
  }
9
9
  })(function (require, exports) {
10
10
  "use strict";
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.BackgroundMask = void 0;
13
13
  const BackgroundMaskCover_1 = require("./BackgroundMaskCover");
14
+ const Utils_1 = require("../../../Utils/Utils");
14
15
  class BackgroundMask {
15
16
  constructor() {
16
17
  this.composite = "destination-out";
@@ -26,7 +27,7 @@
26
27
  }
27
28
  if (data.cover !== undefined) {
28
29
  const cover = data.cover;
29
- const color = (typeof data.cover === "string" ? { color: data.cover } : data.cover);
30
+ const color = ((0, Utils_1.isString)(data.cover) ? { color: data.cover } : data.cover);
30
31
  this.cover.load(cover.color !== undefined ? cover : { color: color });
31
32
  }
32
33
  if (data.enable !== undefined) {
@@ -17,6 +17,7 @@
17
17
  this.enable = false;
18
18
  this.offset = 0;
19
19
  this.speed = 1;
20
+ this.delay = 0;
20
21
  this.decay = 0;
21
22
  this.sync = true;
22
23
  }
@@ -39,6 +40,9 @@
39
40
  if (data.decay !== undefined) {
40
41
  this.decay = (0, NumberUtils_1.setRangeValue)(data.decay);
41
42
  }
43
+ if (data.delay !== undefined) {
44
+ this.delay = (0, NumberUtils_1.setRangeValue)(data.delay);
45
+ }
42
46
  if (data.sync !== undefined) {
43
47
  this.sync = data.sync;
44
48
  }
@@ -4,13 +4,12 @@
4
4
  if (v !== undefined) module.exports = v;
5
5
  }
6
6
  else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "../../../../Utils/Utils"], factory);
7
+ define(["require", "exports"], factory);
8
8
  }
9
9
  })(function (require, exports) {
10
10
  "use strict";
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.DivEvent = void 0;
13
- const Utils_1 = require("../../../../Utils/Utils");
14
13
  class DivEvent {
15
14
  constructor() {
16
15
  this.selectors = [];
@@ -18,33 +17,10 @@
18
17
  this.mode = [];
19
18
  this.type = "circle";
20
19
  }
21
- get el() {
22
- return this.elementId;
23
- }
24
- set el(value) {
25
- this.elementId = value;
26
- }
27
- get elementId() {
28
- return this.ids;
29
- }
30
- set elementId(value) {
31
- this.ids = value;
32
- }
33
- get ids() {
34
- return (0, Utils_1.executeOnSingleOrMultiple)(this.selectors, (t) => t.replace("#", ""));
35
- }
36
- set ids(value) {
37
- this.selectors = (0, Utils_1.executeOnSingleOrMultiple)(value, (t) => `#${t}`);
38
- }
39
20
  load(data) {
40
- var _a, _b;
41
21
  if (!data) {
42
22
  return;
43
23
  }
44
- const ids = (_b = (_a = data.ids) !== null && _a !== void 0 ? _a : data.elementId) !== null && _b !== void 0 ? _b : data.el;
45
- if (ids !== undefined) {
46
- this.ids = ids;
47
- }
48
24
  if (data.selectors !== undefined) {
49
25
  this.selectors = data.selectors;
50
26
  }
@@ -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", "./ClickEvent", "./DivEvent", "./HoverEvent", "./ResizeEvent", "../../../../Utils/Utils"], factory);
7
+ define(["require", "exports", "../../../../Utils/Utils", "./ClickEvent", "./DivEvent", "./HoverEvent", "./ResizeEvent"], factory);
8
8
  }
9
9
  })(function (require, exports) {
10
10
  "use strict";
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.Events = void 0;
13
+ const Utils_1 = require("../../../../Utils/Utils");
13
14
  const ClickEvent_1 = require("./ClickEvent");
14
15
  const DivEvent_1 = require("./DivEvent");
15
16
  const HoverEvent_1 = require("./HoverEvent");
16
17
  const ResizeEvent_1 = require("./ResizeEvent");
17
- const Utils_1 = require("../../../../Utils/Utils");
18
18
  class Events {
19
19
  constructor() {
20
20
  this.onClick = new ClickEvent_1.ClickEvent();
@@ -22,31 +22,12 @@
22
22
  this.onHover = new HoverEvent_1.HoverEvent();
23
23
  this.resize = new ResizeEvent_1.ResizeEvent();
24
24
  }
25
- get onclick() {
26
- return this.onClick;
27
- }
28
- set onclick(value) {
29
- this.onClick = value;
30
- }
31
- get ondiv() {
32
- return this.onDiv;
33
- }
34
- set ondiv(value) {
35
- this.onDiv = value;
36
- }
37
- get onhover() {
38
- return this.onHover;
39
- }
40
- set onhover(value) {
41
- this.onHover = value;
42
- }
43
25
  load(data) {
44
- var _a, _b, _c;
45
26
  if (!data) {
46
27
  return;
47
28
  }
48
- this.onClick.load((_a = data.onClick) !== null && _a !== void 0 ? _a : data.onclick);
49
- const onDiv = (_b = data.onDiv) !== null && _b !== void 0 ? _b : data.ondiv;
29
+ this.onClick.load(data.onClick);
30
+ const onDiv = data.onDiv;
50
31
  if (onDiv !== undefined) {
51
32
  this.onDiv = (0, Utils_1.executeOnSingleOrMultiple)(onDiv, (t) => {
52
33
  const tmp = new DivEvent_1.DivEvent();
@@ -54,8 +35,8 @@
54
35
  return tmp;
55
36
  });
56
37
  }
57
- this.onHover.load((_c = data.onHover) !== null && _c !== void 0 ? _c : data.onhover);
58
- if (typeof data.resize === "boolean") {
38
+ this.onHover.load(data.onHover);
39
+ if ((0, Utils_1.isBoolean)(data.resize)) {
59
40
  this.resize.enable = data.resize;
60
41
  }
61
42
  else {
@@ -18,18 +18,11 @@
18
18
  this.events = new Events_1.Events();
19
19
  this.modes = new Modes_1.Modes(engine, container);
20
20
  }
21
- get detect_on() {
22
- return this.detectsOn;
23
- }
24
- set detect_on(value) {
25
- this.detectsOn = value;
26
- }
27
21
  load(data) {
28
- var _a;
29
22
  if (!data) {
30
23
  return;
31
24
  }
32
- const detectsOn = (_a = data.detectsOn) !== null && _a !== void 0 ? _a : data.detect_on;
25
+ const detectsOn = data.detectsOn;
33
26
  if (detectsOn !== undefined) {
34
27
  this.detectsOn = detectsOn;
35
28
  }
@@ -19,15 +19,18 @@
19
19
  if (!data) {
20
20
  return;
21
21
  }
22
- if (this._container) {
23
- const interactors = this._engine.plugins.interactors.get(this._container);
24
- if (interactors) {
25
- for (const interactor of interactors) {
26
- if (interactor.loadModeOptions) {
27
- interactor.loadModeOptions(this, data);
28
- }
29
- }
22
+ if (!this._container) {
23
+ return;
24
+ }
25
+ const interactors = this._engine.interactors.get(this._container);
26
+ if (!interactors) {
27
+ return;
28
+ }
29
+ for (const interactor of interactors) {
30
+ if (!interactor.loadModeOptions) {
31
+ continue;
30
32
  }
33
+ interactor.loadModeOptions(this, data);
31
34
  }
32
35
  }
33
36
  }
@@ -13,17 +13,17 @@
13
13
  const Utils_1 = require("../../Utils/Utils");
14
14
  class ManualParticle {
15
15
  load(data) {
16
- var _a, _b;
17
16
  if (!data) {
18
17
  return;
19
18
  }
20
- if (data.position !== undefined) {
19
+ if (data.position) {
21
20
  this.position = {
22
- x: (_a = data.position.x) !== null && _a !== void 0 ? _a : 50,
23
- y: (_b = data.position.y) !== null && _b !== void 0 ? _b : 50,
21
+ x: data.position.x ?? 50,
22
+ y: data.position.y ?? 50,
23
+ mode: data.position.mode ?? "percent",
24
24
  };
25
25
  }
26
- if (data.options !== undefined) {
26
+ if (data.options) {
27
27
  this.options = (0, Utils_1.deepExtend)({}, data.options);
28
28
  }
29
29
  }
@@ -22,6 +22,13 @@
22
22
  const NumberUtils_1 = require("../../Utils/NumberUtils");
23
23
  class Options {
24
24
  constructor(engine, container) {
25
+ this._findDefaultTheme = (mode) => {
26
+ return (this.themes.find((theme) => theme.default.value && theme.default.mode === mode) ??
27
+ this.themes.find((theme) => theme.default.value && theme.default.mode === "any"));
28
+ };
29
+ this._importPreset = (preset) => {
30
+ this.load(this._engine.getPreset(preset));
31
+ };
25
32
  this._engine = engine;
26
33
  this._container = container;
27
34
  this.autoPlay = true;
@@ -35,7 +42,6 @@
35
42
  this.fpsLimit = 120;
36
43
  this.interactivity = new Interactivity_1.Interactivity(engine, container);
37
44
  this.manualParticles = [];
38
- this.name = "default";
39
45
  this.particles = (0, OptionsUtils_1.loadParticlesOptions)(this._engine, this._container);
40
46
  this.pauseOnBlur = true;
41
47
  this.pauseOnOutsideViewport = true;
@@ -45,26 +51,7 @@
45
51
  this.themes = [];
46
52
  this.zLayers = 100;
47
53
  }
48
- get backgroundMode() {
49
- return this.fullScreen;
50
- }
51
- set backgroundMode(value) {
52
- this.fullScreen.load(value);
53
- }
54
- get fps_limit() {
55
- return this.fpsLimit;
56
- }
57
- set fps_limit(value) {
58
- this.fpsLimit = value;
59
- }
60
- get retina_detect() {
61
- return this.detectRetina;
62
- }
63
- set retina_detect(value) {
64
- this.detectRetina = value;
65
- }
66
54
  load(data) {
67
- var _a, _b, _c, _d, _e;
68
55
  if (!data) {
69
56
  return;
70
57
  }
@@ -77,14 +64,14 @@
77
64
  if (data.delay !== undefined) {
78
65
  this.delay = (0, NumberUtils_1.setRangeValue)(data.delay);
79
66
  }
80
- const detectRetina = (_a = data.detectRetina) !== null && _a !== void 0 ? _a : data.retina_detect;
67
+ const detectRetina = data.detectRetina;
81
68
  if (detectRetina !== undefined) {
82
69
  this.detectRetina = detectRetina;
83
70
  }
84
71
  if (data.duration !== undefined) {
85
72
  this.duration = (0, NumberUtils_1.setRangeValue)(data.duration);
86
73
  }
87
- const fpsLimit = (_b = data.fpsLimit) !== null && _b !== void 0 ? _b : data.fps_limit;
74
+ const fpsLimit = data.fpsLimit;
88
75
  if (fpsLimit !== undefined) {
89
76
  this.fpsLimit = fpsLimit;
90
77
  }
@@ -98,8 +85,8 @@
98
85
  this.zLayers = data.zLayers;
99
86
  }
100
87
  this.background.load(data.background);
101
- const fullScreen = (_c = data.fullScreen) !== null && _c !== void 0 ? _c : data.backgroundMode;
102
- if (typeof fullScreen === "boolean") {
88
+ const fullScreen = data.fullScreen;
89
+ if ((0, Utils_1.isBoolean)(fullScreen)) {
103
90
  this.fullScreen.enable = fullScreen;
104
91
  }
105
92
  else {
@@ -107,7 +94,7 @@
107
94
  }
108
95
  this.backgroundMask.load(data.backgroundMask);
109
96
  this.interactivity.load(data.interactivity);
110
- if (data.manualParticles !== undefined) {
97
+ if (data.manualParticles) {
111
98
  this.manualParticles = data.manualParticles.map((t) => {
112
99
  const tmp = new ManualParticle_1.ManualParticle();
113
100
  tmp.load(t);
@@ -116,11 +103,11 @@
116
103
  }
117
104
  this.particles.load(data.particles);
118
105
  this.style = (0, Utils_1.deepExtend)(this.style, data.style);
119
- this._engine.plugins.loadOptions(this, data);
106
+ this._engine.loadOptions(this, data);
120
107
  if (data.smooth !== undefined) {
121
108
  this.smooth = data.smooth;
122
109
  }
123
- const interactors = this._engine.plugins.interactors.get(this._container);
110
+ const interactors = this._engine.interactors.get(this._container);
124
111
  if (interactors) {
125
112
  for (const interactor of interactors) {
126
113
  if (interactor.loadOptions) {
@@ -149,14 +136,14 @@
149
136
  }
150
137
  }
151
138
  }
152
- this.defaultThemes.dark = (_d = this._findDefaultTheme("dark")) === null || _d === void 0 ? void 0 : _d.name;
153
- this.defaultThemes.light = (_e = this._findDefaultTheme("light")) === null || _e === void 0 ? void 0 : _e.name;
139
+ this.defaultThemes.dark = this._findDefaultTheme("dark")?.name;
140
+ this.defaultThemes.light = this._findDefaultTheme("light")?.name;
154
141
  }
155
142
  setResponsive(width, pxRatio, defaultOptions) {
156
143
  this.load(defaultOptions);
157
144
  const responsiveOptions = this.responsive.find((t) => t.mode === "screen" && screen ? t.maxWidth > screen.availWidth : t.maxWidth * pxRatio > width);
158
- this.load(responsiveOptions === null || responsiveOptions === void 0 ? void 0 : responsiveOptions.options);
159
- return responsiveOptions === null || responsiveOptions === void 0 ? void 0 : responsiveOptions.maxWidth;
145
+ this.load(responsiveOptions?.options);
146
+ return responsiveOptions?.maxWidth;
160
147
  }
161
148
  setTheme(name) {
162
149
  if (name) {
@@ -172,13 +159,6 @@
172
159
  }
173
160
  }
174
161
  }
175
- _findDefaultTheme(mode) {
176
- var _a;
177
- return ((_a = this.themes.find((theme) => theme.default.value && theme.default.mode === mode)) !== null && _a !== void 0 ? _a : this.themes.find((theme) => theme.default.value && theme.default.mode === "any"));
178
- }
179
- _importPreset(preset) {
180
- this.load(this._engine.plugins.getPreset(preset));
181
- }
182
162
  }
183
163
  exports.Options = Options;
184
164
  });
@@ -4,12 +4,13 @@
4
4
  if (v !== undefined) module.exports = v;
5
5
  }
6
6
  else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports"], factory);
7
+ define(["require", "exports", "../../Utils/Utils"], factory);
8
8
  }
9
9
  })(function (require, exports) {
10
10
  "use strict";
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.OptionsColor = void 0;
13
+ const Utils_1 = require("../../Utils/Utils");
13
14
  class OptionsColor {
14
15
  constructor() {
15
16
  this.value = "";
@@ -18,7 +19,7 @@
18
19
  const color = new OptionsColor();
19
20
  color.load(source);
20
21
  if (data !== undefined) {
21
- if (typeof data === "string" || data instanceof Array) {
22
+ if ((0, Utils_1.isString)(data) || (0, Utils_1.isArray)(data)) {
22
23
  color.load({ value: data });
23
24
  }
24
25
  else {
@@ -28,7 +29,7 @@
28
29
  return color;
29
30
  }
30
31
  load(data) {
31
- if ((data === null || data === void 0 ? void 0 : data.value) === undefined) {
32
+ if (data?.value === undefined) {
32
33
  return;
33
34
  }
34
35
  this.value = data.value;
@@ -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", "./CollisionsAbsorb", "./CollisionsOverlap", "../Bounce/ParticlesBounce"], factory);
7
+ define(["require", "exports", "./CollisionsAbsorb", "./CollisionsOverlap", "../Bounce/ParticlesBounce", "../../../../Utils/NumberUtils"], factory);
8
8
  }
9
9
  })(function (require, exports) {
10
10
  "use strict";
@@ -13,11 +13,13 @@
13
13
  const CollisionsAbsorb_1 = require("./CollisionsAbsorb");
14
14
  const CollisionsOverlap_1 = require("./CollisionsOverlap");
15
15
  const ParticlesBounce_1 = require("../Bounce/ParticlesBounce");
16
+ const NumberUtils_1 = require("../../../../Utils/NumberUtils");
16
17
  class Collisions {
17
18
  constructor() {
18
19
  this.absorb = new CollisionsAbsorb_1.CollisionsAbsorb();
19
20
  this.bounce = new ParticlesBounce_1.ParticlesBounce();
20
21
  this.enable = false;
22
+ this.maxSpeed = 50;
21
23
  this.mode = "bounce";
22
24
  this.overlap = new CollisionsOverlap_1.CollisionsOverlap();
23
25
  }
@@ -30,6 +32,9 @@
30
32
  if (data.enable !== undefined) {
31
33
  this.enable = data.enable;
32
34
  }
35
+ if (data.maxSpeed !== undefined) {
36
+ this.maxSpeed = (0, NumberUtils_1.setRangeValue)(data.maxSpeed);
37
+ }
33
38
  if (data.mode !== undefined) {
34
39
  this.mode = data.mode;
35
40
  }
@@ -4,12 +4,13 @@
4
4
  if (v !== undefined) module.exports = v;
5
5
  }
6
6
  else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "./MoveAngle", "./MoveAttract", "./MoveCenter", "./MoveGravity", "./Path/MovePath", "./MoveTrail", "./OutModes", "./Spin", "../../../../Utils/NumberUtils"], factory);
7
+ define(["require", "exports", "../../../../Utils/Utils", "./MoveAngle", "./MoveAttract", "./MoveCenter", "./MoveGravity", "./Path/MovePath", "./MoveTrail", "./OutModes", "./Spin", "../../../../Utils/NumberUtils"], factory);
8
8
  }
9
9
  })(function (require, exports) {
10
10
  "use strict";
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.Move = void 0;
13
+ const Utils_1 = require("../../../../Utils/Utils");
13
14
  const MoveAngle_1 = require("./MoveAngle");
14
15
  const MoveAttract_1 = require("./MoveAttract");
15
16
  const MoveCenter_1 = require("./MoveCenter");
@@ -41,41 +42,11 @@
41
42
  this.vibrate = false;
42
43
  this.warp = false;
43
44
  }
44
- get bounce() {
45
- return this.collisions;
46
- }
47
- set bounce(value) {
48
- this.collisions = value;
49
- }
50
- get collisions() {
51
- return false;
52
- }
53
- set collisions(_) {
54
- }
55
- get noise() {
56
- return this.path;
57
- }
58
- set noise(value) {
59
- this.path = value;
60
- }
61
- get outMode() {
62
- return this.outModes.default;
63
- }
64
- set outMode(value) {
65
- this.outModes.default = value;
66
- }
67
- get out_mode() {
68
- return this.outMode;
69
- }
70
- set out_mode(value) {
71
- this.outMode = value;
72
- }
73
45
  load(data) {
74
- var _a, _b, _c;
75
46
  if (!data) {
76
47
  return;
77
48
  }
78
- this.angle.load(typeof data.angle === "number" ? { value: data.angle } : data.angle);
49
+ this.angle.load((0, Utils_1.isNumber)(data.angle) ? { value: data.angle } : data.angle);
79
50
  this.attract.load(data.attract);
80
51
  this.center.load(data.center);
81
52
  if (data.decay !== undefined) {
@@ -85,13 +56,12 @@
85
56
  this.direction = data.direction;
86
57
  }
87
58
  if (data.distance !== undefined) {
88
- this.distance =
89
- typeof data.distance === "number"
90
- ? {
91
- horizontal: data.distance,
92
- vertical: data.distance,
93
- }
94
- : Object.assign({}, data.distance);
59
+ this.distance = (0, Utils_1.isNumber)(data.distance)
60
+ ? {
61
+ horizontal: data.distance,
62
+ vertical: data.distance,
63
+ }
64
+ : { ...data.distance };
95
65
  }
96
66
  if (data.drift !== undefined) {
97
67
  this.drift = (0, NumberUtils_1.setRangeValue)(data.drift);
@@ -100,9 +70,9 @@
100
70
  this.enable = data.enable;
101
71
  }
102
72
  this.gravity.load(data.gravity);
103
- const outModes = (_b = (_a = data.outModes) !== null && _a !== void 0 ? _a : data.outMode) !== null && _b !== void 0 ? _b : data.out_mode;
73
+ const outModes = data.outModes;
104
74
  if (outModes !== undefined) {
105
- if (typeof outModes === "object") {
75
+ if ((0, Utils_1.isObject)(outModes)) {
106
76
  this.outModes.load(outModes);
107
77
  }
108
78
  else {
@@ -111,7 +81,7 @@
111
81
  });
112
82
  }
113
83
  }
114
- this.path.load((_c = data.path) !== null && _c !== void 0 ? _c : data.noise);
84
+ this.path.load(data.path);
115
85
  if (data.random !== undefined) {
116
86
  this.random = data.random;
117
87
  }