@tsparticles/engine 4.0.0-alpha.2 → 4.0.0-alpha.4

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 (283) 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 +18 -22
  5. package/browser/Core/Container.js +44 -169
  6. package/browser/Core/Engine.js +40 -61
  7. package/browser/Core/Particle.js +99 -58
  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/CanvasUtils.js +26 -83
  15. package/browser/Utils/ColorUtils.js +17 -2
  16. package/browser/Utils/MathUtils.js +3 -2
  17. package/browser/Utils/Utils.js +26 -33
  18. package/browser/exports.js +1 -21
  19. package/cjs/Core/Canvas.js +18 -22
  20. package/cjs/Core/Container.js +44 -169
  21. package/cjs/Core/Engine.js +40 -61
  22. package/cjs/Core/Particle.js +99 -58
  23. package/cjs/Core/Particles.js +36 -25
  24. package/cjs/Core/Utils/Constants.js +2 -2
  25. package/cjs/Core/Utils/EventListeners.js +5 -250
  26. package/cjs/Options/Classes/Options.js +7 -75
  27. package/cjs/Options/Classes/Particles/ParticlesOptions.js +5 -11
  28. package/cjs/Options/Classes/{Interactivity/Events/ResizeEvent.js → ResizeEvent.js} +1 -1
  29. package/cjs/Utils/CanvasUtils.js +26 -83
  30. package/cjs/Utils/ColorUtils.js +17 -2
  31. package/cjs/Utils/MathUtils.js +3 -2
  32. package/cjs/Utils/Utils.js +26 -33
  33. package/cjs/exports.js +1 -21
  34. package/dist_browser_Core_Container_js.js +6 -16
  35. package/esm/Core/Canvas.js +18 -22
  36. package/esm/Core/Container.js +44 -169
  37. package/esm/Core/Engine.js +40 -61
  38. package/esm/Core/Particle.js +99 -58
  39. package/esm/Core/Particles.js +36 -25
  40. package/esm/Core/Utils/Constants.js +2 -2
  41. package/esm/Core/Utils/EventListeners.js +5 -250
  42. package/esm/Options/Classes/Options.js +7 -75
  43. package/esm/Options/Classes/Particles/ParticlesOptions.js +5 -11
  44. package/{browser/Options/Classes/Interactivity/Events → esm/Options/Classes}/ResizeEvent.js +1 -1
  45. package/esm/Utils/CanvasUtils.js +26 -83
  46. package/esm/Utils/ColorUtils.js +17 -2
  47. package/esm/Utils/MathUtils.js +3 -2
  48. package/esm/Utils/Utils.js +26 -33
  49. package/esm/exports.js +1 -21
  50. package/package.json +1 -1
  51. package/report.html +1 -1
  52. package/tsparticles.engine.js +16 -208
  53. package/tsparticles.engine.min.js +1 -1
  54. package/tsparticles.engine.min.js.LICENSE.txt +1 -1
  55. package/types/Core/Canvas.d.ts +3 -0
  56. package/types/Core/Container.d.ts +4 -15
  57. package/types/Core/Engine.d.ts +4 -19
  58. package/types/Core/Interfaces/IContainerPlugin.d.ts +8 -1
  59. package/types/Core/Interfaces/IDrawParticleParams.d.ts +1 -1
  60. package/types/Core/Interfaces/IParticleOpacityData.d.ts +4 -0
  61. package/types/Core/Interfaces/IParticleRotateData.d.ts +4 -0
  62. package/types/Core/Interfaces/IParticleTransformValues.d.ts +4 -4
  63. package/types/Core/Interfaces/IParticleUpdater.d.ts +1 -1
  64. package/types/Core/Interfaces/IPlugin.d.ts +5 -1
  65. package/types/Core/Particle.d.ts +12 -2
  66. package/types/Core/Particles.d.ts +1 -5
  67. package/types/Core/Utils/Constants.d.ts +2 -2
  68. package/types/Core/Utils/EventListeners.d.ts +0 -14
  69. package/types/Options/Classes/Options.d.ts +2 -11
  70. package/types/Options/Classes/Particles/ParticlesOptions.d.ts +0 -2
  71. package/types/Options/Classes/ResizeEvent.d.ts +9 -0
  72. package/types/Options/Interfaces/IOptions.d.ts +2 -8
  73. package/types/Options/Interfaces/Particles/IParticlesOptions.d.ts +0 -3
  74. package/types/Types/CustomEventListener.d.ts +1 -1
  75. package/types/Types/EngineInitializers.d.ts +10 -0
  76. package/types/Utils/CanvasUtils.d.ts +6 -21
  77. package/types/Utils/EventDispatcher.d.ts +1 -1
  78. package/types/Utils/Utils.d.ts +4 -6
  79. package/types/export-types.d.ts +3 -19
  80. package/types/exports.d.ts +1 -21
  81. package/umd/Core/Canvas.js +17 -21
  82. package/umd/Core/Container.js +44 -169
  83. package/umd/Core/Engine.js +41 -62
  84. package/umd/Core/Particle.js +99 -58
  85. package/umd/Core/Particles.js +37 -26
  86. package/umd/Core/Utils/Constants.js +3 -3
  87. package/umd/Core/Utils/EventListeners.js +7 -252
  88. package/umd/Options/Classes/Options.js +7 -75
  89. package/umd/Options/Classes/Particles/ParticlesOptions.js +5 -11
  90. package/umd/Options/Classes/{Interactivity/Events/ResizeEvent.js → ResizeEvent.js} +2 -2
  91. package/umd/Utils/CanvasUtils.js +25 -82
  92. package/umd/Utils/ColorUtils.js +17 -2
  93. package/umd/Utils/MathUtils.js +3 -2
  94. package/umd/Utils/Utils.js +27 -36
  95. package/umd/exports.js +2 -22
  96. package/638.min.js +0 -2
  97. package/638.min.js.LICENSE.txt +0 -1
  98. package/browser/Core/Utils/ExternalInteractorBase.js +0 -7
  99. package/browser/Core/Utils/InteractionManager.js +0 -60
  100. package/browser/Core/Utils/ParticlesInteractorBase.js +0 -7
  101. package/browser/Enums/InteractivityDetect.js +0 -6
  102. package/browser/Enums/Modes/ResponsiveMode.js +0 -5
  103. package/browser/Enums/Modes/ThemeMode.js +0 -6
  104. package/browser/Enums/Types/DivType.js +0 -5
  105. package/browser/Enums/Types/InteractorType.js +0 -5
  106. package/browser/Options/Classes/Interactivity/Events/ClickEvent.js +0 -18
  107. package/browser/Options/Classes/Interactivity/Events/DivEvent.js +0 -27
  108. package/browser/Options/Classes/Interactivity/Events/Events.js +0 -30
  109. package/browser/Options/Classes/Interactivity/Events/HoverEvent.js +0 -21
  110. package/browser/Options/Classes/Interactivity/Events/Parallax.js +0 -22
  111. package/browser/Options/Classes/Interactivity/Interactivity.js +0 -22
  112. package/browser/Options/Classes/Interactivity/Modes/Modes.js +0 -25
  113. package/browser/Options/Classes/ManualParticle.js +0 -21
  114. package/browser/Options/Classes/Responsive.js +0 -29
  115. package/browser/Options/Classes/Theme/Theme.js +0 -21
  116. package/browser/Options/Classes/Theme/ThemeDefault.js +0 -23
  117. package/browser/Options/Interfaces/Interactivity/Events/IEvents.js +0 -1
  118. package/browser/Options/Interfaces/Interactivity/Events/IHoverEvent.js +0 -1
  119. package/browser/Options/Interfaces/Interactivity/Events/IParallax.js +0 -1
  120. package/browser/Options/Interfaces/Interactivity/IInteractivity.js +0 -1
  121. package/browser/Options/Interfaces/Interactivity/Modes/IModeDiv.js +0 -1
  122. package/browser/Options/Interfaces/Interactivity/Modes/IModes.js +0 -1
  123. package/browser/Options/Interfaces/Theme/ITheme.js +0 -1
  124. package/browser/Options/Interfaces/Theme/IThemeDefault.js +0 -1
  125. package/cjs/Core/Interfaces/IContainerInteractivity.js +0 -1
  126. package/cjs/Core/Interfaces/IExternalInteractor.js +0 -1
  127. package/cjs/Core/Interfaces/IInteractor.js +0 -1
  128. package/cjs/Core/Interfaces/IMouseData.js +0 -1
  129. package/cjs/Core/Interfaces/IParticlesInteractor.js +0 -1
  130. package/cjs/Core/Utils/ExternalInteractorBase.js +0 -7
  131. package/cjs/Core/Utils/InteractionManager.js +0 -60
  132. package/cjs/Core/Utils/ParticlesInteractorBase.js +0 -7
  133. package/cjs/Enums/InteractivityDetect.js +0 -6
  134. package/cjs/Enums/Modes/ResponsiveMode.js +0 -5
  135. package/cjs/Enums/Modes/ThemeMode.js +0 -6
  136. package/cjs/Enums/Types/DivType.js +0 -5
  137. package/cjs/Enums/Types/InteractorType.js +0 -5
  138. package/cjs/Options/Classes/Interactivity/Events/ClickEvent.js +0 -18
  139. package/cjs/Options/Classes/Interactivity/Events/DivEvent.js +0 -27
  140. package/cjs/Options/Classes/Interactivity/Events/Events.js +0 -30
  141. package/cjs/Options/Classes/Interactivity/Events/HoverEvent.js +0 -21
  142. package/cjs/Options/Classes/Interactivity/Events/Parallax.js +0 -22
  143. package/cjs/Options/Classes/Interactivity/Interactivity.js +0 -22
  144. package/cjs/Options/Classes/Interactivity/Modes/Modes.js +0 -25
  145. package/cjs/Options/Classes/ManualParticle.js +0 -21
  146. package/cjs/Options/Classes/Responsive.js +0 -29
  147. package/cjs/Options/Classes/Theme/Theme.js +0 -21
  148. package/cjs/Options/Classes/Theme/ThemeDefault.js +0 -23
  149. package/cjs/Options/Interfaces/IManualParticle.js +0 -1
  150. package/cjs/Options/Interfaces/IResponsive.js +0 -1
  151. package/cjs/Options/Interfaces/Interactivity/Events/IClickEvent.js +0 -1
  152. package/cjs/Options/Interfaces/Interactivity/Events/IDivEvent.js +0 -1
  153. package/cjs/Options/Interfaces/Interactivity/Events/IEvents.js +0 -1
  154. package/cjs/Options/Interfaces/Interactivity/Events/IHoverEvent.js +0 -1
  155. package/cjs/Options/Interfaces/Interactivity/Events/IParallax.js +0 -1
  156. package/cjs/Options/Interfaces/Interactivity/IInteractivity.js +0 -1
  157. package/cjs/Options/Interfaces/Interactivity/Modes/IModeDiv.js +0 -1
  158. package/cjs/Options/Interfaces/Interactivity/Modes/IModes.js +0 -1
  159. package/cjs/Options/Interfaces/Theme/ITheme.js +0 -1
  160. package/cjs/Options/Interfaces/Theme/IThemeDefault.js +0 -1
  161. package/esm/Core/Interfaces/IContainerInteractivity.js +0 -1
  162. package/esm/Core/Interfaces/IExternalInteractor.js +0 -1
  163. package/esm/Core/Interfaces/IInteractor.js +0 -1
  164. package/esm/Core/Interfaces/IMouseData.js +0 -1
  165. package/esm/Core/Interfaces/IParticlesInteractor.js +0 -1
  166. package/esm/Core/Utils/ExternalInteractorBase.js +0 -7
  167. package/esm/Core/Utils/InteractionManager.js +0 -60
  168. package/esm/Core/Utils/ParticlesInteractorBase.js +0 -7
  169. package/esm/Enums/InteractivityDetect.js +0 -6
  170. package/esm/Enums/Modes/ResponsiveMode.js +0 -5
  171. package/esm/Enums/Modes/ThemeMode.js +0 -6
  172. package/esm/Enums/Types/DivType.js +0 -5
  173. package/esm/Enums/Types/InteractorType.js +0 -5
  174. package/esm/Options/Classes/Interactivity/Events/ClickEvent.js +0 -18
  175. package/esm/Options/Classes/Interactivity/Events/DivEvent.js +0 -27
  176. package/esm/Options/Classes/Interactivity/Events/Events.js +0 -30
  177. package/esm/Options/Classes/Interactivity/Events/HoverEvent.js +0 -21
  178. package/esm/Options/Classes/Interactivity/Events/Parallax.js +0 -22
  179. package/esm/Options/Classes/Interactivity/Interactivity.js +0 -22
  180. package/esm/Options/Classes/Interactivity/Modes/Modes.js +0 -25
  181. package/esm/Options/Classes/ManualParticle.js +0 -21
  182. package/esm/Options/Classes/Responsive.js +0 -29
  183. package/esm/Options/Classes/Theme/Theme.js +0 -21
  184. package/esm/Options/Classes/Theme/ThemeDefault.js +0 -23
  185. package/esm/Options/Interfaces/IManualParticle.js +0 -1
  186. package/esm/Options/Interfaces/IResponsive.js +0 -1
  187. package/esm/Options/Interfaces/Interactivity/Events/IClickEvent.js +0 -1
  188. package/esm/Options/Interfaces/Interactivity/Events/IDivEvent.js +0 -1
  189. package/esm/Options/Interfaces/Interactivity/Events/IEvents.js +0 -1
  190. package/esm/Options/Interfaces/Interactivity/Events/IHoverEvent.js +0 -1
  191. package/esm/Options/Interfaces/Interactivity/Events/IParallax.js +0 -1
  192. package/esm/Options/Interfaces/Interactivity/IInteractivity.js +0 -1
  193. package/esm/Options/Interfaces/Interactivity/Modes/IModeDiv.js +0 -1
  194. package/esm/Options/Interfaces/Interactivity/Modes/IModes.js +0 -1
  195. package/esm/Options/Interfaces/Theme/ITheme.js +0 -1
  196. package/esm/Options/Interfaces/Theme/IThemeDefault.js +0 -1
  197. package/types/Core/Interfaces/IContainerInteractivity.d.ts +0 -6
  198. package/types/Core/Interfaces/IExternalInteractor.d.ts +0 -12
  199. package/types/Core/Interfaces/IInteractor.d.ts +0 -16
  200. package/types/Core/Interfaces/IMouseData.d.ts +0 -9
  201. package/types/Core/Interfaces/IParticlesInteractor.d.ts +0 -7
  202. package/types/Core/Utils/ExternalInteractorBase.d.ts +0 -15
  203. package/types/Core/Utils/InteractionManager.d.ts +0 -17
  204. package/types/Core/Utils/ParticlesInteractorBase.d.ts +0 -15
  205. package/types/Enums/InteractivityDetect.d.ts +0 -5
  206. package/types/Enums/Modes/ResponsiveMode.d.ts +0 -4
  207. package/types/Enums/Modes/ThemeMode.d.ts +0 -5
  208. package/types/Enums/Types/DivType.d.ts +0 -4
  209. package/types/Enums/Types/InteractorType.d.ts +0 -4
  210. package/types/Options/Classes/Interactivity/Events/ClickEvent.d.ts +0 -10
  211. package/types/Options/Classes/Interactivity/Events/DivEvent.d.ts +0 -13
  212. package/types/Options/Classes/Interactivity/Events/Events.d.ts +0 -16
  213. package/types/Options/Classes/Interactivity/Events/HoverEvent.d.ts +0 -12
  214. package/types/Options/Classes/Interactivity/Events/Parallax.d.ts +0 -10
  215. package/types/Options/Classes/Interactivity/Events/ResizeEvent.d.ts +0 -9
  216. package/types/Options/Classes/Interactivity/Interactivity.d.ts +0 -16
  217. package/types/Options/Classes/Interactivity/Modes/Modes.d.ts +0 -12
  218. package/types/Options/Classes/ManualParticle.d.ts +0 -10
  219. package/types/Options/Classes/Responsive.d.ts +0 -12
  220. package/types/Options/Classes/Theme/Theme.d.ts +0 -12
  221. package/types/Options/Classes/Theme/ThemeDefault.d.ts +0 -11
  222. package/types/Options/Interfaces/IManualParticle.d.ts +0 -7
  223. package/types/Options/Interfaces/IResponsive.d.ts +0 -7
  224. package/types/Options/Interfaces/Interactivity/Events/IClickEvent.d.ts +0 -5
  225. package/types/Options/Interfaces/Interactivity/Events/IDivEvent.d.ts +0 -8
  226. package/types/Options/Interfaces/Interactivity/Events/IEvents.d.ts +0 -11
  227. package/types/Options/Interfaces/Interactivity/Events/IHoverEvent.d.ts +0 -7
  228. package/types/Options/Interfaces/Interactivity/Events/IParallax.d.ts +0 -5
  229. package/types/Options/Interfaces/Interactivity/IInteractivity.d.ts +0 -9
  230. package/types/Options/Interfaces/Interactivity/Modes/IModeDiv.d.ts +0 -4
  231. package/types/Options/Interfaces/Interactivity/Modes/IModes.d.ts +0 -1
  232. package/types/Options/Interfaces/Theme/ITheme.d.ts +0 -7
  233. package/types/Options/Interfaces/Theme/IThemeDefault.d.ts +0 -6
  234. package/umd/Core/Interfaces/IMouseData.js +0 -12
  235. package/umd/Core/Interfaces/IParticlesInteractor.js +0 -12
  236. package/umd/Core/Utils/ExternalInteractorBase.js +0 -21
  237. package/umd/Core/Utils/InteractionManager.js +0 -74
  238. package/umd/Core/Utils/ParticlesInteractorBase.js +0 -21
  239. package/umd/Enums/InteractivityDetect.js +0 -19
  240. package/umd/Enums/Modes/ResponsiveMode.js +0 -18
  241. package/umd/Enums/Modes/ThemeMode.js +0 -19
  242. package/umd/Enums/Types/DivType.js +0 -18
  243. package/umd/Enums/Types/InteractorType.js +0 -18
  244. package/umd/Options/Classes/Interactivity/Events/ClickEvent.js +0 -32
  245. package/umd/Options/Classes/Interactivity/Events/DivEvent.js +0 -41
  246. package/umd/Options/Classes/Interactivity/Events/Events.js +0 -44
  247. package/umd/Options/Classes/Interactivity/Events/HoverEvent.js +0 -35
  248. package/umd/Options/Classes/Interactivity/Events/Parallax.js +0 -36
  249. package/umd/Options/Classes/Interactivity/Interactivity.js +0 -36
  250. package/umd/Options/Classes/Interactivity/Modes/Modes.js +0 -39
  251. package/umd/Options/Classes/ManualParticle.js +0 -35
  252. package/umd/Options/Classes/Responsive.js +0 -43
  253. package/umd/Options/Classes/Theme/Theme.js +0 -35
  254. package/umd/Options/Classes/Theme/ThemeDefault.js +0 -37
  255. package/umd/Options/Interfaces/IManualParticle.js +0 -12
  256. package/umd/Options/Interfaces/IResponsive.js +0 -12
  257. package/umd/Options/Interfaces/Interactivity/Events/IClickEvent.js +0 -12
  258. package/umd/Options/Interfaces/Interactivity/Events/IDivEvent.js +0 -12
  259. package/umd/Options/Interfaces/Interactivity/Events/IEvents.js +0 -12
  260. package/umd/Options/Interfaces/Interactivity/Events/IHoverEvent.js +0 -12
  261. package/umd/Options/Interfaces/Interactivity/Events/IParallax.js +0 -12
  262. package/umd/Options/Interfaces/Interactivity/IInteractivity.js +0 -12
  263. package/umd/Options/Interfaces/Interactivity/Modes/IModeDiv.js +0 -12
  264. package/umd/Options/Interfaces/Interactivity/Modes/IModes.js +0 -12
  265. package/umd/Options/Interfaces/Theme/ITheme.js +0 -12
  266. package/umd/Options/Interfaces/Theme/IThemeDefault.js +0 -12
  267. /package/browser/Core/Interfaces/{IContainerInteractivity.js → IParticleOpacityData.js} +0 -0
  268. /package/browser/Core/Interfaces/{IExternalInteractor.js → IParticleRotateData.js} +0 -0
  269. /package/browser/Options/Interfaces/{Interactivity/Events/IResizeEvent.js → IResizeEvent.js} +0 -0
  270. /package/browser/{Core/Interfaces/IInteractor.js → Types/EngineInitializers.js} +0 -0
  271. /package/{browser/Core/Interfaces/IMouseData.js → cjs/Core/Interfaces/IParticleOpacityData.js} +0 -0
  272. /package/{browser/Core/Interfaces/IParticlesInteractor.js → cjs/Core/Interfaces/IParticleRotateData.js} +0 -0
  273. /package/cjs/Options/Interfaces/{Interactivity/Events/IResizeEvent.js → IResizeEvent.js} +0 -0
  274. /package/{browser/Options/Interfaces/IManualParticle.js → cjs/Types/EngineInitializers.js} +0 -0
  275. /package/{browser/Options/Interfaces/IResponsive.js → esm/Core/Interfaces/IParticleOpacityData.js} +0 -0
  276. /package/{browser/Options/Interfaces/Interactivity/Events/IClickEvent.js → esm/Core/Interfaces/IParticleRotateData.js} +0 -0
  277. /package/esm/Options/Interfaces/{Interactivity/Events/IResizeEvent.js → IResizeEvent.js} +0 -0
  278. /package/{browser/Options/Interfaces/Interactivity/Events/IDivEvent.js → esm/Types/EngineInitializers.js} +0 -0
  279. /package/types/Options/Interfaces/{Interactivity/Events/IResizeEvent.d.ts → IResizeEvent.d.ts} +0 -0
  280. /package/umd/Core/Interfaces/{IContainerInteractivity.js → IParticleOpacityData.js} +0 -0
  281. /package/umd/Core/Interfaces/{IExternalInteractor.js → IParticleRotateData.js} +0 -0
  282. /package/umd/Options/Interfaces/{Interactivity/Events/IResizeEvent.js → IResizeEvent.js} +0 -0
  283. /package/umd/{Core/Interfaces/IInteractor.js → Types/EngineInitializers.js} +0 -0
