@tsparticles/engine 4.0.0-beta.1 → 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 (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 +60 -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 +60 -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 +60 -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 +15 -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,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"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.setLogger = setLogger;
13
- exports.getLogger = getLogger;
14
- const errorPrefix = "tsParticles - Error";
15
- const _logger = {
16
- debug: console.debug,
17
- error: (message, optionalParams) => {
18
- console.error(`${errorPrefix} - ${message}`, optionalParams);
19
- },
20
- info: console.info,
21
- log: console.log,
22
- trace: console.trace,
23
- verbose: console.log,
24
- warning: console.warn,
25
- };
26
- function setLogger(logger) {
27
- _logger.debug = logger.debug;
28
- _logger.error = logger.error;
29
- _logger.info = logger.info;
30
- _logger.log = logger.log;
31
- _logger.verbose = logger.verbose;
32
- _logger.warning = logger.warning;
33
- }
34
- function getLogger() {
35
- return _logger;
36
- }
37
- });
@@ -1,203 +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", "../Core/Utils/Constants.js", "../Core/Utils/Vectors.js", "./TypeUtils.js"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.setRandom = setRandom;
13
- exports.getRandom = getRandom;
14
- exports.getRandomInRange = getRandomInRange;
15
- exports.setAnimationFunctions = setAnimationFunctions;
16
- exports.animate = animate;
17
- exports.cancelAnimation = cancelAnimation;
18
- exports.clamp = clamp;
19
- exports.mix = mix;
20
- exports.randomInRangeValue = randomInRangeValue;
21
- exports.getRangeValue = getRangeValue;
22
- exports.getRangeMin = getRangeMin;
23
- exports.getRangeMax = getRangeMax;
24
- exports.setRangeValue = setRangeValue;
25
- exports.getDistances = getDistances;
26
- exports.getDistanceSq = getDistanceSq;
27
- exports.getDistance = getDistance;
28
- exports.checkDistance = checkDistance;
29
- exports.degToRad = degToRad;
30
- exports.getParticleDirectionAngle = getParticleDirectionAngle;
31
- exports.getParticleBaseVelocity = getParticleBaseVelocity;
32
- exports.collisionVelocity = collisionVelocity;
33
- exports.calcPositionFromSize = calcPositionFromSize;
34
- exports.calcPositionOrRandomFromSize = calcPositionOrRandomFromSize;
35
- exports.calcPositionOrRandomFromSizeRanged = calcPositionOrRandomFromSizeRanged;
36
- exports.calcExactPositionOrRandomFromSize = calcExactPositionOrRandomFromSize;
37
- exports.calcExactPositionOrRandomFromSizeRanged = calcExactPositionOrRandomFromSizeRanged;
38
- exports.parseAlpha = parseAlpha;
39
- const MoveDirection_js_1 = require("../Enums/Directions/MoveDirection.js");
40
- const Constants_js_1 = require("../Core/Utils/Constants.js");
41
- const Vectors_js_1 = require("../Core/Utils/Vectors.js");
42
- const TypeUtils_js_1 = require("./TypeUtils.js");
43
- const piDeg = 180, degToRadFactor = Math.PI / piDeg;
44
- let _random = Math.random;
45
- const _animationLoop = {
46
- nextFrame: (cb) => requestAnimationFrame(cb),
47
- cancel: (idx) => {
48
- cancelAnimationFrame(idx);
49
- },
50
- };
51
- function setRandom(rnd = Math.random) {
52
- _random = rnd;
53
- }
54
- function getRandom() {
55
- const min = 0, max = 1;
56
- return clamp(_random(), min, max - Number.EPSILON);
57
- }
58
- function getRandomInRange(min, max) {
59
- return getRandom() * (max - min) + min;
60
- }
61
- function setAnimationFunctions(nextFrame, cancel) {
62
- _animationLoop.nextFrame = nextFrame;
63
- _animationLoop.cancel = cancel;
64
- }
65
- function animate(fn) {
66
- return _animationLoop.nextFrame(fn);
67
- }
68
- function cancelAnimation(handle) {
69
- _animationLoop.cancel(handle);
70
- }
71
- function clamp(num, min, max) {
72
- return Math.min(Math.max(num, min), max);
73
- }
74
- function mix(comp1, comp2, weight1, weight2) {
75
- return Math.floor((comp1 * weight1 + comp2 * weight2) / (weight1 + weight2));
76
- }
77
- function randomInRangeValue(r) {
78
- const max = getRangeMax(r), minOffset = 0;
79
- let min = getRangeMin(r);
80
- if (max === min) {
81
- min = minOffset;
82
- }
83
- return getRandomInRange(min, max);
84
- }
85
- function getRangeValue(value) {
86
- return (0, TypeUtils_js_1.isNumber)(value) ? value : randomInRangeValue(value);
87
- }
88
- function getRangeMin(value) {
89
- return (0, TypeUtils_js_1.isNumber)(value) ? value : value.min;
90
- }
91
- function getRangeMax(value) {
92
- return (0, TypeUtils_js_1.isNumber)(value) ? value : value.max;
93
- }
94
- function setRangeValue(source, value) {
95
- if (source === value || (value === undefined && (0, TypeUtils_js_1.isNumber)(source))) {
96
- return source;
97
- }
98
- const min = getRangeMin(source), max = getRangeMax(source);
99
- return value !== undefined
100
- ? {
101
- min: Math.min(min, value),
102
- max: Math.max(max, value),
103
- }
104
- : setRangeValue(min, max);
105
- }
106
- function getDistances(pointA, pointB) {
107
- const dx = pointA.x - pointB.x, dy = pointA.y - pointB.y;
108
- return { dx: dx, dy: dy, distance: Math.hypot(dx, dy) };
109
- }
110
- function getDistanceSq(pointA, pointB) {
111
- const dx = pointA.x - pointB.x, dy = pointA.y - pointB.y;
112
- return dx * dx + dy * dy;
113
- }
114
- function getDistance(pointA, pointB) {
115
- return Math.sqrt(getDistanceSq(pointA, pointB));
116
- }
117
- function checkDistance(pointA, pointB, distance) {
118
- return getDistanceSq(pointA, pointB) <= distance * distance;
119
- }
120
- function degToRad(degrees) {
121
- return degrees * degToRadFactor;
122
- }
123
- function getParticleDirectionAngle(direction, position, center) {
124
- if ((0, TypeUtils_js_1.isNumber)(direction)) {
125
- return degToRad(direction);
126
- }
127
- switch (direction) {
128
- case MoveDirection_js_1.MoveDirection.top:
129
- return -Math.PI * Constants_js_1.half;
130
- case MoveDirection_js_1.MoveDirection.topRight:
131
- return -Math.PI * Constants_js_1.quarter;
132
- case MoveDirection_js_1.MoveDirection.right:
133
- return Constants_js_1.empty;
134
- case MoveDirection_js_1.MoveDirection.bottomRight:
135
- return Math.PI * Constants_js_1.quarter;
136
- case MoveDirection_js_1.MoveDirection.bottom:
137
- return Math.PI * Constants_js_1.half;
138
- case MoveDirection_js_1.MoveDirection.bottomLeft:
139
- return Math.PI * Constants_js_1.threeQuarter;
140
- case MoveDirection_js_1.MoveDirection.left:
141
- return Math.PI;
142
- case MoveDirection_js_1.MoveDirection.topLeft:
143
- return -Math.PI * Constants_js_1.threeQuarter;
144
- case MoveDirection_js_1.MoveDirection.inside:
145
- return Math.atan2(center.y - position.y, center.x - position.x);
146
- case MoveDirection_js_1.MoveDirection.outside:
147
- return Math.atan2(position.y - center.y, position.x - center.x);
148
- default:
149
- return getRandom() * Constants_js_1.doublePI;
150
- }
151
- }
152
- function getParticleBaseVelocity(direction) {
153
- const baseVelocity = Vectors_js_1.Vector.origin;
154
- baseVelocity.length = 1;
155
- baseVelocity.angle = direction;
156
- return baseVelocity;
157
- }
158
- function collisionVelocity(v1, v2, m1, m2) {
159
- return Vectors_js_1.Vector.create((v1.x * (m1 - m2)) / (m1 + m2) + (v2.x * Constants_js_1.double * m2) / (m1 + m2), v1.y);
160
- }
161
- function calcPositionFromSize(data) {
162
- return data.position?.x !== undefined && data.position.y !== undefined
163
- ? {
164
- x: (data.position.x * data.size.width) / Constants_js_1.percentDenominator,
165
- y: (data.position.y * data.size.height) / Constants_js_1.percentDenominator,
166
- }
167
- : undefined;
168
- }
169
- function calcPositionOrRandomFromSize(data) {
170
- return {
171
- x: ((data.position?.x ?? getRandom() * Constants_js_1.percentDenominator) * data.size.width) / Constants_js_1.percentDenominator,
172
- y: ((data.position?.y ?? getRandom() * Constants_js_1.percentDenominator) * data.size.height) / Constants_js_1.percentDenominator,
173
- };
174
- }
175
- function calcPositionOrRandomFromSizeRanged(data) {
176
- const position = {
177
- x: data.position?.x !== undefined ? getRangeValue(data.position.x) : undefined,
178
- y: data.position?.y !== undefined ? getRangeValue(data.position.y) : undefined,
179
- };
180
- return calcPositionOrRandomFromSize({ size: data.size, position });
181
- }
182
- function calcExactPositionOrRandomFromSize(data) {
183
- const { position, size } = data;
184
- return {
185
- x: position?.x ?? getRandom() * size.width,
186
- y: position?.y ?? getRandom() * size.height,
187
- };
188
- }
189
- function calcExactPositionOrRandomFromSizeRanged(data) {
190
- const position = {
191
- x: data.position?.x !== undefined ? getRangeValue(data.position.x) : undefined,
192
- y: data.position?.y !== undefined ? getRangeValue(data.position.y) : undefined,
193
- };
194
- return calcExactPositionOrRandomFromSize({ size: data.size, position });
195
- }
196
- function parseAlpha(input) {
197
- const defaultAlpha = 1;
198
- if (!input) {
199
- return defaultAlpha;
200
- }
201
- return input.endsWith("%") ? parseFloat(input) / Constants_js_1.percentDenominator : parseFloat(input);
202
- }
203
- });
@@ -1,25 +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", "../Options/Classes/Particles/ParticlesOptions.js"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.loadOptions = loadOptions;
13
- exports.loadParticlesOptions = loadParticlesOptions;
14
- const ParticlesOptions_js_1 = require("../Options/Classes/Particles/ParticlesOptions.js");
15
- function loadOptions(options, ...sourceOptionsArr) {
16
- for (const sourceOptions of sourceOptionsArr) {
17
- options.load(sourceOptions);
18
- }
19
- }
20
- function loadParticlesOptions(pluginManager, container, ...sourceOptionsArr) {
21
- const options = new ParticlesOptions_js_1.ParticlesOptions(pluginManager, container);
22
- loadOptions(options, ...sourceOptionsArr);
23
- return options;
24
- }
25
- });
@@ -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"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.isBoolean = isBoolean;
13
- exports.isString = isString;
14
- exports.isNumber = isNumber;
15
- exports.isFunction = isFunction;
16
- exports.isObject = isObject;
17
- exports.isArray = isArray;
18
- exports.isNull = isNull;
19
- function isBoolean(arg) {
20
- return typeof arg === "boolean";
21
- }
22
- function isString(arg) {
23
- return typeof arg === "string";
24
- }
25
- function isNumber(arg) {
26
- return typeof arg === "number";
27
- }
28
- function isFunction(arg) {
29
- return typeof arg === "function";
30
- }
31
- function isObject(arg) {
32
- return typeof arg === "object" && arg !== null;
33
- }
34
- function isArray(arg) {
35
- return Array.isArray(arg);
36
- }
37
- function isNull(arg) {
38
- return arg === null || arg === undefined;
39
- }
40
- });