tsparticles 1.36.0 → 1.37.3

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 (299) hide show
  1. package/Core/Container.d.ts +3 -1
  2. package/Core/Container.js +16 -11
  3. package/Core/InteractionManager.d.ts +1 -0
  4. package/Core/InteractionManager.js +4 -1
  5. package/Core/Particles.d.ts +1 -1
  6. package/Core/Particles.js +3 -1
  7. package/Enums/Modes/ResponsiveMode.d.ts +4 -0
  8. package/Enums/Modes/ResponsiveMode.js +8 -0
  9. package/Enums/Modes/index.d.ts +1 -0
  10. package/Enums/Modes/index.js +1 -0
  11. package/Interactions/External/Attract/index.d.ts +1 -1
  12. package/Interactions/External/Attract/index.js +2 -2
  13. package/Interactions/External/Bounce/index.d.ts +1 -1
  14. package/Interactions/External/Bounce/index.js +2 -2
  15. package/Interactions/External/Bubble/index.d.ts +1 -1
  16. package/Interactions/External/Bubble/index.js +2 -2
  17. package/Interactions/External/Connect/index.d.ts +1 -1
  18. package/Interactions/External/Connect/index.js +2 -2
  19. package/Interactions/External/Grab/index.d.ts +1 -1
  20. package/Interactions/External/Grab/index.js +2 -2
  21. package/Interactions/External/Repulse/index.d.ts +1 -1
  22. package/Interactions/External/Repulse/index.js +2 -2
  23. package/Interactions/External/Trail/index.d.ts +1 -1
  24. package/Interactions/External/Trail/index.js +2 -2
  25. package/Interactions/Particles/Attract/index.d.ts +1 -1
  26. package/Interactions/Particles/Attract/index.js +2 -2
  27. package/Interactions/Particles/Collisions/index.d.ts +1 -1
  28. package/Interactions/Particles/Collisions/index.js +2 -2
  29. package/Interactions/Particles/Links/index.d.ts +2 -2
  30. package/Interactions/Particles/Links/index.js +5 -5
  31. package/Interactions/Particles/Links/plugin.d.ts +1 -1
  32. package/Interactions/Particles/Links/plugin.js +2 -2
  33. package/Options/Classes/FullScreen/FullScreen.js +2 -2
  34. package/Options/Classes/Interactivity/Interactivity.js +1 -1
  35. package/Options/Classes/Options.js +3 -1
  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/AbsorberInstance.d.ts +2 -1
  40. package/Plugins/Absorbers/AbsorberInstance.js +21 -9
  41. package/Plugins/Absorbers/Options/Classes/AbsorberSize.d.ts +2 -1
  42. package/Plugins/Absorbers/Options/Classes/AbsorberSize.js +6 -4
  43. package/Plugins/Absorbers/Options/Classes/AbsorberSizeLimit.d.ts +9 -0
  44. package/Plugins/Absorbers/Options/Classes/AbsorberSizeLimit.js +21 -0
  45. package/Plugins/Absorbers/Options/Interfaces/IAbsorberSize.d.ts +3 -2
  46. package/Plugins/Absorbers/Options/Interfaces/IAbsorberSizeLimit.d.ts +4 -0
  47. package/Plugins/Absorbers/Options/Interfaces/IAbsorberSizeLimit.js +2 -0
  48. package/Plugins/Absorbers/plugin.d.ts +1 -1
  49. package/Plugins/Absorbers/plugin.js +2 -2
  50. package/Plugins/Emitters/plugin.d.ts +1 -1
  51. package/Plugins/Emitters/plugin.js +2 -2
  52. package/Plugins/PolygonMask/plugin.js +1 -1
  53. package/Shapes/Circle/index.d.ts +1 -1
  54. package/Shapes/Circle/index.js +2 -2
  55. package/Shapes/Image/index.d.ts +1 -1
  56. package/Shapes/Image/index.js +3 -3
  57. package/Shapes/Line/index.d.ts +1 -1
  58. package/Shapes/Line/index.js +2 -2
  59. package/Shapes/Polygon/index.d.ts +3 -3
  60. package/Shapes/Polygon/index.js +7 -7
  61. package/Shapes/Square/index.d.ts +1 -1
  62. package/Shapes/Square/index.js +3 -3
  63. package/Shapes/Star/index.d.ts +1 -1
  64. package/Shapes/Star/index.js +2 -2
  65. package/Shapes/Text/index.d.ts +1 -1
  66. package/Shapes/Text/index.js +2 -2
  67. package/Updaters/Angle/index.d.ts +1 -1
  68. package/Updaters/Angle/index.js +2 -2
  69. package/Updaters/Color/index.d.ts +1 -1
  70. package/Updaters/Color/index.js +2 -2
  71. package/Updaters/Life/index.d.ts +1 -1
  72. package/Updaters/Life/index.js +2 -2
  73. package/Updaters/Opacity/index.d.ts +1 -1
  74. package/Updaters/Opacity/index.js +2 -2
  75. package/Updaters/OutModes/index.d.ts +1 -1
  76. package/Updaters/OutModes/index.js +2 -2
  77. package/Updaters/Roll/index.d.ts +1 -1
  78. package/Updaters/Roll/index.js +2 -2
  79. package/Updaters/Size/index.d.ts +1 -1
  80. package/Updaters/Size/index.js +2 -2
  81. package/Updaters/StrokeColor/index.d.ts +1 -1
  82. package/Updaters/StrokeColor/index.js +2 -2
  83. package/Updaters/Tilt/index.d.ts +1 -1
  84. package/Updaters/Tilt/index.js +2 -2
  85. package/Updaters/Wobble/index.d.ts +1 -1
  86. package/Updaters/Wobble/index.js +2 -2
  87. package/Utils/Plugins.d.ts +2 -2
  88. package/Utils/Plugins.js +4 -4
  89. package/Utils/Utils.d.ts +1 -2
  90. package/browser/Core/Container.d.ts +3 -1
  91. package/browser/Core/Container.js +17 -12
  92. package/browser/Core/InteractionManager.d.ts +1 -0
  93. package/browser/Core/InteractionManager.js +4 -1
  94. package/browser/Core/Particles.d.ts +1 -1
  95. package/browser/Core/Particles.js +3 -1
  96. package/browser/Enums/Modes/ResponsiveMode.d.ts +4 -0
  97. package/browser/Enums/Modes/ResponsiveMode.js +5 -0
  98. package/browser/Enums/Modes/index.d.ts +1 -0
  99. package/browser/Enums/Modes/index.js +1 -0
  100. package/browser/Interactions/External/Attract/index.d.ts +1 -1
  101. package/browser/Interactions/External/Attract/index.js +2 -2
  102. package/browser/Interactions/External/Bounce/index.d.ts +1 -1
  103. package/browser/Interactions/External/Bounce/index.js +2 -2
  104. package/browser/Interactions/External/Bubble/index.d.ts +1 -1
  105. package/browser/Interactions/External/Bubble/index.js +2 -2
  106. package/browser/Interactions/External/Connect/index.d.ts +1 -1
  107. package/browser/Interactions/External/Connect/index.js +2 -2
  108. package/browser/Interactions/External/Grab/index.d.ts +1 -1
  109. package/browser/Interactions/External/Grab/index.js +2 -2
  110. package/browser/Interactions/External/Repulse/index.d.ts +1 -1
  111. package/browser/Interactions/External/Repulse/index.js +2 -2
  112. package/browser/Interactions/External/Trail/index.d.ts +1 -1
  113. package/browser/Interactions/External/Trail/index.js +2 -2
  114. package/browser/Interactions/Particles/Attract/index.d.ts +1 -1
  115. package/browser/Interactions/Particles/Attract/index.js +2 -2
  116. package/browser/Interactions/Particles/Collisions/index.d.ts +1 -1
  117. package/browser/Interactions/Particles/Collisions/index.js +2 -2
  118. package/browser/Interactions/Particles/Links/index.d.ts +2 -2
  119. package/browser/Interactions/Particles/Links/index.js +5 -5
  120. package/browser/Interactions/Particles/Links/plugin.d.ts +1 -1
  121. package/browser/Interactions/Particles/Links/plugin.js +2 -2
  122. package/browser/Options/Classes/FullScreen/FullScreen.js +2 -2
  123. package/browser/Options/Classes/Interactivity/Interactivity.js +1 -1
  124. package/browser/Options/Classes/Options.js +4 -2
  125. package/browser/Options/Classes/Responsive.d.ts +2 -0
  126. package/browser/Options/Classes/Responsive.js +11 -0
  127. package/browser/Options/Interfaces/IResponsive.d.ts +2 -0
  128. package/browser/Plugins/Absorbers/AbsorberInstance.d.ts +2 -1
  129. package/browser/Plugins/Absorbers/AbsorberInstance.js +21 -9
  130. package/browser/Plugins/Absorbers/Options/Classes/AbsorberSize.d.ts +2 -1
  131. package/browser/Plugins/Absorbers/Options/Classes/AbsorberSize.js +6 -4
  132. package/browser/Plugins/Absorbers/Options/Classes/AbsorberSizeLimit.d.ts +9 -0
  133. package/browser/Plugins/Absorbers/Options/Classes/AbsorberSizeLimit.js +17 -0
  134. package/browser/Plugins/Absorbers/Options/Interfaces/IAbsorberSize.d.ts +3 -2
  135. package/browser/Plugins/Absorbers/Options/Interfaces/IAbsorberSizeLimit.d.ts +4 -0
  136. package/browser/Plugins/Absorbers/Options/Interfaces/IAbsorberSizeLimit.js +1 -0
  137. package/browser/Plugins/Absorbers/plugin.d.ts +1 -1
  138. package/browser/Plugins/Absorbers/plugin.js +2 -2
  139. package/browser/Plugins/Emitters/plugin.d.ts +1 -1
  140. package/browser/Plugins/Emitters/plugin.js +2 -2
  141. package/browser/Plugins/PolygonMask/plugin.js +4 -2
  142. package/browser/Shapes/Circle/index.d.ts +1 -1
  143. package/browser/Shapes/Circle/index.js +2 -2
  144. package/browser/Shapes/Image/index.d.ts +1 -1
  145. package/browser/Shapes/Image/index.js +3 -3
  146. package/browser/Shapes/Line/index.d.ts +1 -1
  147. package/browser/Shapes/Line/index.js +2 -2
  148. package/browser/Shapes/Polygon/index.d.ts +3 -3
  149. package/browser/Shapes/Polygon/index.js +7 -7
  150. package/browser/Shapes/Square/index.d.ts +1 -1
  151. package/browser/Shapes/Square/index.js +3 -3
  152. package/browser/Shapes/Star/index.d.ts +1 -1
  153. package/browser/Shapes/Star/index.js +2 -2
  154. package/browser/Shapes/Text/index.d.ts +1 -1
  155. package/browser/Shapes/Text/index.js +2 -2
  156. package/browser/Updaters/Angle/index.d.ts +1 -1
  157. package/browser/Updaters/Angle/index.js +2 -2
  158. package/browser/Updaters/Color/index.d.ts +1 -1
  159. package/browser/Updaters/Color/index.js +2 -2
  160. package/browser/Updaters/Life/index.d.ts +1 -1
  161. package/browser/Updaters/Life/index.js +2 -2
  162. package/browser/Updaters/Opacity/index.d.ts +1 -1
  163. package/browser/Updaters/Opacity/index.js +2 -2
  164. package/browser/Updaters/OutModes/index.d.ts +1 -1
  165. package/browser/Updaters/OutModes/index.js +2 -2
  166. package/browser/Updaters/Roll/index.d.ts +1 -1
  167. package/browser/Updaters/Roll/index.js +2 -2
  168. package/browser/Updaters/Size/index.d.ts +1 -1
  169. package/browser/Updaters/Size/index.js +2 -2
  170. package/browser/Updaters/StrokeColor/index.d.ts +1 -1
  171. package/browser/Updaters/StrokeColor/index.js +2 -2
  172. package/browser/Updaters/Tilt/index.d.ts +1 -1
  173. package/browser/Updaters/Tilt/index.js +2 -2
  174. package/browser/Updaters/Wobble/index.d.ts +1 -1
  175. package/browser/Updaters/Wobble/index.js +2 -2
  176. package/browser/Utils/Plugins.d.ts +2 -2
  177. package/browser/Utils/Plugins.js +4 -4
  178. package/browser/Utils/Utils.d.ts +1 -2
  179. package/browser/full.d.ts +1 -1
  180. package/browser/full.js +9 -9
  181. package/browser/index.js +1 -1
  182. package/browser/index.slim.js +1 -1
  183. package/browser/main.d.ts +10 -6
  184. package/browser/main.js +20 -6
  185. package/browser/slim.d.ts +1 -1
  186. package/browser/slim.js +24 -24
  187. package/esm/Core/Container.d.ts +3 -1
  188. package/esm/Core/Container.js +16 -11
  189. package/esm/Core/InteractionManager.d.ts +1 -0
  190. package/esm/Core/InteractionManager.js +4 -1
  191. package/esm/Core/Particles.d.ts +1 -1
  192. package/esm/Core/Particles.js +3 -1
  193. package/esm/Enums/Modes/ResponsiveMode.d.ts +4 -0
  194. package/esm/Enums/Modes/ResponsiveMode.js +5 -0
  195. package/esm/Enums/Modes/index.d.ts +1 -0
  196. package/esm/Enums/Modes/index.js +1 -0
  197. package/esm/Interactions/External/Attract/index.d.ts +1 -1
  198. package/esm/Interactions/External/Attract/index.js +2 -2
  199. package/esm/Interactions/External/Bounce/index.d.ts +1 -1
  200. package/esm/Interactions/External/Bounce/index.js +2 -2
  201. package/esm/Interactions/External/Bubble/index.d.ts +1 -1
  202. package/esm/Interactions/External/Bubble/index.js +2 -2
  203. package/esm/Interactions/External/Connect/index.d.ts +1 -1
  204. package/esm/Interactions/External/Connect/index.js +2 -2
  205. package/esm/Interactions/External/Grab/index.d.ts +1 -1
  206. package/esm/Interactions/External/Grab/index.js +2 -2
  207. package/esm/Interactions/External/Repulse/index.d.ts +1 -1
  208. package/esm/Interactions/External/Repulse/index.js +2 -2
  209. package/esm/Interactions/External/Trail/index.d.ts +1 -1
  210. package/esm/Interactions/External/Trail/index.js +2 -2
  211. package/esm/Interactions/Particles/Attract/index.d.ts +1 -1
  212. package/esm/Interactions/Particles/Attract/index.js +2 -2
  213. package/esm/Interactions/Particles/Collisions/index.d.ts +1 -1
  214. package/esm/Interactions/Particles/Collisions/index.js +2 -2
  215. package/esm/Interactions/Particles/Links/index.d.ts +2 -2
  216. package/esm/Interactions/Particles/Links/index.js +5 -5
  217. package/esm/Interactions/Particles/Links/plugin.d.ts +1 -1
  218. package/esm/Interactions/Particles/Links/plugin.js +2 -2
  219. package/esm/Options/Classes/FullScreen/FullScreen.js +2 -2
  220. package/esm/Options/Classes/Interactivity/Interactivity.js +1 -1
  221. package/esm/Options/Classes/Options.js +4 -2
  222. package/esm/Options/Classes/Responsive.d.ts +2 -0
  223. package/esm/Options/Classes/Responsive.js +10 -0
  224. package/esm/Options/Interfaces/IResponsive.d.ts +2 -0
  225. package/esm/Plugins/Absorbers/AbsorberInstance.d.ts +2 -1
  226. package/esm/Plugins/Absorbers/AbsorberInstance.js +21 -9
  227. package/esm/Plugins/Absorbers/Options/Classes/AbsorberSize.d.ts +2 -1
  228. package/esm/Plugins/Absorbers/Options/Classes/AbsorberSize.js +6 -4
  229. package/esm/Plugins/Absorbers/Options/Classes/AbsorberSizeLimit.d.ts +9 -0
  230. package/esm/Plugins/Absorbers/Options/Classes/AbsorberSizeLimit.js +17 -0
  231. package/esm/Plugins/Absorbers/Options/Interfaces/IAbsorberSize.d.ts +3 -2
  232. package/esm/Plugins/Absorbers/Options/Interfaces/IAbsorberSizeLimit.d.ts +4 -0
  233. package/esm/Plugins/Absorbers/Options/Interfaces/IAbsorberSizeLimit.js +1 -0
  234. package/esm/Plugins/Absorbers/plugin.d.ts +1 -1
  235. package/esm/Plugins/Absorbers/plugin.js +2 -2
  236. package/esm/Plugins/Emitters/plugin.d.ts +1 -1
  237. package/esm/Plugins/Emitters/plugin.js +2 -2
  238. package/esm/Plugins/PolygonMask/plugin.js +1 -1
  239. package/esm/Shapes/Circle/index.d.ts +1 -1
  240. package/esm/Shapes/Circle/index.js +2 -2
  241. package/esm/Shapes/Image/index.d.ts +1 -1
  242. package/esm/Shapes/Image/index.js +3 -3
  243. package/esm/Shapes/Line/index.d.ts +1 -1
  244. package/esm/Shapes/Line/index.js +2 -2
  245. package/esm/Shapes/Polygon/index.d.ts +3 -3
  246. package/esm/Shapes/Polygon/index.js +7 -7
  247. package/esm/Shapes/Square/index.d.ts +1 -1
  248. package/esm/Shapes/Square/index.js +3 -3
  249. package/esm/Shapes/Star/index.d.ts +1 -1
  250. package/esm/Shapes/Star/index.js +2 -2
  251. package/esm/Shapes/Text/index.d.ts +1 -1
  252. package/esm/Shapes/Text/index.js +2 -2
  253. package/esm/Updaters/Angle/index.d.ts +1 -1
  254. package/esm/Updaters/Angle/index.js +2 -2
  255. package/esm/Updaters/Color/index.d.ts +1 -1
  256. package/esm/Updaters/Color/index.js +2 -2
  257. package/esm/Updaters/Life/index.d.ts +1 -1
  258. package/esm/Updaters/Life/index.js +2 -2
  259. package/esm/Updaters/Opacity/index.d.ts +1 -1
  260. package/esm/Updaters/Opacity/index.js +2 -2
  261. package/esm/Updaters/OutModes/index.d.ts +1 -1
  262. package/esm/Updaters/OutModes/index.js +2 -2
  263. package/esm/Updaters/Roll/index.d.ts +1 -1
  264. package/esm/Updaters/Roll/index.js +2 -2
  265. package/esm/Updaters/Size/index.d.ts +1 -1
  266. package/esm/Updaters/Size/index.js +2 -2
  267. package/esm/Updaters/StrokeColor/index.d.ts +1 -1
  268. package/esm/Updaters/StrokeColor/index.js +2 -2
  269. package/esm/Updaters/Tilt/index.d.ts +1 -1
  270. package/esm/Updaters/Tilt/index.js +2 -2
  271. package/esm/Updaters/Wobble/index.d.ts +1 -1
  272. package/esm/Updaters/Wobble/index.js +2 -2
  273. package/esm/Utils/Plugins.d.ts +2 -2
  274. package/esm/Utils/Plugins.js +4 -4
  275. package/esm/Utils/Utils.d.ts +1 -2
  276. package/esm/full.d.ts +1 -1
  277. package/esm/full.js +9 -9
  278. package/esm/index.js +1 -1
  279. package/esm/index.slim.js +1 -1
  280. package/esm/main.d.ts +7 -6
  281. package/esm/main.js +17 -6
  282. package/esm/slim.d.ts +1 -1
  283. package/esm/slim.js +24 -24
  284. package/full.d.ts +1 -1
  285. package/full.js +9 -9
  286. package/index.js +1 -1
  287. package/index.slim.js +1 -1
  288. package/main.d.ts +7 -6
  289. package/main.js +17 -6
  290. package/package.json +1 -1
  291. package/report.html +2 -2
  292. package/report.slim.html +2 -2
  293. package/slim.d.ts +1 -1
  294. package/slim.js +24 -24
  295. package/tsparticles.js +743 -363
  296. package/tsparticles.min.js +2 -2
  297. package/tsparticles.pathseg.js +2 -2
  298. package/tsparticles.slim.js +539 -284
  299. package/tsparticles.slim.min.js +2 -2
