@tsparticles/engine 4.0.0-beta.1 → 4.0.0-beta.11

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 (190) hide show
  1. package/67.min.js +1 -0
  2. package/README.md +53 -944
  3. package/browser/Core/Engine.js +1 -1
  4. package/browser/Options/Classes/Options.js +1 -14
  5. package/browser/Options/Classes/Particles/Paint.js +20 -0
  6. package/browser/Options/Classes/Particles/ParticlesOptions.js +61 -22
  7. package/browser/Options/Interfaces/Particles/IPaint.js +1 -0
  8. package/browser/Utils/CanvasUtils.js +3 -3
  9. package/browser/Utils/Utils.js +16 -10
  10. package/browser/exports.js +1 -0
  11. package/cjs/Core/Engine.js +1 -1
  12. package/cjs/Options/Classes/Options.js +1 -14
  13. package/cjs/Options/Classes/Particles/Paint.js +20 -0
  14. package/cjs/Options/Classes/Particles/ParticlesOptions.js +61 -22
  15. package/cjs/Options/Interfaces/Particles/IPaint.js +1 -0
  16. package/cjs/Utils/CanvasUtils.js +3 -3
  17. package/cjs/Utils/Utils.js +16 -10
  18. package/cjs/exports.js +1 -0
  19. package/dist_browser_Core_Container_js.js +1 -1
  20. package/esm/Core/Engine.js +1 -1
  21. package/esm/Options/Classes/Options.js +1 -14
  22. package/esm/Options/Classes/Particles/Paint.js +20 -0
  23. package/esm/Options/Classes/Particles/ParticlesOptions.js +61 -22
  24. package/esm/Options/Interfaces/Particles/IPaint.js +1 -0
  25. package/esm/Utils/CanvasUtils.js +3 -3
  26. package/esm/Utils/Utils.js +16 -10
  27. package/esm/exports.js +1 -0
  28. package/package.json +2 -3
  29. package/report.html +1 -1
  30. package/tsparticles.engine.js +18 -8
  31. package/tsparticles.engine.min.js +2 -2
  32. package/types/Core/Interfaces/IPalette.d.ts +17 -2
  33. package/types/Options/Classes/Particles/Paint.d.ts +10 -0
  34. package/types/Options/Classes/Particles/ParticlesOptions.d.ts +4 -4
  35. package/types/Options/Interfaces/Particles/IPaint.d.ts +6 -0
  36. package/types/Options/Interfaces/Particles/IParticlesOptions.d.ts +3 -4
  37. package/types/export-types.d.ts +1 -0
  38. package/types/exports.d.ts +1 -0
  39. package/155.min.js +0 -1
  40. package/umd/Core/CanvasManager.js +0 -317
  41. package/umd/Core/Container.js +0 -383
  42. package/umd/Core/Engine.js +0 -183
  43. package/umd/Core/Interfaces/Colors.js +0 -12
  44. package/umd/Core/Interfaces/IBounds.js +0 -12
  45. package/umd/Core/Interfaces/IBubbleParticleData.js +0 -12
  46. package/umd/Core/Interfaces/ICircleBouncer.js +0 -12
  47. package/umd/Core/Interfaces/IColorManager.js +0 -12
  48. package/umd/Core/Interfaces/IContainerPlugin.js +0 -12
  49. package/umd/Core/Interfaces/ICoordinates.js +0 -12
  50. package/umd/Core/Interfaces/IDelta.js +0 -12
  51. package/umd/Core/Interfaces/IDimension.js +0 -12
  52. package/umd/Core/Interfaces/IDistance.js +0 -12
  53. package/umd/Core/Interfaces/IDrawParticleParams.js +0 -12
  54. package/umd/Core/Interfaces/IEffectDrawer.js +0 -12
  55. package/umd/Core/Interfaces/ILoadParams.js +0 -12
  56. package/umd/Core/Interfaces/IPalette.js +0 -12
  57. package/umd/Core/Interfaces/IParticleColorStyle.js +0 -12
  58. package/umd/Core/Interfaces/IParticleHslAnimation.js +0 -12
  59. package/umd/Core/Interfaces/IParticleLife.js +0 -12
  60. package/umd/Core/Interfaces/IParticleOpacityData.js +0 -12
  61. package/umd/Core/Interfaces/IParticleRetinaProps.js +0 -12
  62. package/umd/Core/Interfaces/IParticleRoll.js +0 -12
  63. package/umd/Core/Interfaces/IParticleRotateData.js +0 -12
  64. package/umd/Core/Interfaces/IParticleTransformValues.js +0 -12
  65. package/umd/Core/Interfaces/IParticleUpdater.js +0 -12
  66. package/umd/Core/Interfaces/IParticleValueAnimation.js +0 -12
  67. package/umd/Core/Interfaces/IPlugin.js +0 -12
  68. package/umd/Core/Interfaces/IPositionFromSizeParams.js +0 -12
  69. package/umd/Core/Interfaces/IRangeValue.js +0 -12
  70. package/umd/Core/Interfaces/IShapeDrawData.js +0 -12
  71. package/umd/Core/Interfaces/IShapeDrawer.js +0 -12
  72. package/umd/Core/Interfaces/IShapeValues.js +0 -12
  73. package/umd/Core/Interfaces/ISlowParticleData.js +0 -12
  74. package/umd/Core/Particle.js +0 -433
  75. package/umd/Core/ParticlesManager.js +0 -377
  76. package/umd/Core/RenderManager.js +0 -317
  77. package/umd/Core/Retina.js +0 -47
  78. package/umd/Core/Utils/Constants.js +0 -23
  79. package/umd/Core/Utils/EventListeners.js +0 -102
  80. package/umd/Core/Utils/PluginManager.js +0 -159
  81. package/umd/Core/Utils/Ranges.js +0 -91
  82. package/umd/Core/Utils/SpatialHashGrid.js +0 -116
  83. package/umd/Core/Utils/Vectors.js +0 -126
  84. package/umd/Enums/AnimationStatus.js +0 -18
  85. package/umd/Enums/Directions/MoveDirection.js +0 -27
  86. package/umd/Enums/Directions/OutModeDirection.js +0 -20
  87. package/umd/Enums/Directions/RotateDirection.js +0 -19
  88. package/umd/Enums/Modes/AnimationMode.js +0 -20
  89. package/umd/Enums/Modes/LimitMode.js +0 -18
  90. package/umd/Enums/Modes/OutMode.js +0 -21
  91. package/umd/Enums/Modes/PixelMode.js +0 -18
  92. package/umd/Enums/RangeType.js +0 -18
  93. package/umd/Enums/Types/AlterType.js +0 -18
  94. package/umd/Enums/Types/DestroyType.js +0 -19
  95. package/umd/Enums/Types/EasingType.js +0 -58
  96. package/umd/Enums/Types/EventType.js +0 -28
  97. package/umd/Enums/Types/GradientType.js +0 -19
  98. package/umd/Enums/Types/ParticleOutType.js +0 -19
  99. package/umd/Enums/Types/StartValueType.js +0 -19
  100. package/umd/Options/Classes/AnimatableColor.js +0 -52
  101. package/umd/Options/Classes/AnimationOptions.js +0 -79
  102. package/umd/Options/Classes/Background/Background.js +0 -56
  103. package/umd/Options/Classes/ColorAnimation.js +0 -44
  104. package/umd/Options/Classes/FullScreen/FullScreen.js +0 -34
  105. package/umd/Options/Classes/HslAnimation.js +0 -30
  106. package/umd/Options/Classes/Options.js +0 -171
  107. package/umd/Options/Classes/OptionsColor.js +0 -42
  108. package/umd/Options/Classes/Particles/Bounce/ParticlesBounce.js +0 -31
  109. package/umd/Options/Classes/Particles/Bounce/ParticlesBounceFactor.js +0 -21
  110. package/umd/Options/Classes/Particles/Effect/Effect.js +0 -46
  111. package/umd/Options/Classes/Particles/Fill.js +0 -42
  112. package/umd/Options/Classes/Particles/Move/Move.js +0 -120
  113. package/umd/Options/Classes/Particles/Move/MoveAngle.js +0 -35
  114. package/umd/Options/Classes/Particles/Move/MoveCenter.js +0 -45
  115. package/umd/Options/Classes/Particles/Move/MoveGravity.js +0 -45
  116. package/umd/Options/Classes/Particles/Move/OutModes.js +0 -38
  117. package/umd/Options/Classes/Particles/Move/Path/MovePath.js +0 -46
  118. package/umd/Options/Classes/Particles/Move/Spin.js +0 -40
  119. package/umd/Options/Classes/Particles/Number/ParticlesDensity.js +0 -41
  120. package/umd/Options/Classes/Particles/Number/ParticlesNumber.js +0 -37
  121. package/umd/Options/Classes/Particles/Number/ParticlesNumberLimit.js +0 -35
  122. package/umd/Options/Classes/Particles/Opacity/Opacity.js +0 -35
  123. package/umd/Options/Classes/Particles/Opacity/OpacityAnimation.js +0 -34
  124. package/umd/Options/Classes/Particles/ParticlesOptions.js +0 -116
  125. package/umd/Options/Classes/Particles/Shape/Shape.js +0 -46
  126. package/umd/Options/Classes/Particles/Size/Size.js +0 -35
  127. package/umd/Options/Classes/Particles/Size/SizeAnimation.js +0 -34
  128. package/umd/Options/Classes/Particles/Stroke.js +0 -39
  129. package/umd/Options/Classes/Particles/ZIndex/ZIndex.js +0 -42
  130. package/umd/Options/Classes/ResizeEvent.js +0 -34
  131. package/umd/Options/Classes/ValueWithRandom.js +0 -56
  132. package/umd/Options/Interfaces/Background/IBackground.js +0 -12
  133. package/umd/Options/Interfaces/FullScreen/IFullScreen.js +0 -12
  134. package/umd/Options/Interfaces/IAnimatable.js +0 -12
  135. package/umd/Options/Interfaces/IAnimatableColor.js +0 -12
  136. package/umd/Options/Interfaces/IAnimation.js +0 -12
  137. package/umd/Options/Interfaces/IColorAnimation.js +0 -12
  138. package/umd/Options/Interfaces/IHslAnimation.js +0 -12
  139. package/umd/Options/Interfaces/IOptionLoader.js +0 -12
  140. package/umd/Options/Interfaces/IOptions.js +0 -12
  141. package/umd/Options/Interfaces/IOptionsColor.js +0 -12
  142. package/umd/Options/Interfaces/IResizeEvent.js +0 -12
  143. package/umd/Options/Interfaces/IValueWithRandom.js +0 -12
  144. package/umd/Options/Interfaces/Particles/Bounce/IParticlesBounce.js +0 -12
  145. package/umd/Options/Interfaces/Particles/Effect/IEffect.js +0 -12
  146. package/umd/Options/Interfaces/Particles/IFill.js +0 -12
  147. package/umd/Options/Interfaces/Particles/IParticlesOptions.js +0 -12
  148. package/umd/Options/Interfaces/Particles/IStroke.js +0 -12
  149. package/umd/Options/Interfaces/Particles/Move/IMove.js +0 -12
  150. package/umd/Options/Interfaces/Particles/Move/IMoveAngle.js +0 -12
  151. package/umd/Options/Interfaces/Particles/Move/IMoveCenter.js +0 -12
  152. package/umd/Options/Interfaces/Particles/Move/IMoveGravity.js +0 -12
  153. package/umd/Options/Interfaces/Particles/Move/IOutModes.js +0 -12
  154. package/umd/Options/Interfaces/Particles/Move/ISpin.js +0 -12
  155. package/umd/Options/Interfaces/Particles/Move/Path/IMovePath.js +0 -12
  156. package/umd/Options/Interfaces/Particles/Number/IParticlesDensity.js +0 -12
  157. package/umd/Options/Interfaces/Particles/Number/IParticlesNumber.js +0 -12
  158. package/umd/Options/Interfaces/Particles/Number/IParticlesNumberLimit.js +0 -12
  159. package/umd/Options/Interfaces/Particles/Opacity/IOpacity.js +0 -12
  160. package/umd/Options/Interfaces/Particles/Opacity/IOpacityAnimation.js +0 -12
  161. package/umd/Options/Interfaces/Particles/Shape/IShape.js +0 -12
  162. package/umd/Options/Interfaces/Particles/Size/ISize.js +0 -12
  163. package/umd/Options/Interfaces/Particles/Size/ISizeAnimation.js +0 -12
  164. package/umd/Options/Interfaces/Particles/ZIndex/IZIndex.js +0 -12
  165. package/umd/Types/CanvasContextType.js +0 -12
  166. package/umd/Types/CustomEventArgs.js +0 -12
  167. package/umd/Types/CustomEventListener.js +0 -12
  168. package/umd/Types/EasingFunction.js +0 -12
  169. package/umd/Types/EngineInitializers.js +0 -12
  170. package/umd/Types/ExportResult.js +0 -12
  171. package/umd/Types/ISourceOptions.js +0 -12
  172. package/umd/Types/ParticlesGroups.js +0 -12
  173. package/umd/Types/PathOptions.js +0 -12
  174. package/umd/Types/RangeValue.js +0 -12
  175. package/umd/Types/RecursivePartial.js +0 -12
  176. package/umd/Types/ShapeData.js +0 -12
  177. package/umd/Types/SingleOrMultiple.js +0 -12
  178. package/umd/Utils/CanvasUtils.js +0 -145
  179. package/umd/Utils/ColorUtils.js +0 -395
  180. package/umd/Utils/EventDispatcher.js +0 -63
  181. package/umd/Utils/LogUtils.js +0 -37
  182. package/umd/Utils/MathUtils.js +0 -203
  183. package/umd/Utils/OptionsUtils.js +0 -25
  184. package/umd/Utils/TypeUtils.js +0 -40
  185. package/umd/Utils/Utils.js +0 -484
  186. package/umd/bundle.js +0 -32
  187. package/umd/export-types.js +0 -12
  188. package/umd/exports.js +0 -82
  189. package/umd/index.js +0 -32
  190. package/umd/initEngine.js +0 -17
