tsparticles 1.35.2 → 1.37.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 (663) hide show
  1. package/Core/Canvas.js +4 -6
  2. package/Core/Container.d.ts +4 -2
  3. package/Core/Container.js +21 -12
  4. package/Core/Loader.d.ts +19 -4
  5. package/Core/Loader.js +80 -18
  6. package/Enums/Modes/ResponsiveMode.d.ts +4 -0
  7. package/Enums/Modes/ResponsiveMode.js +8 -0
  8. package/Enums/Modes/index.d.ts +1 -0
  9. package/Enums/Modes/index.js +1 -0
  10. package/Interactions/External/Attract/index.d.ts +1 -1
  11. package/Interactions/External/Attract/index.js +2 -2
  12. package/Interactions/External/Bounce/index.d.ts +1 -1
  13. package/Interactions/External/Bounce/index.js +2 -2
  14. package/Interactions/External/Bubble/index.d.ts +1 -1
  15. package/Interactions/External/Bubble/index.js +2 -2
  16. package/Interactions/External/Connect/index.d.ts +1 -1
  17. package/Interactions/External/Connect/index.js +2 -2
  18. package/Interactions/External/Grab/index.d.ts +1 -1
  19. package/Interactions/External/Grab/index.js +2 -2
  20. package/Interactions/External/Repulse/index.d.ts +1 -1
  21. package/Interactions/External/Repulse/index.js +2 -2
  22. package/Interactions/External/Trail/index.d.ts +1 -1
  23. package/Interactions/External/Trail/index.js +2 -2
  24. package/Interactions/Particles/Attract/index.d.ts +1 -1
  25. package/Interactions/Particles/Attract/index.js +2 -2
  26. package/Interactions/Particles/Collisions/index.d.ts +1 -1
  27. package/Interactions/Particles/Collisions/index.js +2 -2
  28. package/Interactions/Particles/Links/index.d.ts +2 -2
  29. package/Interactions/Particles/Links/index.js +5 -5
  30. package/Interactions/Particles/Links/plugin.d.ts +1 -1
  31. package/Interactions/Particles/Links/plugin.js +2 -2
  32. package/Options/Classes/FullScreen/FullScreen.js +2 -2
  33. package/Options/Classes/Interactivity/Interactivity.js +1 -1
  34. package/Options/Classes/Options.d.ts +1 -1
  35. package/Options/Classes/Options.js +5 -2
  36. package/Options/Classes/Responsive.d.ts +2 -0
  37. package/Options/Classes/Responsive.js +10 -0
  38. package/Options/Interfaces/IResponsive.d.ts +2 -0
  39. package/Plugins/Absorbers/plugin.d.ts +1 -1
  40. package/Plugins/Absorbers/plugin.js +2 -2
  41. package/Plugins/Emitters/plugin.d.ts +1 -1
  42. package/Plugins/Emitters/plugin.js +2 -2
  43. package/Plugins/PolygonMask/plugin.js +1 -1
  44. package/README.md +1 -1
  45. package/Shapes/Circle/index.d.ts +1 -1
  46. package/Shapes/Circle/index.js +2 -2
  47. package/Shapes/Image/index.d.ts +1 -1
  48. package/Shapes/Image/index.js +3 -3
  49. package/Shapes/Line/index.d.ts +1 -1
  50. package/Shapes/Line/index.js +2 -2
  51. package/Shapes/Polygon/index.d.ts +3 -3
  52. package/Shapes/Polygon/index.js +7 -7
  53. package/Shapes/Square/index.d.ts +1 -1
  54. package/Shapes/Square/index.js +3 -3
  55. package/Shapes/Star/index.d.ts +1 -1
  56. package/Shapes/Star/index.js +2 -2
  57. package/Shapes/Text/index.d.ts +1 -1
  58. package/Shapes/Text/index.js +2 -2
  59. package/Updaters/Angle/index.d.ts +1 -1
  60. package/Updaters/Angle/index.js +2 -2
  61. package/Updaters/Color/index.d.ts +1 -1
  62. package/Updaters/Color/index.js +2 -2
  63. package/Updaters/Life/index.d.ts +1 -1
  64. package/Updaters/Life/index.js +2 -2
  65. package/Updaters/Opacity/index.d.ts +1 -1
  66. package/Updaters/Opacity/index.js +2 -2
  67. package/Updaters/OutModes/index.d.ts +1 -1
  68. package/Updaters/OutModes/index.js +2 -2
  69. package/Updaters/Roll/index.d.ts +1 -1
  70. package/Updaters/Roll/index.js +2 -2
  71. package/Updaters/Size/index.d.ts +1 -1
  72. package/Updaters/Size/index.js +2 -2
  73. package/Updaters/StrokeColor/index.d.ts +1 -1
  74. package/Updaters/StrokeColor/index.js +2 -2
  75. package/Updaters/Tilt/index.d.ts +1 -1
  76. package/Updaters/Tilt/index.js +2 -2
  77. package/Updaters/Wobble/index.d.ts +1 -1
  78. package/Updaters/Wobble/index.js +2 -2
  79. package/Utils/Utils.d.ts +1 -2
  80. package/browser/Core/Canvas.d.ts +29 -0
  81. package/browser/Core/Canvas.js +26 -6
  82. package/browser/Core/Container.d.ts +98 -2
  83. package/browser/Core/Container.js +104 -12
  84. package/browser/Core/FrameManager.d.ts +8 -0
  85. package/browser/Core/FrameManager.js +9 -0
  86. package/browser/Core/InteractionManager.d.ts +3 -0
  87. package/browser/Core/InteractionManager.js +4 -0
  88. package/browser/Core/Interfaces/Colors.d.ts +23 -0
  89. package/browser/Core/Interfaces/IAttract.d.ts +3 -0
  90. package/browser/Core/Interfaces/IBounds.d.ts +3 -0
  91. package/browser/Core/Interfaces/IBubble.d.ts +3 -0
  92. package/browser/Core/Interfaces/IBubbleParticleData.d.ts +3 -0
  93. package/browser/Core/Interfaces/IContainerInteractivity.d.ts +3 -0
  94. package/browser/Core/Interfaces/IContainerPlugin.d.ts +3 -0
  95. package/browser/Core/Interfaces/ICoordinates.d.ts +3 -0
  96. package/browser/Core/Interfaces/IDelta.d.ts +3 -0
  97. package/browser/Core/Interfaces/IDimension.d.ts +3 -0
  98. package/browser/Core/Interfaces/IExternalInteractor.d.ts +3 -0
  99. package/browser/Core/Interfaces/IInteractor.d.ts +3 -0
  100. package/browser/Core/Interfaces/IMouseData.d.ts +3 -0
  101. package/browser/Core/Interfaces/IMovePathGenerator.d.ts +3 -0
  102. package/browser/Core/Interfaces/IParticle.d.ts +3 -0
  103. package/browser/Core/Interfaces/IParticleValueAnimation.d.ts +3 -0
  104. package/browser/Core/Interfaces/IParticlesInteractor.d.ts +3 -0
  105. package/browser/Core/Interfaces/IPlugin.d.ts +8 -0
  106. package/browser/Core/Interfaces/IRepulse.d.ts +3 -0
  107. package/browser/Core/Interfaces/IShapeDrawer.d.ts +3 -0
  108. package/browser/Core/Interfaces/IShapeValues.d.ts +3 -0
  109. package/browser/Core/Loader.d.ts +64 -4
  110. package/browser/Core/Loader.js +131 -18
  111. package/browser/Core/Particle/Mover.d.ts +3 -0
  112. package/browser/Core/Particle/Mover.js +7 -2
  113. package/browser/Core/Particle.d.ts +7 -0
  114. package/browser/Core/Particle.js +13 -0
  115. package/browser/Core/Particles.d.ts +13 -0
  116. package/browser/Core/Particles.js +25 -0
  117. package/browser/Core/Retina.d.ts +6 -0
  118. package/browser/Core/Retina.js +9 -0
  119. package/browser/Enums/Directions/MoveDirection.d.ts +3 -0
  120. package/browser/Enums/Directions/MoveDirection.js +3 -0
  121. package/browser/Enums/Directions/RotateDirection.d.ts +3 -0
  122. package/browser/Enums/Directions/RotateDirection.js +3 -0
  123. package/browser/Enums/Directions/TiltDirection.d.ts +3 -0
  124. package/browser/Enums/Directions/TiltDirection.js +3 -0
  125. package/browser/Enums/InteractivityDetect.d.ts +3 -0
  126. package/browser/Enums/InteractivityDetect.js +3 -0
  127. package/browser/Enums/Modes/ClickMode.d.ts +3 -0
  128. package/browser/Enums/Modes/ClickMode.js +3 -0
  129. package/browser/Enums/Modes/CollisionMode.d.ts +3 -0
  130. package/browser/Enums/Modes/CollisionMode.js +3 -0
  131. package/browser/Enums/Modes/DivMode.d.ts +3 -0
  132. package/browser/Enums/Modes/DivMode.js +3 -0
  133. package/browser/Enums/Modes/HoverMode.d.ts +3 -0
  134. package/browser/Enums/Modes/HoverMode.js +3 -0
  135. package/browser/Enums/Modes/OutMode.d.ts +3 -0
  136. package/browser/Enums/Modes/OutMode.js +3 -0
  137. package/browser/Enums/Modes/ResponsiveMode.d.ts +4 -0
  138. package/browser/Enums/Modes/ResponsiveMode.js +5 -0
  139. package/browser/Enums/Modes/SizeMode.d.ts +3 -0
  140. package/browser/Enums/Modes/SizeMode.js +3 -0
  141. package/browser/Enums/Modes/index.d.ts +1 -0
  142. package/browser/Enums/Modes/index.js +1 -0
  143. package/browser/Enums/Types/DestroyType.d.ts +3 -0
  144. package/browser/Enums/Types/DestroyType.js +3 -0
  145. package/browser/Enums/Types/DivType.d.ts +3 -0
  146. package/browser/Enums/Types/DivType.js +3 -0
  147. package/browser/Enums/Types/OrbitType.d.ts +3 -0
  148. package/browser/Enums/Types/OrbitType.js +3 -0
  149. package/browser/Enums/Types/ShapeType.d.ts +3 -0
  150. package/browser/Enums/Types/ShapeType.js +3 -0
  151. package/browser/Enums/Types/StartValueType.d.ts +3 -0
  152. package/browser/Enums/Types/StartValueType.js +3 -0
  153. package/browser/Interactions/External/Attract/Attractor.d.ts +4 -0
  154. package/browser/Interactions/External/Attract/Attractor.js +5 -0
  155. package/browser/Interactions/External/Attract/index.d.ts +1 -1
  156. package/browser/Interactions/External/Attract/index.js +2 -2
  157. package/browser/Interactions/External/Bounce/Bouncer.js +1 -0
  158. package/browser/Interactions/External/Bounce/index.d.ts +1 -1
  159. package/browser/Interactions/External/Bounce/index.js +2 -2
  160. package/browser/Interactions/External/Bubble/Bubbler.d.ts +4 -0
  161. package/browser/Interactions/External/Bubble/Bubbler.js +14 -0
  162. package/browser/Interactions/External/Bubble/IBubblerProcessParam.d.ts +6 -0
  163. package/browser/Interactions/External/Bubble/ProcessBubbleType.d.ts +3 -0
  164. package/browser/Interactions/External/Bubble/ProcessBubbleType.js +3 -0
  165. package/browser/Interactions/External/Bubble/index.d.ts +1 -1
  166. package/browser/Interactions/External/Bubble/index.js +2 -2
  167. package/browser/Interactions/External/Connect/Connector.d.ts +7 -0
  168. package/browser/Interactions/External/Connect/Connector.js +8 -0
  169. package/browser/Interactions/External/Connect/index.d.ts +1 -1
  170. package/browser/Interactions/External/Connect/index.js +2 -2
  171. package/browser/Interactions/External/Grab/Grabber.d.ts +4 -0
  172. package/browser/Interactions/External/Grab/Grabber.js +9 -0
  173. package/browser/Interactions/External/Grab/index.d.ts +1 -1
  174. package/browser/Interactions/External/Grab/index.js +2 -2
  175. package/browser/Interactions/External/Repulse/Repulser.d.ts +4 -0
  176. package/browser/Interactions/External/Repulse/Repulser.js +162 -0
  177. package/browser/Interactions/External/Repulse/index.d.ts +1 -1
  178. package/browser/Interactions/External/Repulse/index.js +2 -2
  179. package/browser/Interactions/External/Trail/TrailMaker.d.ts +3 -0
  180. package/browser/Interactions/External/Trail/TrailMaker.js +4 -0
  181. package/browser/Interactions/External/Trail/index.d.ts +1 -1
  182. package/browser/Interactions/External/Trail/index.js +2 -2
  183. package/browser/Interactions/Particles/Attract/Attractor.d.ts +3 -0
  184. package/browser/Interactions/Particles/Attract/Attractor.js +4 -0
  185. package/browser/Interactions/Particles/Attract/index.d.ts +1 -1
  186. package/browser/Interactions/Particles/Attract/index.js +2 -2
  187. package/browser/Interactions/Particles/Collisions/Collider.d.ts +3 -0
  188. package/browser/Interactions/Particles/Collisions/Collider.js +4 -0
  189. package/browser/Interactions/Particles/Collisions/index.d.ts +1 -1
  190. package/browser/Interactions/Particles/Collisions/index.js +2 -2
  191. package/browser/Interactions/Particles/Links/ILink.d.ts +6 -0
  192. package/browser/Interactions/Particles/Links/LinkInstance.js +8 -0
  193. package/browser/Interactions/Particles/Links/Linker.js +2 -0
  194. package/browser/Interactions/Particles/Links/index.d.ts +2 -2
  195. package/browser/Interactions/Particles/Links/index.js +5 -5
  196. package/browser/Interactions/Particles/Links/plugin.d.ts +1 -1
  197. package/browser/Interactions/Particles/Links/plugin.js +3 -2
  198. package/browser/Options/Classes/AnimatableColor.d.ts +4 -0
  199. package/browser/Options/Classes/AnimatableColor.js +4 -0
  200. package/browser/Options/Classes/Background/Background.d.ts +4 -0
  201. package/browser/Options/Classes/Background/Background.js +4 -0
  202. package/browser/Options/Classes/BackgroundMask/BackgroundMask.d.ts +14 -0
  203. package/browser/Options/Classes/BackgroundMask/BackgroundMask.js +4 -0
  204. package/browser/Options/Classes/BackgroundMask/BackgroundMaskCover.d.ts +3 -0
  205. package/browser/Options/Classes/BackgroundMask/BackgroundMaskCover.js +3 -0
  206. package/browser/Options/Classes/ColorAnimation.d.ts +3 -0
  207. package/browser/Options/Classes/ColorAnimation.js +3 -0
  208. package/browser/Options/Classes/FullScreen/FullScreen.d.ts +16 -0
  209. package/browser/Options/Classes/FullScreen/FullScreen.js +8 -2
  210. package/browser/Options/Classes/Interactivity/Events/ClickEvent.d.ts +10 -0
  211. package/browser/Options/Classes/Interactivity/Events/ClickEvent.js +4 -0
  212. package/browser/Options/Classes/Interactivity/Events/DivEvent.d.ts +37 -0
  213. package/browser/Options/Classes/Interactivity/Events/DivEvent.js +33 -0
  214. package/browser/Options/Classes/Interactivity/Events/Events.d.ts +31 -0
  215. package/browser/Options/Classes/Interactivity/Events/Events.js +31 -0
  216. package/browser/Options/Classes/Interactivity/Events/HoverEvent.d.ts +4 -0
  217. package/browser/Options/Classes/Interactivity/Events/HoverEvent.js +4 -0
  218. package/browser/Options/Classes/Interactivity/Events/Parallax.d.ts +3 -0
  219. package/browser/Options/Classes/Interactivity/Events/Parallax.js +3 -0
  220. package/browser/Options/Classes/Interactivity/Interactivity.d.ts +13 -0
  221. package/browser/Options/Classes/Interactivity/Interactivity.js +14 -1
  222. package/browser/Options/Classes/Interactivity/Modes/Attract.d.ts +3 -0
  223. package/browser/Options/Classes/Interactivity/Modes/Attract.js +3 -0
  224. package/browser/Options/Classes/Interactivity/Modes/Bubble.d.ts +3 -0
  225. package/browser/Options/Classes/Interactivity/Modes/Bubble.js +3 -0
  226. package/browser/Options/Classes/Interactivity/Modes/BubbleBase.d.ts +3 -0
  227. package/browser/Options/Classes/Interactivity/Modes/BubbleBase.js +3 -0
  228. package/browser/Options/Classes/Interactivity/Modes/BubbleDiv.d.ts +9 -0
  229. package/browser/Options/Classes/Interactivity/Modes/BubbleDiv.js +9 -0
  230. package/browser/Options/Classes/Interactivity/Modes/Connect.d.ts +21 -0
  231. package/browser/Options/Classes/Interactivity/Modes/Connect.js +21 -0
  232. package/browser/Options/Classes/Interactivity/Modes/ConnectLinks.d.ts +3 -0
  233. package/browser/Options/Classes/Interactivity/Modes/ConnectLinks.js +3 -0
  234. package/browser/Options/Classes/Interactivity/Modes/Grab.d.ts +21 -0
  235. package/browser/Options/Classes/Interactivity/Modes/Grab.js +21 -0
  236. package/browser/Options/Classes/Interactivity/Modes/GrabLinks.d.ts +3 -0
  237. package/browser/Options/Classes/Interactivity/Modes/GrabLinks.js +3 -0
  238. package/browser/Options/Classes/Interactivity/Modes/Modes.d.ts +4 -0
  239. package/browser/Options/Classes/Interactivity/Modes/Modes.js +4 -0
  240. package/browser/Options/Classes/Interactivity/Modes/Push.d.ts +12 -0
  241. package/browser/Options/Classes/Interactivity/Modes/Push.js +12 -0
  242. package/browser/Options/Classes/Interactivity/Modes/Remove.d.ts +12 -0
  243. package/browser/Options/Classes/Interactivity/Modes/Remove.js +12 -0
  244. package/browser/Options/Classes/Interactivity/Modes/Repulse.d.ts +3 -0
  245. package/browser/Options/Classes/Interactivity/Modes/Repulse.js +3 -0
  246. package/browser/Options/Classes/Interactivity/Modes/RepulseBase.d.ts +3 -0
  247. package/browser/Options/Classes/Interactivity/Modes/RepulseBase.js +3 -0
  248. package/browser/Options/Classes/Interactivity/Modes/RepulseDiv.d.ts +9 -0
  249. package/browser/Options/Classes/Interactivity/Modes/RepulseDiv.js +11 -0
  250. package/browser/Options/Classes/Interactivity/Modes/Slow.d.ts +9 -0
  251. package/browser/Options/Classes/Interactivity/Modes/Slow.js +10 -0
  252. package/browser/Options/Classes/Interactivity/Modes/Trail.d.ts +3 -0
  253. package/browser/Options/Classes/Interactivity/Modes/Trail.js +3 -0
  254. package/browser/Options/Classes/Motion/Motion.d.ts +11 -0
  255. package/browser/Options/Classes/Motion/Motion.js +4 -0
  256. package/browser/Options/Classes/Motion/MotionReduce.d.ts +9 -0
  257. package/browser/Options/Classes/Motion/MotionReduce.js +3 -0
  258. package/browser/Options/Classes/Options.d.ts +31 -1
  259. package/browser/Options/Classes/Options.js +36 -3
  260. package/browser/Options/Classes/OptionsColor.d.ts +4 -0
  261. package/browser/Options/Classes/OptionsColor.js +4 -0
  262. package/browser/Options/Classes/Particles/Collisions/Collisions.d.ts +4 -0
  263. package/browser/Options/Classes/Particles/Collisions/Collisions.js +4 -0
  264. package/browser/Options/Classes/Particles/Links/Links.d.ts +4 -0
  265. package/browser/Options/Classes/Particles/Links/Links.js +4 -0
  266. package/browser/Options/Classes/Particles/Links/LinksShadow.d.ts +3 -0
  267. package/browser/Options/Classes/Particles/Links/LinksShadow.js +3 -0
  268. package/browser/Options/Classes/Particles/Links/LinksTriangle.d.ts +3 -0
  269. package/browser/Options/Classes/Particles/Links/LinksTriangle.js +3 -0
  270. package/browser/Options/Classes/Particles/Move/Attract.d.ts +21 -0
  271. package/browser/Options/Classes/Particles/Move/Attract.js +21 -0
  272. package/browser/Options/Classes/Particles/Move/Move.d.ts +42 -0
  273. package/browser/Options/Classes/Particles/Move/Move.js +43 -0
  274. package/browser/Options/Classes/Particles/Move/MoveAngle.d.ts +3 -0
  275. package/browser/Options/Classes/Particles/Move/MoveAngle.js +4 -1
  276. package/browser/Options/Classes/Particles/Move/Path/Path.d.ts +3 -0
  277. package/browser/Options/Classes/Particles/Move/Path/Path.js +3 -0
  278. package/browser/Options/Classes/Particles/Move/Trail.d.ts +3 -0
  279. package/browser/Options/Classes/Particles/Move/Trail.js +3 -0
  280. package/browser/Options/Classes/Particles/Number/Density.d.ts +12 -0
  281. package/browser/Options/Classes/Particles/Number/Density.js +12 -0
  282. package/browser/Options/Classes/Particles/Number/ParticlesNumber.d.ts +10 -0
  283. package/browser/Options/Classes/Particles/Number/ParticlesNumber.js +10 -0
  284. package/browser/Options/Classes/Particles/Opacity/Opacity.d.ts +13 -0
  285. package/browser/Options/Classes/Particles/Opacity/Opacity.js +13 -0
  286. package/browser/Options/Classes/Particles/Opacity/OpacityAnimation.d.ts +15 -0
  287. package/browser/Options/Classes/Particles/Opacity/OpacityAnimation.js +12 -0
  288. package/browser/Options/Classes/Particles/Orbit/Orbit.d.ts +4 -0
  289. package/browser/Options/Classes/Particles/Orbit/Orbit.js +4 -0
  290. package/browser/Options/Classes/Particles/Orbit/OrbitRotation.d.ts +3 -0
  291. package/browser/Options/Classes/Particles/Orbit/OrbitRotation.js +3 -0
  292. package/browser/Options/Classes/Particles/ParticlesOptions.d.ts +22 -0
  293. package/browser/Options/Classes/Particles/ParticlesOptions.js +22 -0
  294. package/browser/Options/Classes/Particles/Repulse/Repulse.d.ts +3 -0
  295. package/browser/Options/Classes/Particles/Repulse/Repulse.js +3 -0
  296. package/browser/Options/Classes/Particles/Rotate/Rotate.d.ts +4 -0
  297. package/browser/Options/Classes/Particles/Rotate/Rotate.js +4 -0
  298. package/browser/Options/Classes/Particles/Rotate/RotateAnimation.d.ts +3 -0
  299. package/browser/Options/Classes/Particles/Rotate/RotateAnimation.js +3 -0
  300. package/browser/Options/Classes/Particles/Shadow.d.ts +4 -0
  301. package/browser/Options/Classes/Particles/Shadow.js +4 -0
  302. package/browser/Options/Classes/Particles/Shape/Shape.d.ts +42 -0
  303. package/browser/Options/Classes/Particles/Shape/Shape.js +43 -0
  304. package/browser/Options/Classes/Particles/Size/Size.d.ts +13 -0
  305. package/browser/Options/Classes/Particles/Size/Size.js +13 -0
  306. package/browser/Options/Classes/Particles/Size/SizeAnimation.d.ts +15 -0
  307. package/browser/Options/Classes/Particles/Size/SizeAnimation.js +12 -0
  308. package/browser/Options/Classes/Particles/Stroke.d.ts +4 -0
  309. package/browser/Options/Classes/Particles/Stroke.js +4 -0
  310. package/browser/Options/Classes/Particles/Tilt/Tilt.d.ts +4 -0
  311. package/browser/Options/Classes/Particles/Tilt/Tilt.js +4 -0
  312. package/browser/Options/Classes/Particles/Tilt/TiltAnimation.d.ts +3 -0
  313. package/browser/Options/Classes/Particles/Tilt/TiltAnimation.js +3 -0
  314. package/browser/Options/Classes/Particles/Twinkle/Twinkle.d.ts +4 -0
  315. package/browser/Options/Classes/Particles/Twinkle/Twinkle.js +4 -0
  316. package/browser/Options/Classes/Particles/Twinkle/TwinkleValues.d.ts +3 -0
  317. package/browser/Options/Classes/Particles/Twinkle/TwinkleValues.js +3 -0
  318. package/browser/Options/Classes/Particles/ZIndex/ZIndex.d.ts +3 -0
  319. package/browser/Options/Classes/Particles/ZIndex/ZIndex.js +3 -0
  320. package/browser/Options/Classes/Responsive.d.ts +2 -0
  321. package/browser/Options/Classes/Responsive.js +11 -0
  322. package/browser/Options/Classes/ValueWithRandom.d.ts +3 -0
  323. package/browser/Options/Interfaces/Background/IBackground.d.ts +35 -0
  324. package/browser/Options/Interfaces/BackgroundMask/IBackgroundMask.d.ts +21 -0
  325. package/browser/Options/Interfaces/BackgroundMask/IBackgroundMaskCover.d.ts +10 -0
  326. package/browser/Options/Interfaces/FullScreen/IFullScreen.d.ts +16 -0
  327. package/browser/Options/Interfaces/IAnimatableColor.d.ts +8 -0
  328. package/browser/Options/Interfaces/IAnimation.d.ts +10 -0
  329. package/browser/Options/Interfaces/IColorAnimation.d.ts +7 -0
  330. package/browser/Options/Interfaces/IColorAnimation.js +4 -0
  331. package/browser/Options/Interfaces/IManualParticle.d.ts +11 -0
  332. package/browser/Options/Interfaces/IOptionLoader.d.ts +9 -0
  333. package/browser/Options/Interfaces/IOptions.d.ts +71 -0
  334. package/browser/Options/Interfaces/IOptionsColor.d.ts +5 -0
  335. package/browser/Options/Interfaces/IResponsive.d.ts +2 -0
  336. package/browser/Options/Interfaces/IValueWithRandom.d.ts +3 -0
  337. package/browser/Options/Interfaces/Interactivity/Events/IClickEvent.d.ts +12 -0
  338. package/browser/Options/Interfaces/Interactivity/Events/IDivEvent.d.ts +13 -0
  339. package/browser/Options/Interfaces/Interactivity/Events/IEvents.d.ts +13 -0
  340. package/browser/Options/Interfaces/Interactivity/Events/IHoverEvent.d.ts +4 -0
  341. package/browser/Options/Interfaces/Interactivity/Events/IParallax.d.ts +3 -0
  342. package/browser/Options/Interfaces/Interactivity/IInteractivity.d.ts +20 -0
  343. package/browser/Options/Interfaces/Interactivity/Modes/IAttract.d.ts +3 -0
  344. package/browser/Options/Interfaces/Interactivity/Modes/IBubble.d.ts +3 -0
  345. package/browser/Options/Interfaces/Interactivity/Modes/IBubbleBase.d.ts +3 -0
  346. package/browser/Options/Interfaces/Interactivity/Modes/IBubbleDiv.d.ts +3 -0
  347. package/browser/Options/Interfaces/Interactivity/Modes/IConnect.d.ts +9 -0
  348. package/browser/Options/Interfaces/Interactivity/Modes/IConnectLinks.d.ts +3 -0
  349. package/browser/Options/Interfaces/Interactivity/Modes/IGrab.d.ts +9 -0
  350. package/browser/Options/Interfaces/Interactivity/Modes/IGrabLinks.d.ts +3 -0
  351. package/browser/Options/Interfaces/Interactivity/Modes/IModeDiv.d.ts +6 -0
  352. package/browser/Options/Interfaces/Interactivity/Modes/IModes.d.ts +4 -0
  353. package/browser/Options/Interfaces/Interactivity/Modes/IPush.d.ts +6 -0
  354. package/browser/Options/Interfaces/Interactivity/Modes/IRemove.d.ts +6 -0
  355. package/browser/Options/Interfaces/Interactivity/Modes/IRepulse.d.ts +3 -0
  356. package/browser/Options/Interfaces/Interactivity/Modes/IRepulseBase.d.ts +3 -0
  357. package/browser/Options/Interfaces/Interactivity/Modes/IRepulseDiv.d.ts +3 -0
  358. package/browser/Options/Interfaces/Interactivity/Modes/ISlow.d.ts +6 -0
  359. package/browser/Options/Interfaces/Interactivity/Modes/ITrail.d.ts +3 -0
  360. package/browser/Options/Interfaces/Motion/IMotion.d.ts +11 -0
  361. package/browser/Options/Interfaces/Motion/IMotionReduce.d.ts +9 -0
  362. package/browser/Options/Interfaces/Particles/Collisions/ICollisions.d.ts +4 -0
  363. package/browser/Options/Interfaces/Particles/Destroy/IDestroy.d.ts +4 -0
  364. package/browser/Options/Interfaces/Particles/IParticles.d.ts +10 -0
  365. package/browser/Options/Interfaces/Particles/IShadow.d.ts +4 -0
  366. package/browser/Options/Interfaces/Particles/IStroke.d.ts +14 -0
  367. package/browser/Options/Interfaces/Particles/Links/ILinks.d.ts +43 -0
  368. package/browser/Options/Interfaces/Particles/Links/ILinksShadow.d.ts +3 -0
  369. package/browser/Options/Interfaces/Particles/Links/ILinksTriangle.d.ts +3 -0
  370. package/browser/Options/Interfaces/Particles/Move/IAttract.d.ts +9 -0
  371. package/browser/Options/Interfaces/Particles/Move/IMove.d.ts +19 -0
  372. package/browser/Options/Interfaces/Particles/Move/IMoveAngle.d.ts +3 -0
  373. package/browser/Options/Interfaces/Particles/Move/ITrail.d.ts +3 -0
  374. package/browser/Options/Interfaces/Particles/Move/Path/iPath.d.ts +3 -0
  375. package/browser/Options/Interfaces/Particles/Number/IDensity.d.ts +6 -0
  376. package/browser/Options/Interfaces/Particles/Number/IParticlesNumber.d.ts +7 -0
  377. package/browser/Options/Interfaces/Particles/Opacity/IOpacity.d.ts +7 -0
  378. package/browser/Options/Interfaces/Particles/Opacity/IOpacityAnimation.d.ts +9 -0
  379. package/browser/Options/Interfaces/Particles/Orbit/IOrbit.d.ts +7 -0
  380. package/browser/Options/Interfaces/Particles/Repulse/IRepulse.d.ts +4 -0
  381. package/browser/Options/Interfaces/Particles/Rotate/IRotate.d.ts +4 -0
  382. package/browser/Options/Interfaces/Particles/Rotate/IRotateAnimation.d.ts +3 -0
  383. package/browser/Options/Interfaces/Particles/Shape/ICharacterShape.d.ts +3 -0
  384. package/browser/Options/Interfaces/Particles/Shape/IImageShape.d.ts +6 -0
  385. package/browser/Options/Interfaces/Particles/Shape/IPolygonShape.d.ts +6 -0
  386. package/browser/Options/Interfaces/Particles/Shape/IShape.d.ts +22 -0
  387. package/browser/Options/Interfaces/Particles/Shape/IStarShape.d.ts +6 -0
  388. package/browser/Options/Interfaces/Particles/Size/ISize.d.ts +7 -0
  389. package/browser/Options/Interfaces/Particles/Size/ISizeAnimation.d.ts +9 -0
  390. package/browser/Options/Interfaces/Particles/Tilt/ITilt.d.ts +4 -0
  391. package/browser/Options/Interfaces/Particles/Tilt/ITiltAnimation.d.ts +3 -0
  392. package/browser/Options/Interfaces/Particles/Twinkle/ITwinkle.d.ts +4 -0
  393. package/browser/Options/Interfaces/Particles/Twinkle/ITwinkleValues.d.ts +3 -0
  394. package/browser/Options/Interfaces/Particles/ZIndex/IZIndex.d.ts +4 -0
  395. package/browser/Options/Interfaces/Theme/ITheme.d.ts +14 -0
  396. package/browser/Options/Interfaces/Theme/IThemeDefault.d.ts +16 -0
  397. package/browser/Plugins/Absorbers/AbsorberInstance.d.ts +3 -0
  398. package/browser/Plugins/Absorbers/AbsorberInstance.js +3 -0
  399. package/browser/Plugins/Absorbers/Absorbers.d.ts +3 -0
  400. package/browser/Plugins/Absorbers/Absorbers.js +3 -0
  401. package/browser/Plugins/Absorbers/Enums/AbsorberClickMode.d.ts +3 -0
  402. package/browser/Plugins/Absorbers/Enums/AbsorberClickMode.js +3 -0
  403. package/browser/Plugins/Absorbers/Options/Classes/Absorber.d.ts +4 -0
  404. package/browser/Plugins/Absorbers/Options/Classes/Absorber.js +4 -0
  405. package/browser/Plugins/Absorbers/Options/Interfaces/IAbsorber.d.ts +29 -0
  406. package/browser/Plugins/Absorbers/Options/Interfaces/IAbsorberOptions.d.ts +3 -0
  407. package/browser/Plugins/Absorbers/plugin.d.ts +1 -1
  408. package/browser/Plugins/Absorbers/plugin.js +5 -2
  409. package/browser/Plugins/Emitters/EmitterInstance.d.ts +3 -0
  410. package/browser/Plugins/Emitters/EmitterInstance.js +3 -0
  411. package/browser/Plugins/Emitters/Emitters.d.ts +3 -0
  412. package/browser/Plugins/Emitters/Emitters.js +3 -0
  413. package/browser/Plugins/Emitters/Enums/EmitterClickMode.d.ts +3 -0
  414. package/browser/Plugins/Emitters/Enums/EmitterClickMode.js +3 -0
  415. package/browser/Plugins/Emitters/Options/Classes/Emitter.d.ts +4 -0
  416. package/browser/Plugins/Emitters/Options/Classes/Emitter.js +4 -0
  417. package/browser/Plugins/Emitters/Options/Classes/EmitterLife.d.ts +3 -0
  418. package/browser/Plugins/Emitters/Options/Classes/EmitterLife.js +3 -0
  419. package/browser/Plugins/Emitters/Options/Classes/EmitterRate.d.ts +3 -0
  420. package/browser/Plugins/Emitters/Options/Classes/EmitterRate.js +3 -0
  421. package/browser/Plugins/Emitters/Options/Classes/EmitterSize.d.ts +3 -0
  422. package/browser/Plugins/Emitters/Options/Classes/EmitterSize.js +3 -0
  423. package/browser/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +44 -0
  424. package/browser/Plugins/Emitters/Options/Interfaces/IEmitterLife.d.ts +19 -0
  425. package/browser/Plugins/Emitters/Options/Interfaces/IEmitterOptions.d.ts +3 -0
  426. package/browser/Plugins/Emitters/Options/Interfaces/IEmitterRate.d.ts +11 -0
  427. package/browser/Plugins/Emitters/Options/Interfaces/IEmitterSize.d.ts +3 -0
  428. package/browser/Plugins/Emitters/Shapes/Square/SquareShape.js +4 -0
  429. package/browser/Plugins/Emitters/plugin.d.ts +1 -1
  430. package/browser/Plugins/Emitters/plugin.js +5 -2
  431. package/browser/Plugins/PolygonMask/Options/Classes/Draw.d.ts +15 -0
  432. package/browser/Plugins/PolygonMask/Options/Classes/Draw.js +15 -0
  433. package/browser/Plugins/PolygonMask/Options/Classes/DrawStroke.d.ts +3 -0
  434. package/browser/Plugins/PolygonMask/Options/Classes/DrawStroke.js +3 -0
  435. package/browser/Plugins/PolygonMask/Options/Classes/Inline.d.ts +3 -0
  436. package/browser/Plugins/PolygonMask/Options/Classes/Inline.js +3 -0
  437. package/browser/Plugins/PolygonMask/Options/Classes/LocalSvg.d.ts +3 -0
  438. package/browser/Plugins/PolygonMask/Options/Classes/LocalSvg.js +3 -0
  439. package/browser/Plugins/PolygonMask/Options/Classes/Move.d.ts +3 -0
  440. package/browser/Plugins/PolygonMask/Options/Classes/Move.js +3 -0
  441. package/browser/Plugins/PolygonMask/Options/Classes/PolygonMask.d.ts +10 -0
  442. package/browser/Plugins/PolygonMask/Options/Classes/PolygonMask.js +10 -0
  443. package/browser/Plugins/PolygonMask/Options/Interfaces/IDraw.d.ts +9 -0
  444. package/browser/Plugins/PolygonMask/Options/Interfaces/IDrawStroke.d.ts +3 -0
  445. package/browser/Plugins/PolygonMask/Options/Interfaces/IInline.d.ts +3 -0
  446. package/browser/Plugins/PolygonMask/Options/Interfaces/ILocalSvg.d.ts +3 -0
  447. package/browser/Plugins/PolygonMask/Options/Interfaces/IMove.d.ts +3 -0
  448. package/browser/Plugins/PolygonMask/Options/Interfaces/IPolygonMask.d.ts +7 -0
  449. package/browser/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskOptions.d.ts +3 -0
  450. package/browser/Plugins/PolygonMask/PolygonMaskInstance.d.ts +12 -0
  451. package/browser/Plugins/PolygonMask/PolygonMaskInstance.js +22 -0
  452. package/browser/Plugins/PolygonMask/pathseg.js +55 -1
  453. package/browser/Plugins/PolygonMask/plugin.js +8 -2
  454. package/browser/Plugins/PolygonMask/utils.js +14 -2
  455. package/browser/Shapes/Circle/CircleDrawer.d.ts +3 -0
  456. package/browser/Shapes/Circle/CircleDrawer.js +3 -0
  457. package/browser/Shapes/Circle/index.d.ts +1 -1
  458. package/browser/Shapes/Circle/index.js +2 -2
  459. package/browser/Shapes/Image/ImageDrawer.d.ts +3 -0
  460. package/browser/Shapes/Image/ImageDrawer.js +6 -0
  461. package/browser/Shapes/Image/Utils.d.ts +3 -0
  462. package/browser/Shapes/Image/Utils.js +1 -0
  463. package/browser/Shapes/Image/index.d.ts +1 -1
  464. package/browser/Shapes/Image/index.js +3 -3
  465. package/browser/Shapes/Line/LineDrawer.d.ts +3 -0
  466. package/browser/Shapes/Line/LineDrawer.js +3 -0
  467. package/browser/Shapes/Line/index.d.ts +1 -1
  468. package/browser/Shapes/Line/index.js +2 -2
  469. package/browser/Shapes/Polygon/PolygonDrawer.d.ts +3 -0
  470. package/browser/Shapes/Polygon/PolygonDrawer.js +3 -0
  471. package/browser/Shapes/Polygon/PolygonDrawerBase.d.ts +3 -0
  472. package/browser/Shapes/Polygon/PolygonDrawerBase.js +5 -1
  473. package/browser/Shapes/Polygon/TriangleDrawer.d.ts +3 -0
  474. package/browser/Shapes/Polygon/TriangleDrawer.js +3 -0
  475. package/browser/Shapes/Polygon/index.d.ts +3 -3
  476. package/browser/Shapes/Polygon/index.js +7 -7
  477. package/browser/Shapes/Square/SquareDrawer.d.ts +3 -0
  478. package/browser/Shapes/Square/SquareDrawer.js +3 -0
  479. package/browser/Shapes/Square/index.d.ts +1 -1
  480. package/browser/Shapes/Square/index.js +3 -3
  481. package/browser/Shapes/Star/StarDrawer.d.ts +3 -0
  482. package/browser/Shapes/Star/StarDrawer.js +3 -0
  483. package/browser/Shapes/Star/index.d.ts +1 -1
  484. package/browser/Shapes/Star/index.js +2 -2
  485. package/browser/Shapes/Text/TextDrawer.d.ts +3 -0
  486. package/browser/Shapes/Text/TextDrawer.js +3 -0
  487. package/browser/Shapes/Text/index.d.ts +1 -1
  488. package/browser/Shapes/Text/index.js +2 -2
  489. package/browser/Types/ParticlesGroups.d.ts +4 -0
  490. package/browser/Types/RecursivePartial.d.ts +3 -0
  491. package/browser/Types/ShapeData.d.ts +3 -0
  492. package/browser/Types/ShapeDrawerFunctions.d.ts +21 -0
  493. package/browser/Types/SingleOrMultiple.d.ts +3 -0
  494. package/browser/Updaters/Angle/index.d.ts +1 -1
  495. package/browser/Updaters/Angle/index.js +2 -2
  496. package/browser/Updaters/Color/ColorUpdater.js +1 -0
  497. package/browser/Updaters/Color/index.d.ts +1 -1
  498. package/browser/Updaters/Color/index.js +2 -2
  499. package/browser/Updaters/Life/LifeUpdater.js +1 -0
  500. package/browser/Updaters/Life/index.d.ts +1 -1
  501. package/browser/Updaters/Life/index.js +2 -2
  502. package/browser/Updaters/Opacity/OpacityUpdater.js +1 -0
  503. package/browser/Updaters/Opacity/index.d.ts +1 -1
  504. package/browser/Updaters/Opacity/index.js +2 -2
  505. package/browser/Updaters/OutModes/OutOfCanvasUpdater.js +1 -0
  506. package/browser/Updaters/OutModes/index.d.ts +1 -1
  507. package/browser/Updaters/OutModes/index.js +2 -2
  508. package/browser/Updaters/Roll/index.d.ts +1 -1
  509. package/browser/Updaters/Roll/index.js +2 -2
  510. package/browser/Updaters/Size/SizeUpdater.js +1 -0
  511. package/browser/Updaters/Size/index.d.ts +1 -1
  512. package/browser/Updaters/Size/index.js +2 -2
  513. package/browser/Updaters/StrokeColor/StrokeColorUpdater.js +1 -0
  514. package/browser/Updaters/StrokeColor/index.d.ts +1 -1
  515. package/browser/Updaters/StrokeColor/index.js +2 -2
  516. package/browser/Updaters/Tilt/index.d.ts +1 -1
  517. package/browser/Updaters/Tilt/index.js +2 -2
  518. package/browser/Updaters/Wobble/index.d.ts +1 -1
  519. package/browser/Updaters/Wobble/index.js +2 -2
  520. package/browser/Utils/CanvasUtils.js +4 -0
  521. package/browser/Utils/Circle.d.ts +3 -0
  522. package/browser/Utils/Circle.js +3 -0
  523. package/browser/Utils/CircleWarp.d.ts +3 -0
  524. package/browser/Utils/CircleWarp.js +3 -0
  525. package/browser/Utils/ColorUtils.d.ts +20 -0
  526. package/browser/Utils/ColorUtils.js +33 -1
  527. package/browser/Utils/Constants.d.ts +7 -0
  528. package/browser/Utils/Constants.js +7 -0
  529. package/browser/Utils/EventListeners.d.ts +32 -0
  530. package/browser/Utils/EventListeners.js +40 -0
  531. package/browser/Utils/NumberUtils.d.ts +27 -0
  532. package/browser/Utils/NumberUtils.js +27 -0
  533. package/browser/Utils/Plugins.d.ts +3 -0
  534. package/browser/Utils/Plugins.js +3 -0
  535. package/browser/Utils/Point.d.ts +3 -0
  536. package/browser/Utils/Point.js +3 -0
  537. package/browser/Utils/QuadTree.d.ts +3 -0
  538. package/browser/Utils/QuadTree.js +3 -0
  539. package/browser/Utils/Range.d.ts +3 -0
  540. package/browser/Utils/Range.js +3 -0
  541. package/browser/Utils/Rectangle.d.ts +3 -0
  542. package/browser/Utils/Rectangle.js +3 -0
  543. package/browser/Utils/Utils.d.ts +6 -2
  544. package/browser/Utils/Utils.js +14 -0
  545. package/browser/full.d.ts +1 -1
  546. package/browser/full.js +14 -6
  547. package/browser/index.d.ts +1 -2
  548. package/browser/index.js +2 -2
  549. package/browser/index.slim.d.ts +1 -2
  550. package/browser/index.slim.js +3 -2
  551. package/browser/main.d.ts +103 -10
  552. package/browser/main.js +114 -11
  553. package/browser/pjs.d.ts +27 -0
  554. package/browser/pjs.js +23 -0
  555. package/browser/slim.d.ts +1 -1
  556. package/browser/slim.js +39 -47
  557. package/esm/Core/Canvas.js +4 -6
  558. package/esm/Core/Container.d.ts +4 -2
  559. package/esm/Core/Container.js +21 -12
  560. package/esm/Core/Loader.d.ts +19 -4
  561. package/esm/Core/Loader.js +80 -18
  562. package/esm/Enums/Modes/ResponsiveMode.d.ts +4 -0
  563. package/esm/Enums/Modes/ResponsiveMode.js +5 -0
  564. package/esm/Enums/Modes/index.d.ts +1 -0
  565. package/esm/Enums/Modes/index.js +1 -0
  566. package/esm/Interactions/External/Attract/index.d.ts +1 -1
  567. package/esm/Interactions/External/Attract/index.js +2 -2
  568. package/esm/Interactions/External/Bounce/index.d.ts +1 -1
  569. package/esm/Interactions/External/Bounce/index.js +2 -2
  570. package/esm/Interactions/External/Bubble/index.d.ts +1 -1
  571. package/esm/Interactions/External/Bubble/index.js +2 -2
  572. package/esm/Interactions/External/Connect/index.d.ts +1 -1
  573. package/esm/Interactions/External/Connect/index.js +2 -2
  574. package/esm/Interactions/External/Grab/index.d.ts +1 -1
  575. package/esm/Interactions/External/Grab/index.js +2 -2
  576. package/esm/Interactions/External/Repulse/index.d.ts +1 -1
  577. package/esm/Interactions/External/Repulse/index.js +2 -2
  578. package/esm/Interactions/External/Trail/index.d.ts +1 -1
  579. package/esm/Interactions/External/Trail/index.js +2 -2
  580. package/esm/Interactions/Particles/Attract/index.d.ts +1 -1
  581. package/esm/Interactions/Particles/Attract/index.js +2 -2
  582. package/esm/Interactions/Particles/Collisions/index.d.ts +1 -1
  583. package/esm/Interactions/Particles/Collisions/index.js +2 -2
  584. package/esm/Interactions/Particles/Links/index.d.ts +2 -2
  585. package/esm/Interactions/Particles/Links/index.js +5 -5
  586. package/esm/Interactions/Particles/Links/plugin.d.ts +1 -1
  587. package/esm/Interactions/Particles/Links/plugin.js +2 -2
  588. package/esm/Options/Classes/FullScreen/FullScreen.js +2 -2
  589. package/esm/Options/Classes/Interactivity/Interactivity.js +1 -1
  590. package/esm/Options/Classes/Options.d.ts +1 -1
  591. package/esm/Options/Classes/Options.js +6 -3
  592. package/esm/Options/Classes/Responsive.d.ts +2 -0
  593. package/esm/Options/Classes/Responsive.js +10 -0
  594. package/esm/Options/Interfaces/IResponsive.d.ts +2 -0
  595. package/esm/Plugins/Absorbers/plugin.d.ts +1 -1
  596. package/esm/Plugins/Absorbers/plugin.js +2 -2
  597. package/esm/Plugins/Emitters/plugin.d.ts +1 -1
  598. package/esm/Plugins/Emitters/plugin.js +2 -2
  599. package/esm/Plugins/PolygonMask/plugin.js +1 -1
  600. package/esm/Shapes/Circle/index.d.ts +1 -1
  601. package/esm/Shapes/Circle/index.js +2 -2
  602. package/esm/Shapes/Image/index.d.ts +1 -1
  603. package/esm/Shapes/Image/index.js +3 -3
  604. package/esm/Shapes/Line/index.d.ts +1 -1
  605. package/esm/Shapes/Line/index.js +2 -2
  606. package/esm/Shapes/Polygon/index.d.ts +3 -3
  607. package/esm/Shapes/Polygon/index.js +7 -7
  608. package/esm/Shapes/Square/index.d.ts +1 -1
  609. package/esm/Shapes/Square/index.js +3 -3
  610. package/esm/Shapes/Star/index.d.ts +1 -1
  611. package/esm/Shapes/Star/index.js +2 -2
  612. package/esm/Shapes/Text/index.d.ts +1 -1
  613. package/esm/Shapes/Text/index.js +2 -2
  614. package/esm/Updaters/Angle/index.d.ts +1 -1
  615. package/esm/Updaters/Angle/index.js +2 -2
  616. package/esm/Updaters/Color/index.d.ts +1 -1
  617. package/esm/Updaters/Color/index.js +2 -2
  618. package/esm/Updaters/Life/index.d.ts +1 -1
  619. package/esm/Updaters/Life/index.js +2 -2
  620. package/esm/Updaters/Opacity/index.d.ts +1 -1
  621. package/esm/Updaters/Opacity/index.js +2 -2
  622. package/esm/Updaters/OutModes/index.d.ts +1 -1
  623. package/esm/Updaters/OutModes/index.js +2 -2
  624. package/esm/Updaters/Roll/index.d.ts +1 -1
  625. package/esm/Updaters/Roll/index.js +2 -2
  626. package/esm/Updaters/Size/index.d.ts +1 -1
  627. package/esm/Updaters/Size/index.js +2 -2
  628. package/esm/Updaters/StrokeColor/index.d.ts +1 -1
  629. package/esm/Updaters/StrokeColor/index.js +2 -2
  630. package/esm/Updaters/Tilt/index.d.ts +1 -1
  631. package/esm/Updaters/Tilt/index.js +2 -2
  632. package/esm/Updaters/Wobble/index.d.ts +1 -1
  633. package/esm/Updaters/Wobble/index.js +2 -2
  634. package/esm/Utils/Utils.d.ts +1 -2
  635. package/esm/full.d.ts +1 -1
  636. package/esm/full.js +14 -6
  637. package/esm/index.d.ts +1 -2
  638. package/esm/index.js +2 -2
  639. package/esm/index.slim.d.ts +1 -2
  640. package/esm/index.slim.js +2 -2
  641. package/esm/main.d.ts +11 -10
  642. package/esm/main.js +18 -7
  643. package/esm/slim.d.ts +1 -1
  644. package/esm/slim.js +39 -47
  645. package/full.d.ts +1 -1
  646. package/full.js +14 -6
  647. package/index.d.ts +1 -2
  648. package/index.js +2 -3
  649. package/index.slim.d.ts +1 -2
  650. package/index.slim.js +2 -3
  651. package/main.d.ts +11 -10
  652. package/main.js +18 -7
  653. package/package.json +1 -1
  654. package/report.html +2 -2
  655. package/report.slim.html +2 -2
  656. package/slim.d.ts +1 -1
  657. package/slim.js +39 -47
  658. package/tsparticles.js +10262 -13560
  659. package/tsparticles.min.js +2 -2
  660. package/tsparticles.pathseg.js +1472 -0
  661. package/tsparticles.slim.js +8305 -11259
  662. package/tsparticles.slim.min.js +2 -2
  663. package/167.js +0 -1779
