@tsparticles/engine 4.0.0-beta.0 → 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 (228) hide show
  1. package/155.min.js +1 -0
  2. package/README.md +0 -21
  3. package/browser/Core/CanvasManager.js +303 -0
  4. package/browser/Core/Container.js +64 -34
  5. package/browser/Core/Engine.js +26 -138
  6. package/browser/Core/Interfaces/IPositionFromSizeParams.js +1 -1
  7. package/browser/Core/Particle.js +29 -28
  8. package/{cjs/Core/Particles.js → browser/Core/ParticlesManager.js} +28 -57
  9. package/browser/Core/RenderManager.js +303 -0
  10. package/browser/Core/Retina.js +3 -8
  11. package/browser/Core/Utils/PluginManager.js +145 -0
  12. package/browser/Options/Classes/Options.js +7 -7
  13. package/browser/Options/Classes/Particles/ParticlesOptions.js +5 -5
  14. package/browser/Types/CanvasContextType.js +1 -0
  15. package/browser/Utils/CanvasUtils.js +1 -1
  16. package/browser/Utils/ColorUtils.js +21 -21
  17. package/browser/Utils/LogUtils.js +1 -0
  18. package/browser/Utils/OptionsUtils.js +2 -2
  19. package/cjs/Core/CanvasManager.js +303 -0
  20. package/cjs/Core/Container.js +64 -34
  21. package/cjs/Core/Engine.js +26 -138
  22. package/cjs/Core/Interfaces/IPositionFromSizeParams.js +1 -1
  23. package/cjs/Core/Particle.js +29 -28
  24. package/{esm/Core/Particles.js → cjs/Core/ParticlesManager.js} +28 -57
  25. package/cjs/Core/RenderManager.js +303 -0
  26. package/cjs/Core/Retina.js +3 -8
  27. package/cjs/Core/Utils/PluginManager.js +145 -0
  28. package/cjs/Options/Classes/Options.js +7 -7
  29. package/cjs/Options/Classes/Particles/ParticlesOptions.js +5 -5
  30. package/cjs/Types/CanvasContextType.js +1 -0
  31. package/cjs/Utils/CanvasUtils.js +1 -1
  32. package/cjs/Utils/ColorUtils.js +21 -21
  33. package/cjs/Utils/LogUtils.js +1 -0
  34. package/cjs/Utils/OptionsUtils.js +2 -2
  35. package/dist_browser_Core_Container_js.js +24 -14
  36. package/esm/Core/CanvasManager.js +303 -0
  37. package/esm/Core/Container.js +64 -34
  38. package/esm/Core/Engine.js +26 -138
  39. package/esm/Core/Interfaces/IPositionFromSizeParams.js +1 -1
  40. package/esm/Core/Particle.js +29 -28
  41. package/{browser/Core/Particles.js → esm/Core/ParticlesManager.js} +28 -57
  42. package/esm/Core/RenderManager.js +303 -0
  43. package/esm/Core/Retina.js +3 -8
  44. package/esm/Core/Utils/PluginManager.js +145 -0
  45. package/esm/Options/Classes/Options.js +7 -7
  46. package/esm/Options/Classes/Particles/ParticlesOptions.js +5 -5
  47. package/esm/Types/CanvasContextType.js +1 -0
  48. package/esm/Utils/CanvasUtils.js +1 -1
  49. package/esm/Utils/ColorUtils.js +21 -21
  50. package/esm/Utils/LogUtils.js +1 -0
  51. package/esm/Utils/OptionsUtils.js +2 -2
  52. package/package.json +2 -3
  53. package/report.html +84 -29
  54. package/tsparticles.engine.js +18 -8
  55. package/tsparticles.engine.min.js +2 -2
  56. package/types/Core/CanvasManager.d.ts +39 -0
  57. package/types/Core/Container.d.ts +26 -7
  58. package/types/Core/Engine.d.ts +2 -54
  59. package/types/Core/Interfaces/IContainerPlugin.d.ts +8 -7
  60. package/types/Core/Interfaces/IDrawParticleParams.d.ts +2 -1
  61. package/types/Core/Interfaces/IParticleRetinaProps.d.ts +4 -4
  62. package/types/Core/Interfaces/IParticleUpdater.d.ts +2 -1
  63. package/types/Core/Interfaces/IShapeDrawData.d.ts +2 -1
  64. package/types/Core/Particle.d.ts +4 -4
  65. package/types/Core/{Particles.d.ts → ParticlesManager.d.ts} +4 -11
  66. package/types/Core/{Canvas.d.ts → RenderManager.d.ts} +12 -33
  67. package/types/Core/Retina.d.ts +0 -2
  68. package/types/Core/Utils/PluginManager.d.ts +62 -0
  69. package/types/Options/Classes/Options.d.ts +3 -3
  70. package/types/Options/Classes/Particles/ParticlesOptions.d.ts +3 -3
  71. package/types/Types/CanvasContextType.d.ts +1 -0
  72. package/types/Utils/CanvasUtils.d.ts +8 -5
  73. package/types/Utils/ColorUtils.d.ts +8 -8
  74. package/types/Utils/LogUtils.d.ts +1 -0
  75. package/types/Utils/OptionsUtils.d.ts +2 -2
  76. package/types/export-types.d.ts +4 -2
  77. package/164.min.js +0 -1
  78. package/browser/Core/Canvas.js +0 -570
  79. package/cjs/Core/Canvas.js +0 -570
  80. package/esm/Core/Canvas.js +0 -570
  81. package/umd/Core/Canvas.js +0 -584
  82. package/umd/Core/Container.js +0 -356
  83. package/umd/Core/Engine.js +0 -295
  84. package/umd/Core/Interfaces/Colors.js +0 -12
  85. package/umd/Core/Interfaces/IBounds.js +0 -12
  86. package/umd/Core/Interfaces/IBubbleParticleData.js +0 -12
  87. package/umd/Core/Interfaces/ICircleBouncer.js +0 -12
  88. package/umd/Core/Interfaces/IColorManager.js +0 -12
  89. package/umd/Core/Interfaces/IContainerPlugin.js +0 -12
  90. package/umd/Core/Interfaces/ICoordinates.js +0 -12
  91. package/umd/Core/Interfaces/IDelta.js +0 -12
  92. package/umd/Core/Interfaces/IDimension.js +0 -12
  93. package/umd/Core/Interfaces/IDistance.js +0 -12
  94. package/umd/Core/Interfaces/IDrawParticleParams.js +0 -12
  95. package/umd/Core/Interfaces/IEffectDrawer.js +0 -12
  96. package/umd/Core/Interfaces/ILoadParams.js +0 -12
  97. package/umd/Core/Interfaces/IPalette.js +0 -12
  98. package/umd/Core/Interfaces/IParticleColorStyle.js +0 -12
  99. package/umd/Core/Interfaces/IParticleHslAnimation.js +0 -12
  100. package/umd/Core/Interfaces/IParticleLife.js +0 -12
  101. package/umd/Core/Interfaces/IParticleOpacityData.js +0 -12
  102. package/umd/Core/Interfaces/IParticleRetinaProps.js +0 -12
  103. package/umd/Core/Interfaces/IParticleRoll.js +0 -12
  104. package/umd/Core/Interfaces/IParticleRotateData.js +0 -12
  105. package/umd/Core/Interfaces/IParticleTransformValues.js +0 -12
  106. package/umd/Core/Interfaces/IParticleUpdater.js +0 -12
  107. package/umd/Core/Interfaces/IParticleValueAnimation.js +0 -12
  108. package/umd/Core/Interfaces/IPlugin.js +0 -12
  109. package/umd/Core/Interfaces/IPositionFromSizeParams.js +0 -12
  110. package/umd/Core/Interfaces/IRangeValue.js +0 -12
  111. package/umd/Core/Interfaces/IShapeDrawData.js +0 -12
  112. package/umd/Core/Interfaces/IShapeDrawer.js +0 -12
  113. package/umd/Core/Interfaces/IShapeValues.js +0 -12
  114. package/umd/Core/Interfaces/ISlowParticleData.js +0 -12
  115. package/umd/Core/Particle.js +0 -432
  116. package/umd/Core/Particles.js +0 -407
  117. package/umd/Core/Retina.js +0 -52
  118. package/umd/Core/Utils/Constants.js +0 -23
  119. package/umd/Core/Utils/EventListeners.js +0 -102
  120. package/umd/Core/Utils/Ranges.js +0 -91
  121. package/umd/Core/Utils/SpatialHashGrid.js +0 -116
  122. package/umd/Core/Utils/Vectors.js +0 -126
  123. package/umd/Enums/AnimationStatus.js +0 -18
  124. package/umd/Enums/Directions/MoveDirection.js +0 -27
  125. package/umd/Enums/Directions/OutModeDirection.js +0 -20
  126. package/umd/Enums/Directions/RotateDirection.js +0 -19
  127. package/umd/Enums/Modes/AnimationMode.js +0 -20
  128. package/umd/Enums/Modes/LimitMode.js +0 -18
  129. package/umd/Enums/Modes/OutMode.js +0 -21
  130. package/umd/Enums/Modes/PixelMode.js +0 -18
  131. package/umd/Enums/RangeType.js +0 -18
  132. package/umd/Enums/Types/AlterType.js +0 -18
  133. package/umd/Enums/Types/DestroyType.js +0 -19
  134. package/umd/Enums/Types/EasingType.js +0 -58
  135. package/umd/Enums/Types/EventType.js +0 -28
  136. package/umd/Enums/Types/GradientType.js +0 -19
  137. package/umd/Enums/Types/ParticleOutType.js +0 -19
  138. package/umd/Enums/Types/StartValueType.js +0 -19
  139. package/umd/Options/Classes/AnimatableColor.js +0 -52
  140. package/umd/Options/Classes/AnimationOptions.js +0 -79
  141. package/umd/Options/Classes/Background/Background.js +0 -56
  142. package/umd/Options/Classes/ColorAnimation.js +0 -44
  143. package/umd/Options/Classes/FullScreen/FullScreen.js +0 -34
  144. package/umd/Options/Classes/HslAnimation.js +0 -30
  145. package/umd/Options/Classes/Options.js +0 -171
  146. package/umd/Options/Classes/OptionsColor.js +0 -42
  147. package/umd/Options/Classes/Particles/Bounce/ParticlesBounce.js +0 -31
  148. package/umd/Options/Classes/Particles/Bounce/ParticlesBounceFactor.js +0 -21
  149. package/umd/Options/Classes/Particles/Effect/Effect.js +0 -46
  150. package/umd/Options/Classes/Particles/Fill.js +0 -42
  151. package/umd/Options/Classes/Particles/Move/Move.js +0 -120
  152. package/umd/Options/Classes/Particles/Move/MoveAngle.js +0 -35
  153. package/umd/Options/Classes/Particles/Move/MoveCenter.js +0 -45
  154. package/umd/Options/Classes/Particles/Move/MoveGravity.js +0 -45
  155. package/umd/Options/Classes/Particles/Move/OutModes.js +0 -38
  156. package/umd/Options/Classes/Particles/Move/Path/MovePath.js +0 -46
  157. package/umd/Options/Classes/Particles/Move/Spin.js +0 -40
  158. package/umd/Options/Classes/Particles/Number/ParticlesDensity.js +0 -41
  159. package/umd/Options/Classes/Particles/Number/ParticlesNumber.js +0 -37
  160. package/umd/Options/Classes/Particles/Number/ParticlesNumberLimit.js +0 -35
  161. package/umd/Options/Classes/Particles/Opacity/Opacity.js +0 -35
  162. package/umd/Options/Classes/Particles/Opacity/OpacityAnimation.js +0 -34
  163. package/umd/Options/Classes/Particles/ParticlesOptions.js +0 -116
  164. package/umd/Options/Classes/Particles/Shape/Shape.js +0 -46
  165. package/umd/Options/Classes/Particles/Size/Size.js +0 -35
  166. package/umd/Options/Classes/Particles/Size/SizeAnimation.js +0 -34
  167. package/umd/Options/Classes/Particles/Stroke.js +0 -39
  168. package/umd/Options/Classes/Particles/ZIndex/ZIndex.js +0 -42
  169. package/umd/Options/Classes/ResizeEvent.js +0 -34
  170. package/umd/Options/Classes/ValueWithRandom.js +0 -56
  171. package/umd/Options/Interfaces/Background/IBackground.js +0 -12
  172. package/umd/Options/Interfaces/FullScreen/IFullScreen.js +0 -12
  173. package/umd/Options/Interfaces/IAnimatable.js +0 -12
  174. package/umd/Options/Interfaces/IAnimatableColor.js +0 -12
  175. package/umd/Options/Interfaces/IAnimation.js +0 -12
  176. package/umd/Options/Interfaces/IColorAnimation.js +0 -12
  177. package/umd/Options/Interfaces/IHslAnimation.js +0 -12
  178. package/umd/Options/Interfaces/IOptionLoader.js +0 -12
  179. package/umd/Options/Interfaces/IOptions.js +0 -12
  180. package/umd/Options/Interfaces/IOptionsColor.js +0 -12
  181. package/umd/Options/Interfaces/IResizeEvent.js +0 -12
  182. package/umd/Options/Interfaces/IValueWithRandom.js +0 -12
  183. package/umd/Options/Interfaces/Particles/Bounce/IParticlesBounce.js +0 -12
  184. package/umd/Options/Interfaces/Particles/Effect/IEffect.js +0 -12
  185. package/umd/Options/Interfaces/Particles/IFill.js +0 -12
  186. package/umd/Options/Interfaces/Particles/IParticlesOptions.js +0 -12
  187. package/umd/Options/Interfaces/Particles/IStroke.js +0 -12
  188. package/umd/Options/Interfaces/Particles/Move/IMove.js +0 -12
  189. package/umd/Options/Interfaces/Particles/Move/IMoveAngle.js +0 -12
  190. package/umd/Options/Interfaces/Particles/Move/IMoveCenter.js +0 -12
  191. package/umd/Options/Interfaces/Particles/Move/IMoveGravity.js +0 -12
  192. package/umd/Options/Interfaces/Particles/Move/IOutModes.js +0 -12
  193. package/umd/Options/Interfaces/Particles/Move/ISpin.js +0 -12
  194. package/umd/Options/Interfaces/Particles/Move/Path/IMovePath.js +0 -12
  195. package/umd/Options/Interfaces/Particles/Number/IParticlesDensity.js +0 -12
  196. package/umd/Options/Interfaces/Particles/Number/IParticlesNumber.js +0 -12
  197. package/umd/Options/Interfaces/Particles/Number/IParticlesNumberLimit.js +0 -12
  198. package/umd/Options/Interfaces/Particles/Opacity/IOpacity.js +0 -12
  199. package/umd/Options/Interfaces/Particles/Opacity/IOpacityAnimation.js +0 -12
  200. package/umd/Options/Interfaces/Particles/Shape/IShape.js +0 -12
  201. package/umd/Options/Interfaces/Particles/Size/ISize.js +0 -12
  202. package/umd/Options/Interfaces/Particles/Size/ISizeAnimation.js +0 -12
  203. package/umd/Options/Interfaces/Particles/ZIndex/IZIndex.js +0 -12
  204. package/umd/Types/CustomEventArgs.js +0 -12
  205. package/umd/Types/CustomEventListener.js +0 -12
  206. package/umd/Types/EasingFunction.js +0 -12
  207. package/umd/Types/EngineInitializers.js +0 -12
  208. package/umd/Types/ExportResult.js +0 -12
  209. package/umd/Types/ISourceOptions.js +0 -12
  210. package/umd/Types/ParticlesGroups.js +0 -12
  211. package/umd/Types/PathOptions.js +0 -12
  212. package/umd/Types/RangeValue.js +0 -12
  213. package/umd/Types/RecursivePartial.js +0 -12
  214. package/umd/Types/ShapeData.js +0 -12
  215. package/umd/Types/SingleOrMultiple.js +0 -12
  216. package/umd/Utils/CanvasUtils.js +0 -145
  217. package/umd/Utils/ColorUtils.js +0 -395
  218. package/umd/Utils/EventDispatcher.js +0 -63
  219. package/umd/Utils/LogUtils.js +0 -36
  220. package/umd/Utils/MathUtils.js +0 -203
  221. package/umd/Utils/OptionsUtils.js +0 -25
  222. package/umd/Utils/TypeUtils.js +0 -40
  223. package/umd/Utils/Utils.js +0 -484
  224. package/umd/bundle.js +0 -32
  225. package/umd/export-types.js +0 -12
  226. package/umd/exports.js +0 -82
  227. package/umd/index.js +0 -32
  228. package/umd/initEngine.js +0 -17