@@ -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
- _pluginManager;
40
- constructor(pluginManager, container) {
41
- this._pluginManager = pluginManager;
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._pluginManager.plugins) {
100
- if (plugin.loadParticlesOptions) {
101
- plugin.loadParticlesOptions(this._container, this, data);
102
- }
103
- }
104
- const updaters = this._pluginManager.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
- });
@@ -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", "../../../../Utils/Utils.js", "../../../../Utils/TypeUtils.js"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.Shape = void 0;
13
- const Utils_js_1 = require("../../../../Utils/Utils.js");
14
- const TypeUtils_js_1 = require("../../../../Utils/TypeUtils.js");
15
- class Shape {
16
- close;
17
- options;
18
- type;
19
- constructor() {
20
- this.close = true;
21
- this.options = {};
22
- this.type = "circle";
23
- }
24
- load(data) {
25
- if ((0, TypeUtils_js_1.isNull)(data)) {
26
- return;
27
- }
28
- const options = data.options;
29
- if (options !== undefined) {
30
- for (const shape in options) {
31
- const item = options[shape];
32
- if (item) {
33
- this.options[shape] = (0, Utils_js_1.deepExtend)(this.options[shape] ?? {}, item);
34
- }
35
- }
36
- }
37
- if (data.close !== undefined) {
38
- this.close = data.close;
39
- }
40
- if (data.type !== undefined) {
41
- this.type = data.type;
42
- }
43
- }
44
- }
45
- exports.Shape = Shape;
46
- });
@@ -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", "../../ValueWithRandom.js", "./SizeAnimation.js", "../../../../Utils/TypeUtils.js"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.Size = void 0;
13
- const ValueWithRandom_js_1 = require("../../ValueWithRandom.js");
14
- const SizeAnimation_js_1 = require("./SizeAnimation.js");
15
- const TypeUtils_js_1 = require("../../../../Utils/TypeUtils.js");
16
- class Size extends ValueWithRandom_js_1.RangedAnimationValueWithRandom {
17
- animation;
18
- constructor() {
19
- super();
20
- this.animation = new SizeAnimation_js_1.SizeAnimation();
21
- this.value = 3;
22
- }
23
- load(data) {
24
- super.load(data);
25
- if ((0, TypeUtils_js_1.isNull)(data)) {
26
- return;
27
- }
28
- const animation = data.animation;
29
- if (animation !== undefined) {
30
- this.animation.load(animation);
31
- }
32
- }
33
- }
34
- exports.Size = Size;
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.SizeAnimation = 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 SizeAnimation extends AnimationOptions_js_1.RangedAnimationOptions {
17
- destroy;
18
- constructor() {
19
- super();
20
- this.destroy = DestroyType_js_1.DestroyType.none;
21
- this.speed = 5;
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.SizeAnimation = SizeAnimation;
34
- });
@@ -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", "../AnimatableColor.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.Stroke = void 0;
13
- const AnimatableColor_js_1 = require("../AnimatableColor.js");
14
- const TypeUtils_js_1 = require("../../../Utils/TypeUtils.js");
15
- const MathUtils_js_1 = require("../../../Utils/MathUtils.js");
16
- class Stroke {
17
- color;
18
- opacity;
19
- width;
20
- constructor() {
21
- this.width = 0;
22
- }
23
- load(data) {
24
- if ((0, TypeUtils_js_1.isNull)(data)) {
25
- return;
26
- }
27
- if (data.color !== undefined) {
28
- this.color = AnimatableColor_js_1.AnimatableColor.create(this.color, data.color);
29
- }
30
- if (data.width !== undefined) {
31
- this.width = (0, MathUtils_js_1.setRangeValue)(data.width);
32
- }
33
- if (data.opacity !== undefined) {
34
- this.opacity = (0, MathUtils_js_1.setRangeValue)(data.opacity);
35
- }
36
- }
37
- }
38
- exports.Stroke = Stroke;
39
- });
@@ -1,42 +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/TypeUtils.js"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.ZIndex = void 0;
13
- const ValueWithRandom_js_1 = require("../../ValueWithRandom.js");
14
- const TypeUtils_js_1 = require("../../../../Utils/TypeUtils.js");
15
- class ZIndex extends ValueWithRandom_js_1.ValueWithRandom {
16
- opacityRate;
17
- sizeRate;
18
- velocityRate;
19
- constructor() {
20
- super();
21
- this.opacityRate = 1;
22
- this.sizeRate = 1;
23
- this.velocityRate = 1;
24
- }
25
- load(data) {
26
- super.load(data);
27
- if ((0, TypeUtils_js_1.isNull)(data)) {
28
- return;
29
- }
30
- if (data.opacityRate !== undefined) {
31
- this.opacityRate = data.opacityRate;
32
- }
33
- if (data.sizeRate !== undefined) {
34
- this.sizeRate = data.sizeRate;
35
- }
36
- if (data.velocityRate !== undefined) {
37
- this.velocityRate = data.velocityRate;
38
- }
39
- }
40
- }
41
- exports.ZIndex = ZIndex;
42
- });
@@ -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", "../../Utils/TypeUtils.js"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.ResizeEvent = void 0;
13
- const TypeUtils_js_1 = require("../../Utils/TypeUtils.js");
14
- class ResizeEvent {
15
- delay;
16
- enable;
17
- constructor() {
18
- this.delay = 0.5;
19
- this.enable = true;
20
- }
21
- load(data) {
22
- if ((0, TypeUtils_js_1.isNull)(data)) {
23
- return;
24
- }
25
- if (data.delay !== undefined) {
26
- this.delay = data.delay;
27
- }
28
- if (data.enable !== undefined) {
29
- this.enable = data.enable;
30
- }
31
- }
32
- }
33
- exports.ResizeEvent = ResizeEvent;
34
- });