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