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

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 (168) hide show
  1. package/browser/Core/Container.js +3 -0
  2. package/browser/Core/Engine.js +1 -1
  3. package/browser/Core/Interfaces/IPositionFromSizeParams.js +1 -1
  4. package/browser/Core/ParticlesManager.js +1 -0
  5. package/cjs/Core/Container.js +3 -0
  6. package/cjs/Core/Engine.js +1 -1
  7. package/cjs/Core/Interfaces/IPositionFromSizeParams.js +1 -1
  8. package/cjs/Core/ParticlesManager.js +1 -0
  9. package/dist_browser_Core_Container_js.js +3 -3
  10. package/esm/Core/Container.js +3 -0
  11. package/esm/Core/Engine.js +1 -1
  12. package/esm/Core/Interfaces/IPositionFromSizeParams.js +1 -1
  13. package/esm/Core/ParticlesManager.js +1 -0
  14. package/package.json +2 -3
  15. package/report.html +1 -1
  16. package/tsparticles.engine.js +2 -2
  17. package/tsparticles.engine.min.js +1 -1
  18. package/umd/Core/CanvasManager.js +0 -317
  19. package/umd/Core/Container.js +0 -383
  20. package/umd/Core/Engine.js +0 -183
  21. package/umd/Core/Interfaces/Colors.js +0 -12
  22. package/umd/Core/Interfaces/IBounds.js +0 -12
  23. package/umd/Core/Interfaces/IBubbleParticleData.js +0 -12
  24. package/umd/Core/Interfaces/ICircleBouncer.js +0 -12
  25. package/umd/Core/Interfaces/IColorManager.js +0 -12
  26. package/umd/Core/Interfaces/IContainerPlugin.js +0 -12
  27. package/umd/Core/Interfaces/ICoordinates.js +0 -12
  28. package/umd/Core/Interfaces/IDelta.js +0 -12
  29. package/umd/Core/Interfaces/IDimension.js +0 -12
  30. package/umd/Core/Interfaces/IDistance.js +0 -12
  31. package/umd/Core/Interfaces/IDrawParticleParams.js +0 -12
  32. package/umd/Core/Interfaces/IEffectDrawer.js +0 -12
  33. package/umd/Core/Interfaces/ILoadParams.js +0 -12
  34. package/umd/Core/Interfaces/IPalette.js +0 -12
  35. package/umd/Core/Interfaces/IParticleColorStyle.js +0 -12
  36. package/umd/Core/Interfaces/IParticleHslAnimation.js +0 -12
  37. package/umd/Core/Interfaces/IParticleLife.js +0 -12
  38. package/umd/Core/Interfaces/IParticleOpacityData.js +0 -12
  39. package/umd/Core/Interfaces/IParticleRetinaProps.js +0 -12
  40. package/umd/Core/Interfaces/IParticleRoll.js +0 -12
  41. package/umd/Core/Interfaces/IParticleRotateData.js +0 -12
  42. package/umd/Core/Interfaces/IParticleTransformValues.js +0 -12
  43. package/umd/Core/Interfaces/IParticleUpdater.js +0 -12
  44. package/umd/Core/Interfaces/IParticleValueAnimation.js +0 -12
  45. package/umd/Core/Interfaces/IPlugin.js +0 -12
  46. package/umd/Core/Interfaces/IPositionFromSizeParams.js +0 -12
  47. package/umd/Core/Interfaces/IRangeValue.js +0 -12
  48. package/umd/Core/Interfaces/IShapeDrawData.js +0 -12
  49. package/umd/Core/Interfaces/IShapeDrawer.js +0 -12
  50. package/umd/Core/Interfaces/IShapeValues.js +0 -12
  51. package/umd/Core/Interfaces/ISlowParticleData.js +0 -12
  52. package/umd/Core/Particle.js +0 -433
  53. package/umd/Core/ParticlesManager.js +0 -377
  54. package/umd/Core/RenderManager.js +0 -317
  55. package/umd/Core/Retina.js +0 -47
  56. package/umd/Core/Utils/Constants.js +0 -23
  57. package/umd/Core/Utils/EventListeners.js +0 -102
  58. package/umd/Core/Utils/PluginManager.js +0 -159
  59. package/umd/Core/Utils/Ranges.js +0 -91
  60. package/umd/Core/Utils/SpatialHashGrid.js +0 -116
  61. package/umd/Core/Utils/Vectors.js +0 -126
  62. package/umd/Enums/AnimationStatus.js +0 -18
  63. package/umd/Enums/Directions/MoveDirection.js +0 -27
  64. package/umd/Enums/Directions/OutModeDirection.js +0 -20
  65. package/umd/Enums/Directions/RotateDirection.js +0 -19
  66. package/umd/Enums/Modes/AnimationMode.js +0 -20
  67. package/umd/Enums/Modes/LimitMode.js +0 -18
  68. package/umd/Enums/Modes/OutMode.js +0 -21
  69. package/umd/Enums/Modes/PixelMode.js +0 -18
  70. package/umd/Enums/RangeType.js +0 -18
  71. package/umd/Enums/Types/AlterType.js +0 -18
  72. package/umd/Enums/Types/DestroyType.js +0 -19
  73. package/umd/Enums/Types/EasingType.js +0 -58
  74. package/umd/Enums/Types/EventType.js +0 -28
  75. package/umd/Enums/Types/GradientType.js +0 -19
  76. package/umd/Enums/Types/ParticleOutType.js +0 -19
  77. package/umd/Enums/Types/StartValueType.js +0 -19
  78. package/umd/Options/Classes/AnimatableColor.js +0 -52
  79. package/umd/Options/Classes/AnimationOptions.js +0 -79
  80. package/umd/Options/Classes/Background/Background.js +0 -56
  81. package/umd/Options/Classes/ColorAnimation.js +0 -44
  82. package/umd/Options/Classes/FullScreen/FullScreen.js +0 -34
  83. package/umd/Options/Classes/HslAnimation.js +0 -30
  84. package/umd/Options/Classes/Options.js +0 -171
  85. package/umd/Options/Classes/OptionsColor.js +0 -42
  86. package/umd/Options/Classes/Particles/Bounce/ParticlesBounce.js +0 -31
  87. package/umd/Options/Classes/Particles/Bounce/ParticlesBounceFactor.js +0 -21
  88. package/umd/Options/Classes/Particles/Effect/Effect.js +0 -46
  89. package/umd/Options/Classes/Particles/Fill.js +0 -42
  90. package/umd/Options/Classes/Particles/Move/Move.js +0 -120
  91. package/umd/Options/Classes/Particles/Move/MoveAngle.js +0 -35
  92. package/umd/Options/Classes/Particles/Move/MoveCenter.js +0 -45
  93. package/umd/Options/Classes/Particles/Move/MoveGravity.js +0 -45
  94. package/umd/Options/Classes/Particles/Move/OutModes.js +0 -38
  95. package/umd/Options/Classes/Particles/Move/Path/MovePath.js +0 -46
  96. package/umd/Options/Classes/Particles/Move/Spin.js +0 -40
  97. package/umd/Options/Classes/Particles/Number/ParticlesDensity.js +0 -41
  98. package/umd/Options/Classes/Particles/Number/ParticlesNumber.js +0 -37
  99. package/umd/Options/Classes/Particles/Number/ParticlesNumberLimit.js +0 -35
  100. package/umd/Options/Classes/Particles/Opacity/Opacity.js +0 -35
  101. package/umd/Options/Classes/Particles/Opacity/OpacityAnimation.js +0 -34
  102. package/umd/Options/Classes/Particles/ParticlesOptions.js +0 -116
  103. package/umd/Options/Classes/Particles/Shape/Shape.js +0 -46
  104. package/umd/Options/Classes/Particles/Size/Size.js +0 -35
  105. package/umd/Options/Classes/Particles/Size/SizeAnimation.js +0 -34
  106. package/umd/Options/Classes/Particles/Stroke.js +0 -39
  107. package/umd/Options/Classes/Particles/ZIndex/ZIndex.js +0 -42
  108. package/umd/Options/Classes/ResizeEvent.js +0 -34
  109. package/umd/Options/Classes/ValueWithRandom.js +0 -56
  110. package/umd/Options/Interfaces/Background/IBackground.js +0 -12
  111. package/umd/Options/Interfaces/FullScreen/IFullScreen.js +0 -12
  112. package/umd/Options/Interfaces/IAnimatable.js +0 -12
  113. package/umd/Options/Interfaces/IAnimatableColor.js +0 -12
  114. package/umd/Options/Interfaces/IAnimation.js +0 -12
  115. package/umd/Options/Interfaces/IColorAnimation.js +0 -12
  116. package/umd/Options/Interfaces/IHslAnimation.js +0 -12
  117. package/umd/Options/Interfaces/IOptionLoader.js +0 -12
  118. package/umd/Options/Interfaces/IOptions.js +0 -12
  119. package/umd/Options/Interfaces/IOptionsColor.js +0 -12
  120. package/umd/Options/Interfaces/IResizeEvent.js +0 -12
  121. package/umd/Options/Interfaces/IValueWithRandom.js +0 -12
  122. package/umd/Options/Interfaces/Particles/Bounce/IParticlesBounce.js +0 -12
  123. package/umd/Options/Interfaces/Particles/Effect/IEffect.js +0 -12
  124. package/umd/Options/Interfaces/Particles/IFill.js +0 -12
  125. package/umd/Options/Interfaces/Particles/IParticlesOptions.js +0 -12
  126. package/umd/Options/Interfaces/Particles/IStroke.js +0 -12
  127. package/umd/Options/Interfaces/Particles/Move/IMove.js +0 -12
  128. package/umd/Options/Interfaces/Particles/Move/IMoveAngle.js +0 -12
  129. package/umd/Options/Interfaces/Particles/Move/IMoveCenter.js +0 -12
  130. package/umd/Options/Interfaces/Particles/Move/IMoveGravity.js +0 -12
  131. package/umd/Options/Interfaces/Particles/Move/IOutModes.js +0 -12
  132. package/umd/Options/Interfaces/Particles/Move/ISpin.js +0 -12
  133. package/umd/Options/Interfaces/Particles/Move/Path/IMovePath.js +0 -12
  134. package/umd/Options/Interfaces/Particles/Number/IParticlesDensity.js +0 -12
  135. package/umd/Options/Interfaces/Particles/Number/IParticlesNumber.js +0 -12
  136. package/umd/Options/Interfaces/Particles/Number/IParticlesNumberLimit.js +0 -12
  137. package/umd/Options/Interfaces/Particles/Opacity/IOpacity.js +0 -12
  138. package/umd/Options/Interfaces/Particles/Opacity/IOpacityAnimation.js +0 -12
  139. package/umd/Options/Interfaces/Particles/Shape/IShape.js +0 -12
  140. package/umd/Options/Interfaces/Particles/Size/ISize.js +0 -12
  141. package/umd/Options/Interfaces/Particles/Size/ISizeAnimation.js +0 -12
  142. package/umd/Options/Interfaces/Particles/ZIndex/IZIndex.js +0 -12
  143. package/umd/Types/CanvasContextType.js +0 -12
  144. package/umd/Types/CustomEventArgs.js +0 -12
  145. package/umd/Types/CustomEventListener.js +0 -12
  146. package/umd/Types/EasingFunction.js +0 -12
  147. package/umd/Types/EngineInitializers.js +0 -12
  148. package/umd/Types/ExportResult.js +0 -12
  149. package/umd/Types/ISourceOptions.js +0 -12
  150. package/umd/Types/ParticlesGroups.js +0 -12
  151. package/umd/Types/PathOptions.js +0 -12
  152. package/umd/Types/RangeValue.js +0 -12
  153. package/umd/Types/RecursivePartial.js +0 -12
  154. package/umd/Types/ShapeData.js +0 -12
  155. package/umd/Types/SingleOrMultiple.js +0 -12
  156. package/umd/Utils/CanvasUtils.js +0 -145
  157. package/umd/Utils/ColorUtils.js +0 -395
  158. package/umd/Utils/EventDispatcher.js +0 -63
  159. package/umd/Utils/LogUtils.js +0 -37
  160. package/umd/Utils/MathUtils.js +0 -203
  161. package/umd/Utils/OptionsUtils.js +0 -25
  162. package/umd/Utils/TypeUtils.js +0 -40
  163. package/umd/Utils/Utils.js +0 -484
  164. package/umd/bundle.js +0 -32
  165. package/umd/export-types.js +0 -12
  166. package/umd/exports.js +0 -82
  167. package/umd/index.js +0 -32
  168. 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
- });