@tsparticles/engine 4.0.0-beta.0 → 4.0.0-beta.10

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 (242) hide show
  1. package/67.min.js +1 -0
  2. package/README.md +53 -965
  3. package/browser/Core/CanvasManager.js +303 -0
  4. package/browser/Core/Container.js +61 -34
  5. package/browser/Core/Engine.js +26 -138
  6. package/browser/Core/Particle.js +29 -28
  7. package/{cjs/Core/Particles.js → browser/Core/ParticlesManager.js} +27 -57
  8. package/browser/Core/RenderManager.js +303 -0
  9. package/browser/Core/Retina.js +3 -8
  10. package/browser/Core/Utils/PluginManager.js +145 -0
  11. package/browser/Options/Classes/Options.js +8 -21
  12. package/browser/Options/Classes/Particles/Paint.js +20 -0
  13. package/browser/Options/Classes/Particles/ParticlesOptions.js +65 -27
  14. package/browser/Options/Interfaces/Particles/IPaint.js +1 -0
  15. package/browser/Types/CanvasContextType.js +1 -0
  16. package/browser/Utils/CanvasUtils.js +4 -4
  17. package/browser/Utils/ColorUtils.js +21 -21
  18. package/browser/Utils/LogUtils.js +1 -0
  19. package/browser/Utils/OptionsUtils.js +2 -2
  20. package/browser/Utils/Utils.js +16 -10
  21. package/browser/exports.js +1 -0
  22. package/cjs/Core/CanvasManager.js +303 -0
  23. package/cjs/Core/Container.js +61 -34
  24. package/cjs/Core/Engine.js +26 -138
  25. package/cjs/Core/Particle.js +29 -28
  26. package/{esm/Core/Particles.js → cjs/Core/ParticlesManager.js} +27 -57
  27. package/cjs/Core/RenderManager.js +303 -0
  28. package/cjs/Core/Retina.js +3 -8
  29. package/cjs/Core/Utils/PluginManager.js +145 -0
  30. package/cjs/Options/Classes/Options.js +8 -21
  31. package/cjs/Options/Classes/Particles/Paint.js +20 -0
  32. package/cjs/Options/Classes/Particles/ParticlesOptions.js +65 -27
  33. package/cjs/Options/Interfaces/Particles/IPaint.js +1 -0
  34. package/cjs/Types/CanvasContextType.js +1 -0
  35. package/cjs/Utils/CanvasUtils.js +4 -4
  36. package/cjs/Utils/ColorUtils.js +21 -21
  37. package/cjs/Utils/LogUtils.js +1 -0
  38. package/cjs/Utils/OptionsUtils.js +2 -2
  39. package/cjs/Utils/Utils.js +16 -10
  40. package/cjs/exports.js +1 -0
  41. package/dist_browser_Core_Container_js.js +24 -14
  42. package/esm/Core/CanvasManager.js +303 -0
  43. package/esm/Core/Container.js +61 -34
  44. package/esm/Core/Engine.js +26 -138
  45. package/esm/Core/Particle.js +29 -28
  46. package/{browser/Core/Particles.js → esm/Core/ParticlesManager.js} +27 -57
  47. package/esm/Core/RenderManager.js +303 -0
  48. package/esm/Core/Retina.js +3 -8
  49. package/esm/Core/Utils/PluginManager.js +145 -0
  50. package/esm/Options/Classes/Options.js +8 -21
  51. package/esm/Options/Classes/Particles/Paint.js +20 -0
  52. package/esm/Options/Classes/Particles/ParticlesOptions.js +65 -27
  53. package/esm/Options/Interfaces/Particles/IPaint.js +1 -0
  54. package/esm/Types/CanvasContextType.js +1 -0
  55. package/esm/Utils/CanvasUtils.js +4 -4
  56. package/esm/Utils/ColorUtils.js +21 -21
  57. package/esm/Utils/LogUtils.js +1 -0
  58. package/esm/Utils/OptionsUtils.js +2 -2
  59. package/esm/Utils/Utils.js +16 -10
  60. package/esm/exports.js +1 -0
  61. package/package.json +2 -3
  62. package/report.html +84 -29
  63. package/tsparticles.engine.js +31 -11
  64. package/tsparticles.engine.min.js +2 -2
  65. package/types/Core/CanvasManager.d.ts +39 -0
  66. package/types/Core/Container.d.ts +26 -7
  67. package/types/Core/Engine.d.ts +2 -54
  68. package/types/Core/Interfaces/IContainerPlugin.d.ts +8 -7
  69. package/types/Core/Interfaces/IDrawParticleParams.d.ts +2 -1
  70. package/types/Core/Interfaces/IPalette.d.ts +15 -2
  71. package/types/Core/Interfaces/IParticleRetinaProps.d.ts +4 -4
  72. package/types/Core/Interfaces/IParticleUpdater.d.ts +2 -1
  73. package/types/Core/Interfaces/IShapeDrawData.d.ts +2 -1
  74. package/types/Core/Particle.d.ts +4 -4
  75. package/types/Core/{Particles.d.ts → ParticlesManager.d.ts} +4 -11
  76. package/types/Core/{Canvas.d.ts → RenderManager.d.ts} +12 -33
  77. package/types/Core/Retina.d.ts +0 -2
  78. package/types/Core/Utils/PluginManager.d.ts +62 -0
  79. package/types/Options/Classes/Options.d.ts +3 -3
  80. package/types/Options/Classes/Particles/Paint.d.ts +10 -0
  81. package/types/Options/Classes/Particles/ParticlesOptions.d.ts +7 -7
  82. package/types/Options/Interfaces/Particles/IPaint.d.ts +6 -0
  83. package/types/Options/Interfaces/Particles/IParticlesOptions.d.ts +3 -4
  84. package/types/Types/CanvasContextType.d.ts +1 -0
  85. package/types/Utils/CanvasUtils.d.ts +8 -5
  86. package/types/Utils/ColorUtils.d.ts +8 -8
  87. package/types/Utils/LogUtils.d.ts +1 -0
  88. package/types/Utils/OptionsUtils.d.ts +2 -2
  89. package/types/export-types.d.ts +5 -2
  90. package/types/exports.d.ts +1 -0
  91. package/164.min.js +0 -1
  92. package/browser/Core/Canvas.js +0 -570
  93. package/cjs/Core/Canvas.js +0 -570
  94. package/esm/Core/Canvas.js +0 -570
  95. package/umd/Core/Canvas.js +0 -584
  96. package/umd/Core/Container.js +0 -356
  97. package/umd/Core/Engine.js +0 -295
  98. package/umd/Core/Interfaces/Colors.js +0 -12
  99. package/umd/Core/Interfaces/IBounds.js +0 -12
  100. package/umd/Core/Interfaces/IBubbleParticleData.js +0 -12
  101. package/umd/Core/Interfaces/ICircleBouncer.js +0 -12
  102. package/umd/Core/Interfaces/IColorManager.js +0 -12
  103. package/umd/Core/Interfaces/IContainerPlugin.js +0 -12
  104. package/umd/Core/Interfaces/ICoordinates.js +0 -12
  105. package/umd/Core/Interfaces/IDelta.js +0 -12
  106. package/umd/Core/Interfaces/IDimension.js +0 -12
  107. package/umd/Core/Interfaces/IDistance.js +0 -12
  108. package/umd/Core/Interfaces/IDrawParticleParams.js +0 -12
  109. package/umd/Core/Interfaces/IEffectDrawer.js +0 -12
  110. package/umd/Core/Interfaces/ILoadParams.js +0 -12
  111. package/umd/Core/Interfaces/IPalette.js +0 -12
  112. package/umd/Core/Interfaces/IParticleColorStyle.js +0 -12
  113. package/umd/Core/Interfaces/IParticleHslAnimation.js +0 -12
  114. package/umd/Core/Interfaces/IParticleLife.js +0 -12
  115. package/umd/Core/Interfaces/IParticleOpacityData.js +0 -12
  116. package/umd/Core/Interfaces/IParticleRetinaProps.js +0 -12
  117. package/umd/Core/Interfaces/IParticleRoll.js +0 -12
  118. package/umd/Core/Interfaces/IParticleRotateData.js +0 -12
  119. package/umd/Core/Interfaces/IParticleTransformValues.js +0 -12
  120. package/umd/Core/Interfaces/IParticleUpdater.js +0 -12
  121. package/umd/Core/Interfaces/IParticleValueAnimation.js +0 -12
  122. package/umd/Core/Interfaces/IPlugin.js +0 -12
  123. package/umd/Core/Interfaces/IPositionFromSizeParams.js +0 -12
  124. package/umd/Core/Interfaces/IRangeValue.js +0 -12
  125. package/umd/Core/Interfaces/IShapeDrawData.js +0 -12
  126. package/umd/Core/Interfaces/IShapeDrawer.js +0 -12
  127. package/umd/Core/Interfaces/IShapeValues.js +0 -12
  128. package/umd/Core/Interfaces/ISlowParticleData.js +0 -12
  129. package/umd/Core/Particle.js +0 -432
  130. package/umd/Core/Particles.js +0 -407
  131. package/umd/Core/Retina.js +0 -52
  132. package/umd/Core/Utils/Constants.js +0 -23
  133. package/umd/Core/Utils/EventListeners.js +0 -102
  134. package/umd/Core/Utils/Ranges.js +0 -91
  135. package/umd/Core/Utils/SpatialHashGrid.js +0 -116
  136. package/umd/Core/Utils/Vectors.js +0 -126
  137. package/umd/Enums/AnimationStatus.js +0 -18
  138. package/umd/Enums/Directions/MoveDirection.js +0 -27
  139. package/umd/Enums/Directions/OutModeDirection.js +0 -20
  140. package/umd/Enums/Directions/RotateDirection.js +0 -19
  141. package/umd/Enums/Modes/AnimationMode.js +0 -20
  142. package/umd/Enums/Modes/LimitMode.js +0 -18
  143. package/umd/Enums/Modes/OutMode.js +0 -21
  144. package/umd/Enums/Modes/PixelMode.js +0 -18
  145. package/umd/Enums/RangeType.js +0 -18
  146. package/umd/Enums/Types/AlterType.js +0 -18
  147. package/umd/Enums/Types/DestroyType.js +0 -19
  148. package/umd/Enums/Types/EasingType.js +0 -58
  149. package/umd/Enums/Types/EventType.js +0 -28
  150. package/umd/Enums/Types/GradientType.js +0 -19
  151. package/umd/Enums/Types/ParticleOutType.js +0 -19
  152. package/umd/Enums/Types/StartValueType.js +0 -19
  153. package/umd/Options/Classes/AnimatableColor.js +0 -52
  154. package/umd/Options/Classes/AnimationOptions.js +0 -79
  155. package/umd/Options/Classes/Background/Background.js +0 -56
  156. package/umd/Options/Classes/ColorAnimation.js +0 -44
  157. package/umd/Options/Classes/FullScreen/FullScreen.js +0 -34
  158. package/umd/Options/Classes/HslAnimation.js +0 -30
  159. package/umd/Options/Classes/Options.js +0 -171
  160. package/umd/Options/Classes/OptionsColor.js +0 -42
  161. package/umd/Options/Classes/Particles/Bounce/ParticlesBounce.js +0 -31
  162. package/umd/Options/Classes/Particles/Bounce/ParticlesBounceFactor.js +0 -21
  163. package/umd/Options/Classes/Particles/Effect/Effect.js +0 -46
  164. package/umd/Options/Classes/Particles/Fill.js +0 -42
  165. package/umd/Options/Classes/Particles/Move/Move.js +0 -120
  166. package/umd/Options/Classes/Particles/Move/MoveAngle.js +0 -35
  167. package/umd/Options/Classes/Particles/Move/MoveCenter.js +0 -45
  168. package/umd/Options/Classes/Particles/Move/MoveGravity.js +0 -45
  169. package/umd/Options/Classes/Particles/Move/OutModes.js +0 -38
  170. package/umd/Options/Classes/Particles/Move/Path/MovePath.js +0 -46
  171. package/umd/Options/Classes/Particles/Move/Spin.js +0 -40
  172. package/umd/Options/Classes/Particles/Number/ParticlesDensity.js +0 -41
  173. package/umd/Options/Classes/Particles/Number/ParticlesNumber.js +0 -37
  174. package/umd/Options/Classes/Particles/Number/ParticlesNumberLimit.js +0 -35
  175. package/umd/Options/Classes/Particles/Opacity/Opacity.js +0 -35
  176. package/umd/Options/Classes/Particles/Opacity/OpacityAnimation.js +0 -34
  177. package/umd/Options/Classes/Particles/ParticlesOptions.js +0 -116
  178. package/umd/Options/Classes/Particles/Shape/Shape.js +0 -46
  179. package/umd/Options/Classes/Particles/Size/Size.js +0 -35
  180. package/umd/Options/Classes/Particles/Size/SizeAnimation.js +0 -34
  181. package/umd/Options/Classes/Particles/Stroke.js +0 -39
  182. package/umd/Options/Classes/Particles/ZIndex/ZIndex.js +0 -42
  183. package/umd/Options/Classes/ResizeEvent.js +0 -34
  184. package/umd/Options/Classes/ValueWithRandom.js +0 -56
  185. package/umd/Options/Interfaces/Background/IBackground.js +0 -12
  186. package/umd/Options/Interfaces/FullScreen/IFullScreen.js +0 -12
  187. package/umd/Options/Interfaces/IAnimatable.js +0 -12
  188. package/umd/Options/Interfaces/IAnimatableColor.js +0 -12
  189. package/umd/Options/Interfaces/IAnimation.js +0 -12
  190. package/umd/Options/Interfaces/IColorAnimation.js +0 -12
  191. package/umd/Options/Interfaces/IHslAnimation.js +0 -12
  192. package/umd/Options/Interfaces/IOptionLoader.js +0 -12
  193. package/umd/Options/Interfaces/IOptions.js +0 -12
  194. package/umd/Options/Interfaces/IOptionsColor.js +0 -12
  195. package/umd/Options/Interfaces/IResizeEvent.js +0 -12
  196. package/umd/Options/Interfaces/IValueWithRandom.js +0 -12
  197. package/umd/Options/Interfaces/Particles/Bounce/IParticlesBounce.js +0 -12
  198. package/umd/Options/Interfaces/Particles/Effect/IEffect.js +0 -12
  199. package/umd/Options/Interfaces/Particles/IFill.js +0 -12
  200. package/umd/Options/Interfaces/Particles/IParticlesOptions.js +0 -12
  201. package/umd/Options/Interfaces/Particles/IStroke.js +0 -12
  202. package/umd/Options/Interfaces/Particles/Move/IMove.js +0 -12
  203. package/umd/Options/Interfaces/Particles/Move/IMoveAngle.js +0 -12
  204. package/umd/Options/Interfaces/Particles/Move/IMoveCenter.js +0 -12
  205. package/umd/Options/Interfaces/Particles/Move/IMoveGravity.js +0 -12
  206. package/umd/Options/Interfaces/Particles/Move/IOutModes.js +0 -12
  207. package/umd/Options/Interfaces/Particles/Move/ISpin.js +0 -12
  208. package/umd/Options/Interfaces/Particles/Move/Path/IMovePath.js +0 -12
  209. package/umd/Options/Interfaces/Particles/Number/IParticlesDensity.js +0 -12
  210. package/umd/Options/Interfaces/Particles/Number/IParticlesNumber.js +0 -12
  211. package/umd/Options/Interfaces/Particles/Number/IParticlesNumberLimit.js +0 -12
  212. package/umd/Options/Interfaces/Particles/Opacity/IOpacity.js +0 -12
  213. package/umd/Options/Interfaces/Particles/Opacity/IOpacityAnimation.js +0 -12
  214. package/umd/Options/Interfaces/Particles/Shape/IShape.js +0 -12
  215. package/umd/Options/Interfaces/Particles/Size/ISize.js +0 -12
  216. package/umd/Options/Interfaces/Particles/Size/ISizeAnimation.js +0 -12
  217. package/umd/Options/Interfaces/Particles/ZIndex/IZIndex.js +0 -12
  218. package/umd/Types/CustomEventArgs.js +0 -12
  219. package/umd/Types/CustomEventListener.js +0 -12
  220. package/umd/Types/EasingFunction.js +0 -12
  221. package/umd/Types/EngineInitializers.js +0 -12
  222. package/umd/Types/ExportResult.js +0 -12
  223. package/umd/Types/ISourceOptions.js +0 -12
  224. package/umd/Types/ParticlesGroups.js +0 -12
  225. package/umd/Types/PathOptions.js +0 -12
  226. package/umd/Types/RangeValue.js +0 -12
  227. package/umd/Types/RecursivePartial.js +0 -12
  228. package/umd/Types/ShapeData.js +0 -12
  229. package/umd/Types/SingleOrMultiple.js +0 -12
  230. package/umd/Utils/CanvasUtils.js +0 -145
  231. package/umd/Utils/ColorUtils.js +0 -395
  232. package/umd/Utils/EventDispatcher.js +0 -63
  233. package/umd/Utils/LogUtils.js +0 -36
  234. package/umd/Utils/MathUtils.js +0 -203
  235. package/umd/Utils/OptionsUtils.js +0 -25
  236. package/umd/Utils/TypeUtils.js +0 -40
  237. package/umd/Utils/Utils.js +0 -484
  238. package/umd/bundle.js +0 -32
  239. package/umd/export-types.js +0 -12
  240. package/umd/exports.js +0 -82
  241. package/umd/index.js +0 -32
  242. package/umd/initEngine.js +0 -17