@@ -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", "./Ranges.js"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.SpatialHashGrid = void 0;
13
- const Ranges_js_1 = require("./Ranges.js");
14
- class SpatialHashGrid {
15
- _cellSize;
16
- _cells = new Map();
17
- _circlePool = [];
18
- _circlePoolIdx;
19
- _pendingCellSize;
20
- _rectanglePool = [];
21
- _rectanglePoolIdx;
22
- constructor(cellSize) {
23
- this._cellSize = cellSize;
24
- this._circlePoolIdx = 0;
25
- this._rectanglePoolIdx = 0;
26
- }
27
- clear() {
28
- this._cells.clear();
29
- const pendingCellSize = this._pendingCellSize;
30
- if (pendingCellSize) {
31
- this._cellSize = pendingCellSize;
32
- }
33
- this._pendingCellSize = undefined;
34
- }
35
- insert(particle) {
36
- const { x, y } = particle.getPosition(), key = this._cellKeyFromCoords(x, y);
37
- if (!this._cells.has(key)) {
38
- this._cells.set(key, []);
39
- }
40
- this._cells.get(key)?.push(particle);
41
- }
42
- query(range, check, out = []) {
43
- const bounds = this._getRangeBounds(range);
44
- if (!bounds) {
45
- return out;
46
- }
47
- const minCellX = Math.floor(bounds.minX / this._cellSize), maxCellX = Math.floor(bounds.maxX / this._cellSize), minCellY = Math.floor(bounds.minY / this._cellSize), maxCellY = Math.floor(bounds.maxY / this._cellSize);
48
- for (let cx = minCellX; cx <= maxCellX; cx++) {
49
- for (let cy = minCellY; cy <= maxCellY; cy++) {
50
- const key = `${cx}_${cy}`, cellParticles = this._cells.get(key);
51
- if (!cellParticles) {
52
- continue;
53
- }
54
- for (const p of cellParticles) {
55
- if (check && !check(p)) {
56
- continue;
57
- }
58
- if (range.contains(p.getPosition())) {
59
- out.push(p);
60
- }
61
- }
62
- }
63
- }
64
- return out;
65
- }
66
- queryCircle(position, radius, check, out = []) {
67
- const circle = this._acquireCircle(position.x, position.y, radius), result = this.query(circle, check, out);
68
- this._releaseShapes();
69
- return result;
70
- }
71
- queryRectangle(position, size, check, out = []) {
72
- const rect = this._acquireRectangle(position.x, position.y, size.width, size.height), result = this.query(rect, check, out);
73
- this._releaseShapes();
74
- return result;
75
- }
76
- setCellSize(cellSize) {
77
- this._pendingCellSize = cellSize;
78
- }
79
- _acquireCircle(x, y, r) {
80
- return (this._circlePool[this._circlePoolIdx++] ??= new Ranges_js_1.Circle(x, y, r)).reset(x, y, r);
81
- }
82
- _acquireRectangle(x, y, w, h) {
83
- return (this._rectanglePool[this._rectanglePoolIdx++] ??= new Ranges_js_1.Rectangle(x, y, w, h)).reset(x, y, w, h);
84
- }
85
- _cellKeyFromCoords(x, y) {
86
- const cellX = Math.floor(x / this._cellSize), cellY = Math.floor(y / this._cellSize);
87
- return `${cellX}_${cellY}`;
88
- }
89
- _getRangeBounds(range) {
90
- if (range instanceof Ranges_js_1.Circle) {
91
- const r = range.radius, { x, y } = range.position;
92
- return {
93
- minX: x - r,
94
- maxX: x + r,
95
- minY: y - r,
96
- maxY: y + r,
97
- };
98
- }
99
- if (range instanceof Ranges_js_1.Rectangle) {
100
- const { x, y } = range.position, { width, height } = range.size;
101
- return {
102
- minX: x,
103
- maxX: x + width,
104
- minY: y,
105
- maxY: y + height,
106
- };
107
- }
108
- return null;
109
- }
110
- _releaseShapes() {
111
- this._circlePoolIdx = 0;
112
- this._rectanglePoolIdx = 0;
113
- }
114
- }
115
- exports.SpatialHashGrid = SpatialHashGrid;
116
- });
@@ -1,126 +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", "./Constants.js"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.Vector = exports.Vector3d = void 0;
13
- const Constants_js_1 = require("./Constants.js");
14
- function getZ(source) {
15
- return "z" in source ? source.z : Constants_js_1.originPoint.z;
16
- }
17
- class Vector3d {
18
- x;
19
- y;
20
- z;
21
- constructor(x = Constants_js_1.originPoint.x, y = Constants_js_1.originPoint.y, z = Constants_js_1.originPoint.z) {
22
- this.x = x;
23
- this.y = y;
24
- this.z = z;
25
- }
26
- static get origin() {
27
- return Vector3d.create(Constants_js_1.originPoint.x, Constants_js_1.originPoint.y, Constants_js_1.originPoint.z);
28
- }
29
- get angle() {
30
- return Math.atan2(this.y, this.x);
31
- }
32
- set angle(angle) {
33
- this._updateFromAngle(angle, this.length);
34
- }
35
- get length() {
36
- return Math.sqrt(this.getLengthSq());
37
- }
38
- set length(length) {
39
- this._updateFromAngle(this.angle, length);
40
- }
41
- static clone(source) {
42
- return Vector3d.create(source.x, source.y, getZ(source));
43
- }
44
- static create(x, y, z) {
45
- if (typeof x === "number") {
46
- return new Vector3d(x, y ?? Constants_js_1.originPoint.y, z ?? Constants_js_1.originPoint.z);
47
- }
48
- return new Vector3d(x.x, x.y, getZ(x));
49
- }
50
- add(v) {
51
- return Vector3d.create(this.x + v.x, this.y + v.y, this.z + getZ(v));
52
- }
53
- addTo(v) {
54
- this.x += v.x;
55
- this.y += v.y;
56
- this.z += getZ(v);
57
- }
58
- copy() {
59
- return Vector3d.clone(this);
60
- }
61
- div(n) {
62
- return Vector3d.create(this.x / n, this.y / n, this.z / n);
63
- }
64
- divTo(n) {
65
- this.x /= n;
66
- this.y /= n;
67
- this.z /= n;
68
- }
69
- getLengthSq() {
70
- return this.x ** Constants_js_1.squareExp + this.y ** Constants_js_1.squareExp;
71
- }
72
- mult(n) {
73
- return Vector3d.create(this.x * n, this.y * n, this.z * n);
74
- }
75
- multTo(n) {
76
- this.x *= n;
77
- this.y *= n;
78
- this.z *= n;
79
- }
80
- normalize() {
81
- const length = this.length;
82
- if (length != Constants_js_1.none) {
83
- this.multTo(Constants_js_1.inverseFactorNumerator / length);
84
- }
85
- }
86
- rotate(angle) {
87
- return Vector3d.create(this.x * Math.cos(angle) - this.y * Math.sin(angle), this.x * Math.sin(angle) + this.y * Math.cos(angle), Constants_js_1.originPoint.z);
88
- }
89
- setTo(c) {
90
- this.x = c.x;
91
- this.y = c.y;
92
- this.z = getZ(c);
93
- }
94
- sub(v) {
95
- return Vector3d.create(this.x - v.x, this.y - v.y, this.z - getZ(v));
96
- }
97
- subFrom(v) {
98
- this.x -= v.x;
99
- this.y -= v.y;
100
- this.z -= getZ(v);
101
- }
102
- _updateFromAngle(angle, length) {
103
- this.x = Math.cos(angle) * length;
104
- this.y = Math.sin(angle) * length;
105
- }
106
- }
107
- exports.Vector3d = Vector3d;
108
- class Vector extends Vector3d {
109
- constructor(x = Constants_js_1.originPoint.x, y = Constants_js_1.originPoint.y) {
110
- super(x, y, Constants_js_1.originPoint.z);
111
- }
112
- static get origin() {
113
- return Vector.create(Constants_js_1.originPoint.x, Constants_js_1.originPoint.y);
114
- }
115
- static clone(source) {
116
- return Vector.create(source.x, source.y);
117
- }
118
- static create(x, y) {
119
- if (typeof x === "number") {
120
- return new Vector(x, y ?? Constants_js_1.originPoint.y);
121
- }
122
- return new Vector(x.x, x.y);
123
- }
124
- }
125
- exports.Vector = Vector;
126
- });
@@ -1,18 +0,0 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
5
- }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.AnimationStatus = void 0;
13
- var AnimationStatus;
14
- (function (AnimationStatus) {
15
- AnimationStatus["increasing"] = "increasing";
16
- AnimationStatus["decreasing"] = "decreasing";
17
- })(AnimationStatus || (exports.AnimationStatus = AnimationStatus = {}));
18
- });
@@ -1,27 +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.MoveDirection = void 0;
13
- var MoveDirection;
14
- (function (MoveDirection) {
15
- MoveDirection["bottom"] = "bottom";
16
- MoveDirection["bottomLeft"] = "bottom-left";
17
- MoveDirection["bottomRight"] = "bottom-right";
18
- MoveDirection["left"] = "left";
19
- MoveDirection["none"] = "none";
20
- MoveDirection["right"] = "right";
21
- MoveDirection["top"] = "top";
22
- MoveDirection["topLeft"] = "top-left";
23
- MoveDirection["topRight"] = "top-right";
24
- MoveDirection["outside"] = "outside";
25
- MoveDirection["inside"] = "inside";
26
- })(MoveDirection || (exports.MoveDirection = MoveDirection = {}));
27
- });
@@ -1,20 +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.OutModeDirection = void 0;
13
- var OutModeDirection;
14
- (function (OutModeDirection) {
15
- OutModeDirection["bottom"] = "bottom";
16
- OutModeDirection["left"] = "left";
17
- OutModeDirection["right"] = "right";
18
- OutModeDirection["top"] = "top";
19
- })(OutModeDirection || (exports.OutModeDirection = OutModeDirection = {}));
20
- });
@@ -1,19 +0,0 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
5
- }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.RotateDirection = void 0;
13
- var RotateDirection;
14
- (function (RotateDirection) {
15
- RotateDirection["clockwise"] = "clockwise";
16
- RotateDirection["counterClockwise"] = "counter-clockwise";
17
- RotateDirection["random"] = "random";
18
- })(RotateDirection || (exports.RotateDirection = RotateDirection = {}));
19
- });
@@ -1,20 +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.AnimationMode = void 0;
13
- var AnimationMode;
14
- (function (AnimationMode) {
15
- AnimationMode["auto"] = "auto";
16
- AnimationMode["increase"] = "increase";
17
- AnimationMode["decrease"] = "decrease";
18
- AnimationMode["random"] = "random";
19
- })(AnimationMode || (exports.AnimationMode = AnimationMode = {}));
20
- });
@@ -1,18 +0,0 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
5
- }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.LimitMode = void 0;
13
- var LimitMode;
14
- (function (LimitMode) {
15
- LimitMode["delete"] = "delete";
16
- LimitMode["wait"] = "wait";
17
- })(LimitMode || (exports.LimitMode = LimitMode = {}));
18
- });
@@ -1,21 +0,0 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
5
- }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.OutMode = void 0;
13
- var OutMode;
14
- (function (OutMode) {
15
- OutMode["bounce"] = "bounce";
16
- OutMode["none"] = "none";
17
- OutMode["out"] = "out";
18
- OutMode["destroy"] = "destroy";
19
- OutMode["split"] = "split";
20
- })(OutMode || (exports.OutMode = OutMode = {}));
21
- });
@@ -1,18 +0,0 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
5
- }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.PixelMode = void 0;
13
- var PixelMode;
14
- (function (PixelMode) {
15
- PixelMode["precise"] = "precise";
16
- PixelMode["percent"] = "percent";
17
- })(PixelMode || (exports.PixelMode = PixelMode = {}));
18
- });
@@ -1,18 +0,0 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
5
- }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.RangeType = void 0;
13
- var RangeType;
14
- (function (RangeType) {
15
- RangeType["circle"] = "circle";
16
- RangeType["rectangle"] = "rectangle";
17
- })(RangeType || (exports.RangeType = RangeType = {}));
18
- });
@@ -1,18 +0,0 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
5
- }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.AlterType = void 0;
13
- var AlterType;
14
- (function (AlterType) {
15
- AlterType["darken"] = "darken";
16
- AlterType["enlighten"] = "enlighten";
17
- })(AlterType || (exports.AlterType = AlterType = {}));
18
- });
@@ -1,19 +0,0 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
5
- }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.DestroyType = void 0;
13
- var DestroyType;
14
- (function (DestroyType) {
15
- DestroyType["none"] = "none";
16
- DestroyType["max"] = "max";
17
- DestroyType["min"] = "min";
18
- })(DestroyType || (exports.DestroyType = DestroyType = {}));
19
- });
@@ -1,58 +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.EasingType = void 0;
13
- var EasingType;
14
- (function (EasingType) {
15
- EasingType["easeInBack"] = "ease-in-back";
16
- EasingType["easeInBounce"] = "ease-in-bounce";
17
- EasingType["easeInCirc"] = "ease-in-circ";
18
- EasingType["easeInCubic"] = "ease-in-cubic";
19
- EasingType["easeInElastic"] = "ease-in-elastic";
20
- EasingType["easeInExpo"] = "ease-in-expo";
21
- EasingType["easeInGaussian"] = "ease-in-gaussian";
22
- EasingType["easeInLinear"] = "ease-in-linear";
23
- EasingType["easeInQuad"] = "ease-in-quad";
24
- EasingType["easeInQuart"] = "ease-in-quart";
25
- EasingType["easeInQuint"] = "ease-in-quint";
26
- EasingType["easeInSigmoid"] = "ease-in-sigmoid";
27
- EasingType["easeInSine"] = "ease-in-sine";
28
- EasingType["easeInSmoothstep"] = "ease-in-smoothstep";
29
- EasingType["easeOutBack"] = "ease-out-back";
30
- EasingType["easeOutBounce"] = "ease-out-bounce";
31
- EasingType["easeOutCirc"] = "ease-out-circ";
32
- EasingType["easeOutCubic"] = "ease-out-cubic";
33
- EasingType["easeOutElastic"] = "ease-out-elastic";
34
- EasingType["easeOutExpo"] = "ease-out-expo";
35
- EasingType["easeOutGaussian"] = "ease-out-gaussian";
36
- EasingType["easeOutLinear"] = "ease-out-linear";
37
- EasingType["easeOutQuad"] = "ease-out-quad";
38
- EasingType["easeOutQuart"] = "ease-out-quart";
39
- EasingType["easeOutQuint"] = "ease-out-quint";
40
- EasingType["easeOutSigmoid"] = "ease-out-sigmoid";
41
- EasingType["easeOutSine"] = "ease-out-sine";
42
- EasingType["easeOutSmoothstep"] = "ease-out-smoothstep";
43
- EasingType["easeInOutBack"] = "ease-in-out-back";
44
- EasingType["easeInOutBounce"] = "ease-in-out-bounce";
45
- EasingType["easeInOutCirc"] = "ease-in-out-circ";
46
- EasingType["easeInOutCubic"] = "ease-in-out-cubic";
47
- EasingType["easeInOutElastic"] = "ease-in-out-elastic";
48
- EasingType["easeInOutExpo"] = "ease-in-out-expo";
49
- EasingType["easeInOutGaussian"] = "ease-in-out-gaussian";
50
- EasingType["easeInOutLinear"] = "ease-in-out-linear";
51
- EasingType["easeInOutQuad"] = "ease-in-out-quad";
52
- EasingType["easeInOutQuart"] = "ease-in-out-quart";
53
- EasingType["easeInOutQuint"] = "ease-in-out-quint";
54
- EasingType["easeInOutSigmoid"] = "ease-in-out-sigmoid";
55
- EasingType["easeInOutSine"] = "ease-in-out-sine";
56
- EasingType["easeInOutSmoothstep"] = "ease-in-out-smoothstep";
57
- })(EasingType || (exports.EasingType = EasingType = {}));
58
- });
@@ -1,28 +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.EventType = void 0;
13
- var EventType;
14
- (function (EventType) {
15
- EventType["configAdded"] = "configAdded";
16
- EventType["containerInit"] = "containerInit";
17
- EventType["particlesSetup"] = "particlesSetup";
18
- EventType["containerStarted"] = "containerStarted";
19
- EventType["containerStopped"] = "containerStopped";
20
- EventType["containerDestroyed"] = "containerDestroyed";
21
- EventType["containerPaused"] = "containerPaused";
22
- EventType["containerPlay"] = "containerPlay";
23
- EventType["containerBuilt"] = "containerBuilt";
24
- EventType["particleAdded"] = "particleAdded";
25
- EventType["particleDestroyed"] = "particleDestroyed";
26
- EventType["particleRemoved"] = "particleRemoved";
27
- })(EventType || (exports.EventType = EventType = {}));
28
- });
@@ -1,19 +0,0 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
5
- }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.GradientType = void 0;
13
- var GradientType;
14
- (function (GradientType) {
15
- GradientType["linear"] = "linear";
16
- GradientType["radial"] = "radial";
17
- GradientType["random"] = "random";
18
- })(GradientType || (exports.GradientType = GradientType = {}));
19
- });
@@ -1,19 +0,0 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
5
- }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.ParticleOutType = void 0;
13
- var ParticleOutType;
14
- (function (ParticleOutType) {
15
- ParticleOutType["normal"] = "normal";
16
- ParticleOutType["inside"] = "inside";
17
- ParticleOutType["outside"] = "outside";
18
- })(ParticleOutType || (exports.ParticleOutType = ParticleOutType = {}));
19
- });
@@ -1,19 +0,0 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
5
- }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.StartValueType = void 0;
13
- var StartValueType;
14
- (function (StartValueType) {
15
- StartValueType["max"] = "max";
16
- StartValueType["min"] = "min";
17
- StartValueType["random"] = "random";
18
- })(StartValueType || (exports.StartValueType = StartValueType = {}));
19
- });