@@ -1,11 +0,0 @@
1
- import type { IOptionLoader } from "../../Interfaces/IOptionLoader.js";
2
- import type { IThemeDefault } from "../../Interfaces/Theme/IThemeDefault.js";
3
- import type { RecursivePartial } from "../../../Types/RecursivePartial.js";
4
- import { ThemeMode } from "../../../Enums/Modes/ThemeMode.js";
5
- export declare class ThemeDefault implements IThemeDefault, IOptionLoader<IThemeDefault> {
6
- auto: boolean;
7
- mode: ThemeMode | keyof typeof ThemeMode;
8
- value: boolean;
9
- constructor();
10
- load(data?: RecursivePartial<IThemeDefault>): void;
11
- }
@@ -1,7 +0,0 @@
1
- import type { ICoordinatesWithMode } from "../../Core/Interfaces/ICoordinates.js";
2
- import type { IParticlesOptions } from "./Particles/IParticlesOptions.js";
3
- import type { RecursivePartial } from "../../Types/RecursivePartial.js";
4
- export interface IManualParticle {
5
- options?: RecursivePartial<IParticlesOptions>;
6
- position?: ICoordinatesWithMode;
7
- }
@@ -1,7 +0,0 @@
1
- import type { ISourceOptions } from "../../Types/ISourceOptions.js";
2
- import type { ResponsiveMode } from "../../Enums/Modes/ResponsiveMode.js";
3
- export interface IResponsive {
4
- maxWidth: number;
5
- mode: ResponsiveMode | keyof typeof ResponsiveMode;
6
- options: ISourceOptions;
7
- }
@@ -1,5 +0,0 @@
1
- import type { SingleOrMultiple } from "../../../../Types/SingleOrMultiple.js";
2
- export interface IClickEvent {
3
- enable: boolean;
4
- mode: SingleOrMultiple<string>;
5
- }
@@ -1,8 +0,0 @@
1
- import type { DivType } from "../../../../Enums/Types/DivType.js";
2
- import type { SingleOrMultiple } from "../../../../Types/SingleOrMultiple.js";
3
- export interface IDivEvent {
4
- enable: boolean;
5
- mode: SingleOrMultiple<string>;
6
- selectors: SingleOrMultiple<string>;
7
- type: DivType | keyof typeof DivType;
8
- }
@@ -1,11 +0,0 @@
1
- import type { IClickEvent } from "./IClickEvent.js";
2
- import type { IDivEvent } from "./IDivEvent.js";
3
- import type { IHoverEvent } from "./IHoverEvent.js";
4
- import type { IResizeEvent } from "./IResizeEvent.js";
5
- import type { SingleOrMultiple } from "../../../../Types/SingleOrMultiple.js";
6
- export interface IEvents {
7
- onClick: IClickEvent;
8
- onDiv: SingleOrMultiple<IDivEvent>;
9
- onHover: IHoverEvent;
10
- resize: IResizeEvent;
11
- }
@@ -1,7 +0,0 @@
1
- import type { IParallax } from "./IParallax.js";
2
- import type { SingleOrMultiple } from "../../../../Types/SingleOrMultiple.js";
3
- export interface IHoverEvent {
4
- enable: boolean;
5
- mode: SingleOrMultiple<string>;
6
- parallax: IParallax;
7
- }
@@ -1,5 +0,0 @@
1
- export interface IParallax {
2
- enable: boolean;
3
- force: number;
4
- smooth: number;
5
- }
@@ -1,9 +0,0 @@
1
- import type { IEvents } from "./Events/IEvents.js";
2
- import type { IModes } from "./Modes/IModes.js";
3
- import type { InteractivityDetect } from "../../../Enums/InteractivityDetect.js";
4
- export interface IInteractivity {
5
- [name: string]: unknown;
6
- detectsOn: InteractivityDetect | keyof typeof InteractivityDetect;
7
- events: IEvents;
8
- modes: IModes;
9
- }
@@ -1,4 +0,0 @@
1
- import type { SingleOrMultiple } from "../../../../Types/SingleOrMultiple.js";
2
- export interface IModeDiv {
3
- selectors: SingleOrMultiple<string>;
4
- }
@@ -1 +0,0 @@
1
- export type IModes = Record<string, unknown>;
@@ -1,7 +0,0 @@
1
- import type { ISourceOptions } from "../../../Types/ISourceOptions.js";
2
- import type { IThemeDefault } from "./IThemeDefault.js";
3
- export interface ITheme {
4
- default: IThemeDefault;
5
- name: string;
6
- options?: ISourceOptions;
7
- }
@@ -1,6 +0,0 @@
1
- import type { ThemeMode } from "../../../Enums/Modes/ThemeMode.js";
2
- export interface IThemeDefault {
3
- auto: boolean;
4
- mode: ThemeMode | keyof typeof ThemeMode;
5
- value: boolean;
6
- }
@@ -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
- });