@tsparticles/engine 4.0.0-alpha.3 → 4.0.0-alpha.5

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 (266) hide show
  1. package/794.min.js +2 -0
  2. package/794.min.js.LICENSE.txt +1 -0
  3. package/README.md +2 -5
  4. package/browser/Core/Canvas.js +3 -3
  5. package/browser/Core/Container.js +35 -155
  6. package/browser/Core/Engine.js +32 -78
  7. package/browser/Core/Particle.js +5 -10
  8. package/browser/Core/Particles.js +36 -25
  9. package/browser/Core/Utils/Constants.js +2 -2
  10. package/browser/Core/Utils/EventListeners.js +5 -250
  11. package/browser/Options/Classes/Options.js +7 -75
  12. package/browser/Options/Classes/Particles/ParticlesOptions.js +5 -11
  13. package/{esm/Options/Classes/Interactivity/Events → browser/Options/Classes}/ResizeEvent.js +1 -1
  14. package/browser/Utils/ColorUtils.js +7 -5
  15. package/browser/Utils/Utils.js +33 -36
  16. package/browser/exports.js +1 -21
  17. package/cjs/Core/Canvas.js +3 -3
  18. package/cjs/Core/Container.js +35 -155
  19. package/cjs/Core/Engine.js +32 -78
  20. package/cjs/Core/Particle.js +5 -10
  21. package/cjs/Core/Particles.js +36 -25
  22. package/cjs/Core/Utils/Constants.js +2 -2
  23. package/cjs/Core/Utils/EventListeners.js +5 -250
  24. package/cjs/Options/Classes/Options.js +7 -75
  25. package/cjs/Options/Classes/Particles/ParticlesOptions.js +5 -11
  26. package/cjs/Options/Classes/{Interactivity/Events/ResizeEvent.js → ResizeEvent.js} +1 -1
  27. package/cjs/Utils/ColorUtils.js +7 -5
  28. package/cjs/Utils/Utils.js +33 -36
  29. package/cjs/exports.js +1 -21
  30. package/dist_browser_Core_Container_js.js +6 -16
  31. package/esm/Core/Canvas.js +3 -3
  32. package/esm/Core/Container.js +35 -155
  33. package/esm/Core/Engine.js +32 -78
  34. package/esm/Core/Particle.js +5 -10
  35. package/esm/Core/Particles.js +36 -25
  36. package/esm/Core/Utils/Constants.js +2 -2
  37. package/esm/Core/Utils/EventListeners.js +5 -250
  38. package/esm/Options/Classes/Options.js +7 -75
  39. package/esm/Options/Classes/Particles/ParticlesOptions.js +5 -11
  40. package/{browser/Options/Classes/Interactivity/Events → esm/Options/Classes}/ResizeEvent.js +1 -1
  41. package/esm/Utils/ColorUtils.js +7 -5
  42. package/esm/Utils/Utils.js +33 -36
  43. package/esm/exports.js +1 -21
  44. package/package.json +1 -1
  45. package/report.html +1 -1
  46. package/tsparticles.engine.js +14 -206
  47. package/tsparticles.engine.min.js +1 -1
  48. package/tsparticles.engine.min.js.LICENSE.txt +1 -1
  49. package/types/Core/Container.d.ts +3 -15
  50. package/types/Core/Engine.d.ts +8 -19
  51. package/types/Core/Interfaces/IContainerPlugin.d.ts +8 -1
  52. package/types/Core/Interfaces/IPlugin.d.ts +5 -1
  53. package/types/Core/Particle.d.ts +0 -2
  54. package/types/Core/Particles.d.ts +1 -5
  55. package/types/Core/Utils/Constants.d.ts +2 -2
  56. package/types/Core/Utils/EventListeners.d.ts +0 -14
  57. package/types/Options/Classes/Options.d.ts +2 -11
  58. package/types/Options/Classes/Particles/ParticlesOptions.d.ts +0 -2
  59. package/types/Options/Classes/ResizeEvent.d.ts +9 -0
  60. package/types/Options/Interfaces/IOptions.d.ts +2 -8
  61. package/types/Options/Interfaces/Particles/IParticlesOptions.d.ts +0 -3
  62. package/types/Types/EngineInitializers.d.ts +10 -0
  63. package/types/Utils/Utils.d.ts +4 -6
  64. package/types/export-types.d.ts +3 -19
  65. package/types/exports.d.ts +1 -21
  66. package/umd/Core/Canvas.js +3 -3
  67. package/umd/Core/Container.js +35 -155
  68. package/umd/Core/Engine.js +33 -79
  69. package/umd/Core/Particle.js +6 -11
  70. package/umd/Core/Particles.js +37 -26
  71. package/umd/Core/Utils/Constants.js +3 -3
  72. package/umd/Core/Utils/EventListeners.js +7 -252
  73. package/umd/Options/Classes/Options.js +7 -75
  74. package/umd/Options/Classes/Particles/ParticlesOptions.js +5 -11
  75. package/umd/Options/Classes/{Interactivity/Events/ResizeEvent.js → ResizeEvent.js} +2 -2
  76. package/umd/Utils/ColorUtils.js +7 -5
  77. package/umd/Utils/Utils.js +34 -39
  78. package/umd/exports.js +2 -22
  79. package/638.min.js +0 -2
  80. package/638.min.js.LICENSE.txt +0 -1
  81. package/browser/Core/Interfaces/IMouseData.js +0 -1
  82. package/browser/Core/Interfaces/IParticlesInteractor.js +0 -1
  83. package/browser/Core/Utils/ExternalInteractorBase.js +0 -7
  84. package/browser/Core/Utils/InteractionManager.js +0 -60
  85. package/browser/Core/Utils/ParticlesInteractorBase.js +0 -7
  86. package/browser/Enums/InteractivityDetect.js +0 -6
  87. package/browser/Enums/Modes/ResponsiveMode.js +0 -5
  88. package/browser/Enums/Modes/ThemeMode.js +0 -6
  89. package/browser/Enums/Types/DivType.js +0 -5
  90. package/browser/Enums/Types/InteractorType.js +0 -5
  91. package/browser/Options/Classes/Interactivity/Events/ClickEvent.js +0 -18
  92. package/browser/Options/Classes/Interactivity/Events/DivEvent.js +0 -27
  93. package/browser/Options/Classes/Interactivity/Events/Events.js +0 -30
  94. package/browser/Options/Classes/Interactivity/Events/HoverEvent.js +0 -21
  95. package/browser/Options/Classes/Interactivity/Events/Parallax.js +0 -22
  96. package/browser/Options/Classes/Interactivity/Interactivity.js +0 -22
  97. package/browser/Options/Classes/Interactivity/Modes/Modes.js +0 -25
  98. package/browser/Options/Classes/ManualParticle.js +0 -21
  99. package/browser/Options/Classes/Responsive.js +0 -29
  100. package/browser/Options/Classes/Theme/Theme.js +0 -21
  101. package/browser/Options/Classes/Theme/ThemeDefault.js +0 -23
  102. package/browser/Options/Interfaces/IManualParticle.js +0 -1
  103. package/browser/Options/Interfaces/IResponsive.js +0 -1
  104. package/browser/Options/Interfaces/Interactivity/Events/IClickEvent.js +0 -1
  105. package/browser/Options/Interfaces/Interactivity/Events/IDivEvent.js +0 -1
  106. package/browser/Options/Interfaces/Interactivity/Events/IEvents.js +0 -1
  107. package/browser/Options/Interfaces/Interactivity/Events/IHoverEvent.js +0 -1
  108. package/browser/Options/Interfaces/Interactivity/Events/IParallax.js +0 -1
  109. package/browser/Options/Interfaces/Interactivity/IInteractivity.js +0 -1
  110. package/browser/Options/Interfaces/Interactivity/Modes/IModeDiv.js +0 -1
  111. package/browser/Options/Interfaces/Interactivity/Modes/IModes.js +0 -1
  112. package/browser/Options/Interfaces/Theme/ITheme.js +0 -1
  113. package/browser/Options/Interfaces/Theme/IThemeDefault.js +0 -1
  114. package/cjs/Core/Interfaces/IContainerInteractivity.js +0 -1
  115. package/cjs/Core/Interfaces/IExternalInteractor.js +0 -1
  116. package/cjs/Core/Interfaces/IInteractor.js +0 -1
  117. package/cjs/Core/Interfaces/IMouseData.js +0 -1
  118. package/cjs/Core/Interfaces/IParticlesInteractor.js +0 -1
  119. package/cjs/Core/Utils/ExternalInteractorBase.js +0 -7
  120. package/cjs/Core/Utils/InteractionManager.js +0 -60
  121. package/cjs/Core/Utils/ParticlesInteractorBase.js +0 -7
  122. package/cjs/Enums/InteractivityDetect.js +0 -6
  123. package/cjs/Enums/Modes/ResponsiveMode.js +0 -5
  124. package/cjs/Enums/Modes/ThemeMode.js +0 -6
  125. package/cjs/Enums/Types/DivType.js +0 -5
  126. package/cjs/Enums/Types/InteractorType.js +0 -5
  127. package/cjs/Options/Classes/Interactivity/Events/ClickEvent.js +0 -18
  128. package/cjs/Options/Classes/Interactivity/Events/DivEvent.js +0 -27
  129. package/cjs/Options/Classes/Interactivity/Events/Events.js +0 -30
  130. package/cjs/Options/Classes/Interactivity/Events/HoverEvent.js +0 -21
  131. package/cjs/Options/Classes/Interactivity/Events/Parallax.js +0 -22
  132. package/cjs/Options/Classes/Interactivity/Interactivity.js +0 -22
  133. package/cjs/Options/Classes/Interactivity/Modes/Modes.js +0 -25
  134. package/cjs/Options/Classes/ManualParticle.js +0 -21
  135. package/cjs/Options/Classes/Responsive.js +0 -29
  136. package/cjs/Options/Classes/Theme/Theme.js +0 -21
  137. package/cjs/Options/Classes/Theme/ThemeDefault.js +0 -23
  138. package/cjs/Options/Interfaces/IManualParticle.js +0 -1
  139. package/cjs/Options/Interfaces/IResponsive.js +0 -1
  140. package/cjs/Options/Interfaces/Interactivity/Events/IClickEvent.js +0 -1
  141. package/cjs/Options/Interfaces/Interactivity/Events/IDivEvent.js +0 -1
  142. package/cjs/Options/Interfaces/Interactivity/Events/IEvents.js +0 -1
  143. package/cjs/Options/Interfaces/Interactivity/Events/IHoverEvent.js +0 -1
  144. package/cjs/Options/Interfaces/Interactivity/Events/IParallax.js +0 -1
  145. package/cjs/Options/Interfaces/Interactivity/IInteractivity.js +0 -1
  146. package/cjs/Options/Interfaces/Interactivity/Modes/IModeDiv.js +0 -1
  147. package/cjs/Options/Interfaces/Interactivity/Modes/IModes.js +0 -1
  148. package/cjs/Options/Interfaces/Theme/ITheme.js +0 -1
  149. package/cjs/Options/Interfaces/Theme/IThemeDefault.js +0 -1
  150. package/esm/Core/Interfaces/IContainerInteractivity.js +0 -1
  151. package/esm/Core/Interfaces/IExternalInteractor.js +0 -1
  152. package/esm/Core/Interfaces/IInteractor.js +0 -1
  153. package/esm/Core/Interfaces/IMouseData.js +0 -1
  154. package/esm/Core/Interfaces/IParticlesInteractor.js +0 -1
  155. package/esm/Core/Utils/ExternalInteractorBase.js +0 -7
  156. package/esm/Core/Utils/InteractionManager.js +0 -60
  157. package/esm/Core/Utils/ParticlesInteractorBase.js +0 -7
  158. package/esm/Enums/InteractivityDetect.js +0 -6
  159. package/esm/Enums/Modes/ResponsiveMode.js +0 -5
  160. package/esm/Enums/Modes/ThemeMode.js +0 -6
  161. package/esm/Enums/Types/DivType.js +0 -5
  162. package/esm/Enums/Types/InteractorType.js +0 -5
  163. package/esm/Options/Classes/Interactivity/Events/ClickEvent.js +0 -18
  164. package/esm/Options/Classes/Interactivity/Events/DivEvent.js +0 -27
  165. package/esm/Options/Classes/Interactivity/Events/Events.js +0 -30
  166. package/esm/Options/Classes/Interactivity/Events/HoverEvent.js +0 -21
  167. package/esm/Options/Classes/Interactivity/Events/Parallax.js +0 -22
  168. package/esm/Options/Classes/Interactivity/Interactivity.js +0 -22
  169. package/esm/Options/Classes/Interactivity/Modes/Modes.js +0 -25
  170. package/esm/Options/Classes/ManualParticle.js +0 -21
  171. package/esm/Options/Classes/Responsive.js +0 -29
  172. package/esm/Options/Classes/Theme/Theme.js +0 -21
  173. package/esm/Options/Classes/Theme/ThemeDefault.js +0 -23
  174. package/esm/Options/Interfaces/IManualParticle.js +0 -1
  175. package/esm/Options/Interfaces/IResponsive.js +0 -1
  176. package/esm/Options/Interfaces/Interactivity/Events/IClickEvent.js +0 -1
  177. package/esm/Options/Interfaces/Interactivity/Events/IDivEvent.js +0 -1
  178. package/esm/Options/Interfaces/Interactivity/Events/IEvents.js +0 -1
  179. package/esm/Options/Interfaces/Interactivity/Events/IHoverEvent.js +0 -1
  180. package/esm/Options/Interfaces/Interactivity/Events/IParallax.js +0 -1
  181. package/esm/Options/Interfaces/Interactivity/IInteractivity.js +0 -1
  182. package/esm/Options/Interfaces/Interactivity/Modes/IModeDiv.js +0 -1
  183. package/esm/Options/Interfaces/Interactivity/Modes/IModes.js +0 -1
  184. package/esm/Options/Interfaces/Theme/ITheme.js +0 -1
  185. package/esm/Options/Interfaces/Theme/IThemeDefault.js +0 -1
  186. package/types/Core/Interfaces/IContainerInteractivity.d.ts +0 -6
  187. package/types/Core/Interfaces/IExternalInteractor.d.ts +0 -12
  188. package/types/Core/Interfaces/IInteractor.d.ts +0 -16
  189. package/types/Core/Interfaces/IMouseData.d.ts +0 -9
  190. package/types/Core/Interfaces/IParticlesInteractor.d.ts +0 -7
  191. package/types/Core/Utils/ExternalInteractorBase.d.ts +0 -15
  192. package/types/Core/Utils/InteractionManager.d.ts +0 -17
  193. package/types/Core/Utils/ParticlesInteractorBase.d.ts +0 -15
  194. package/types/Enums/InteractivityDetect.d.ts +0 -5
  195. package/types/Enums/Modes/ResponsiveMode.d.ts +0 -4
  196. package/types/Enums/Modes/ThemeMode.d.ts +0 -5
  197. package/types/Enums/Types/DivType.d.ts +0 -4
  198. package/types/Enums/Types/InteractorType.d.ts +0 -4
  199. package/types/Options/Classes/Interactivity/Events/ClickEvent.d.ts +0 -10
  200. package/types/Options/Classes/Interactivity/Events/DivEvent.d.ts +0 -13
  201. package/types/Options/Classes/Interactivity/Events/Events.d.ts +0 -16
  202. package/types/Options/Classes/Interactivity/Events/HoverEvent.d.ts +0 -12
  203. package/types/Options/Classes/Interactivity/Events/Parallax.d.ts +0 -10
  204. package/types/Options/Classes/Interactivity/Events/ResizeEvent.d.ts +0 -9
  205. package/types/Options/Classes/Interactivity/Interactivity.d.ts +0 -16
  206. package/types/Options/Classes/Interactivity/Modes/Modes.d.ts +0 -12
  207. package/types/Options/Classes/ManualParticle.d.ts +0 -10
  208. package/types/Options/Classes/Responsive.d.ts +0 -12
  209. package/types/Options/Classes/Theme/Theme.d.ts +0 -12
  210. package/types/Options/Classes/Theme/ThemeDefault.d.ts +0 -11
  211. package/types/Options/Interfaces/IManualParticle.d.ts +0 -7
  212. package/types/Options/Interfaces/IResponsive.d.ts +0 -7
  213. package/types/Options/Interfaces/Interactivity/Events/IClickEvent.d.ts +0 -5
  214. package/types/Options/Interfaces/Interactivity/Events/IDivEvent.d.ts +0 -8
  215. package/types/Options/Interfaces/Interactivity/Events/IEvents.d.ts +0 -11
  216. package/types/Options/Interfaces/Interactivity/Events/IHoverEvent.d.ts +0 -7
  217. package/types/Options/Interfaces/Interactivity/Events/IParallax.d.ts +0 -5
  218. package/types/Options/Interfaces/Interactivity/IInteractivity.d.ts +0 -9
  219. package/types/Options/Interfaces/Interactivity/Modes/IModeDiv.d.ts +0 -4
  220. package/types/Options/Interfaces/Interactivity/Modes/IModes.d.ts +0 -1
  221. package/types/Options/Interfaces/Theme/ITheme.d.ts +0 -7
  222. package/types/Options/Interfaces/Theme/IThemeDefault.d.ts +0 -6
  223. package/umd/Core/Interfaces/IExternalInteractor.js +0 -12
  224. package/umd/Core/Interfaces/IInteractor.js +0 -12
  225. package/umd/Core/Interfaces/IMouseData.js +0 -12
  226. package/umd/Core/Interfaces/IParticlesInteractor.js +0 -12
  227. package/umd/Core/Utils/ExternalInteractorBase.js +0 -21
  228. package/umd/Core/Utils/InteractionManager.js +0 -74
  229. package/umd/Core/Utils/ParticlesInteractorBase.js +0 -21
  230. package/umd/Enums/InteractivityDetect.js +0 -19
  231. package/umd/Enums/Modes/ResponsiveMode.js +0 -18
  232. package/umd/Enums/Modes/ThemeMode.js +0 -19
  233. package/umd/Enums/Types/DivType.js +0 -18
  234. package/umd/Enums/Types/InteractorType.js +0 -18
  235. package/umd/Options/Classes/Interactivity/Events/ClickEvent.js +0 -32
  236. package/umd/Options/Classes/Interactivity/Events/DivEvent.js +0 -41
  237. package/umd/Options/Classes/Interactivity/Events/Events.js +0 -44
  238. package/umd/Options/Classes/Interactivity/Events/HoverEvent.js +0 -35
  239. package/umd/Options/Classes/Interactivity/Events/Parallax.js +0 -36
  240. package/umd/Options/Classes/Interactivity/Interactivity.js +0 -36
  241. package/umd/Options/Classes/Interactivity/Modes/Modes.js +0 -39
  242. package/umd/Options/Classes/ManualParticle.js +0 -35
  243. package/umd/Options/Classes/Responsive.js +0 -43
  244. package/umd/Options/Classes/Theme/Theme.js +0 -35
  245. package/umd/Options/Classes/Theme/ThemeDefault.js +0 -37
  246. package/umd/Options/Interfaces/IManualParticle.js +0 -12
  247. package/umd/Options/Interfaces/IResponsive.js +0 -12
  248. package/umd/Options/Interfaces/Interactivity/Events/IClickEvent.js +0 -12
  249. package/umd/Options/Interfaces/Interactivity/Events/IDivEvent.js +0 -12
  250. package/umd/Options/Interfaces/Interactivity/Events/IEvents.js +0 -12
  251. package/umd/Options/Interfaces/Interactivity/Events/IHoverEvent.js +0 -12
  252. package/umd/Options/Interfaces/Interactivity/Events/IParallax.js +0 -12
  253. package/umd/Options/Interfaces/Interactivity/IInteractivity.js +0 -12
  254. package/umd/Options/Interfaces/Interactivity/Modes/IModeDiv.js +0 -12
  255. package/umd/Options/Interfaces/Interactivity/Modes/IModes.js +0 -12
  256. package/umd/Options/Interfaces/Theme/ITheme.js +0 -12
  257. package/umd/Options/Interfaces/Theme/IThemeDefault.js +0 -12
  258. /package/browser/Options/Interfaces/{Interactivity/Events/IResizeEvent.js → IResizeEvent.js} +0 -0
  259. /package/browser/{Core/Interfaces/IContainerInteractivity.js → Types/EngineInitializers.js} +0 -0
  260. /package/cjs/Options/Interfaces/{Interactivity/Events/IResizeEvent.js → IResizeEvent.js} +0 -0
  261. /package/{browser/Core/Interfaces/IExternalInteractor.js → cjs/Types/EngineInitializers.js} +0 -0
  262. /package/esm/Options/Interfaces/{Interactivity/Events/IResizeEvent.js → IResizeEvent.js} +0 -0
  263. /package/{browser/Core/Interfaces/IInteractor.js → esm/Types/EngineInitializers.js} +0 -0
  264. /package/types/Options/Interfaces/{Interactivity/Events/IResizeEvent.d.ts → IResizeEvent.d.ts} +0 -0
  265. /package/umd/Options/Interfaces/{Interactivity/Events/IResizeEvent.js → IResizeEvent.js} +0 -0
  266. /package/umd/{Core/Interfaces/IContainerInteractivity.js → Types/EngineInitializers.js} +0 -0