@@ -1,8 +1,17 @@
1
1
  import type { IDrawStroke } from "./IDrawStroke";
2
2
  import type { IColor } from "../../../../Core/Interfaces/Colors";
3
+ /**
4
+ * @category Polygon Mask Plugin
5
+ */
3
6
  export interface IDraw {
4
7
  enable: boolean;
8
+ /**
9
+ * @deprecated the property lineColor is deprecated, please use the new stroke.color property
10
+ */
5
11
  lineColor: string | IColor;
12
+ /**
13
+ * @deprecated the property lineColor is deprecated, please use the new stroke.width property
14
+ */
6
15
  lineWidth: number;
7
16
  stroke: IDrawStroke;
8
17
  }
@@ -1,4 +1,7 @@
1
1
  import type { IColor } from "../../../../Core/Interfaces/Colors";
2
+ /**
3
+ * @category Polygon Mask Plugin
4
+ */
2
5
  export interface IDrawStroke {
3
6
  color: string | IColor;
4
7
  width: number;
@@ -1,4 +1,7 @@
1
1
  import type { InlineArrangement, InlineArrangementAlt } from "../../Enums";
2
+ /**
3
+ * @category Polygon Mask Plugin
4
+ */
2
5
  export interface IInline {
3
6
  arrangement: InlineArrangement | keyof typeof InlineArrangement | InlineArrangementAlt;
4
7
  }
@@ -1,5 +1,8 @@
1
1
  import type { SingleOrMultiple } from "../../../../Types";
2
2
  import type { IDimension } from "../../../../Core/Interfaces/IDimension";
3
+ /**
4
+ * @category Polygon Mask Plugin
5
+ */
3
6
  export interface ILocalSvg {
4
7
  path: SingleOrMultiple<string>;
5
8
  size: IDimension;
@@ -1,4 +1,7 @@
1
1
  import type { MoveType } from "../../Enums";
2
+ /**
3
+ * @category Polygon Mask Plugin
4
+ */
2
5
  export interface IMove {
3
6
  radius: number;
4
7
  type: MoveType | keyof typeof MoveType;
@@ -5,10 +5,17 @@ import type { IInline } from "./IInline";
5
5
  import type { ICoordinates } from "../../../../Core/Interfaces/ICoordinates";
6
6
  import type { ILocalSvg } from "./ILocalSvg";
7
7
  import { Type } from "../../Enums";
8
+ /**
9
+ * [[include:Options/Plugins/PolygonMask.md]]
10
+ * @category Polygon Mask Plugin
11
+ */
8
12
  export interface IPolygonMask {
9
13
  draw: IDraw;
10
14
  enable: boolean;
11
15
  inline: IInline;
16
+ /**
17
+ * @deprecated the inlineArrangement is deprecated, please use the new inline.arrangement property
18
+ */
12
19
  inlineArrangement: InlineArrangement | keyof typeof InlineArrangement | InlineArrangementAlt;
13
20
  move: IMove;
14
21
  position?: ICoordinates;
@@ -1,4 +1,7 @@
1
1
  import type { IPolygonMask } from "./IPolygonMask";
2
+ /**
3
+ * @category Polygon Mask Plugin
4
+ */
2
5
  export interface IPolygonMaskOptions {
3
6
  polygon: IPolygonMask;
4
7
  }
@@ -6,6 +6,10 @@ import type { RecursivePartial } from "../../Types";
6
6
  import { PolygonMask } from "./Options/Classes/PolygonMask";
7
7
  import { OutModeDirection } from "../../Enums";
8
8
  import type { IPolygonMaskOptions } from "./types";
9
+ /**
10
+ * Polygon Mask manager
11
+ * @category Polygon Mask Plugin
12
+ */
9
13
  export declare class PolygonMaskInstance implements IContainerPlugin {
10
14
  private readonly container;
11
15
  redrawTimeout?: number;
@@ -28,6 +32,14 @@ export declare class PolygonMaskInstance implements IContainerPlugin {
28
32
  private polygonBounce;
29
33
  private checkInsidePolygon;
30
34
  private parseSvgPath;
35
+ /**
36
+ * Deprecate SVGPathElement.getPathSegAtLength removed in:
37
+ * Chrome for desktop release 62
38
+ * Chrome for Android release 62
39
+ * Android WebView release 62
40
+ * Opera release 49
41
+ * Opera for Android release 49
42
+ */
31
43
  private downloadSvgPath;
32
44
  private drawPoints;
33
45
  private randomPoint;
@@ -3,6 +3,10 @@ import { Constants, deepExtend, getDistance, getDistances, itemFromArray } from
3
3
  import { PolygonMask } from "./Options/Classes/PolygonMask";
4
4
  import { OutModeDirection } from "../../Enums";
5
5
  import { calcClosestPtOnSegment, drawPolygonMask, drawPolygonMaskPath, parsePaths, segmentBounce } from "./utils";
6
+ /**
7
+ * Polygon Mask manager
8
+ * @category Polygon Mask Plugin
9
+ */
6
10
  export class PolygonMaskInstance {
7
11
  constructor(container) {
8
12
  this.container = container;
@@ -18,6 +22,7 @@ export class PolygonMaskInstance {
18
22
  this.options.load(options === null || options === void 0 ? void 0 : options.polygon);
19
23
  const polygonMaskOptions = this.options;
20
24
  this.polygonMaskMoveRadius = polygonMaskOptions.move.radius * this.container.retina.pixelRatio;
25
+ /* If is set the url of svg element, load it and parse into raw polygon data */
21
26
  if (polygonMaskOptions.enable) {
22
27
  await this.initRawData();
23
28
  }
@@ -143,6 +148,9 @@ export class PolygonMaskInstance {
143
148
  if (!options.enable || options.type === Type.none || options.type === Type.inline) {
144
149
  return true;
145
150
  }
151
+ // https://github.com/substack/point-in-polygon
152
+ // ray-casting algorithm based on
153
+ // http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html
146
154
  if (!this.raw) {
147
155
  throw new Error(Constants.noPolygonFound);
148
156
  }
@@ -150,6 +158,9 @@ export class PolygonMaskInstance {
150
158
  const x = (_a = position === null || position === void 0 ? void 0 : position.x) !== null && _a !== void 0 ? _a : Math.random() * canvasSize.width;
151
159
  const y = (_b = position === null || position === void 0 ? void 0 : position.y) !== null && _b !== void 0 ? _b : Math.random() * canvasSize.height;
152
160
  let inside = false;
161
+ // if (this.path2DSupported && this.polygonPath && position) {
162
+ // inside = container.canvas.isPointInPath(this.polygonPath, position);
163
+ // } else {
153
164
  for (let i = 0, j = this.raw.length - 1; i < this.raw.length; j = i++) {
154
165
  const pi = this.raw[i];
155
166
  const pj = this.raw[j];
@@ -158,6 +169,7 @@ export class PolygonMaskInstance {
158
169
  inside = !inside;
159
170
  }
160
171
  }
172
+ // }
161
173
  return options.type === Type.inside ? inside : options.type === Type.outside ? !inside : false;
162
174
  }
163
175
  parseSvgPath(xml, force) {
@@ -193,16 +205,26 @@ export class PolygonMaskInstance {
193
205
  x: 50,
194
206
  y: 50,
195
207
  };
208
+ /* centering of the polygon mask */
196
209
  this.offset = {
197
210
  x: (container.canvas.size.width * position.x) / (100 * pxRatio) - this.dimension.width / 2,
198
211
  y: (container.canvas.size.height * position.y) / (100 * pxRatio) - this.dimension.height / 2,
199
212
  };
200
213
  return parsePaths(this.paths, scale, this.offset);
201
214
  }
215
+ /**
216
+ * Deprecate SVGPathElement.getPathSegAtLength removed in:
217
+ * Chrome for desktop release 62
218
+ * Chrome for Android release 62
219
+ * Android WebView release 62
220
+ * Opera release 49
221
+ * Opera for Android release 49
222
+ */
202
223
  async downloadSvgPath(svgUrl, force) {
203
224
  const options = this.options;
204
225
  const url = svgUrl || options.url;
205
226
  const forceDownload = force !== null && force !== void 0 ? force : false;
227
+ // Load SVG from file on server
206
228
  if (!url || (this.paths !== undefined && !forceDownload)) {
207
229
  return this.raw;
208
230
  }
@@ -1,10 +1,20 @@
1
1
  "use strict";
2
+ // SVGPathSeg API polyfill
3
+ // https://github.com/progers/pathseg
4
+ //
5
+ // This is a drop-in replacement for the SVGPathSeg and SVGPathSegList APIs that were removed from
6
+ // SVG2 (https://lists.w3.org/Archives/Public/www-svg/2015Jun/0044.html), including the latest spec
7
+ // changes which were implemented in Firefox 43 and Chrome 46.
2
8
  (function () {
3
9
  "use strict";
4
10
  try {
11
+ // The polyfill only applies to browser environments with a `window` object
12
+ // (i.e. not node.js, workers, etc.). If included in one of these
13
+ // environments (such as when using 'react-dom/server'), simply return out
5
14
  if (typeof window === "undefined")
6
15
  return;
7
16
  if (!("SVGPathSeg" in window)) {
17
+ // Spec: http://www.w3.org/TR/SVG11/single-page.html#paths-InterfaceSVGPathSeg
8
18
  window.SVGPathSeg = function (type, typeAsLetter, owningPathSegList) {
9
19
  this.pathSegType = type;
10
20
  this.pathSegTypeAsLetter = typeAsLetter;
@@ -31,6 +41,7 @@
31
41
  window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL = 17;
32
42
  window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS = 18;
33
43
  window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL = 19;
44
+ // Notify owning PathSegList on any changes so they can be synchronized back to the path element.
34
45
  window.SVGPathSeg.prototype._segmentChanged = function () {
35
46
  if (this._owningPathSegList)
36
47
  this._owningPathSegList.segmentChanged(this);
@@ -972,6 +983,8 @@
972
983
  },
973
984
  enumerable: true,
974
985
  });
986
+ // Add createSVGPathSeg* functions to window.SVGPathElement.
987
+ // Spec: http://www.w3.org/TR/SVG11/single-page.html#paths-Interfacewindow.SVGPathElement.
975
988
  window.SVGPathElement.prototype.createSVGPathSegClosePath = function () {
976
989
  return new window.SVGPathSegClosePath(undefined);
977
990
  };
@@ -1030,12 +1043,16 @@
1030
1043
  return new window.SVGPathSegCurvetoQuadraticSmoothRel(undefined, x, y);
1031
1044
  };
1032
1045
  if (!("getPathSegAtLength" in window.SVGPathElement.prototype)) {
1046
+ // Add getPathSegAtLength to SVGPathElement.
1047
+ // Spec: https://www.w3.org/TR/SVG11/single-page.html#paths-__svg__SVGPathElement__getPathSegAtLength
1048
+ // This polyfill requires SVGPathElement.getTotalLength to implement the distance-along-a-path algorithm.
1033
1049
  window.SVGPathElement.prototype.getPathSegAtLength = function (distance) {
1034
1050
  if (distance === undefined || !isFinite(distance))
1035
1051
  throw "Invalid arguments.";
1036
1052
  var measurementElement = document.createElementNS("http://www.w3.org/2000/svg", "path");
1037
1053
  measurementElement.setAttribute("d", this.getAttribute("d"));
1038
1054
  var lastPathSegment = measurementElement.pathSegList.numberOfItems - 1;
1055
+ // If the path is empty, return 0.
1039
1056
  if (lastPathSegment <= 0)
1040
1057
  return 0;
1041
1058
  do {
@@ -1048,10 +1065,17 @@
1048
1065
  };
1049
1066
  }
1050
1067
  }
1068
+ // Checking for SVGPathSegList in window checks for the case of an implementation without the
1069
+ // SVGPathSegList API.
1070
+ // The second check for appendItem is specific to Firefox 59+ which removed only parts of the
1071
+ // SVGPathSegList API (e.g., appendItem). In this case we need to re-implement the entire API
1072
+ // so the polyfill data (i.e., _list) is used throughout.
1051
1073
  if (!("SVGPathSegList" in window) || !("appendItem" in window.SVGPathSegList.prototype)) {
1074
+ // Spec: http://www.w3.org/TR/SVG11/single-page.html#paths-InterfaceSVGPathSegList
1052
1075
  window.SVGPathSegList = function (pathElement) {
1053
1076
  this._pathElement = pathElement;
1054
1077
  this._list = this._parsePath(this._pathElement.getAttribute("d"));
1078
+ // Use a MutationObserver to catch changes to the path's "d" attribute.
1055
1079
  this._mutationObserverConfig = { attributes: true, attributeFilter: ["d"] };
1056
1080
  this._pathElementMutationObserver = new MutationObserver(this._updateListFromPathMutations.bind(this));
1057
1081
  this._pathElementMutationObserver.observe(this._pathElement, this._mutationObserverConfig);
@@ -1064,6 +1088,7 @@
1064
1088
  },
1065
1089
  enumerable: true,
1066
1090
  });
1091
+ // The length property was not specified but was in Firefox 58.
1067
1092
  Object.defineProperty(window.SVGPathSegList.prototype, "length", {
1068
1093
  get: function () {
1069
1094
  this._checkPathSynchronizedToList();
@@ -1071,6 +1096,8 @@
1071
1096
  },
1072
1097
  enumerable: true,
1073
1098
  });
1099
+ // Add the pathSegList accessors to window.SVGPathElement.
1100
+ // Spec: http://www.w3.org/TR/SVG11/single-page.html#paths-InterfaceSVGAnimatedPathData
1074
1101
  Object.defineProperty(window.SVGPathElement.prototype, "pathSegList", {
1075
1102
  get: function () {
1076
1103
  if (!this._pathSegList)
@@ -1079,6 +1106,7 @@
1079
1106
  },
1080
1107
  enumerable: true,
1081
1108
  });
1109
+ // FIXME: The following are not implemented and simply return window.SVGPathElement.pathSegList.
1082
1110
  Object.defineProperty(window.SVGPathElement.prototype, "normalizedPathSegList", {
1083
1111
  get: function () {
1084
1112
  return this.pathSegList;
@@ -1097,6 +1125,9 @@
1097
1125
  },
1098
1126
  enumerable: true,
1099
1127
  });
1128
+ // Process any pending mutations to the path element and update the list as needed.
1129
+ // This should be the first call of all public functions and is needed because
1130
+ // MutationObservers are not synchronous so we can have pending asynchronous mutations.
1100
1131
  window.SVGPathSegList.prototype._checkPathSynchronizedToList = function () {
1101
1132
  this._updateListFromPathMutations(this._pathElementMutationObserver.takeRecords());
1102
1133
  };
@@ -1111,11 +1142,13 @@
1111
1142
  if (hasPathMutations)
1112
1143
  this._list = this._parsePath(this._pathElement.getAttribute("d"));
1113
1144
  };
1145
+ // Serialize the list and update the path's 'd' attribute.
1114
1146
  window.SVGPathSegList.prototype._writeListToPath = function () {
1115
1147
  this._pathElementMutationObserver.disconnect();
1116
1148
  this._pathElement.setAttribute("d", window.SVGPathSegList._pathSegArrayAsString(this._list));
1117
1149
  this._pathElementMutationObserver.observe(this._pathElement, this._mutationObserverConfig);
1118
1150
  };
1151
+ // When a path segment changes the list needs to be synchronized back to the path element.
1119
1152
  window.SVGPathSegList.prototype.segmentChanged = function (pathSeg) {
1120
1153
  this._writeListToPath();
1121
1154
  };
@@ -1145,9 +1178,11 @@
1145
1178
  };
1146
1179
  window.SVGPathSegList.prototype.insertItemBefore = function (newItem, index) {
1147
1180
  this._checkPathSynchronizedToList();
1181
+ // Spec: If the index is greater than or equal to numberOfItems, then the new item is appended to the end of the list.
1148
1182
  if (index > this.numberOfItems)
1149
1183
  index = this.numberOfItems;
1150
1184
  if (newItem._owningPathSegList) {
1185
+ // SVG2 spec says to make a copy.
1151
1186
  newItem = newItem.clone();
1152
1187
  }
1153
1188
  this._list.splice(index, 0, newItem);
@@ -1158,6 +1193,7 @@
1158
1193
  window.SVGPathSegList.prototype.replaceItem = function (newItem, index) {
1159
1194
  this._checkPathSynchronizedToList();
1160
1195
  if (newItem._owningPathSegList) {
1196
+ // SVG2 spec says to make a copy.
1161
1197
  newItem = newItem.clone();
1162
1198
  }
1163
1199
  this._checkValidIndex(index);
@@ -1177,10 +1213,12 @@
1177
1213
  window.SVGPathSegList.prototype.appendItem = function (newItem) {
1178
1214
  this._checkPathSynchronizedToList();
1179
1215
  if (newItem._owningPathSegList) {
1216
+ // SVG2 spec says to make a copy.
1180
1217
  newItem = newItem.clone();
1181
1218
  }
1182
1219
  this._list.push(newItem);
1183
1220
  newItem._owningPathSegList = this;
1221
+ // TODO: Optimize this to just append to the existing attribute.
1184
1222
  this._writeListToPath();
1185
1223
  return newItem;
1186
1224
  };
@@ -1198,6 +1236,7 @@
1198
1236
  });
1199
1237
  return string;
1200
1238
  };
1239
+ // This closely follows SVGPathParser::parsePath from Source/core/svg/SVGPathParser.cpp.
1201
1240
  window.SVGPathSegList.prototype._parsePath = function (string) {
1202
1241
  if (!string || string.length == 0)
1203
1242
  return [];
@@ -1291,6 +1330,7 @@
1291
1330
  }
1292
1331
  };
1293
1332
  Source.prototype._nextCommandHelper = function (lookahead, previousCommand) {
1333
+ // Check for remaining coordinates in the current command.
1294
1334
  if ((lookahead == "+" || lookahead == "-" || lookahead == "." || (lookahead >= "0" && lookahead <= "9")) &&
1295
1335
  previousCommand != window.SVGPathSeg.PATHSEG_CLOSEPATH) {
1296
1336
  if (previousCommand == window.SVGPathSeg.PATHSEG_MOVETO_ABS)
@@ -1302,11 +1342,15 @@
1302
1342
  return window.SVGPathSeg.PATHSEG_UNKNOWN;
1303
1343
  };
1304
1344
  Source.prototype.initialCommandIsMoveTo = function () {
1345
+ // If the path is empty it is still valid, so return true.
1305
1346
  if (!this.hasMoreData())
1306
1347
  return true;
1307
1348
  var command = this.peekSegmentType();
1349
+ // Path must start with moveTo.
1308
1350
  return command == window.SVGPathSeg.PATHSEG_MOVETO_ABS || command == window.SVGPathSeg.PATHSEG_MOVETO_REL;
1309
1351
  };
1352
+ // Parse a number from an SVG path. This very closely follows genericParseNumber(...) from Source/core/svg/SVGParserUtilities.cpp.
1353
+ // Spec: http://www.w3.org/TR/SVG11/single-page.html#paths-PathDataBNF
1310
1354
  Source.prototype._parseNumber = function () {
1311
1355
  var exponent = 0;
1312
1356
  var integer = 0;
@@ -1316,6 +1360,7 @@
1316
1360
  var expsign = 1;
1317
1361
  var startIndex = this._currentIndex;
1318
1362
  this._skipOptionalSpaces();
1363
+ // Read the sign.
1319
1364
  if (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) == "+")
1320
1365
  this._currentIndex++;
1321
1366
  else if (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) == "-") {
@@ -1325,12 +1370,14 @@
1325
1370
  if (this._currentIndex == this._endIndex ||
1326
1371
  ((this._string.charAt(this._currentIndex) < "0" || this._string.charAt(this._currentIndex) > "9") &&
1327
1372
  this._string.charAt(this._currentIndex) != "."))
1373
+ // The first character of a number must be one of [0-9+-.].
1328
1374
  return undefined;
1375
+ // Read the integer part, build right-to-left.
1329
1376
  var startIntPartIndex = this._currentIndex;
1330
1377
  while (this._currentIndex < this._endIndex &&
1331
1378
  this._string.charAt(this._currentIndex) >= "0" &&
1332
1379
  this._string.charAt(this._currentIndex) <= "9")
1333
- this._currentIndex++;
1380
+ this._currentIndex++; // Advance to first non-digit.
1334
1381
  if (this._currentIndex != startIntPartIndex) {
1335
1382
  var scanIntPartIndex = this._currentIndex - 1;
1336
1383
  var multiplier = 1;
@@ -1339,8 +1386,10 @@
1339
1386
  multiplier *= 10;
1340
1387
  }
1341
1388
  }
1389
+ // Read the decimals.
1342
1390
  if (this._currentIndex < this._endIndex && this._string.charAt(this._currentIndex) == ".") {
1343
1391
  this._currentIndex++;
1392
+ // There must be a least one digit following the .
1344
1393
  if (this._currentIndex >= this._endIndex ||
1345
1394
  this._string.charAt(this._currentIndex) < "0" ||
1346
1395
  this._string.charAt(this._currentIndex) > "9")
@@ -1353,12 +1402,14 @@
1353
1402
  this._currentIndex += 1;
1354
1403
  }
1355
1404
  }
1405
+ // Read the exponent part.
1356
1406
  if (this._currentIndex != startIndex &&
1357
1407
  this._currentIndex + 1 < this._endIndex &&
1358
1408
  (this._string.charAt(this._currentIndex) == "e" || this._string.charAt(this._currentIndex) == "E") &&
1359
1409
  this._string.charAt(this._currentIndex + 1) != "x" &&
1360
1410
  this._string.charAt(this._currentIndex + 1) != "m") {
1361
1411
  this._currentIndex++;
1412
+ // Read the sign of the exponent.
1362
1413
  if (this._string.charAt(this._currentIndex) == "+") {
1363
1414
  this._currentIndex++;
1364
1415
  }
@@ -1366,6 +1417,7 @@
1366
1417
  this._currentIndex++;
1367
1418
  expsign = -1;
1368
1419
  }
1420
+ // There must be an exponent.
1369
1421
  if (this._currentIndex >= this._endIndex ||
1370
1422
  this._string.charAt(this._currentIndex) < "0" ||
1371
1423
  this._string.charAt(this._currentIndex) > "9")
@@ -1405,6 +1457,7 @@
1405
1457
  var lookahead = this._string[this._currentIndex];
1406
1458
  var command = this._pathSegTypeFromChar(lookahead);
1407
1459
  if (command == window.SVGPathSeg.PATHSEG_UNKNOWN) {
1460
+ // Possibly an implicit command. Not allowed if this is the first command.
1408
1461
  if (this._previousCommand == window.SVGPathSeg.PATHSEG_UNKNOWN)
1409
1462
  return null;
1410
1463
  command = this._nextCommandHelper(lookahead, this._previousCommand);
@@ -1532,6 +1585,7 @@
1532
1585
  }
1533
1586
  }
1534
1587
  catch (e) {
1588
+ // ignore, if it's not working we can ignore errors
1535
1589
  console.warn("An error occurred in tsParticles pathseg polyfill. If the Polygon Mask is not working, please open an issue here: https://github.com/matteobruni/tsparticles", e);
1536
1590
  }
1537
1591
  })();
@@ -2,6 +2,9 @@ import { PolygonMaskInstance } from "./PolygonMaskInstance";
2
2
  import { PolygonMask } from "./Options/Classes/PolygonMask";
3
3
  import { Type } from "./Enums";
4
4
  import { isSsr } from "../../Utils";
5
+ /**
6
+ * @category Polygon Mask Plugin
7
+ */
5
8
  class Plugin {
6
9
  constructor() {
7
10
  this.id = "polygonMask";
@@ -27,8 +30,11 @@ class Plugin {
27
30
  }
28
31
  export async function loadPolygonMaskPlugin(tsParticles) {
29
32
  if (!isSsr() && !window.SVGPathSeg) {
30
- await import("./pathseg");
33
+ await import(
34
+ /* webpackChunkName: "tsparticles.pathseg" */
35
+ /* webpackMode: "lazy-once" */
36
+ "./pathseg");
31
37
  }
32
38
  const plugin = new Plugin();
33
- tsParticles.addPlugin(plugin);
39
+ await tsParticles.addPlugin(plugin);
34
40
  }
@@ -38,6 +38,9 @@ export function parsePaths(paths, scale, offset) {
38
38
  const segment = segments === null || segments === void 0 ? void 0 : segments.getItem(i);
39
39
  const svgPathSeg = window.SVGPathSeg;
40
40
  switch (segment === null || segment === void 0 ? void 0 : segment.pathSegType) {
41
+ //
42
+ // Absolute
43
+ //
41
44
  case svgPathSeg.PATHSEG_MOVETO_ABS:
42
45
  case svgPathSeg.PATHSEG_LINETO_ABS:
43
46
  case svgPathSeg.PATHSEG_CURVETO_CUBIC_ABS:
@@ -56,6 +59,9 @@ export function parsePaths(paths, scale, offset) {
56
59
  case svgPathSeg.PATHSEG_LINETO_VERTICAL_ABS:
57
60
  p.y = segment.y;
58
61
  break;
62
+ //
63
+ // Relative
64
+ //
59
65
  case svgPathSeg.PATHSEG_LINETO_REL:
60
66
  case svgPathSeg.PATHSEG_MOVETO_REL:
61
67
  case svgPathSeg.PATHSEG_CURVETO_CUBIC_REL:
@@ -76,7 +82,7 @@ export function parsePaths(paths, scale, offset) {
76
82
  break;
77
83
  case svgPathSeg.PATHSEG_UNKNOWN:
78
84
  case svgPathSeg.PATHSEG_CLOSEPATH:
79
- continue;
85
+ continue; // Skip the closing path (and the UNKNOWN)
80
86
  }
81
87
  res.push({
82
88
  x: p.x * scale + offset.x,
@@ -87,11 +93,17 @@ export function parsePaths(paths, scale, offset) {
87
93
  return res;
88
94
  }
89
95
  export function calcClosestPtOnSegment(s1, s2, pos) {
96
+ // calc delta distance: source point to line start
90
97
  const { dx, dy } = getDistances(pos, s1);
98
+ // calc delta distance: line start to end
91
99
  const { dx: dxx, dy: dyy } = getDistances(s2, s1);
100
+ // Calc position on line normalized between 0.00 & 1.00
101
+ // == dot product divided by delta line distances squared
92
102
  const t = (dx * dxx + dy * dyy) / (dxx ** 2 + dyy ** 2);
103
+ // calc nearest pt on line
93
104
  let x = s1.x + dxx * t;
94
105
  let y = s1.y + dyy * t;
106
+ // clamp results to being on the segment
95
107
  if (t < 0) {
96
108
  x = s1.x;
97
109
  y = s1.y;
@@ -104,7 +116,7 @@ export function calcClosestPtOnSegment(s1, s2, pos) {
104
116
  }
105
117
  export function segmentBounce(start, stop, velocity) {
106
118
  const { dx, dy } = getDistances(start, stop);
107
- const wallAngle = Math.atan2(dy, dx);
119
+ const wallAngle = Math.atan2(dy, dx); // + Math.PI / 2;
108
120
  const wallNormalX = Math.sin(wallAngle);
109
121
  const wallNormalY = -Math.cos(wallAngle);
110
122
  const d = 2 * (velocity.x * wallNormalX + velocity.y * wallNormalY);
@@ -1,4 +1,7 @@
1
1
  import type { IParticle, IShapeDrawer } from "../../Core/Interfaces";
2
+ /**
3
+ * @category Shape Drawers
4
+ */
2
5
  export declare class CircleDrawer implements IShapeDrawer {
3
6
  getSidesCount(): number;
4
7
  draw(context: CanvasRenderingContext2D, particle: IParticle, radius: number): void;
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @category Shape Drawers
3
+ */
1
4
  export class CircleDrawer {
2
5
  getSidesCount() {
3
6
  return 12;
@@ -1,2 +1,2 @@
1
1
  import type { Main } from "../../main";
2
- export declare function loadCircleShape(tsParticles: Main): void;
2
+ export declare function loadCircleShape(tsParticles: Main): Promise<void>;
@@ -1,4 +1,4 @@
1
1
  import { CircleDrawer } from "./CircleDrawer";
2
- export function loadCircleShape(tsParticles) {
3
- tsParticles.addShape("circle", new CircleDrawer());
2
+ export async function loadCircleShape(tsParticles) {
3
+ await tsParticles.addShape("circle", new CircleDrawer());
4
4
  }
@@ -6,6 +6,9 @@ interface ContainerImage {
6
6
  id: string;
7
7
  images: IImage[];
8
8
  }
9
+ /**
10
+ * @category Shape Drawers
11
+ */
9
12
  export declare class ImageDrawer implements IShapeDrawer {
10
13
  #private;
11
14
  constructor();
@@ -13,6 +13,9 @@ var _ImageDrawer_images;
13
13
  import { isInArray } from "../../Utils";
14
14
  import { ShapeType } from "../../Enums";
15
15
  import { downloadSvgImage, loadImage, replaceColorSvg } from "./Utils";
16
+ /**
17
+ * @category Shape Drawers
18
+ */
16
19
  export class ImageDrawer {
17
20
  constructor() {
18
21
  _ImageDrawer_images.set(this, void 0);
@@ -151,9 +154,11 @@ export class ImageDrawer {
151
154
  }
152
155
  if (image.svgData !== undefined && imageData.replaceColor && color) {
153
156
  const svgColoredData = replaceColorSvg(image, color, (_c = (_b = particle.opacity) === null || _b === void 0 ? void 0 : _b.value) !== null && _c !== void 0 ? _c : 1);
157
+ /* prepare to create img with colored svg */
154
158
  const svg = new Blob([svgColoredData], { type: "image/svg+xml" });
155
159
  const domUrl = URL || window.URL || window.webkitURL || window;
156
160
  const url = domUrl.createObjectURL(svg);
161
+ /* create particle img obj */
157
162
  const img = new Image();
158
163
  imageRes = {
159
164
  data: Object.assign(Object.assign({}, image), { svgData: svgColoredData }),
@@ -171,6 +176,7 @@ export class ImageDrawer {
171
176
  });
172
177
  img.addEventListener("error", () => {
173
178
  domUrl.revokeObjectURL(url);
179
+ // deepcode ignore PromiseNotCaughtGeneral: catch can be ignored
174
180
  loadImage(imageData.src).then((img2) => {
175
181
  const pImage = particle.image;
176
182
  if (pImage) {
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @category Interfaces
3
+ */
1
4
  import type { IHsl, IParticle } from "../../Core/Interfaces";
2
5
  export interface IImage {
3
6
  source: string;
@@ -43,6 +43,7 @@ export function replaceColorSvg(imageShape, color, opacity) {
43
43
  if (!svgData) {
44
44
  return "";
45
45
  }
46
+ /* set color to svg element */
46
47
  if (svgData.includes("fill")) {
47
48
  const currentColor = /(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d.]+%?\))|currentcolor/gi;
48
49
  return svgData.replace(currentColor, () => getStyleFromHsl(color, opacity));
@@ -1,2 +1,2 @@
1
1
  import type { Main } from "../../main";
2
- export declare function loadImageShape(tsParticles: Main): void;
2
+ export declare function loadImageShape(tsParticles: Main): Promise<void>;
@@ -1,6 +1,6 @@
1
1
  import { ImageDrawer } from "./ImageDrawer";
2
- export function loadImageShape(tsParticles) {
2
+ export async function loadImageShape(tsParticles) {
3
3
  const imageDrawer = new ImageDrawer();
4
- tsParticles.addShape("image", imageDrawer);
5
- tsParticles.addShape("images", imageDrawer);
4
+ await tsParticles.addShape("image", imageDrawer);
5
+ await tsParticles.addShape("images", imageDrawer);
6
6
  }
@@ -1,4 +1,7 @@
1
1
  import { IParticle, IShapeDrawer } from "../../Core/Interfaces";
2
+ /**
3
+ * @category Shape Drawers
4
+ */
2
5
  export declare class LineDrawer implements IShapeDrawer {
3
6
  getSidesCount(): number;
4
7
  draw(context: CanvasRenderingContext2D, particle: IParticle, radius: number): void;
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @category Shape Drawers
3
+ */
1
4
  export class LineDrawer {
2
5
  getSidesCount() {
3
6
  return 1;
@@ -1,2 +1,2 @@
1
1
  import type { Main } from "../../main";
2
- export declare function loadLineShape(tsParticles: Main): void;
2
+ export declare function loadLineShape(tsParticles: Main): Promise<void>;
@@ -1,4 +1,4 @@
1
1
  import { LineDrawer } from "./LineDrawer";
2
- export function loadLineShape(tsParticles) {
3
- tsParticles.addShape("line", new LineDrawer());
2
+ export async function loadLineShape(tsParticles) {
3
+ await tsParticles.addShape("line", new LineDrawer());
4
4
  }