@@ -1,4 +1,4 @@
1
1
  import { Grabber } from "./Grabber";
2
- export function loadExternalGrabInteraction(tsParticles) {
3
- tsParticles.addInteractor("externalGrab", (container) => new Grabber(container));
2
+ export async function loadExternalGrabInteraction(tsParticles) {
3
+ await tsParticles.addInteractor("externalGrab", (container) => new Grabber(container));
4
4
  }
@@ -1,2 +1,2 @@
1
1
  import type { Main } from "../../../main";
2
- export declare function loadExternalRepulseInteraction(tsParticles: Main): void;
2
+ export declare function loadExternalRepulseInteraction(tsParticles: Main): Promise<void>;
@@ -1,4 +1,4 @@
1
1
  import { Repulser } from "./Repulser";
2
- export function loadExternalRepulseInteraction(tsParticles) {
3
- tsParticles.addInteractor("externalRepulse", (container) => new Repulser(container));
2
+ export async function loadExternalRepulseInteraction(tsParticles) {
3
+ await tsParticles.addInteractor("externalRepulse", (container) => new Repulser(container));
4
4
  }
@@ -1,2 +1,2 @@
1
1
  import type { Main } from "../../../main";
2
- export declare function loadExternalTrailInteraction(tsParticles: Main): void;
2
+ export declare function loadExternalTrailInteraction(tsParticles: Main): Promise<void>;
@@ -1,4 +1,4 @@
1
1
  import { TrailMaker } from "./TrailMaker";
2
- export function loadExternalTrailInteraction(tsParticles) {
3
- tsParticles.addInteractor("externalTrail", (container) => new TrailMaker(container));
2
+ export async function loadExternalTrailInteraction(tsParticles) {
3
+ await tsParticles.addInteractor("externalTrail", (container) => new TrailMaker(container));
4
4
  }
@@ -1,2 +1,2 @@
1
1
  import type { Main } from "../../../main";
2
- export declare function loadParticlesAttractInteraction(tsParticles: Main): void;
2
+ export declare function loadParticlesAttractInteraction(tsParticles: Main): Promise<void>;
@@ -1,4 +1,4 @@
1
1
  import { Attractor } from "./Attractor";
2
- export function loadParticlesAttractInteraction(tsParticles) {
3
- tsParticles.addInteractor("particlesAttract", (container) => new Attractor(container));
2
+ export async function loadParticlesAttractInteraction(tsParticles) {
3
+ await tsParticles.addInteractor("particlesAttract", (container) => new Attractor(container));
4
4
  }
@@ -1,2 +1,2 @@
1
1
  import type { Main } from "../../../main";
2
- export declare function loadParticlesCollisionsInteraction(tsParticles: Main): void;
2
+ export declare function loadParticlesCollisionsInteraction(tsParticles: Main): Promise<void>;
@@ -1,4 +1,4 @@
1
1
  import { Collider } from "./Collider";
2
- export function loadParticlesCollisionsInteraction(tsParticles) {
3
- tsParticles.addInteractor("particlesCollisions", (container) => new Collider(container));
2
+ export async function loadParticlesCollisionsInteraction(tsParticles) {
3
+ await tsParticles.addInteractor("particlesCollisions", (container) => new Collider(container));
4
4
  }
@@ -1,3 +1,3 @@
1
1
  import type { Main } from "../../../main";
2
- export declare function loadInteraction(tsParticles: Main): void;
3
- export declare function loadParticlesLinksInteraction(tsParticles: Main): void;
2
+ export declare function loadInteraction(tsParticles: Main): Promise<void>;
3
+ export declare function loadParticlesLinksInteraction(tsParticles: Main): Promise<void>;
@@ -1,9 +1,9 @@
1
1
  import { Linker } from "./Linker";
2
2
  import { loadPlugin } from "./plugin";
3
- export function loadInteraction(tsParticles) {
4
- tsParticles.addInteractor("particlesLinks", (container) => new Linker(container));
3
+ export async function loadInteraction(tsParticles) {
4
+ await tsParticles.addInteractor("particlesLinks", (container) => new Linker(container));
5
5
  }
6
- export function loadParticlesLinksInteraction(tsParticles) {
7
- loadInteraction(tsParticles);
8
- loadPlugin(tsParticles);
6
+ export async function loadParticlesLinksInteraction(tsParticles) {
7
+ await loadInteraction(tsParticles);
8
+ await loadPlugin(tsParticles);
9
9
  }
@@ -1,2 +1,2 @@
1
1
  import type { Main } from "../../../main";
2
- export declare function loadPlugin(tsParticles: Main): void;
2
+ export declare function loadPlugin(tsParticles: Main): Promise<void>;
@@ -13,7 +13,7 @@ class Plugin {
13
13
  // do nothing
14
14
  }
15
15
  }
16
- export function loadPlugin(tsParticles) {
16
+ export async function loadPlugin(tsParticles) {
17
17
  const plugin = new Plugin();
18
- tsParticles.addPlugin(plugin);
18
+ await tsParticles.addPlugin(plugin);
19
19
  }
@@ -6,8 +6,8 @@
6
6
  */
7
7
  export class FullScreen {
8
8
  constructor() {
9
- this.enable = false;
10
- this.zIndex = -1;
9
+ this.enable = true;
10
+ this.zIndex = 0;
11
11
  }
12
12
  load(data) {
13
13
  if (!data) {
@@ -7,7 +7,7 @@ import { Modes } from "./Modes/Modes";
7
7
  */
8
8
  export class Interactivity {
9
9
  constructor() {
10
- this.detectsOn = InteractivityDetect.canvas;
10
+ this.detectsOn = InteractivityDetect.window;
11
11
  this.events = new Events();
12
12
  this.modes = new Modes();
13
13
  }
@@ -10,7 +10,7 @@ import { BackgroundMask } from "./BackgroundMask/BackgroundMask";
10
10
  import { Background } from "./Background/Background";
11
11
  import { Plugins } from "../../Utils";
12
12
  import { Theme } from "./Theme/Theme";
13
- import { ThemeMode } from "../../Enums";
13
+ import { ResponsiveMode, ThemeMode } from "../../Enums";
14
14
  import { FullScreen } from "./FullScreen/FullScreen";
15
15
  import { Motion } from "./Motion/Motion";
16
16
  import { ManualParticle } from "./ManualParticle";
@@ -175,7 +175,9 @@ export class Options {
175
175
  }
176
176
  setResponsive(width, pxRatio, defaultOptions) {
177
177
  this.load(defaultOptions);
178
- const responsiveOptions = this.responsive.find((t) => t.maxWidth * pxRatio > width);
178
+ const responsiveOptions = this.responsive.find((t) => t.mode === ResponsiveMode.screen && screen
179
+ ? t.maxWidth * pxRatio > screen.availWidth
180
+ : t.maxWidth * pxRatio > width);
179
181
  this.load(responsiveOptions === null || responsiveOptions === void 0 ? void 0 : responsiveOptions.options);
180
182
  return responsiveOptions === null || responsiveOptions === void 0 ? void 0 : responsiveOptions.maxWidth;
181
183
  }
@@ -2,9 +2,11 @@ import type { IResponsive } from "../Interfaces/IResponsive";
2
2
  import type { IOptionLoader } from "../Interfaces/IOptionLoader";
3
3
  import type { RecursivePartial } from "../../Types";
4
4
  import type { IOptions } from "../Interfaces/IOptions";
5
+ import { ResponsiveMode } from "../../Enums";
5
6
  export declare class Responsive implements IResponsive, IOptionLoader<IResponsive> {
6
7
  maxWidth: number;
7
8
  options: RecursivePartial<IOptions>;
9
+ mode: ResponsiveMode;
8
10
  constructor();
9
11
  load(data?: RecursivePartial<IResponsive>): void;
10
12
  }
@@ -1,8 +1,10 @@
1
1
  import { deepExtend } from "../../Utils";
2
+ import { ResponsiveMode } from "../../Enums";
2
3
  export class Responsive {
3
4
  constructor() {
4
5
  this.maxWidth = Infinity;
5
6
  this.options = {};
7
+ this.mode = ResponsiveMode.canvas;
6
8
  }
7
9
  load(data) {
8
10
  if (!data) {
@@ -11,6 +13,15 @@ export class Responsive {
11
13
  if (data.maxWidth !== undefined) {
12
14
  this.maxWidth = data.maxWidth;
13
15
  }
16
+ if (data.mode !== undefined) {
17
+ // not enforcing an error here as this should largely be an opt-in setting
18
+ if (data.mode === ResponsiveMode.screen) {
19
+ this.mode = ResponsiveMode.screen;
20
+ }
21
+ else {
22
+ this.mode = ResponsiveMode.canvas;
23
+ }
24
+ }
14
25
  if (data.options !== undefined) {
15
26
  this.options = deepExtend({}, data.options);
16
27
  }
@@ -1,6 +1,8 @@
1
+ import { ResponsiveMode } from "../../Enums";
1
2
  import type { RecursivePartial } from "../../Types";
2
3
  import type { IOptions } from "./IOptions";
3
4
  export interface IResponsive {
4
5
  maxWidth: number;
5
6
  options: RecursivePartial<IOptions>;
7
+ mode: ResponsiveMode;
6
8
  }
@@ -5,6 +5,7 @@ import type { IAbsorber } from "./Options/Interfaces/IAbsorber";
5
5
  import type { Absorbers } from "./Absorbers";
6
6
  import { Vector } from "../../Core/Particle/Vector";
7
7
  import { RotateDirection } from "../../Enums";
8
+ import { IAbsorberSizeLimit } from "./Options/Interfaces/IAbsorberSizeLimit";
8
9
  declare type OrbitingParticle = Particle & {
9
10
  absorberOrbit?: Vector;
10
11
  absorberOrbitDirection?: RotateDirection;
@@ -20,7 +21,7 @@ export declare class AbsorberInstance {
20
21
  opacity: number;
21
22
  size: number;
22
23
  color: IRgb;
23
- limit?: number;
24
+ limit: IAbsorberSizeLimit;
24
25
  readonly name?: string;
25
26
  position: Vector;
26
27
  private dragging;
@@ -6,7 +6,7 @@ import { RotateDirection } from "../../Enums";
6
6
  */
7
7
  export class AbsorberInstance {
8
8
  constructor(absorbers, container, options, position) {
9
- var _a, _b, _c;
9
+ var _a, _b, _c, _d, _e;
10
10
  this.absorbers = absorbers;
11
11
  this.container = container;
12
12
  this.initialPosition = position ? Vector.create(position.x, position.y) : undefined;
@@ -17,14 +17,23 @@ export class AbsorberInstance {
17
17
  this.size = getRangeValue(options.size.value) * container.retina.pixelRatio;
18
18
  this.mass = this.size * options.size.density * container.retina.reduceFactor;
19
19
  const limit = options.size.limit;
20
- this.limit = limit !== undefined ? limit * container.retina.pixelRatio * container.retina.reduceFactor : limit;
20
+ this.limit =
21
+ typeof limit === "number"
22
+ ? {
23
+ radius: limit * container.retina.pixelRatio * container.retina.reduceFactor,
24
+ mass: 0,
25
+ }
26
+ : {
27
+ radius: ((_a = limit === null || limit === void 0 ? void 0 : limit.radius) !== null && _a !== void 0 ? _a : 0) * container.retina.pixelRatio * container.retina.reduceFactor,
28
+ mass: (_b = limit === null || limit === void 0 ? void 0 : limit.mass) !== null && _b !== void 0 ? _b : 0,
29
+ };
21
30
  const color = typeof options.color === "string" ? { value: options.color } : options.color;
22
- this.color = (_a = colorToRgb(color)) !== null && _a !== void 0 ? _a : {
31
+ this.color = (_c = colorToRgb(color)) !== null && _c !== void 0 ? _c : {
23
32
  b: 0,
24
33
  g: 0,
25
34
  r: 0,
26
35
  };
27
- this.position = (_c = (_b = this.initialPosition) === null || _b === void 0 ? void 0 : _b.copy()) !== null && _c !== void 0 ? _c : this.calcPosition();
36
+ this.position = (_e = (_d = this.initialPosition) === null || _d === void 0 ? void 0 : _d.copy()) !== null && _e !== void 0 ? _e : this.calcPosition();
28
37
  }
29
38
  attract(particle) {
30
39
  const container = this.container;
@@ -67,10 +76,12 @@ export class AbsorberInstance {
67
76
  }
68
77
  this.updateParticlePosition(particle, v);
69
78
  }
70
- if (this.limit === undefined || this.size < this.limit) {
79
+ if (this.limit.radius <= 0 || this.size < this.limit.radius) {
71
80
  this.size += sizeFactor;
72
81
  }
73
- this.mass += sizeFactor * this.options.size.density * container.retina.reduceFactor;
82
+ if (this.limit.mass <= 0 || this.mass < this.limit.mass) {
83
+ this.mass += sizeFactor * this.options.size.density * container.retina.reduceFactor;
84
+ }
74
85
  }
75
86
  else {
76
87
  this.updateParticlePosition(particle, v);
@@ -105,9 +116,10 @@ export class AbsorberInstance {
105
116
  const container = this.container;
106
117
  const canvasSize = container.canvas.size;
107
118
  if (particle.needsNewPosition) {
108
- const pSize = particle.getRadius();
109
- particle.position.x = (canvasSize.width - pSize * 2) * (1 + (Math.random() * 0.2 - 0.1)) + pSize;
110
- particle.position.y = (canvasSize.height - pSize * 2) * (1 + (Math.random() * 0.2 - 0.1)) + pSize;
119
+ particle.position.x = Math.floor(Math.random() * canvasSize.width);
120
+ particle.position.y = Math.floor(Math.random() * canvasSize.height);
121
+ particle.velocity.setTo(particle.initialVelocity);
122
+ particle.absorberOrbit = undefined;
111
123
  particle.needsNewPosition = false;
112
124
  }
113
125
  if (this.options.orbits) {
@@ -2,9 +2,10 @@ import type { IAbsorberSize } from "../Interfaces/IAbsorberSize";
2
2
  import type { RecursivePartial } from "../../../../Types";
3
3
  import type { IOptionLoader } from "../../../../Options/Interfaces/IOptionLoader";
4
4
  import { ValueWithRandom } from "../../../../Options/Classes/ValueWithRandom";
5
+ import { AbsorberSizeLimit } from "./AbsorberSizeLimit";
5
6
  export declare class AbsorberSize extends ValueWithRandom implements IAbsorberSize, IOptionLoader<IAbsorberSize> {
6
7
  density: number;
7
- limit?: number;
8
+ limit: AbsorberSizeLimit;
8
9
  constructor();
9
10
  load(data?: RecursivePartial<IAbsorberSize>): void;
10
11
  }
@@ -1,10 +1,12 @@
1
1
  import { ValueWithRandom } from "../../../../Options/Classes/ValueWithRandom";
2
+ import { AbsorberSizeLimit } from "./AbsorberSizeLimit";
2
3
  export class AbsorberSize extends ValueWithRandom {
3
4
  constructor() {
4
5
  super();
5
6
  this.density = 5;
6
7
  this.random.minimumValue = 1;
7
8
  this.value = 50;
9
+ this.limit = new AbsorberSizeLimit();
8
10
  }
9
11
  load(data) {
10
12
  if (!data) {
@@ -14,11 +16,11 @@ export class AbsorberSize extends ValueWithRandom {
14
16
  if (data.density !== undefined) {
15
17
  this.density = data.density;
16
18
  }
17
- if (data.limit !== undefined) {
18
- this.limit = data.limit;
19
+ if (typeof data.limit === "number") {
20
+ this.limit.radius = data.limit;
19
21
  }
20
- if (data.limit !== undefined) {
21
- this.limit = data.limit;
22
+ else {
23
+ this.limit.load(data.limit);
22
24
  }
23
25
  }
24
26
  }
@@ -0,0 +1,9 @@
1
+ import type { RecursivePartial } from "../../../../Types";
2
+ import type { IOptionLoader } from "../../../../Options/Interfaces/IOptionLoader";
3
+ import type { IAbsorberSizeLimit } from "../Interfaces/IAbsorberSizeLimit";
4
+ export declare class AbsorberSizeLimit implements IAbsorberSizeLimit, IOptionLoader<IAbsorberSizeLimit> {
5
+ radius: number;
6
+ mass: number;
7
+ constructor();
8
+ load(data?: RecursivePartial<IAbsorberSizeLimit>): void;
9
+ }
@@ -0,0 +1,17 @@
1
+ export class AbsorberSizeLimit {
2
+ constructor() {
3
+ this.radius = 0;
4
+ this.mass = 0;
5
+ }
6
+ load(data) {
7
+ if (!data) {
8
+ return;
9
+ }
10
+ if (data.mass !== undefined) {
11
+ this.mass = data.mass;
12
+ }
13
+ if (data.radius !== undefined) {
14
+ this.radius = data.radius;
15
+ }
16
+ }
17
+ }
@@ -1,5 +1,6 @@
1
- import { IValueWithRandom } from "../../../../Options/Interfaces/IValueWithRandom";
1
+ import type { IValueWithRandom } from "../../../../Options/Interfaces/IValueWithRandom";
2
+ import type { IAbsorberSizeLimit } from "./IAbsorberSizeLimit";
2
3
  export interface IAbsorberSize extends IValueWithRandom {
3
- limit?: number;
4
+ limit?: number | IAbsorberSizeLimit;
4
5
  density: number;
5
6
  }
@@ -0,0 +1,4 @@
1
+ export interface IAbsorberSizeLimit {
2
+ radius: number;
3
+ mass: number;
4
+ }
@@ -1,2 +1,2 @@
1
1
  import type { Main } from "../../main";
2
- export declare function loadAbsorbersPlugin(tsParticles: Main): void;
2
+ export declare function loadAbsorbersPlugin(tsParticles: Main): Promise<void>;
@@ -74,7 +74,7 @@ class Plugin {
74
74
  }
75
75
  }
76
76
  }
77
- export function loadAbsorbersPlugin(tsParticles) {
77
+ export async function loadAbsorbersPlugin(tsParticles) {
78
78
  const plugin = new Plugin();
79
- tsParticles.addPlugin(plugin);
79
+ await tsParticles.addPlugin(plugin);
80
80
  }
@@ -1,3 +1,3 @@
1
1
  import { EmittersMain } from "./EmittersMain";
2
- export declare function loadEmittersPlugin(tsParticles: EmittersMain): void;
2
+ export declare function loadEmittersPlugin(tsParticles: EmittersMain): Promise<void>;
3
3
  export * from "./EmittersMain";
@@ -67,9 +67,9 @@ class EmittersPlugin {
67
67
  }
68
68
  }
69
69
  }
70
- export function loadEmittersPlugin(tsParticles) {
70
+ export async function loadEmittersPlugin(tsParticles) {
71
71
  const plugin = new EmittersPlugin();
72
- tsParticles.addPlugin(plugin);
72
+ await tsParticles.addPlugin(plugin);
73
73
  if (!tsParticles.addEmitterShape) {
74
74
  tsParticles.addEmitterShape = (name, shape) => {
75
75
  ShapeManager.addShape(name, shape);
@@ -32,9 +32,11 @@ export async function loadPolygonMaskPlugin(tsParticles) {
32
32
  if (!isSsr() && !window.SVGPathSeg) {
33
33
  await import(
34
34
  /* webpackChunkName: "tsparticles.pathseg" */
35
- /* webpackMode: "lazy-once" */
35
+ /* webpackMode: "lazy" */
36
+ /* webpackPrefetch: true */
37
+ /* webpackPreload: true */
36
38
  "./pathseg");
37
39
  }
38
40
  const plugin = new Plugin();
39
- tsParticles.addPlugin(plugin);
41
+ await tsParticles.addPlugin(plugin);
40
42
  }
@@ -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
  }
@@ -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,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
  }
@@ -1,4 +1,4 @@
1
1
  import type { Main } from "../../main";
2
- export declare function loadGenericPolygonShape(tsParticles: Main): void;
3
- export declare function loadTriangleShape(tsParticles: Main): void;
4
- export declare function loadPolygonShape(tsParticles: Main): void;
2
+ export declare function loadGenericPolygonShape(tsParticles: Main): Promise<void>;
3
+ export declare function loadTriangleShape(tsParticles: Main): Promise<void>;
4
+ export declare function loadPolygonShape(tsParticles: Main): Promise<void>;
@@ -1,12 +1,12 @@
1
1
  import { PolygonDrawer } from "./PolygonDrawer";
2
2
  import { TriangleDrawer } from "./TriangleDrawer";
3
- export function loadGenericPolygonShape(tsParticles) {
4
- tsParticles.addShape("polygon", new PolygonDrawer());
3
+ export async function loadGenericPolygonShape(tsParticles) {
4
+ await tsParticles.addShape("polygon", new PolygonDrawer());
5
5
  }
6
- export function loadTriangleShape(tsParticles) {
7
- tsParticles.addShape("triangle", new TriangleDrawer());
6
+ export async function loadTriangleShape(tsParticles) {
7
+ await tsParticles.addShape("triangle", new TriangleDrawer());
8
8
  }
9
- export function loadPolygonShape(tsParticles) {
10
- loadGenericPolygonShape(tsParticles);
11
- loadTriangleShape(tsParticles);
9
+ export async function loadPolygonShape(tsParticles) {
10
+ await loadGenericPolygonShape(tsParticles);
11
+ await loadTriangleShape(tsParticles);
12
12
  }
@@ -1,2 +1,2 @@
1
1
  import type { Main } from "../../main";
2
- export declare function loadSquareShape(tsParticles: Main): void;
2
+ export declare function loadSquareShape(tsParticles: Main): Promise<void>;
@@ -1,6 +1,6 @@
1
1
  import { SquareDrawer } from "./SquareDrawer";
2
- export function loadSquareShape(tsParticles) {
2
+ export async function loadSquareShape(tsParticles) {
3
3
  const drawer = new SquareDrawer();
4
- tsParticles.addShape("edge", drawer);
5
- tsParticles.addShape("square", drawer);
4
+ await tsParticles.addShape("edge", drawer);
5
+ await tsParticles.addShape("square", drawer);
6
6
  }
@@ -1,2 +1,2 @@
1
1
  import type { Main } from "../../main";
2
- export declare function loadStarShape(tsParticles: Main): void;
2
+ export declare function loadStarShape(tsParticles: Main): Promise<void>;
@@ -1,4 +1,4 @@
1
1
  import { StarDrawer } from "./StarDrawer";
2
- export function loadStarShape(tsParticles) {
3
- tsParticles.addShape("star", new StarDrawer());
2
+ export async function loadStarShape(tsParticles) {
3
+ await tsParticles.addShape("star", new StarDrawer());
4
4
  }
@@ -1,2 +1,2 @@
1
1
  import type { Main } from "../../main";
2
- export declare function loadTextShape(tsParticles: Main): void;
2
+ export declare function loadTextShape(tsParticles: Main): Promise<void>;
@@ -1,7 +1,7 @@
1
1
  import { validTypes, TextDrawer } from "./TextDrawer";
2
- export function loadTextShape(tsParticles) {
2
+ export async function loadTextShape(tsParticles) {
3
3
  const drawer = new TextDrawer();
4
4
  for (const type of validTypes) {
5
- tsParticles.addShape(type, drawer);
5
+ await tsParticles.addShape(type, drawer);
6
6
  }
7
7
  }
@@ -1,2 +1,2 @@
1
1
  import type { Main } from "../../main";
2
- export declare function loadAngleUpdater(tsParticles: Main): void;
2
+ export declare function loadAngleUpdater(tsParticles: Main): Promise<void>;
@@ -1,4 +1,4 @@
1
1
  import { AngleUpdater } from "./AngleUpdater";
2
- export function loadAngleUpdater(tsParticles) {
3
- tsParticles.addParticleUpdater("angle", (container) => new AngleUpdater(container));
2
+ export async function loadAngleUpdater(tsParticles) {
3
+ await tsParticles.addParticleUpdater("angle", (container) => new AngleUpdater(container));
4
4
  }
@@ -1,2 +1,2 @@
1
1
  import type { Main } from "../../main";
2
- export declare function loadColorUpdater(tsParticles: Main): void;
2
+ export declare function loadColorUpdater(tsParticles: Main): Promise<void>;
@@ -1,4 +1,4 @@
1
1
  import { ColorUpdater } from "./ColorUpdater";
2
- export function loadColorUpdater(tsParticles) {
3
- tsParticles.addParticleUpdater("color", (container) => new ColorUpdater(container));
2
+ export async function loadColorUpdater(tsParticles) {
3
+ await tsParticles.addParticleUpdater("color", (container) => new ColorUpdater(container));
4
4
  }
@@ -1,2 +1,2 @@
1
1
  import type { Main } from "../../main";
2
- export declare function loadLifeUpdater(tsParticles: Main): void;
2
+ export declare function loadLifeUpdater(tsParticles: Main): Promise<void>;
@@ -1,4 +1,4 @@
1
1
  import { LifeUpdater } from "./LifeUpdater";
2
- export function loadLifeUpdater(tsParticles) {
3
- tsParticles.addParticleUpdater("life", (container) => new LifeUpdater(container));
2
+ export async function loadLifeUpdater(tsParticles) {
3
+ await tsParticles.addParticleUpdater("life", (container) => new LifeUpdater(container));
4
4
  }
@@ -1,2 +1,2 @@
1
1
  import type { Main } from "../../main";
2
- export declare function loadOpacityUpdater(tsParticles: Main): void;
2
+ export declare function loadOpacityUpdater(tsParticles: Main): Promise<void>;
@@ -1,4 +1,4 @@
1
1
  import { OpacityUpdater } from "./OpacityUpdater";
2
- export function loadOpacityUpdater(tsParticles) {
3
- tsParticles.addParticleUpdater("opacity", (container) => new OpacityUpdater(container));
2
+ export async function loadOpacityUpdater(tsParticles) {
3
+ await tsParticles.addParticleUpdater("opacity", (container) => new OpacityUpdater(container));
4
4
  }
@@ -1,2 +1,2 @@
1
1
  import type { Main } from "../../main";
2
- export declare function loadOutModesUpdater(tsParticles: Main): void;
2
+ export declare function loadOutModesUpdater(tsParticles: Main): Promise<void>;
@@ -1,4 +1,4 @@
1
1
  import { OutOfCanvasUpdater } from "./OutOfCanvasUpdater";
2
- export function loadOutModesUpdater(tsParticles) {
3
- tsParticles.addParticleUpdater("outModes", (container) => new OutOfCanvasUpdater(container));
2
+ export async function loadOutModesUpdater(tsParticles) {
3
+ await tsParticles.addParticleUpdater("outModes", (container) => new OutOfCanvasUpdater(container));
4
4
  }
@@ -1,2 +1,2 @@
1
1
  import type { Main } from "../../main";
2
- export declare function loadRollUpdater(tsParticles: Main): void;
2
+ export declare function loadRollUpdater(tsParticles: Main): Promise<void>;