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
@@ -36,10 +36,12 @@ export declare class Container {
36
36
  readonly pathGenerator: IMovePathGenerator;
37
37
  private _options;
38
38
  private _sourceOptions;
39
+ private readonly _initialSourceOptions;
39
40
  private paused;
40
41
  private firstStart;
41
42
  private currentTheme?;
42
43
  private drawAnimationFrame?;
44
+ private readonly presets;
43
45
  private readonly eventListeners;
44
46
  private readonly intersectionObserver?;
45
47
  constructor(id: string, sourceOptions?: RecursivePartial<IOptions>, ...presets: string[]);
@@ -60,6 +62,6 @@ export declare class Container {
60
62
  start(): Promise<void>;
61
63
  addClickHandler(callback: (evt: Event, particles?: Particle[]) => void): void;
62
64
  updateActualOptions(): boolean;
63
- private init;
65
+ init(): Promise<void>;
64
66
  private intersectionManager;
65
67
  }
package/Core/Container.js CHANGED
@@ -22,10 +22,12 @@ class Container {
22
22
  this.zLayers = 100;
23
23
  this.pageHidden = false;
24
24
  this._sourceOptions = sourceOptions;
25
+ this._initialSourceOptions = sourceOptions;
25
26
  this.retina = new Retina_1.Retina(this);
26
27
  this.canvas = new Canvas_1.Canvas(this);
27
28
  this.particles = new Particles_1.Particles(this);
28
29
  this.drawer = new FrameManager_1.FrameManager(this);
30
+ this.presets = presets;
29
31
  this.pathGenerator = {
30
32
  generate: () => {
31
33
  const v = Vector_1.Vector.create(0, 0);
@@ -52,17 +54,6 @@ class Container {
52
54
  this.density = 1;
53
55
  this._options = new Options_1.Options();
54
56
  this.actualOptions = new Options_1.Options();
55
- for (const preset of presets) {
56
- this._options.load(Utils_1.Plugins.getPreset(preset));
57
- }
58
- const shapes = Utils_1.Plugins.getSupportedShapes();
59
- for (const type of shapes) {
60
- const drawer = Utils_1.Plugins.getShapeDrawer(type);
61
- if (drawer) {
62
- this.drawers.set(type, drawer);
63
- }
64
- }
65
- this._options.load(this._sourceOptions);
66
57
  this.eventListeners = new Utils_1.EventListeners(this);
67
58
  if (typeof IntersectionObserver !== "undefined" && IntersectionObserver) {
68
59
  this.intersectionObserver = new IntersectionObserver((entries) => this.intersectionManager(entries));
@@ -205,6 +196,7 @@ class Container {
205
196
  this.particles.linksColors = new Map();
206
197
  delete this.particles.grabLineColor;
207
198
  delete this.particles.linksColor;
199
+ this._sourceOptions = this._options;
208
200
  }
209
201
  async loadTheme(name) {
210
202
  this.currentTheme = name;
@@ -319,6 +311,19 @@ class Container {
319
311
  return false;
320
312
  }
321
313
  async init() {
314
+ this._options = new Options_1.Options();
315
+ for (const preset of this.presets) {
316
+ this._options.load(Utils_1.Plugins.getPreset(preset));
317
+ }
318
+ const shapes = Utils_1.Plugins.getSupportedShapes();
319
+ for (const type of shapes) {
320
+ const drawer = Utils_1.Plugins.getShapeDrawer(type);
321
+ if (drawer) {
322
+ this.drawers.set(type, drawer);
323
+ }
324
+ }
325
+ this._options.load(this._initialSourceOptions);
326
+ this._options.load(this._sourceOptions);
322
327
  this.actualOptions = new Options_1.Options();
323
328
  this.actualOptions.load(this._options);
324
329
  this.retina.init();
@@ -6,6 +6,7 @@ export declare class InteractionManager {
6
6
  private readonly externalInteractors;
7
7
  private readonly particleInteractors;
8
8
  constructor(container: Container);
9
+ init(): void;
9
10
  externalInteract(delta: IDelta): void;
10
11
  particlesInteract(particle: Particle, delta: IDelta): void;
11
12
  }
@@ -6,9 +6,12 @@ const Enums_1 = require("../Enums");
6
6
  class InteractionManager {
7
7
  constructor(container) {
8
8
  this.container = container;
9
- const interactors = Utils_1.Plugins.getInteractors(container);
10
9
  this.externalInteractors = [];
11
10
  this.particleInteractors = [];
11
+ this.init();
12
+ }
13
+ init() {
14
+ const interactors = Utils_1.Plugins.getInteractors(this.container, true);
12
15
  for (const interactor of interactors) {
13
16
  switch (interactor.type) {
14
17
  case Enums_1.InteractorType.External:
@@ -17,7 +17,7 @@ export declare class Particles {
17
17
  pushing?: boolean;
18
18
  linksColor?: IRgb | string;
19
19
  grabLineColor?: IRgb | string;
20
- readonly updaters: import("./Interfaces").IParticleUpdater[];
20
+ updaters: import("./Interfaces").IParticleUpdater[];
21
21
  private interactionManager;
22
22
  private nextId;
23
23
  private readonly freqs;
package/Core/Particles.js CHANGED
@@ -24,7 +24,7 @@ class Particles {
24
24
  const canvasSize = this.container.canvas.size;
25
25
  this.linksColors = new Map();
26
26
  this.quadTree = new Utils_1.QuadTree(new Utils_1.Rectangle(-canvasSize.width / 4, -canvasSize.height / 4, (canvasSize.width * 3) / 2, (canvasSize.height * 3) / 2), 4);
27
- this.updaters = Utils_1.Plugins.getUpdaters(container);
27
+ this.updaters = Utils_1.Plugins.getUpdaters(container, true);
28
28
  }
29
29
  get count() {
30
30
  return this.array.length;
@@ -38,6 +38,8 @@ class Particles {
38
38
  this.freqs.links = new Map();
39
39
  this.freqs.triangles = new Map();
40
40
  let handled = false;
41
+ this.updaters = Utils_1.Plugins.getUpdaters(container, true);
42
+ this.interactionManager.init();
41
43
  for (const [, plugin] of container.plugins) {
42
44
  if (plugin.particlesInitialization !== undefined) {
43
45
  handled = plugin.particlesInitialization();
@@ -0,0 +1,4 @@
1
+ export declare enum ResponsiveMode {
2
+ screen = "screen",
3
+ canvas = "canvas"
4
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ResponsiveMode = void 0;
4
+ var ResponsiveMode;
5
+ (function (ResponsiveMode) {
6
+ ResponsiveMode["screen"] = "screen";
7
+ ResponsiveMode["canvas"] = "canvas";
8
+ })(ResponsiveMode = exports.ResponsiveMode || (exports.ResponsiveMode = {}));
@@ -7,3 +7,4 @@ export * from "./OutMode";
7
7
  export * from "./RollMode";
8
8
  export * from "./SizeMode";
9
9
  export * from "./ThemeMode";
10
+ export * from "./ResponsiveMode";
@@ -19,3 +19,4 @@ __exportStar(require("./OutMode"), exports);
19
19
  __exportStar(require("./RollMode"), exports);
20
20
  __exportStar(require("./SizeMode"), exports);
21
21
  __exportStar(require("./ThemeMode"), exports);
22
+ __exportStar(require("./ResponsiveMode"), exports);
@@ -1,2 +1,2 @@
1
1
  import type { Main } from "../../../main";
2
- export declare function loadExternalAttractInteraction(tsParticles: Main): void;
2
+ export declare function loadExternalAttractInteraction(tsParticles: Main): Promise<void>;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.loadExternalAttractInteraction = void 0;
4
4
  const Attractor_1 = require("./Attractor");
5
- function loadExternalAttractInteraction(tsParticles) {
6
- tsParticles.addInteractor("externalAttract", (container) => new Attractor_1.Attractor(container));
5
+ async function loadExternalAttractInteraction(tsParticles) {
6
+ await tsParticles.addInteractor("externalAttract", (container) => new Attractor_1.Attractor(container));
7
7
  }
8
8
  exports.loadExternalAttractInteraction = loadExternalAttractInteraction;
@@ -1,2 +1,2 @@
1
1
  import type { Main } from "../../../main";
2
- export declare function loadExternalBounceInteraction(tsParticles: Main): void;
2
+ export declare function loadExternalBounceInteraction(tsParticles: Main): Promise<void>;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.loadExternalBounceInteraction = void 0;
4
4
  const Bouncer_1 = require("./Bouncer");
5
- function loadExternalBounceInteraction(tsParticles) {
6
- tsParticles.addInteractor("externalBounce", (container) => new Bouncer_1.Bouncer(container));
5
+ async function loadExternalBounceInteraction(tsParticles) {
6
+ await tsParticles.addInteractor("externalBounce", (container) => new Bouncer_1.Bouncer(container));
7
7
  }
8
8
  exports.loadExternalBounceInteraction = loadExternalBounceInteraction;
@@ -1,2 +1,2 @@
1
1
  import type { Main } from "../../../main";
2
- export declare function loadExternalBubbleInteraction(tsParticles: Main): void;
2
+ export declare function loadExternalBubbleInteraction(tsParticles: Main): Promise<void>;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.loadExternalBubbleInteraction = void 0;
4
4
  const Bubbler_1 = require("./Bubbler");
5
- function loadExternalBubbleInteraction(tsParticles) {
6
- tsParticles.addInteractor("externalBubble", (container) => new Bubbler_1.Bubbler(container));
5
+ async function loadExternalBubbleInteraction(tsParticles) {
6
+ await tsParticles.addInteractor("externalBubble", (container) => new Bubbler_1.Bubbler(container));
7
7
  }
8
8
  exports.loadExternalBubbleInteraction = loadExternalBubbleInteraction;
@@ -1,2 +1,2 @@
1
1
  import type { Main } from "../../../main";
2
- export declare function loadExternalConnectInteraction(tsParticles: Main): void;
2
+ export declare function loadExternalConnectInteraction(tsParticles: Main): Promise<void>;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.loadExternalConnectInteraction = void 0;
4
4
  const Connector_1 = require("./Connector");
5
- function loadExternalConnectInteraction(tsParticles) {
6
- tsParticles.addInteractor("externalConnect", (container) => new Connector_1.Connector(container));
5
+ async function loadExternalConnectInteraction(tsParticles) {
6
+ await tsParticles.addInteractor("externalConnect", (container) => new Connector_1.Connector(container));
7
7
  }
8
8
  exports.loadExternalConnectInteraction = loadExternalConnectInteraction;
@@ -1,2 +1,2 @@
1
1
  import type { Main } from "../../../main";
2
- export declare function loadExternalGrabInteraction(tsParticles: Main): void;
2
+ export declare function loadExternalGrabInteraction(tsParticles: Main): Promise<void>;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.loadExternalGrabInteraction = void 0;
4
4
  const Grabber_1 = require("./Grabber");
5
- function loadExternalGrabInteraction(tsParticles) {
6
- tsParticles.addInteractor("externalGrab", (container) => new Grabber_1.Grabber(container));
5
+ async function loadExternalGrabInteraction(tsParticles) {
6
+ await tsParticles.addInteractor("externalGrab", (container) => new Grabber_1.Grabber(container));
7
7
  }
8
8
  exports.loadExternalGrabInteraction = loadExternalGrabInteraction;
@@ -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>;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.loadExternalRepulseInteraction = void 0;
4
4
  const Repulser_1 = require("./Repulser");
5
- function loadExternalRepulseInteraction(tsParticles) {
6
- tsParticles.addInteractor("externalRepulse", (container) => new Repulser_1.Repulser(container));
5
+ async function loadExternalRepulseInteraction(tsParticles) {
6
+ await tsParticles.addInteractor("externalRepulse", (container) => new Repulser_1.Repulser(container));
7
7
  }
8
8
  exports.loadExternalRepulseInteraction = loadExternalRepulseInteraction;
@@ -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>;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.loadExternalTrailInteraction = void 0;
4
4
  const TrailMaker_1 = require("./TrailMaker");
5
- function loadExternalTrailInteraction(tsParticles) {
6
- tsParticles.addInteractor("externalTrail", (container) => new TrailMaker_1.TrailMaker(container));
5
+ async function loadExternalTrailInteraction(tsParticles) {
6
+ await tsParticles.addInteractor("externalTrail", (container) => new TrailMaker_1.TrailMaker(container));
7
7
  }
8
8
  exports.loadExternalTrailInteraction = loadExternalTrailInteraction;
@@ -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>;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.loadParticlesAttractInteraction = void 0;
4
4
  const Attractor_1 = require("./Attractor");
5
- function loadParticlesAttractInteraction(tsParticles) {
6
- tsParticles.addInteractor("particlesAttract", (container) => new Attractor_1.Attractor(container));
5
+ async function loadParticlesAttractInteraction(tsParticles) {
6
+ await tsParticles.addInteractor("particlesAttract", (container) => new Attractor_1.Attractor(container));
7
7
  }
8
8
  exports.loadParticlesAttractInteraction = loadParticlesAttractInteraction;
@@ -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>;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.loadParticlesCollisionsInteraction = void 0;
4
4
  const Collider_1 = require("./Collider");
5
- function loadParticlesCollisionsInteraction(tsParticles) {
6
- tsParticles.addInteractor("particlesCollisions", (container) => new Collider_1.Collider(container));
5
+ async function loadParticlesCollisionsInteraction(tsParticles) {
6
+ await tsParticles.addInteractor("particlesCollisions", (container) => new Collider_1.Collider(container));
7
7
  }
8
8
  exports.loadParticlesCollisionsInteraction = loadParticlesCollisionsInteraction;
@@ -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>;
@@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.loadParticlesLinksInteraction = exports.loadInteraction = void 0;
4
4
  const Linker_1 = require("./Linker");
5
5
  const plugin_1 = require("./plugin");
6
- function loadInteraction(tsParticles) {
7
- tsParticles.addInteractor("particlesLinks", (container) => new Linker_1.Linker(container));
6
+ async function loadInteraction(tsParticles) {
7
+ await tsParticles.addInteractor("particlesLinks", (container) => new Linker_1.Linker(container));
8
8
  }
9
9
  exports.loadInteraction = loadInteraction;
10
- function loadParticlesLinksInteraction(tsParticles) {
11
- loadInteraction(tsParticles);
12
- (0, plugin_1.loadPlugin)(tsParticles);
10
+ async function loadParticlesLinksInteraction(tsParticles) {
11
+ await loadInteraction(tsParticles);
12
+ await (0, plugin_1.loadPlugin)(tsParticles);
13
13
  }
14
14
  exports.loadParticlesLinksInteraction = loadParticlesLinksInteraction;
@@ -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>;
@@ -15,8 +15,8 @@ class Plugin {
15
15
  loadOptions() {
16
16
  }
17
17
  }
18
- function loadPlugin(tsParticles) {
18
+ async function loadPlugin(tsParticles) {
19
19
  const plugin = new Plugin();
20
- tsParticles.addPlugin(plugin);
20
+ await tsParticles.addPlugin(plugin);
21
21
  }
22
22
  exports.loadPlugin = loadPlugin;
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FullScreen = void 0;
4
4
  class FullScreen {
5
5
  constructor() {
6
- this.enable = false;
7
- this.zIndex = -1;
6
+ this.enable = true;
7
+ this.zIndex = 0;
8
8
  }
9
9
  load(data) {
10
10
  if (!data) {
@@ -6,7 +6,7 @@ const Events_1 = require("./Events/Events");
6
6
  const Modes_1 = require("./Modes/Modes");
7
7
  class Interactivity {
8
8
  constructor() {
9
- this.detectsOn = Enums_1.InteractivityDetect.canvas;
9
+ this.detectsOn = Enums_1.InteractivityDetect.window;
10
10
  this.events = new Events_1.Events();
11
11
  this.modes = new Modes_1.Modes();
12
12
  }
@@ -148,7 +148,9 @@ class Options {
148
148
  }
149
149
  setResponsive(width, pxRatio, defaultOptions) {
150
150
  this.load(defaultOptions);
151
- const responsiveOptions = this.responsive.find((t) => t.maxWidth * pxRatio > width);
151
+ const responsiveOptions = this.responsive.find((t) => t.mode === Enums_1.ResponsiveMode.screen && screen
152
+ ? t.maxWidth * pxRatio > screen.availWidth
153
+ : t.maxWidth * pxRatio > width);
152
154
  this.load(responsiveOptions === null || responsiveOptions === void 0 ? void 0 : responsiveOptions.options);
153
155
  return responsiveOptions === null || responsiveOptions === void 0 ? void 0 : responsiveOptions.maxWidth;
154
156
  }
@@ -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
  }
@@ -2,10 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Responsive = void 0;
4
4
  const Utils_1 = require("../../Utils");
5
+ const Enums_1 = require("../../Enums");
5
6
  class Responsive {
6
7
  constructor() {
7
8
  this.maxWidth = Infinity;
8
9
  this.options = {};
10
+ this.mode = Enums_1.ResponsiveMode.canvas;
9
11
  }
10
12
  load(data) {
11
13
  if (!data) {
@@ -14,6 +16,14 @@ class Responsive {
14
16
  if (data.maxWidth !== undefined) {
15
17
  this.maxWidth = data.maxWidth;
16
18
  }
19
+ if (data.mode !== undefined) {
20
+ if (data.mode === Enums_1.ResponsiveMode.screen) {
21
+ this.mode = Enums_1.ResponsiveMode.screen;
22
+ }
23
+ else {
24
+ this.mode = Enums_1.ResponsiveMode.canvas;
25
+ }
26
+ }
17
27
  if (data.options !== undefined) {
18
28
  this.options = (0, Utils_1.deepExtend)({}, data.options);
19
29
  }
@@ -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;
@@ -17,7 +18,7 @@ export declare class AbsorberInstance {
17
18
  opacity: number;
18
19
  size: number;
19
20
  color: IRgb;
20
- limit?: number;
21
+ limit: IAbsorberSizeLimit;
21
22
  readonly name?: string;
22
23
  position: Vector;
23
24
  private dragging;
@@ -6,7 +6,7 @@ const Vector_1 = require("../../Core/Particle/Vector");
6
6
  const Enums_1 = require("../../Enums");
7
7
  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_1.Vector.create(position.x, position.y) : undefined;
@@ -17,14 +17,23 @@ class AbsorberInstance {
17
17
  this.size = (0, Utils_1.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 = (0, Utils_1.colorToRgb)(color)) !== null && _a !== void 0 ? _a : {
31
+ this.color = (_c = (0, Utils_1.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 @@ 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 @@ 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
  }
@@ -2,12 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AbsorberSize = void 0;
4
4
  const ValueWithRandom_1 = require("../../../../Options/Classes/ValueWithRandom");
5
+ const AbsorberSizeLimit_1 = require("./AbsorberSizeLimit");
5
6
  class AbsorberSize extends ValueWithRandom_1.ValueWithRandom {
6
7
  constructor() {
7
8
  super();
8
9
  this.density = 5;
9
10
  this.random.minimumValue = 1;
10
11
  this.value = 50;
12
+ this.limit = new AbsorberSizeLimit_1.AbsorberSizeLimit();
11
13
  }
12
14
  load(data) {
13
15
  if (!data) {
@@ -17,11 +19,11 @@ class AbsorberSize extends ValueWithRandom_1.ValueWithRandom {
17
19
  if (data.density !== undefined) {
18
20
  this.density = data.density;
19
21
  }
20
- if (data.limit !== undefined) {
21
- this.limit = data.limit;
22
+ if (typeof data.limit === "number") {
23
+ this.limit.radius = data.limit;
22
24
  }
23
- if (data.limit !== undefined) {
24
- this.limit = data.limit;
25
+ else {
26
+ this.limit.load(data.limit);
25
27
  }
26
28
  }
27
29
  }
@@ -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,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AbsorberSizeLimit = void 0;
4
+ class AbsorberSizeLimit {
5
+ constructor() {
6
+ this.radius = 0;
7
+ this.mass = 0;
8
+ }
9
+ load(data) {
10
+ if (!data) {
11
+ return;
12
+ }
13
+ if (data.mass !== undefined) {
14
+ this.mass = data.mass;
15
+ }
16
+ if (data.radius !== undefined) {
17
+ this.radius = data.radius;
18
+ }
19
+ }
20
+ }
21
+ exports.AbsorberSizeLimit = AbsorberSizeLimit;
@@ -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
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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>;