@@ -1,120 +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/Directions/MoveDirection.js", "../../../../Utils/TypeUtils.js", "./MoveAngle.js", "./MoveCenter.js", "./MoveGravity.js", "./Path/MovePath.js", "./OutModes.js", "./Spin.js", "../../../../Utils/MathUtils.js"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.Move = void 0;
13
- const MoveDirection_js_1 = require("../../../../Enums/Directions/MoveDirection.js");
14
- const TypeUtils_js_1 = require("../../../../Utils/TypeUtils.js");
15
- const MoveAngle_js_1 = require("./MoveAngle.js");
16
- const MoveCenter_js_1 = require("./MoveCenter.js");
17
- const MoveGravity_js_1 = require("./MoveGravity.js");
18
- const MovePath_js_1 = require("./Path/MovePath.js");
19
- const OutModes_js_1 = require("./OutModes.js");
20
- const Spin_js_1 = require("./Spin.js");
21
- const MathUtils_js_1 = require("../../../../Utils/MathUtils.js");
22
- class Move {
23
- angle;
24
- center;
25
- decay;
26
- direction;
27
- distance;
28
- drift;
29
- enable;
30
- gravity;
31
- outModes;
32
- path;
33
- random;
34
- size;
35
- speed;
36
- spin;
37
- straight;
38
- vibrate;
39
- warp;
40
- constructor() {
41
- this.angle = new MoveAngle_js_1.MoveAngle();
42
- this.center = new MoveCenter_js_1.MoveCenter();
43
- this.decay = 0;
44
- this.distance = {};
45
- this.direction = MoveDirection_js_1.MoveDirection.none;
46
- this.drift = 0;
47
- this.enable = false;
48
- this.gravity = new MoveGravity_js_1.MoveGravity();
49
- this.path = new MovePath_js_1.MovePath();
50
- this.outModes = new OutModes_js_1.OutModes();
51
- this.random = false;
52
- this.size = false;
53
- this.speed = 2;
54
- this.spin = new Spin_js_1.Spin();
55
- this.straight = false;
56
- this.vibrate = false;
57
- this.warp = false;
58
- }
59
- load(data) {
60
- if ((0, TypeUtils_js_1.isNull)(data)) {
61
- return;
62
- }
63
- this.angle.load((0, TypeUtils_js_1.isNumber)(data.angle) ? { value: data.angle } : data.angle);
64
- this.center.load(data.center);
65
- if (data.decay !== undefined) {
66
- this.decay = (0, MathUtils_js_1.setRangeValue)(data.decay);
67
- }
68
- if (data.direction !== undefined) {
69
- this.direction = data.direction;
70
- }
71
- if (data.distance !== undefined) {
72
- this.distance = (0, TypeUtils_js_1.isNumber)(data.distance)
73
- ? {
74
- horizontal: data.distance,
75
- vertical: data.distance,
76
- }
77
- : { ...data.distance };
78
- }
79
- if (data.drift !== undefined) {
80
- this.drift = (0, MathUtils_js_1.setRangeValue)(data.drift);
81
- }
82
- if (data.enable !== undefined) {
83
- this.enable = data.enable;
84
- }
85
- this.gravity.load(data.gravity);
86
- const outModes = data.outModes;
87
- if (outModes !== undefined) {
88
- if ((0, TypeUtils_js_1.isObject)(outModes)) {
89
- this.outModes.load(outModes);
90
- }
91
- else {
92
- this.outModes.load({
93
- default: outModes,
94
- });
95
- }
96
- }
97
- this.path.load(data.path);
98
- if (data.random !== undefined) {
99
- this.random = data.random;
100
- }
101
- if (data.size !== undefined) {
102
- this.size = data.size;
103
- }
104
- if (data.speed !== undefined) {
105
- this.speed = (0, MathUtils_js_1.setRangeValue)(data.speed);
106
- }
107
- this.spin.load(data.spin);
108
- if (data.straight !== undefined) {
109
- this.straight = data.straight;
110
- }
111
- if (data.vibrate !== undefined) {
112
- this.vibrate = data.vibrate;
113
- }
114
- if (data.warp !== undefined) {
115
- this.warp = data.warp;
116
- }
117
- }
118
- }
119
- exports.Move = Move;
120
- });
@@ -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", "../../../../Utils/TypeUtils.js", "../../../../Utils/MathUtils.js"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.MoveAngle = void 0;
13
- const TypeUtils_js_1 = require("../../../../Utils/TypeUtils.js");
14
- const MathUtils_js_1 = require("../../../../Utils/MathUtils.js");
15
- class MoveAngle {
16
- offset;
17
- value;
18
- constructor() {
19
- this.offset = 0;
20
- this.value = 90;
21
- }
22
- load(data) {
23
- if ((0, TypeUtils_js_1.isNull)(data)) {
24
- return;
25
- }
26
- if (data.offset !== undefined) {
27
- this.offset = (0, MathUtils_js_1.setRangeValue)(data.offset);
28
- }
29
- if (data.value !== undefined) {
30
- this.value = (0, MathUtils_js_1.setRangeValue)(data.value);
31
- }
32
- }
33
- }
34
- exports.MoveAngle = MoveAngle;
35
- });
@@ -1,45 +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/TypeUtils.js"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.MoveCenter = void 0;
13
- const PixelMode_js_1 = require("../../../../Enums/Modes/PixelMode.js");
14
- const TypeUtils_js_1 = require("../../../../Utils/TypeUtils.js");
15
- class MoveCenter {
16
- mode;
17
- radius;
18
- x;
19
- y;
20
- constructor() {
21
- this.x = 50;
22
- this.y = 50;
23
- this.mode = PixelMode_js_1.PixelMode.percent;
24
- this.radius = 0;
25
- }
26
- load(data) {
27
- if ((0, TypeUtils_js_1.isNull)(data)) {
28
- return;
29
- }
30
- if (data.x !== undefined) {
31
- this.x = data.x;
32
- }
33
- if (data.y !== undefined) {
34
- this.y = data.y;
35
- }
36
- if (data.mode !== undefined) {
37
- this.mode = data.mode;
38
- }
39
- if (data.radius !== undefined) {
40
- this.radius = data.radius;
41
- }
42
- }
43
- }
44
- exports.MoveCenter = MoveCenter;
45
- });
@@ -1,45 +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", "../../../../Utils/MathUtils.js"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.MoveGravity = void 0;
13
- const TypeUtils_js_1 = require("../../../../Utils/TypeUtils.js");
14
- const MathUtils_js_1 = require("../../../../Utils/MathUtils.js");
15
- class MoveGravity {
16
- acceleration;
17
- enable;
18
- inverse;
19
- maxSpeed;
20
- constructor() {
21
- this.acceleration = 9.81;
22
- this.enable = false;
23
- this.inverse = false;
24
- this.maxSpeed = 50;
25
- }
26
- load(data) {
27
- if ((0, TypeUtils_js_1.isNull)(data)) {
28
- return;
29
- }
30
- if (data.acceleration !== undefined) {
31
- this.acceleration = (0, MathUtils_js_1.setRangeValue)(data.acceleration);
32
- }
33
- if (data.enable !== undefined) {
34
- this.enable = data.enable;
35
- }
36
- if (data.inverse !== undefined) {
37
- this.inverse = data.inverse;
38
- }
39
- if (data.maxSpeed !== undefined) {
40
- this.maxSpeed = (0, MathUtils_js_1.setRangeValue)(data.maxSpeed);
41
- }
42
- }
43
- }
44
- exports.MoveGravity = MoveGravity;
45
- });
@@ -1,38 +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/OutMode.js", "../../../../Utils/TypeUtils.js"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.OutModes = void 0;
13
- const OutMode_js_1 = require("../../../../Enums/Modes/OutMode.js");
14
- const TypeUtils_js_1 = require("../../../../Utils/TypeUtils.js");
15
- class OutModes {
16
- bottom;
17
- default;
18
- left;
19
- right;
20
- top;
21
- constructor() {
22
- this.default = OutMode_js_1.OutMode.out;
23
- }
24
- load(data) {
25
- if ((0, TypeUtils_js_1.isNull)(data)) {
26
- return;
27
- }
28
- if (data.default !== undefined) {
29
- this.default = data.default;
30
- }
31
- this.bottom = data.bottom ?? data.default;
32
- this.left = data.left ?? data.default;
33
- this.right = data.right ?? data.default;
34
- this.top = data.top ?? data.default;
35
- }
36
- }
37
- exports.OutModes = OutModes;
38
- });
@@ -1,46 +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", "../../../ValueWithRandom.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.MovePath = void 0;
13
- const ValueWithRandom_js_1 = require("../../../ValueWithRandom.js");
14
- const Utils_js_1 = require("../../../../../Utils/Utils.js");
15
- const TypeUtils_js_1 = require("../../../../../Utils/TypeUtils.js");
16
- class MovePath {
17
- clamp;
18
- delay;
19
- enable;
20
- generator;
21
- options;
22
- constructor() {
23
- this.clamp = true;
24
- this.delay = new ValueWithRandom_js_1.ValueWithRandom();
25
- this.enable = false;
26
- this.options = {};
27
- }
28
- load(data) {
29
- if ((0, TypeUtils_js_1.isNull)(data)) {
30
- return;
31
- }
32
- if (data.clamp !== undefined) {
33
- this.clamp = data.clamp;
34
- }
35
- this.delay.load(data.delay);
36
- if (data.enable !== undefined) {
37
- this.enable = data.enable;
38
- }
39
- this.generator = data.generator;
40
- if (data.options) {
41
- this.options = (0, Utils_js_1.deepExtend)(this.options, data.options);
42
- }
43
- }
44
- }
45
- exports.MovePath = MovePath;
46
- });
@@ -1,40 +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/Utils.js", "../../../../Utils/TypeUtils.js", "../../../../Utils/MathUtils.js"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.Spin = void 0;
13
- const Utils_js_1 = require("../../../../Utils/Utils.js");
14
- const TypeUtils_js_1 = require("../../../../Utils/TypeUtils.js");
15
- const MathUtils_js_1 = require("../../../../Utils/MathUtils.js");
16
- class Spin {
17
- acceleration;
18
- enable;
19
- position;
20
- constructor() {
21
- this.acceleration = 0;
22
- this.enable = false;
23
- }
24
- load(data) {
25
- if ((0, TypeUtils_js_1.isNull)(data)) {
26
- return;
27
- }
28
- if (data.acceleration !== undefined) {
29
- this.acceleration = (0, MathUtils_js_1.setRangeValue)(data.acceleration);
30
- }
31
- if (data.enable !== undefined) {
32
- this.enable = data.enable;
33
- }
34
- if (data.position) {
35
- this.position = (0, Utils_js_1.deepExtend)({}, data.position);
36
- }
37
- }
38
- }
39
- exports.Spin = Spin;
40
- });
@@ -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", "../../../../Utils/TypeUtils.js"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.ParticlesDensity = void 0;
13
- const TypeUtils_js_1 = require("../../../../Utils/TypeUtils.js");
14
- class ParticlesDensity {
15
- enable;
16
- height;
17
- width;
18
- constructor() {
19
- this.enable = false;
20
- this.width = 1920;
21
- this.height = 1080;
22
- }
23
- load(data) {
24
- if ((0, TypeUtils_js_1.isNull)(data)) {
25
- return;
26
- }
27
- if (data.enable !== undefined) {
28
- this.enable = data.enable;
29
- }
30
- const width = data.width;
31
- if (width !== undefined) {
32
- this.width = width;
33
- }
34
- const height = data.height;
35
- if (height !== undefined) {
36
- this.height = height;
37
- }
38
- }
39
- }
40
- exports.ParticlesDensity = ParticlesDensity;
41
- });
@@ -1,37 +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", "./ParticlesDensity.js", "./ParticlesNumberLimit.js", "../../../../Utils/TypeUtils.js"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.ParticlesNumber = void 0;
13
- const ParticlesDensity_js_1 = require("./ParticlesDensity.js");
14
- const ParticlesNumberLimit_js_1 = require("./ParticlesNumberLimit.js");
15
- const TypeUtils_js_1 = require("../../../../Utils/TypeUtils.js");
16
- class ParticlesNumber {
17
- density;
18
- limit;
19
- value;
20
- constructor() {
21
- this.density = new ParticlesDensity_js_1.ParticlesDensity();
22
- this.limit = new ParticlesNumberLimit_js_1.ParticlesNumberLimit();
23
- this.value = 0;
24
- }
25
- load(data) {
26
- if ((0, TypeUtils_js_1.isNull)(data)) {
27
- return;
28
- }
29
- this.density.load(data.density);
30
- this.limit.load(data.limit);
31
- if (data.value !== undefined) {
32
- this.value = data.value;
33
- }
34
- }
35
- }
36
- exports.ParticlesNumber = ParticlesNumber;
37
- });
@@ -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/LimitMode.js", "../../../../Utils/TypeUtils.js"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.ParticlesNumberLimit = void 0;
13
- const LimitMode_js_1 = require("../../../../Enums/Modes/LimitMode.js");
14
- const TypeUtils_js_1 = require("../../../../Utils/TypeUtils.js");
15
- class ParticlesNumberLimit {
16
- mode;
17
- value;
18
- constructor() {
19
- this.mode = LimitMode_js_1.LimitMode.delete;
20
- this.value = 0;
21
- }
22
- load(data) {
23
- if ((0, TypeUtils_js_1.isNull)(data)) {
24
- return;
25
- }
26
- if (data.mode !== undefined) {
27
- this.mode = data.mode;
28
- }
29
- if (data.value !== undefined) {
30
- this.value = data.value;
31
- }
32
- }
33
- }
34
- exports.ParticlesNumberLimit = ParticlesNumberLimit;
35
- });
@@ -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", "./OpacityAnimation.js", "../../ValueWithRandom.js", "../../../../Utils/TypeUtils.js"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.Opacity = void 0;
13
- const OpacityAnimation_js_1 = require("./OpacityAnimation.js");
14
- const ValueWithRandom_js_1 = require("../../ValueWithRandom.js");
15
- const TypeUtils_js_1 = require("../../../../Utils/TypeUtils.js");
16
- class Opacity extends ValueWithRandom_js_1.RangedAnimationValueWithRandom {
17
- animation;
18
- constructor() {
19
- super();
20
- this.animation = new OpacityAnimation_js_1.OpacityAnimation();
21
- this.value = 1;
22
- }
23
- load(data) {
24
- if ((0, TypeUtils_js_1.isNull)(data)) {
25
- return;
26
- }
27
- super.load(data);
28
- const animation = data.animation;
29
- if (animation !== undefined) {
30
- this.animation.load(animation);
31
- }
32
- }
33
- }
34
- exports.Opacity = Opacity;
35
- });
@@ -1,34 +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/DestroyType.js", "../../AnimationOptions.js", "../../../../Utils/TypeUtils.js"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.OpacityAnimation = void 0;
13
- const DestroyType_js_1 = require("../../../../Enums/Types/DestroyType.js");
14
- const AnimationOptions_js_1 = require("../../AnimationOptions.js");
15
- const TypeUtils_js_1 = require("../../../../Utils/TypeUtils.js");
16
- class OpacityAnimation extends AnimationOptions_js_1.RangedAnimationOptions {
17
- destroy;
18
- constructor() {
19
- super();
20
- this.destroy = DestroyType_js_1.DestroyType.none;
21
- this.speed = 2;
22
- }
23
- load(data) {
24
- super.load(data);
25
- if ((0, TypeUtils_js_1.isNull)(data)) {
26
- return;
27
- }
28
- if (data.destroy !== undefined) {
29
- this.destroy = data.destroy;
30
- }
31
- }
32
- }
33
- exports.OpacityAnimation = OpacityAnimation;
34
- });
@@ -1,116 +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/Utils.js", "./Effect/Effect.js", "./Fill.js", "./Move/Move.js", "./Opacity/Opacity.js", "./Bounce/ParticlesBounce.js", "./Number/ParticlesNumber.js", "./Shape/Shape.js", "./Size/Size.js", "./Stroke.js", "./ZIndex/ZIndex.js", "../../../Utils/TypeUtils.js"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.ParticlesOptions = void 0;
13
- const Utils_js_1 = require("../../../Utils/Utils.js");
14
- const Effect_js_1 = require("./Effect/Effect.js");
15
- const Fill_js_1 = require("./Fill.js");
16
- const Move_js_1 = require("./Move/Move.js");
17
- const Opacity_js_1 = require("./Opacity/Opacity.js");
18
- const ParticlesBounce_js_1 = require("./Bounce/ParticlesBounce.js");
19
- const ParticlesNumber_js_1 = require("./Number/ParticlesNumber.js");
20
- const Shape_js_1 = require("./Shape/Shape.js");
21
- const Size_js_1 = require("./Size/Size.js");
22
- const Stroke_js_1 = require("./Stroke.js");
23
- const ZIndex_js_1 = require("./ZIndex/ZIndex.js");
24
- const TypeUtils_js_1 = require("../../../Utils/TypeUtils.js");
25
- class ParticlesOptions {
26
- bounce;
27
- effect;
28
- fill;
29
- groups;
30
- move;
31
- number;
32
- opacity;
33
- reduceDuplicates;
34
- shape;
35
- size;
36
- stroke;
37
- zIndex;
38
- _container;
39
- _engine;
40
- constructor(engine, container) {
41
- this._engine = engine;
42
- this._container = container;
43
- this.bounce = new ParticlesBounce_js_1.ParticlesBounce();
44
- this.effect = new Effect_js_1.Effect();
45
- this.fill = new Fill_js_1.Fill();
46
- this.groups = {};
47
- this.move = new Move_js_1.Move();
48
- this.number = new ParticlesNumber_js_1.ParticlesNumber();
49
- this.opacity = new Opacity_js_1.Opacity();
50
- this.reduceDuplicates = false;
51
- this.shape = new Shape_js_1.Shape();
52
- this.size = new Size_js_1.Size();
53
- this.stroke = new Stroke_js_1.Stroke();
54
- this.zIndex = new ZIndex_js_1.ZIndex();
55
- }
56
- load(data) {
57
- if ((0, TypeUtils_js_1.isNull)(data)) {
58
- return;
59
- }
60
- if (data.groups !== undefined) {
61
- for (const group of Object.keys(data.groups)) {
62
- if (!(group in data.groups)) {
63
- continue;
64
- }
65
- const item = data.groups[group];
66
- if (item !== undefined) {
67
- this.groups[group] = (0, Utils_js_1.deepExtend)(this.groups[group] ?? {}, item);
68
- }
69
- }
70
- }
71
- if (data.reduceDuplicates !== undefined) {
72
- this.reduceDuplicates = data.reduceDuplicates;
73
- }
74
- this.bounce.load(data.bounce);
75
- this.effect.load(data.effect);
76
- this.move.load(data.move);
77
- this.number.load(data.number);
78
- this.opacity.load(data.opacity);
79
- this.shape.load(data.shape);
80
- this.size.load(data.size);
81
- this.zIndex.load(data.zIndex);
82
- const fillToLoad = data.fill;
83
- if (fillToLoad) {
84
- this.fill = (0, Utils_js_1.executeOnSingleOrMultiple)(fillToLoad, t => {
85
- const tmp = new Fill_js_1.Fill();
86
- tmp.load(t);
87
- return tmp;
88
- });
89
- }
90
- const strokeToLoad = data.stroke;
91
- if (strokeToLoad) {
92
- this.stroke = (0, Utils_js_1.executeOnSingleOrMultiple)(strokeToLoad, t => {
93
- const tmp = new Stroke_js_1.Stroke();
94
- tmp.load(t);
95
- return tmp;
96
- });
97
- }
98
- if (this._container) {
99
- for (const plugin of this._engine.plugins) {
100
- if (plugin.loadParticlesOptions) {
101
- plugin.loadParticlesOptions(this._container, this, data);
102
- }
103
- }
104
- const updaters = this._engine.updaters.get(this._container);
105
- if (updaters) {
106
- for (const updater of updaters) {
107
- if (updater.loadOptions) {
108
- updater.loadOptions(this, data);
109
- }
110
- }
111
- }
112
- }
113
- }
114
- }
115
- exports.ParticlesOptions = ParticlesOptions;
116
- });