@@ -1,12 +0,0 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
5
- }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- });
@@ -1,12 +0,0 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
5
- }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- });
@@ -1,12 +0,0 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
5
- }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- });
@@ -1,12 +0,0 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
5
- }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- });
@@ -1,21 +0,0 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
5
- }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "../../Enums/Types/InteractorType.js"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.ExternalInteractorBase = void 0;
13
- const InteractorType_js_1 = require("../../Enums/Types/InteractorType.js");
14
- class ExternalInteractorBase {
15
- constructor(container) {
16
- this.type = InteractorType_js_1.InteractorType.external;
17
- this.container = container;
18
- }
19
- }
20
- exports.ExternalInteractorBase = ExternalInteractorBase;
21
- });
@@ -1,74 +0,0 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
5
- }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "../../Enums/Types/InteractorType.js"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.InteractionManager = void 0;
13
- const InteractorType_js_1 = require("../../Enums/Types/InteractorType.js");
14
- class InteractionManager {
15
- constructor(engine, container) {
16
- this.container = container;
17
- this._engine = engine;
18
- this._interactors = [];
19
- this._externalInteractors = [];
20
- this._particleInteractors = [];
21
- }
22
- externalInteract(delta) {
23
- for (const interactor of this._externalInteractors) {
24
- if (interactor.isEnabled()) {
25
- interactor.interact(delta);
26
- }
27
- }
28
- }
29
- handleClickMode(mode) {
30
- for (const interactor of this._externalInteractors) {
31
- interactor.handleClickMode?.(mode);
32
- }
33
- }
34
- async init() {
35
- this._interactors = await this._engine.getInteractors(this.container, true);
36
- this._externalInteractors = [];
37
- this._particleInteractors = [];
38
- for (const interactor of this._interactors) {
39
- switch (interactor.type) {
40
- case InteractorType_js_1.InteractorType.external:
41
- this._externalInteractors.push(interactor);
42
- break;
43
- case InteractorType_js_1.InteractorType.particles:
44
- this._particleInteractors.push(interactor);
45
- break;
46
- }
47
- interactor.init();
48
- }
49
- }
50
- particlesInteract(particle, delta) {
51
- for (const interactor of this._externalInteractors) {
52
- interactor.clear(particle, delta);
53
- }
54
- for (const interactor of this._particleInteractors) {
55
- if (interactor.isEnabled(particle)) {
56
- interactor.interact(particle, delta);
57
- }
58
- }
59
- }
60
- reset(particle) {
61
- for (const interactor of this._externalInteractors) {
62
- if (interactor.isEnabled()) {
63
- interactor.reset(particle);
64
- }
65
- }
66
- for (const interactor of this._particleInteractors) {
67
- if (interactor.isEnabled(particle)) {
68
- interactor.reset(particle);
69
- }
70
- }
71
- }
72
- }
73
- exports.InteractionManager = InteractionManager;
74
- });
@@ -1,21 +0,0 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
5
- }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "../../Enums/Types/InteractorType.js"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.ParticlesInteractorBase = void 0;
13
- const InteractorType_js_1 = require("../../Enums/Types/InteractorType.js");
14
- class ParticlesInteractorBase {
15
- constructor(container) {
16
- this.type = InteractorType_js_1.InteractorType.particles;
17
- this.container = container;
18
- }
19
- }
20
- exports.ParticlesInteractorBase = ParticlesInteractorBase;
21
- });
@@ -1,19 +0,0 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
5
- }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.InteractivityDetect = void 0;
13
- var InteractivityDetect;
14
- (function (InteractivityDetect) {
15
- InteractivityDetect["canvas"] = "canvas";
16
- InteractivityDetect["parent"] = "parent";
17
- InteractivityDetect["window"] = "window";
18
- })(InteractivityDetect || (exports.InteractivityDetect = InteractivityDetect = {}));
19
- });
@@ -1,18 +0,0 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
5
- }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.ResponsiveMode = void 0;
13
- var ResponsiveMode;
14
- (function (ResponsiveMode) {
15
- ResponsiveMode["screen"] = "screen";
16
- ResponsiveMode["canvas"] = "canvas";
17
- })(ResponsiveMode || (exports.ResponsiveMode = ResponsiveMode = {}));
18
- });
@@ -1,19 +0,0 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
5
- }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.ThemeMode = void 0;
13
- var ThemeMode;
14
- (function (ThemeMode) {
15
- ThemeMode["any"] = "any";
16
- ThemeMode["dark"] = "dark";
17
- ThemeMode["light"] = "light";
18
- })(ThemeMode || (exports.ThemeMode = ThemeMode = {}));
19
- });
@@ -1,18 +0,0 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
5
- }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.DivType = void 0;
13
- var DivType;
14
- (function (DivType) {
15
- DivType["circle"] = "circle";
16
- DivType["rectangle"] = "rectangle";
17
- })(DivType || (exports.DivType = DivType = {}));
18
- });
@@ -1,18 +0,0 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
5
- }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.InteractorType = void 0;
13
- var InteractorType;
14
- (function (InteractorType) {
15
- InteractorType["external"] = "external";
16
- InteractorType["particles"] = "particles";
17
- })(InteractorType || (exports.InteractorType = InteractorType = {}));
18
- });
@@ -1,32 +0,0 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
5
- }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "../../../../Utils/TypeUtils.js"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.ClickEvent = void 0;
13
- const TypeUtils_js_1 = require("../../../../Utils/TypeUtils.js");
14
- class ClickEvent {
15
- constructor() {
16
- this.enable = false;
17
- this.mode = [];
18
- }
19
- load(data) {
20
- if ((0, TypeUtils_js_1.isNull)(data)) {
21
- return;
22
- }
23
- if (data.enable !== undefined) {
24
- this.enable = data.enable;
25
- }
26
- if (data.mode !== undefined) {
27
- this.mode = data.mode;
28
- }
29
- }
30
- }
31
- exports.ClickEvent = ClickEvent;
32
- });
@@ -1,41 +0,0 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
5
- }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "../../../../Enums/Types/DivType.js", "../../../../Utils/TypeUtils.js"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.DivEvent = void 0;
13
- const DivType_js_1 = require("../../../../Enums/Types/DivType.js");
14
- const TypeUtils_js_1 = require("../../../../Utils/TypeUtils.js");
15
- class DivEvent {
16
- constructor() {
17
- this.selectors = [];
18
- this.enable = false;
19
- this.mode = [];
20
- this.type = DivType_js_1.DivType.circle;
21
- }
22
- load(data) {
23
- if ((0, TypeUtils_js_1.isNull)(data)) {
24
- return;
25
- }
26
- if (data.selectors !== undefined) {
27
- this.selectors = data.selectors;
28
- }
29
- if (data.enable !== undefined) {
30
- this.enable = data.enable;
31
- }
32
- if (data.mode !== undefined) {
33
- this.mode = data.mode;
34
- }
35
- if (data.type !== undefined) {
36
- this.type = data.type;
37
- }
38
- }
39
- }
40
- exports.DivEvent = DivEvent;
41
- });
@@ -1,44 +0,0 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
5
- }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "./ClickEvent.js", "./DivEvent.js", "./HoverEvent.js", "./ResizeEvent.js", "../../../../Utils/Utils.js", "../../../../Utils/TypeUtils.js"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.Events = void 0;
13
- const ClickEvent_js_1 = require("./ClickEvent.js");
14
- const DivEvent_js_1 = require("./DivEvent.js");
15
- const HoverEvent_js_1 = require("./HoverEvent.js");
16
- const ResizeEvent_js_1 = require("./ResizeEvent.js");
17
- const Utils_js_1 = require("../../../../Utils/Utils.js");
18
- const TypeUtils_js_1 = require("../../../../Utils/TypeUtils.js");
19
- class Events {
20
- constructor() {
21
- this.onClick = new ClickEvent_js_1.ClickEvent();
22
- this.onDiv = new DivEvent_js_1.DivEvent();
23
- this.onHover = new HoverEvent_js_1.HoverEvent();
24
- this.resize = new ResizeEvent_js_1.ResizeEvent();
25
- }
26
- load(data) {
27
- if ((0, TypeUtils_js_1.isNull)(data)) {
28
- return;
29
- }
30
- this.onClick.load(data.onClick);
31
- const onDiv = data.onDiv;
32
- if (onDiv !== undefined) {
33
- this.onDiv = (0, Utils_js_1.executeOnSingleOrMultiple)(onDiv, t => {
34
- const tmp = new DivEvent_js_1.DivEvent();
35
- tmp.load(t);
36
- return tmp;
37
- });
38
- }
39
- this.onHover.load(data.onHover);
40
- this.resize.load(data.resize);
41
- }
42
- }
43
- exports.Events = Events;
44
- });
@@ -1,35 +0,0 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
5
- }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "./Parallax.js", "../../../../Utils/TypeUtils.js"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.HoverEvent = void 0;
13
- const Parallax_js_1 = require("./Parallax.js");
14
- const TypeUtils_js_1 = require("../../../../Utils/TypeUtils.js");
15
- class HoverEvent {
16
- constructor() {
17
- this.enable = false;
18
- this.mode = [];
19
- this.parallax = new Parallax_js_1.Parallax();
20
- }
21
- load(data) {
22
- if ((0, TypeUtils_js_1.isNull)(data)) {
23
- return;
24
- }
25
- if (data.enable !== undefined) {
26
- this.enable = data.enable;
27
- }
28
- if (data.mode !== undefined) {
29
- this.mode = data.mode;
30
- }
31
- this.parallax.load(data.parallax);
32
- }
33
- }
34
- exports.HoverEvent = HoverEvent;
35
- });
@@ -1,36 +0,0 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
5
- }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "../../../../Utils/TypeUtils.js"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.Parallax = void 0;
13
- const TypeUtils_js_1 = require("../../../../Utils/TypeUtils.js");
14
- class Parallax {
15
- constructor() {
16
- this.enable = false;
17
- this.force = 2;
18
- this.smooth = 10;
19
- }
20
- load(data) {
21
- if ((0, TypeUtils_js_1.isNull)(data)) {
22
- return;
23
- }
24
- if (data.enable !== undefined) {
25
- this.enable = data.enable;
26
- }
27
- if (data.force !== undefined) {
28
- this.force = data.force;
29
- }
30
- if (data.smooth !== undefined) {
31
- this.smooth = data.smooth;
32
- }
33
- }
34
- }
35
- exports.Parallax = Parallax;
36
- });
@@ -1,36 +0,0 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
5
- }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "./Events/Events.js", "../../../Enums/InteractivityDetect.js", "./Modes/Modes.js", "../../../Utils/TypeUtils.js"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.Interactivity = void 0;
13
- const Events_js_1 = require("./Events/Events.js");
14
- const InteractivityDetect_js_1 = require("../../../Enums/InteractivityDetect.js");
15
- const Modes_js_1 = require("./Modes/Modes.js");
16
- const TypeUtils_js_1 = require("../../../Utils/TypeUtils.js");
17
- class Interactivity {
18
- constructor(engine, container) {
19
- this.detectsOn = InteractivityDetect_js_1.InteractivityDetect.window;
20
- this.events = new Events_js_1.Events();
21
- this.modes = new Modes_js_1.Modes(engine, container);
22
- }
23
- load(data) {
24
- if ((0, TypeUtils_js_1.isNull)(data)) {
25
- return;
26
- }
27
- const detectsOn = data.detectsOn;
28
- if (detectsOn !== undefined) {
29
- this.detectsOn = detectsOn;
30
- }
31
- this.events.load(data.events);
32
- this.modes.load(data.modes);
33
- }
34
- }
35
- exports.Interactivity = Interactivity;
36
- });
@@ -1,39 +0,0 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
5
- }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "../../../../Utils/TypeUtils.js"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.Modes = void 0;
13
- const TypeUtils_js_1 = require("../../../../Utils/TypeUtils.js");
14
- class Modes {
15
- constructor(engine, container) {
16
- this._engine = engine;
17
- this._container = container;
18
- }
19
- load(data) {
20
- if ((0, TypeUtils_js_1.isNull)(data)) {
21
- return;
22
- }
23
- if (!this._container) {
24
- return;
25
- }
26
- const interactors = this._engine.interactors.get(this._container);
27
- if (!interactors) {
28
- return;
29
- }
30
- for (const interactor of interactors) {
31
- if (!interactor.loadModeOptions) {
32
- continue;
33
- }
34
- interactor.loadModeOptions(this, data);
35
- }
36
- }
37
- }
38
- exports.Modes = Modes;
39
- });
@@ -1,35 +0,0 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
5
- }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "../../Enums/Modes/PixelMode.js", "../../Utils/Utils.js", "../../Utils/TypeUtils.js", "../../Core/Utils/Constants.js"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.ManualParticle = void 0;
13
- const PixelMode_js_1 = require("../../Enums/Modes/PixelMode.js");
14
- const Utils_js_1 = require("../../Utils/Utils.js");
15
- const TypeUtils_js_1 = require("../../Utils/TypeUtils.js");
16
- const Constants_js_1 = require("../../Core/Utils/Constants.js");
17
- class ManualParticle {
18
- load(data) {
19
- if ((0, TypeUtils_js_1.isNull)(data)) {
20
- return;
21
- }
22
- if (data.position) {
23
- this.position = {
24
- x: data.position.x ?? Constants_js_1.manualDefaultPosition,
25
- y: data.position.y ?? Constants_js_1.manualDefaultPosition,
26
- mode: data.position.mode ?? PixelMode_js_1.PixelMode.percent,
27
- };
28
- }
29
- if (data.options) {
30
- this.options = (0, Utils_js_1.deepExtend)({}, data.options);
31
- }
32
- }
33
- }
34
- exports.ManualParticle = ManualParticle;
35
- });
@@ -1,43 +0,0 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
5
- }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "../../Enums/Modes/ResponsiveMode.js", "../../Utils/Utils.js", "../../Utils/TypeUtils.js"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.Responsive = void 0;
13
- const ResponsiveMode_js_1 = require("../../Enums/Modes/ResponsiveMode.js");
14
- const Utils_js_1 = require("../../Utils/Utils.js");
15
- const TypeUtils_js_1 = require("../../Utils/TypeUtils.js");
16
- class Responsive {
17
- constructor() {
18
- this.maxWidth = Infinity;
19
- this.options = {};
20
- this.mode = ResponsiveMode_js_1.ResponsiveMode.canvas;
21
- }
22
- load(data) {
23
- if ((0, TypeUtils_js_1.isNull)(data)) {
24
- return;
25
- }
26
- if (!(0, TypeUtils_js_1.isNull)(data.maxWidth)) {
27
- this.maxWidth = data.maxWidth;
28
- }
29
- if (!(0, TypeUtils_js_1.isNull)(data.mode)) {
30
- if (data.mode === ResponsiveMode_js_1.ResponsiveMode.screen) {
31
- this.mode = ResponsiveMode_js_1.ResponsiveMode.screen;
32
- }
33
- else {
34
- this.mode = ResponsiveMode_js_1.ResponsiveMode.canvas;
35
- }
36
- }
37
- if (!(0, TypeUtils_js_1.isNull)(data.options)) {
38
- this.options = (0, Utils_js_1.deepExtend)({}, data.options);
39
- }
40
- }
41
- }
42
- exports.Responsive = Responsive;
43
- });
@@ -1,35 +0,0 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
5
- }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "./ThemeDefault.js", "../../../Utils/Utils.js", "../../../Utils/TypeUtils.js"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.Theme = void 0;
13
- const ThemeDefault_js_1 = require("./ThemeDefault.js");
14
- const Utils_js_1 = require("../../../Utils/Utils.js");
15
- const TypeUtils_js_1 = require("../../../Utils/TypeUtils.js");
16
- class Theme {
17
- constructor() {
18
- this.name = "";
19
- this.default = new ThemeDefault_js_1.ThemeDefault();
20
- }
21
- load(data) {
22
- if ((0, TypeUtils_js_1.isNull)(data)) {
23
- return;
24
- }
25
- if (data.name !== undefined) {
26
- this.name = data.name;
27
- }
28
- this.default.load(data.default);
29
- if (data.options !== undefined) {
30
- this.options = (0, Utils_js_1.deepExtend)({}, data.options);
31
- }
32
- }
33
- }
34
- exports.Theme = Theme;
35
- });