@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
@@ -1,9 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Vector3d = void 0;
4
+ const Constants_1 = require("./Constants");
5
+ const Utils_1 = require("../../Utils/Utils");
4
6
  class Vector3d {
5
7
  constructor(xOrCoords, y, z) {
6
- if (typeof xOrCoords !== "number" && xOrCoords) {
8
+ this._updateFromAngle = (angle, length) => {
9
+ this.x = Math.cos(angle) * length;
10
+ this.y = Math.sin(angle) * length;
11
+ };
12
+ if (!(0, Utils_1.isNumber)(xOrCoords) && xOrCoords) {
7
13
  this.x = xOrCoords.x;
8
14
  this.y = xOrCoords.y;
9
15
  const coords3d = xOrCoords;
@@ -12,10 +18,10 @@ class Vector3d {
12
18
  else if (xOrCoords !== undefined && y !== undefined) {
13
19
  this.x = xOrCoords;
14
20
  this.y = y;
15
- this.z = z !== null && z !== void 0 ? z : 0;
21
+ this.z = z ?? 0;
16
22
  }
17
23
  else {
18
- throw new Error("tsParticles - Vector3d not initialized correctly");
24
+ throw new Error(`${Constants_1.errorPrefix} Vector3d not initialized correctly`);
19
25
  }
20
26
  }
21
27
  static get origin() {
@@ -25,13 +31,13 @@ class Vector3d {
25
31
  return Math.atan2(this.y, this.x);
26
32
  }
27
33
  set angle(angle) {
28
- this.updateFromAngle(angle, this.length);
34
+ this._updateFromAngle(angle, this.length);
29
35
  }
30
36
  get length() {
31
37
  return Math.sqrt(this.getLengthSq());
32
38
  }
33
39
  set length(length) {
34
- this.updateFromAngle(this.angle, length);
40
+ this._updateFromAngle(this.angle, length);
35
41
  }
36
42
  static clone(source) {
37
43
  return Vector3d.create(source.x, source.y, source.z);
@@ -75,6 +81,12 @@ class Vector3d {
75
81
  this.y *= n;
76
82
  this.z *= n;
77
83
  }
84
+ normalize() {
85
+ const length = this.length;
86
+ if (length != 0) {
87
+ this.multTo(1.0 / length);
88
+ }
89
+ }
78
90
  rotate(angle) {
79
91
  return Vector3d.create(this.x * Math.cos(angle) - this.y * Math.sin(angle), this.x * Math.sin(angle) + this.y * Math.cos(angle), 0);
80
92
  }
@@ -92,9 +104,5 @@ class Vector3d {
92
104
  this.y -= v.y;
93
105
  this.z -= v.z;
94
106
  }
95
- updateFromAngle(angle, length) {
96
- this.x = Math.cos(angle) * length;
97
- this.y = Math.sin(angle) * length;
98
- }
99
107
  }
100
108
  exports.Vector3d = Vector3d;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AnimatableColor = void 0;
4
+ const Utils_1 = require("../../Utils/Utils");
4
5
  const HslAnimation_1 = require("./HslAnimation");
5
6
  const OptionsColor_1 = require("./OptionsColor");
6
7
  class AnimatableColor extends OptionsColor_1.OptionsColor {
@@ -12,7 +13,7 @@ class AnimatableColor extends OptionsColor_1.OptionsColor {
12
13
  const color = new AnimatableColor();
13
14
  color.load(source);
14
15
  if (data !== undefined) {
15
- if (typeof data === "string" || data instanceof Array) {
16
+ if ((0, Utils_1.isString)(data) || (0, Utils_1.isArray)(data)) {
16
17
  color.load({ value: data });
17
18
  }
18
19
  else {
@@ -8,6 +8,7 @@ class AnimationOptions {
8
8
  this.enable = false;
9
9
  this.speed = 1;
10
10
  this.decay = 0;
11
+ this.delay = 0;
11
12
  this.sync = false;
12
13
  }
13
14
  load(data) {
@@ -26,6 +27,9 @@ class AnimationOptions {
26
27
  if (data.decay !== undefined) {
27
28
  this.decay = (0, NumberUtils_1.setRangeValue)(data.decay);
28
29
  }
30
+ if (data.delay !== undefined) {
31
+ this.delay = (0, NumberUtils_1.setRangeValue)(data.delay);
32
+ }
29
33
  if (data.sync !== undefined) {
30
34
  this.sync = data.sync;
31
35
  }
@@ -35,6 +39,7 @@ exports.AnimationOptions = AnimationOptions;
35
39
  class RangedAnimationOptions extends AnimationOptions {
36
40
  constructor() {
37
41
  super();
42
+ this.mode = "auto";
38
43
  this.startValue = "random";
39
44
  }
40
45
  load(data) {
@@ -42,8 +47,8 @@ class RangedAnimationOptions extends AnimationOptions {
42
47
  if (!data) {
43
48
  return;
44
49
  }
45
- if (data.minimumValue !== undefined) {
46
- this.minimumValue = data.minimumValue;
50
+ if (data.mode !== undefined) {
51
+ this.mode = data.mode;
47
52
  }
48
53
  if (data.startValue !== undefined) {
49
54
  this.startValue = data.startValue;
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BackgroundMask = void 0;
4
4
  const BackgroundMaskCover_1 = require("./BackgroundMaskCover");
5
+ const Utils_1 = require("../../../Utils/Utils");
5
6
  class BackgroundMask {
6
7
  constructor() {
7
8
  this.composite = "destination-out";
@@ -17,7 +18,7 @@ class BackgroundMask {
17
18
  }
18
19
  if (data.cover !== undefined) {
19
20
  const cover = data.cover;
20
- const color = (typeof data.cover === "string" ? { color: data.cover } : data.cover);
21
+ const color = ((0, Utils_1.isString)(data.cover) ? { color: data.cover } : data.cover);
21
22
  this.cover.load(cover.color !== undefined ? cover : { color: color });
22
23
  }
23
24
  if (data.enable !== undefined) {
@@ -8,6 +8,7 @@ class ColorAnimation {
8
8
  this.enable = false;
9
9
  this.offset = 0;
10
10
  this.speed = 1;
11
+ this.delay = 0;
11
12
  this.decay = 0;
12
13
  this.sync = true;
13
14
  }
@@ -30,6 +31,9 @@ class ColorAnimation {
30
31
  if (data.decay !== undefined) {
31
32
  this.decay = (0, NumberUtils_1.setRangeValue)(data.decay);
32
33
  }
34
+ if (data.delay !== undefined) {
35
+ this.delay = (0, NumberUtils_1.setRangeValue)(data.delay);
36
+ }
33
37
  if (data.sync !== undefined) {
34
38
  this.sync = data.sync;
35
39
  }
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DivEvent = void 0;
4
- const Utils_1 = require("../../../../Utils/Utils");
5
4
  class DivEvent {
6
5
  constructor() {
7
6
  this.selectors = [];
@@ -9,33 +8,10 @@ class DivEvent {
9
8
  this.mode = [];
10
9
  this.type = "circle";
11
10
  }
12
- get el() {
13
- return this.elementId;
14
- }
15
- set el(value) {
16
- this.elementId = value;
17
- }
18
- get elementId() {
19
- return this.ids;
20
- }
21
- set elementId(value) {
22
- this.ids = value;
23
- }
24
- get ids() {
25
- return (0, Utils_1.executeOnSingleOrMultiple)(this.selectors, (t) => t.replace("#", ""));
26
- }
27
- set ids(value) {
28
- this.selectors = (0, Utils_1.executeOnSingleOrMultiple)(value, (t) => `#${t}`);
29
- }
30
11
  load(data) {
31
- var _a, _b;
32
12
  if (!data) {
33
13
  return;
34
14
  }
35
- const ids = (_b = (_a = data.ids) !== null && _a !== void 0 ? _a : data.elementId) !== null && _b !== void 0 ? _b : data.el;
36
- if (ids !== undefined) {
37
- this.ids = ids;
38
- }
39
15
  if (data.selectors !== undefined) {
40
16
  this.selectors = data.selectors;
41
17
  }
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Events = void 0;
4
+ const Utils_1 = require("../../../../Utils/Utils");
4
5
  const ClickEvent_1 = require("./ClickEvent");
5
6
  const DivEvent_1 = require("./DivEvent");
6
7
  const HoverEvent_1 = require("./HoverEvent");
7
8
  const ResizeEvent_1 = require("./ResizeEvent");
8
- const Utils_1 = require("../../../../Utils/Utils");
9
9
  class Events {
10
10
  constructor() {
11
11
  this.onClick = new ClickEvent_1.ClickEvent();
@@ -13,31 +13,12 @@ class Events {
13
13
  this.onHover = new HoverEvent_1.HoverEvent();
14
14
  this.resize = new ResizeEvent_1.ResizeEvent();
15
15
  }
16
- get onclick() {
17
- return this.onClick;
18
- }
19
- set onclick(value) {
20
- this.onClick = value;
21
- }
22
- get ondiv() {
23
- return this.onDiv;
24
- }
25
- set ondiv(value) {
26
- this.onDiv = value;
27
- }
28
- get onhover() {
29
- return this.onHover;
30
- }
31
- set onhover(value) {
32
- this.onHover = value;
33
- }
34
16
  load(data) {
35
- var _a, _b, _c;
36
17
  if (!data) {
37
18
  return;
38
19
  }
39
- this.onClick.load((_a = data.onClick) !== null && _a !== void 0 ? _a : data.onclick);
40
- const onDiv = (_b = data.onDiv) !== null && _b !== void 0 ? _b : data.ondiv;
20
+ this.onClick.load(data.onClick);
21
+ const onDiv = data.onDiv;
41
22
  if (onDiv !== undefined) {
42
23
  this.onDiv = (0, Utils_1.executeOnSingleOrMultiple)(onDiv, (t) => {
43
24
  const tmp = new DivEvent_1.DivEvent();
@@ -45,8 +26,8 @@ class Events {
45
26
  return tmp;
46
27
  });
47
28
  }
48
- this.onHover.load((_c = data.onHover) !== null && _c !== void 0 ? _c : data.onhover);
49
- if (typeof data.resize === "boolean") {
29
+ this.onHover.load(data.onHover);
30
+ if ((0, Utils_1.isBoolean)(data.resize)) {
50
31
  this.resize.enable = data.resize;
51
32
  }
52
33
  else {
@@ -9,18 +9,11 @@ class Interactivity {
9
9
  this.events = new Events_1.Events();
10
10
  this.modes = new Modes_1.Modes(engine, container);
11
11
  }
12
- get detect_on() {
13
- return this.detectsOn;
14
- }
15
- set detect_on(value) {
16
- this.detectsOn = value;
17
- }
18
12
  load(data) {
19
- var _a;
20
13
  if (!data) {
21
14
  return;
22
15
  }
23
- const detectsOn = (_a = data.detectsOn) !== null && _a !== void 0 ? _a : data.detect_on;
16
+ const detectsOn = data.detectsOn;
24
17
  if (detectsOn !== undefined) {
25
18
  this.detectsOn = detectsOn;
26
19
  }
@@ -10,15 +10,18 @@ class Modes {
10
10
  if (!data) {
11
11
  return;
12
12
  }
13
- if (this._container) {
14
- const interactors = this._engine.plugins.interactors.get(this._container);
15
- if (interactors) {
16
- for (const interactor of interactors) {
17
- if (interactor.loadModeOptions) {
18
- interactor.loadModeOptions(this, data);
19
- }
20
- }
13
+ if (!this._container) {
14
+ return;
15
+ }
16
+ const interactors = this._engine.interactors.get(this._container);
17
+ if (!interactors) {
18
+ return;
19
+ }
20
+ for (const interactor of interactors) {
21
+ if (!interactor.loadModeOptions) {
22
+ continue;
21
23
  }
24
+ interactor.loadModeOptions(this, data);
22
25
  }
23
26
  }
24
27
  }
@@ -4,17 +4,17 @@ exports.ManualParticle = void 0;
4
4
  const Utils_1 = require("../../Utils/Utils");
5
5
  class ManualParticle {
6
6
  load(data) {
7
- var _a, _b;
8
7
  if (!data) {
9
8
  return;
10
9
  }
11
- if (data.position !== undefined) {
10
+ if (data.position) {
12
11
  this.position = {
13
- x: (_a = data.position.x) !== null && _a !== void 0 ? _a : 50,
14
- y: (_b = data.position.y) !== null && _b !== void 0 ? _b : 50,
12
+ x: data.position.x ?? 50,
13
+ y: data.position.y ?? 50,
14
+ mode: data.position.mode ?? "percent",
15
15
  };
16
16
  }
17
- if (data.options !== undefined) {
17
+ if (data.options) {
18
18
  this.options = (0, Utils_1.deepExtend)({}, data.options);
19
19
  }
20
20
  }
@@ -13,6 +13,13 @@ const OptionsUtils_1 = require("../../Utils/OptionsUtils");
13
13
  const NumberUtils_1 = require("../../Utils/NumberUtils");
14
14
  class Options {
15
15
  constructor(engine, container) {
16
+ this._findDefaultTheme = (mode) => {
17
+ return (this.themes.find((theme) => theme.default.value && theme.default.mode === mode) ??
18
+ this.themes.find((theme) => theme.default.value && theme.default.mode === "any"));
19
+ };
20
+ this._importPreset = (preset) => {
21
+ this.load(this._engine.getPreset(preset));
22
+ };
16
23
  this._engine = engine;
17
24
  this._container = container;
18
25
  this.autoPlay = true;
@@ -26,7 +33,6 @@ class Options {
26
33
  this.fpsLimit = 120;
27
34
  this.interactivity = new Interactivity_1.Interactivity(engine, container);
28
35
  this.manualParticles = [];
29
- this.name = "default";
30
36
  this.particles = (0, OptionsUtils_1.loadParticlesOptions)(this._engine, this._container);
31
37
  this.pauseOnBlur = true;
32
38
  this.pauseOnOutsideViewport = true;
@@ -36,26 +42,7 @@ class Options {
36
42
  this.themes = [];
37
43
  this.zLayers = 100;
38
44
  }
39
- get backgroundMode() {
40
- return this.fullScreen;
41
- }
42
- set backgroundMode(value) {
43
- this.fullScreen.load(value);
44
- }
45
- get fps_limit() {
46
- return this.fpsLimit;
47
- }
48
- set fps_limit(value) {
49
- this.fpsLimit = value;
50
- }
51
- get retina_detect() {
52
- return this.detectRetina;
53
- }
54
- set retina_detect(value) {
55
- this.detectRetina = value;
56
- }
57
45
  load(data) {
58
- var _a, _b, _c, _d, _e;
59
46
  if (!data) {
60
47
  return;
61
48
  }
@@ -68,14 +55,14 @@ class Options {
68
55
  if (data.delay !== undefined) {
69
56
  this.delay = (0, NumberUtils_1.setRangeValue)(data.delay);
70
57
  }
71
- const detectRetina = (_a = data.detectRetina) !== null && _a !== void 0 ? _a : data.retina_detect;
58
+ const detectRetina = data.detectRetina;
72
59
  if (detectRetina !== undefined) {
73
60
  this.detectRetina = detectRetina;
74
61
  }
75
62
  if (data.duration !== undefined) {
76
63
  this.duration = (0, NumberUtils_1.setRangeValue)(data.duration);
77
64
  }
78
- const fpsLimit = (_b = data.fpsLimit) !== null && _b !== void 0 ? _b : data.fps_limit;
65
+ const fpsLimit = data.fpsLimit;
79
66
  if (fpsLimit !== undefined) {
80
67
  this.fpsLimit = fpsLimit;
81
68
  }
@@ -89,8 +76,8 @@ class Options {
89
76
  this.zLayers = data.zLayers;
90
77
  }
91
78
  this.background.load(data.background);
92
- const fullScreen = (_c = data.fullScreen) !== null && _c !== void 0 ? _c : data.backgroundMode;
93
- if (typeof fullScreen === "boolean") {
79
+ const fullScreen = data.fullScreen;
80
+ if ((0, Utils_1.isBoolean)(fullScreen)) {
94
81
  this.fullScreen.enable = fullScreen;
95
82
  }
96
83
  else {
@@ -98,7 +85,7 @@ class Options {
98
85
  }
99
86
  this.backgroundMask.load(data.backgroundMask);
100
87
  this.interactivity.load(data.interactivity);
101
- if (data.manualParticles !== undefined) {
88
+ if (data.manualParticles) {
102
89
  this.manualParticles = data.manualParticles.map((t) => {
103
90
  const tmp = new ManualParticle_1.ManualParticle();
104
91
  tmp.load(t);
@@ -107,11 +94,11 @@ class Options {
107
94
  }
108
95
  this.particles.load(data.particles);
109
96
  this.style = (0, Utils_1.deepExtend)(this.style, data.style);
110
- this._engine.plugins.loadOptions(this, data);
97
+ this._engine.loadOptions(this, data);
111
98
  if (data.smooth !== undefined) {
112
99
  this.smooth = data.smooth;
113
100
  }
114
- const interactors = this._engine.plugins.interactors.get(this._container);
101
+ const interactors = this._engine.interactors.get(this._container);
115
102
  if (interactors) {
116
103
  for (const interactor of interactors) {
117
104
  if (interactor.loadOptions) {
@@ -140,14 +127,14 @@ class Options {
140
127
  }
141
128
  }
142
129
  }
143
- this.defaultThemes.dark = (_d = this._findDefaultTheme("dark")) === null || _d === void 0 ? void 0 : _d.name;
144
- this.defaultThemes.light = (_e = this._findDefaultTheme("light")) === null || _e === void 0 ? void 0 : _e.name;
130
+ this.defaultThemes.dark = this._findDefaultTheme("dark")?.name;
131
+ this.defaultThemes.light = this._findDefaultTheme("light")?.name;
145
132
  }
146
133
  setResponsive(width, pxRatio, defaultOptions) {
147
134
  this.load(defaultOptions);
148
135
  const responsiveOptions = this.responsive.find((t) => t.mode === "screen" && screen ? t.maxWidth > screen.availWidth : t.maxWidth * pxRatio > width);
149
- this.load(responsiveOptions === null || responsiveOptions === void 0 ? void 0 : responsiveOptions.options);
150
- return responsiveOptions === null || responsiveOptions === void 0 ? void 0 : responsiveOptions.maxWidth;
136
+ this.load(responsiveOptions?.options);
137
+ return responsiveOptions?.maxWidth;
151
138
  }
152
139
  setTheme(name) {
153
140
  if (name) {
@@ -163,12 +150,5 @@ class Options {
163
150
  }
164
151
  }
165
152
  }
166
- _findDefaultTheme(mode) {
167
- var _a;
168
- 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"));
169
- }
170
- _importPreset(preset) {
171
- this.load(this._engine.plugins.getPreset(preset));
172
- }
173
153
  }
174
154
  exports.Options = Options;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.OptionsColor = void 0;
4
+ const Utils_1 = require("../../Utils/Utils");
4
5
  class OptionsColor {
5
6
  constructor() {
6
7
  this.value = "";
@@ -9,7 +10,7 @@ class OptionsColor {
9
10
  const color = new OptionsColor();
10
11
  color.load(source);
11
12
  if (data !== undefined) {
12
- if (typeof data === "string" || data instanceof Array) {
13
+ if ((0, Utils_1.isString)(data) || (0, Utils_1.isArray)(data)) {
13
14
  color.load({ value: data });
14
15
  }
15
16
  else {
@@ -19,7 +20,7 @@ class OptionsColor {
19
20
  return color;
20
21
  }
21
22
  load(data) {
22
- if ((data === null || data === void 0 ? void 0 : data.value) === undefined) {
23
+ if (data?.value === undefined) {
23
24
  return;
24
25
  }
25
26
  this.value = data.value;
@@ -4,11 +4,13 @@ exports.Collisions = void 0;
4
4
  const CollisionsAbsorb_1 = require("./CollisionsAbsorb");
5
5
  const CollisionsOverlap_1 = require("./CollisionsOverlap");
6
6
  const ParticlesBounce_1 = require("../Bounce/ParticlesBounce");
7
+ const NumberUtils_1 = require("../../../../Utils/NumberUtils");
7
8
  class Collisions {
8
9
  constructor() {
9
10
  this.absorb = new CollisionsAbsorb_1.CollisionsAbsorb();
10
11
  this.bounce = new ParticlesBounce_1.ParticlesBounce();
11
12
  this.enable = false;
13
+ this.maxSpeed = 50;
12
14
  this.mode = "bounce";
13
15
  this.overlap = new CollisionsOverlap_1.CollisionsOverlap();
14
16
  }
@@ -21,6 +23,9 @@ class Collisions {
21
23
  if (data.enable !== undefined) {
22
24
  this.enable = data.enable;
23
25
  }
26
+ if (data.maxSpeed !== undefined) {
27
+ this.maxSpeed = (0, NumberUtils_1.setRangeValue)(data.maxSpeed);
28
+ }
24
29
  if (data.mode !== undefined) {
25
30
  this.mode = data.mode;
26
31
  }
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Move = void 0;
4
+ const Utils_1 = require("../../../../Utils/Utils");
4
5
  const MoveAngle_1 = require("./MoveAngle");
5
6
  const MoveAttract_1 = require("./MoveAttract");
6
7
  const MoveCenter_1 = require("./MoveCenter");
@@ -32,41 +33,11 @@ class Move {
32
33
  this.vibrate = false;
33
34
  this.warp = false;
34
35
  }
35
- get bounce() {
36
- return this.collisions;
37
- }
38
- set bounce(value) {
39
- this.collisions = value;
40
- }
41
- get collisions() {
42
- return false;
43
- }
44
- set collisions(_) {
45
- }
46
- get noise() {
47
- return this.path;
48
- }
49
- set noise(value) {
50
- this.path = value;
51
- }
52
- get outMode() {
53
- return this.outModes.default;
54
- }
55
- set outMode(value) {
56
- this.outModes.default = value;
57
- }
58
- get out_mode() {
59
- return this.outMode;
60
- }
61
- set out_mode(value) {
62
- this.outMode = value;
63
- }
64
36
  load(data) {
65
- var _a, _b, _c;
66
37
  if (!data) {
67
38
  return;
68
39
  }
69
- this.angle.load(typeof data.angle === "number" ? { value: data.angle } : data.angle);
40
+ this.angle.load((0, Utils_1.isNumber)(data.angle) ? { value: data.angle } : data.angle);
70
41
  this.attract.load(data.attract);
71
42
  this.center.load(data.center);
72
43
  if (data.decay !== undefined) {
@@ -76,13 +47,12 @@ class Move {
76
47
  this.direction = data.direction;
77
48
  }
78
49
  if (data.distance !== undefined) {
79
- this.distance =
80
- typeof data.distance === "number"
81
- ? {
82
- horizontal: data.distance,
83
- vertical: data.distance,
84
- }
85
- : Object.assign({}, data.distance);
50
+ this.distance = (0, Utils_1.isNumber)(data.distance)
51
+ ? {
52
+ horizontal: data.distance,
53
+ vertical: data.distance,
54
+ }
55
+ : { ...data.distance };
86
56
  }
87
57
  if (data.drift !== undefined) {
88
58
  this.drift = (0, NumberUtils_1.setRangeValue)(data.drift);
@@ -91,9 +61,9 @@ class Move {
91
61
  this.enable = data.enable;
92
62
  }
93
63
  this.gravity.load(data.gravity);
94
- const outModes = (_b = (_a = data.outModes) !== null && _a !== void 0 ? _a : data.outMode) !== null && _b !== void 0 ? _b : data.out_mode;
64
+ const outModes = data.outModes;
95
65
  if (outModes !== undefined) {
96
- if (typeof outModes === "object") {
66
+ if ((0, Utils_1.isObject)(outModes)) {
97
67
  this.outModes.load(outModes);
98
68
  }
99
69
  else {
@@ -102,7 +72,7 @@ class Move {
102
72
  });
103
73
  }
104
74
  }
105
- this.path.load((_c = data.path) !== null && _c !== void 0 ? _c : data.noise);
75
+ this.path.load(data.path);
106
76
  if (data.random !== undefined) {
107
77
  this.random = data.random;
108
78
  }
@@ -11,20 +11,7 @@ class MoveAttract {
11
11
  y: 3000,
12
12
  };
13
13
  }
14
- get rotateX() {
15
- return this.rotate.x;
16
- }
17
- set rotateX(value) {
18
- this.rotate.x = value;
19
- }
20
- get rotateY() {
21
- return this.rotate.y;
22
- }
23
- set rotateY(value) {
24
- this.rotate.y = value;
25
- }
26
14
  load(data) {
27
- var _a, _b, _c, _d;
28
15
  if (!data) {
29
16
  return;
30
17
  }
@@ -34,13 +21,15 @@ class MoveAttract {
34
21
  if (data.enable !== undefined) {
35
22
  this.enable = data.enable;
36
23
  }
37
- const rotateX = (_b = (_a = data.rotate) === null || _a === void 0 ? void 0 : _a.x) !== null && _b !== void 0 ? _b : data.rotateX;
38
- if (rotateX !== undefined) {
39
- this.rotate.x = rotateX;
40
- }
41
- const rotateY = (_d = (_c = data.rotate) === null || _c === void 0 ? void 0 : _c.y) !== null && _d !== void 0 ? _d : data.rotateY;
42
- if (rotateY !== undefined) {
43
- this.rotate.y = rotateY;
24
+ if (data.rotate) {
25
+ const rotateX = data.rotate.x;
26
+ if (rotateX !== undefined) {
27
+ this.rotate.x = rotateX;
28
+ }
29
+ const rotateY = data.rotate.y;
30
+ if (rotateY !== undefined) {
31
+ this.rotate.y = rotateY;
32
+ }
44
33
  }
45
34
  }
46
35
  }
@@ -8,12 +8,6 @@ class MoveTrail {
8
8
  this.length = 10;
9
9
  this.fill = new MoveTrailFill_1.MoveTrailFill();
10
10
  }
11
- get fillColor() {
12
- return this.fill.color;
13
- }
14
- set fillColor(value) {
15
- this.fill.load({ color: value });
16
- }
17
11
  load(data) {
18
12
  if (!data) {
19
13
  return;
@@ -21,8 +15,8 @@ class MoveTrail {
21
15
  if (data.enable !== undefined) {
22
16
  this.enable = data.enable;
23
17
  }
24
- if (data.fill !== undefined || data.fillColor !== undefined) {
25
- this.fill.load(data.fill || { color: data.fillColor });
18
+ if (data.fill !== undefined) {
19
+ this.fill.load(data.fill);
26
20
  }
27
21
  if (data.length !== undefined) {
28
22
  this.length = data.length;