@tsparticles/engine 3.2.1 → 3.3.0

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 (144) hide show
  1. package/174.min.js +2 -0
  2. package/174.min.js.LICENSE.txt +1 -0
  3. package/browser/Core/Canvas.js +9 -9
  4. package/browser/Core/Container.js +7 -7
  5. package/browser/Core/Engine.js +1 -1
  6. package/browser/Core/Particle.js +12 -13
  7. package/browser/Core/Particles.js +30 -30
  8. package/browser/Core/Utils/EventListeners.js +4 -3
  9. package/browser/Core/Utils/InteractionManager.js +4 -4
  10. package/browser/Core/Utils/QuadTree.js +4 -5
  11. package/browser/Core/Utils/Ranges.js +55 -0
  12. package/browser/Core/Utils/{Vector3d.js → Vectors.js} +15 -1
  13. package/browser/Options/Classes/AnimatableColor.js +1 -1
  14. package/browser/Options/Classes/BackgroundMask/BackgroundMask.js +1 -1
  15. package/browser/Options/Classes/Options.js +2 -1
  16. package/browser/Options/Classes/OptionsColor.js +1 -1
  17. package/browser/Options/Classes/Particles/Move/Move.js +1 -1
  18. package/browser/Types/RangeType.js +1 -0
  19. package/browser/Utils/CanvasUtils.js +14 -14
  20. package/browser/Utils/ColorUtils.js +2 -1
  21. package/browser/Utils/NumberUtils.js +2 -2
  22. package/browser/Utils/TypeUtils.js +18 -0
  23. package/browser/Utils/Utils.js +2 -19
  24. package/browser/exports.js +3 -5
  25. package/cjs/Core/Canvas.js +9 -9
  26. package/cjs/Core/Container.js +7 -7
  27. package/cjs/Core/Engine.js +2 -25
  28. package/cjs/Core/Particle.js +15 -16
  29. package/cjs/Core/Particles.js +32 -55
  30. package/cjs/Core/Utils/EventListeners.js +4 -3
  31. package/cjs/Core/Utils/InteractionManager.js +4 -4
  32. package/cjs/Core/Utils/QuadTree.js +7 -8
  33. package/cjs/Core/Utils/Ranges.js +61 -0
  34. package/cjs/Core/Utils/{Vector3d.js → Vectors.js} +18 -3
  35. package/cjs/Options/Classes/AnimatableColor.js +2 -2
  36. package/cjs/Options/Classes/BackgroundMask/BackgroundMask.js +2 -2
  37. package/cjs/Options/Classes/Options.js +2 -1
  38. package/cjs/Options/Classes/OptionsColor.js +2 -2
  39. package/cjs/Options/Classes/Particles/Move/Move.js +4 -4
  40. package/cjs/Types/RangeType.js +2 -0
  41. package/cjs/Utils/CanvasUtils.js +14 -14
  42. package/cjs/Utils/ColorUtils.js +9 -8
  43. package/cjs/Utils/NumberUtils.js +9 -9
  44. package/cjs/Utils/TypeUtils.js +27 -0
  45. package/cjs/Utils/Utils.js +13 -36
  46. package/cjs/exports.js +3 -5
  47. package/dist_browser_Core_Container_js.js +17 -7
  48. package/esm/Core/Canvas.js +9 -9
  49. package/esm/Core/Container.js +7 -7
  50. package/esm/Core/Engine.js +1 -1
  51. package/esm/Core/Particle.js +12 -13
  52. package/esm/Core/Particles.js +30 -30
  53. package/esm/Core/Utils/EventListeners.js +4 -3
  54. package/esm/Core/Utils/InteractionManager.js +4 -4
  55. package/esm/Core/Utils/QuadTree.js +4 -5
  56. package/esm/Core/Utils/Ranges.js +55 -0
  57. package/esm/Core/Utils/{Vector3d.js → Vectors.js} +15 -1
  58. package/esm/Options/Classes/AnimatableColor.js +1 -1
  59. package/esm/Options/Classes/BackgroundMask/BackgroundMask.js +1 -1
  60. package/esm/Options/Classes/Options.js +2 -1
  61. package/esm/Options/Classes/OptionsColor.js +1 -1
  62. package/esm/Options/Classes/Particles/Move/Move.js +1 -1
  63. package/esm/Types/RangeType.js +1 -0
  64. package/esm/Utils/CanvasUtils.js +14 -14
  65. package/esm/Utils/ColorUtils.js +2 -1
  66. package/esm/Utils/NumberUtils.js +2 -2
  67. package/esm/Utils/TypeUtils.js +18 -0
  68. package/esm/Utils/Utils.js +2 -19
  69. package/esm/exports.js +3 -5
  70. package/package.json +1 -1
  71. package/report.html +1 -1
  72. package/tsparticles.engine.js +32 -52
  73. package/tsparticles.engine.min.js +1 -1
  74. package/tsparticles.engine.min.js.LICENSE.txt +1 -1
  75. package/types/Core/Canvas.d.ts +4 -4
  76. package/types/Core/Interfaces/ICircleBouncer.d.ts +1 -1
  77. package/types/Core/Interfaces/IContainerPlugin.d.ts +4 -4
  78. package/types/Core/Interfaces/IEffectDrawer.d.ts +3 -3
  79. package/types/Core/Interfaces/IExternalInteractor.d.ts +1 -1
  80. package/types/Core/Interfaces/IMovePathGenerator.d.ts +3 -3
  81. package/types/Core/Interfaces/IParticleMover.d.ts +2 -2
  82. package/types/Core/Interfaces/IParticleUpdater.d.ts +2 -2
  83. package/types/Core/Interfaces/IParticlesInteractor.d.ts +1 -1
  84. package/types/Core/Interfaces/IShapeDrawer.d.ts +4 -4
  85. package/types/Core/Particle.d.ts +3 -4
  86. package/types/Core/Particles.d.ts +7 -7
  87. package/types/Core/Utils/ExternalInteractorBase.d.ts +1 -1
  88. package/types/Core/Utils/InteractionManager.d.ts +2 -2
  89. package/types/Core/Utils/ParticlesInteractorBase.d.ts +1 -1
  90. package/types/Core/Utils/QuadTree.d.ts +2 -3
  91. package/types/Core/Utils/Ranges.d.ts +21 -0
  92. package/types/Core/Utils/{Vector3d.d.ts → Vectors.d.ts} +6 -0
  93. package/types/Types/RangeType.d.ts +4 -0
  94. package/types/Utils/CanvasUtils.d.ts +6 -6
  95. package/types/Utils/NumberUtils.d.ts +1 -1
  96. package/types/Utils/TypeUtils.d.ts +6 -0
  97. package/types/Utils/Utils.d.ts +0 -6
  98. package/types/exports.d.ts +3 -5
  99. package/umd/Core/Canvas.js +9 -9
  100. package/umd/Core/Container.js +7 -7
  101. package/umd/Core/Engine.js +1 -1
  102. package/umd/Core/Particle.js +16 -17
  103. package/umd/Core/Particles.js +33 -57
  104. package/umd/Core/Utils/EventListeners.js +5 -4
  105. package/umd/Core/Utils/InteractionManager.js +4 -4
  106. package/umd/Core/Utils/QuadTree.js +8 -9
  107. package/umd/Core/Utils/Ranges.js +71 -0
  108. package/umd/Core/Utils/{Vector3d.js → Vectors.js} +19 -4
  109. package/umd/Options/Classes/AnimatableColor.js +3 -3
  110. package/umd/Options/Classes/BackgroundMask/BackgroundMask.js +3 -3
  111. package/umd/Options/Classes/Options.js +3 -2
  112. package/umd/Options/Classes/OptionsColor.js +3 -3
  113. package/umd/Options/Classes/Particles/Move/Move.js +5 -5
  114. package/umd/{Core/Utils/Range.js → Types/RangeType.js} +0 -10
  115. package/umd/Utils/CanvasUtils.js +14 -14
  116. package/umd/Utils/ColorUtils.js +10 -9
  117. package/umd/Utils/NumberUtils.js +10 -10
  118. package/umd/Utils/TypeUtils.js +37 -0
  119. package/umd/Utils/Utils.js +14 -37
  120. package/umd/exports.js +4 -6
  121. package/373.min.js +0 -2
  122. package/373.min.js.LICENSE.txt +0 -1
  123. package/438.min.js +0 -2
  124. package/438.min.js.LICENSE.txt +0 -1
  125. package/browser/Core/Utils/Circle.js +0 -28
  126. package/browser/Core/Utils/Range.js +0 -8
  127. package/browser/Core/Utils/Rectangle.js +0 -22
  128. package/browser/Core/Utils/Vector.js +0 -20
  129. package/cjs/Core/Utils/Circle.js +0 -32
  130. package/cjs/Core/Utils/Range.js +0 -12
  131. package/cjs/Core/Utils/Rectangle.js +0 -26
  132. package/cjs/Core/Utils/Vector.js +0 -24
  133. package/dist_browser_Core_Particle_js.js +0 -32
  134. package/esm/Core/Utils/Circle.js +0 -28
  135. package/esm/Core/Utils/Range.js +0 -8
  136. package/esm/Core/Utils/Rectangle.js +0 -22
  137. package/esm/Core/Utils/Vector.js +0 -20
  138. package/types/Core/Utils/Circle.d.ts +0 -8
  139. package/types/Core/Utils/Range.d.ts +0 -7
  140. package/types/Core/Utils/Rectangle.d.ts +0 -9
  141. package/types/Core/Utils/Vector.d.ts +0 -8
  142. package/umd/Core/Utils/Circle.js +0 -42
  143. package/umd/Core/Utils/Rectangle.js +0 -36
  144. package/umd/Core/Utils/Vector.js +0 -34
@@ -4,15 +4,16 @@
4
4
  if (v !== undefined) module.exports = v;
5
5
  }
6
6
  else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "./NumberUtils.js", "../Core/Utils/Constants.js", "../Core/Utils/Vector.js"], factory);
7
+ define(["require", "exports", "./NumberUtils.js", "../Core/Utils/Constants.js", "./TypeUtils.js", "../Core/Utils/Vectors.js"], factory);
8
8
  }
9
9
  })(function (require, exports) {
10
10
  "use strict";
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.updateAnimation = exports.isArray = exports.isObject = exports.isFunction = exports.isNumber = exports.isString = exports.isBoolean = exports.getSize = exports.getPosition = exports.initParticleNumericAnimationValue = exports.findItemFromSingleOrMultiple = exports.itemFromSingleOrMultiple = exports.executeOnSingleOrMultiple = exports.rectBounce = exports.circleBounce = exports.circleBounceDataFromParticle = exports.divMode = exports.singleDivModeExecute = exports.divModeExecute = exports.isDivModeEnabled = exports.deepExtend = exports.calculateBounds = exports.areBoundsInside = exports.isPointInside = exports.itemFromArray = exports.arrayRandomIndex = exports.loadFont = exports.isInArray = exports.safeMutationObserver = exports.safeIntersectionObserver = exports.safeMatchMedia = exports.hasMatchMedia = exports.isSsr = exports.getLogger = exports.setLogger = void 0;
12
+ exports.updateAnimation = exports.getSize = exports.getPosition = exports.initParticleNumericAnimationValue = exports.findItemFromSingleOrMultiple = exports.itemFromSingleOrMultiple = exports.executeOnSingleOrMultiple = exports.rectBounce = exports.circleBounce = exports.circleBounceDataFromParticle = exports.divMode = exports.singleDivModeExecute = exports.divModeExecute = exports.isDivModeEnabled = exports.deepExtend = exports.calculateBounds = exports.areBoundsInside = exports.isPointInside = exports.itemFromArray = exports.arrayRandomIndex = exports.loadFont = exports.isInArray = exports.safeMutationObserver = exports.safeIntersectionObserver = exports.safeMatchMedia = exports.hasMatchMedia = exports.isSsr = exports.getLogger = exports.setLogger = void 0;
13
13
  const NumberUtils_js_1 = require("./NumberUtils.js");
14
14
  const Constants_js_1 = require("../Core/Utils/Constants.js");
15
- const Vector_js_1 = require("../Core/Utils/Vector.js");
15
+ const TypeUtils_js_1 = require("./TypeUtils.js");
16
+ const Vectors_js_1 = require("../Core/Utils/Vectors.js");
16
17
  const _logger = {
17
18
  debug: console.debug,
18
19
  error: console.error,
@@ -53,7 +54,7 @@
53
54
  const res = executeOnSingleOrMultiple(selectors, (selector) => {
54
55
  return element.matches(selector);
55
56
  });
56
- return isArray(res) ? res.some((t) => t) : res;
57
+ return (0, TypeUtils_js_1.isArray)(res) ? res.some((t) => t) : res;
57
58
  }
58
59
  function isSsr() {
59
60
  return typeof window === "undefined" || !window || typeof window.document === "undefined" || !window.document;
@@ -86,7 +87,7 @@
86
87
  exports.safeMutationObserver = safeMutationObserver;
87
88
  function isInArray(value, array) {
88
89
  const invalidIndex = -1;
89
- return value === array || (isArray(array) && array.indexOf(value) > invalidIndex);
90
+ return value === array || ((0, TypeUtils_js_1.isArray)(array) && array.indexOf(value) > invalidIndex);
90
91
  }
91
92
  exports.isInArray = isInArray;
92
93
  async function loadFont(font, weight) {
@@ -141,15 +142,15 @@
141
142
  if (source === undefined || source === null) {
142
143
  continue;
143
144
  }
144
- if (!isObject(source)) {
145
+ if (!(0, TypeUtils_js_1.isObject)(source)) {
145
146
  destination = source;
146
147
  continue;
147
148
  }
148
149
  const sourceIsArray = Array.isArray(source);
149
- if (sourceIsArray && (isObject(destination) || !destination || !Array.isArray(destination))) {
150
+ if (sourceIsArray && ((0, TypeUtils_js_1.isObject)(destination) || !destination || !Array.isArray(destination))) {
150
151
  destination = [];
151
152
  }
152
- else if (!sourceIsArray && (isObject(destination) || !destination || Array.isArray(destination))) {
153
+ else if (!sourceIsArray && ((0, TypeUtils_js_1.isObject)(destination) || !destination || Array.isArray(destination))) {
153
154
  destination = {};
154
155
  }
155
156
  for (const key in source) {
@@ -158,7 +159,7 @@
158
159
  }
159
160
  const sourceDict = source, value = sourceDict[key], destDict = destination;
160
161
  destDict[key] =
161
- isObject(value) && Array.isArray(value)
162
+ (0, TypeUtils_js_1.isObject)(value) && Array.isArray(value)
162
163
  ? value.map((v) => deepExtend(destDict[key], v))
163
164
  : deepExtend(destDict[key], value);
164
165
  }
@@ -201,7 +202,7 @@
201
202
  radius: p.getRadius(),
202
203
  mass: p.getMass(),
203
204
  velocity: p.velocity,
204
- factor: Vector_js_1.Vector.create((0, NumberUtils_js_1.getRangeValue)(p.options.bounce.horizontal.value), (0, NumberUtils_js_1.getRangeValue)(p.options.bounce.vertical.value)),
205
+ factor: Vectors_js_1.Vector.create((0, NumberUtils_js_1.getRangeValue)(p.options.bounce.horizontal.value), (0, NumberUtils_js_1.getRangeValue)(p.options.bounce.vertical.value)),
205
206
  };
206
207
  }
207
208
  exports.circleBounceDataFromParticle = circleBounceDataFromParticle;
@@ -278,15 +279,15 @@
278
279
  exports.rectBounce = rectBounce;
279
280
  function executeOnSingleOrMultiple(obj, callback) {
280
281
  const defaultIndex = 0;
281
- return isArray(obj) ? obj.map((item, index) => callback(item, index)) : callback(obj, defaultIndex);
282
+ return (0, TypeUtils_js_1.isArray)(obj) ? obj.map((item, index) => callback(item, index)) : callback(obj, defaultIndex);
282
283
  }
283
284
  exports.executeOnSingleOrMultiple = executeOnSingleOrMultiple;
284
285
  function itemFromSingleOrMultiple(obj, index, useIndex) {
285
- return isArray(obj) ? itemFromArray(obj, index, useIndex) : obj;
286
+ return (0, TypeUtils_js_1.isArray)(obj) ? itemFromArray(obj, index, useIndex) : obj;
286
287
  }
287
288
  exports.itemFromSingleOrMultiple = itemFromSingleOrMultiple;
288
289
  function findItemFromSingleOrMultiple(obj, callback) {
289
- if (isArray(obj)) {
290
+ if ((0, TypeUtils_js_1.isArray)(obj)) {
290
291
  return obj.find((t, index) => callback(t, index));
291
292
  }
292
293
  const defaultIndex = 0;
@@ -372,30 +373,6 @@
372
373
  return getPositionOrSize(size, canvasSize);
373
374
  }
374
375
  exports.getSize = getSize;
375
- function isBoolean(arg) {
376
- return typeof arg === "boolean";
377
- }
378
- exports.isBoolean = isBoolean;
379
- function isString(arg) {
380
- return typeof arg === "string";
381
- }
382
- exports.isString = isString;
383
- function isNumber(arg) {
384
- return typeof arg === "number";
385
- }
386
- exports.isNumber = isNumber;
387
- function isFunction(arg) {
388
- return typeof arg === "function";
389
- }
390
- exports.isFunction = isFunction;
391
- function isObject(arg) {
392
- return typeof arg === "object" && arg !== null;
393
- }
394
- exports.isObject = isObject;
395
- function isArray(arg) {
396
- return Array.isArray(arg);
397
- }
398
- exports.isArray = isArray;
399
376
  function checkDestroy(particle, destroyType, value, minValue, maxValue) {
400
377
  switch (destroyType) {
401
378
  case "max":
package/umd/exports.js CHANGED
@@ -18,20 +18,17 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
18
18
  if (v !== undefined) module.exports = v;
19
19
  }
20
20
  else if (typeof define === "function" && define.amd) {
21
- define(["require", "exports", "./Core/Utils/Circle.js", "./Core/Utils/Constants.js", "./Core/Utils/ExternalInteractorBase.js", "./Core/Utils/ParticlesInteractorBase.js", "./Core/Utils/Point.js", "./Core/Utils/Range.js", "./Core/Utils/Rectangle.js", "./Core/Utils/Vector.js", "./Core/Utils/Vector3d.js", "./Enums/Directions/MoveDirection.js", "./Enums/Directions/RotateDirection.js", "./Enums/Directions/OutModeDirection.js", "./Enums/Modes/AnimationMode.js", "./Enums/Modes/CollisionMode.js", "./Enums/Modes/LimitMode.js", "./Enums/Modes/OutMode.js", "./Enums/Modes/PixelMode.js", "./Enums/Modes/ThemeMode.js", "./Enums/Modes/ResponsiveMode.js", "./Enums/Types/AlterType.js", "./Enums/Types/DestroyType.js", "./Enums/Types/GradientType.js", "./Enums/Types/InteractorType.js", "./Enums/Types/ParticleOutType.js", "./Enums/Types/StartValueType.js", "./Enums/Types/DivType.js", "./Enums/Types/EasingType.js", "./Enums/Types/EventType.js", "./Enums/AnimationStatus.js", "./Enums/InteractivityDetect.js", "./Options/Classes/AnimatableColor.js", "./Options/Classes/AnimationOptions.js", "./Options/Classes/Background/Background.js", "./Options/Classes/BackgroundMask/BackgroundMask.js", "./Options/Classes/BackgroundMask/BackgroundMaskCover.js", "./Options/Classes/ColorAnimation.js", "./Options/Classes/FullScreen/FullScreen.js", "./Options/Classes/HslAnimation.js", "./Options/Classes/Interactivity/Events/ClickEvent.js", "./Options/Classes/Interactivity/Events/DivEvent.js", "./Options/Classes/Interactivity/Events/ClickEvent.js", "./Options/Classes/Interactivity/Events/DivEvent.js", "./Options/Classes/Interactivity/Events/Events.js", "./Options/Classes/Interactivity/Events/HoverEvent.js", "./Options/Classes/Interactivity/Events/Parallax.js", "./Options/Classes/Interactivity/Events/ResizeEvent.js", "./Options/Classes/Interactivity/Interactivity.js", "./Options/Classes/Interactivity/Modes/Modes.js", "./Options/Classes/ManualParticle.js", "./Options/Classes/Options.js", "./Options/Classes/OptionsColor.js", "./Options/Classes/Particles/Bounce/ParticlesBounce.js", "./Options/Classes/Particles/Bounce/ParticlesBounceFactor.js", "./Options/Classes/Particles/Collisions/Collisions.js", "./Options/Classes/Particles/Collisions/CollisionsAbsorb.js", "./Options/Classes/Particles/Collisions/CollisionsOverlap.js", "./Options/Classes/Particles/ParticlesOptions.js", "./Options/Classes/Particles/Shadow.js", "./Options/Classes/Particles/Stroke.js", "./Options/Classes/Particles/Move/MoveAttract.js", "./Options/Classes/Particles/Move/Move.js", "./Options/Classes/Particles/Move/MoveAngle.js", "./Options/Classes/Particles/Move/MoveCenter.js", "./Options/Classes/Particles/Move/MoveGravity.js", "./Options/Classes/Particles/Move/OutModes.js", "./Options/Classes/Particles/Move/Path/MovePath.js", "./Options/Classes/Particles/Move/Spin.js", "./Options/Classes/Particles/Move/MoveTrail.js", "./Options/Classes/Particles/Number/ParticlesNumber.js", "./Options/Classes/Particles/Number/ParticlesNumberLimit.js", "./Options/Classes/Particles/Number/ParticlesDensity.js", "./Options/Classes/Particles/Opacity/Opacity.js", "./Options/Classes/Particles/Opacity/OpacityAnimation.js", "./Options/Classes/Particles/Shape/Shape.js", "./Options/Classes/Particles/Size/Size.js", "./Options/Classes/Particles/Size/SizeAnimation.js", "./Options/Classes/Particles/ZIndex/ZIndex.js", "./Options/Classes/Responsive.js", "./Options/Classes/Theme/Theme.js", "./Options/Classes/Theme/ThemeDefault.js", "./Options/Classes/ValueWithRandom.js", "./Utils/CanvasUtils.js", "./Utils/ColorUtils.js", "./Utils/HslColorManager.js", "./Utils/NumberUtils.js", "./Utils/OptionsUtils.js", "./Utils/RgbColorManager.js", "./Utils/Utils.js"], factory);
21
+ define(["require", "exports", "./Core/Utils/Constants.js", "./Core/Utils/ExternalInteractorBase.js", "./Core/Utils/ParticlesInteractorBase.js", "./Core/Utils/Point.js", "./Core/Utils/Ranges.js", "./Core/Utils/Vectors.js", "./Enums/Directions/MoveDirection.js", "./Enums/Directions/RotateDirection.js", "./Enums/Directions/OutModeDirection.js", "./Enums/Modes/AnimationMode.js", "./Enums/Modes/CollisionMode.js", "./Enums/Modes/LimitMode.js", "./Enums/Modes/OutMode.js", "./Enums/Modes/PixelMode.js", "./Enums/Modes/ThemeMode.js", "./Enums/Modes/ResponsiveMode.js", "./Enums/Types/AlterType.js", "./Enums/Types/DestroyType.js", "./Enums/Types/GradientType.js", "./Enums/Types/InteractorType.js", "./Enums/Types/ParticleOutType.js", "./Enums/Types/StartValueType.js", "./Enums/Types/DivType.js", "./Enums/Types/EasingType.js", "./Enums/Types/EventType.js", "./Enums/AnimationStatus.js", "./Enums/InteractivityDetect.js", "./Options/Classes/AnimatableColor.js", "./Options/Classes/AnimationOptions.js", "./Options/Classes/Background/Background.js", "./Options/Classes/BackgroundMask/BackgroundMask.js", "./Options/Classes/BackgroundMask/BackgroundMaskCover.js", "./Options/Classes/ColorAnimation.js", "./Options/Classes/FullScreen/FullScreen.js", "./Options/Classes/HslAnimation.js", "./Options/Classes/Interactivity/Events/ClickEvent.js", "./Options/Classes/Interactivity/Events/DivEvent.js", "./Options/Classes/Interactivity/Events/ClickEvent.js", "./Options/Classes/Interactivity/Events/DivEvent.js", "./Options/Classes/Interactivity/Events/Events.js", "./Options/Classes/Interactivity/Events/HoverEvent.js", "./Options/Classes/Interactivity/Events/Parallax.js", "./Options/Classes/Interactivity/Events/ResizeEvent.js", "./Options/Classes/Interactivity/Interactivity.js", "./Options/Classes/Interactivity/Modes/Modes.js", "./Options/Classes/ManualParticle.js", "./Options/Classes/Options.js", "./Options/Classes/OptionsColor.js", "./Options/Classes/Particles/Bounce/ParticlesBounce.js", "./Options/Classes/Particles/Bounce/ParticlesBounceFactor.js", "./Options/Classes/Particles/Collisions/Collisions.js", "./Options/Classes/Particles/Collisions/CollisionsAbsorb.js", "./Options/Classes/Particles/Collisions/CollisionsOverlap.js", "./Options/Classes/Particles/ParticlesOptions.js", "./Options/Classes/Particles/Shadow.js", "./Options/Classes/Particles/Stroke.js", "./Options/Classes/Particles/Move/MoveAttract.js", "./Options/Classes/Particles/Move/Move.js", "./Options/Classes/Particles/Move/MoveAngle.js", "./Options/Classes/Particles/Move/MoveCenter.js", "./Options/Classes/Particles/Move/MoveGravity.js", "./Options/Classes/Particles/Move/OutModes.js", "./Options/Classes/Particles/Move/Path/MovePath.js", "./Options/Classes/Particles/Move/Spin.js", "./Options/Classes/Particles/Move/MoveTrail.js", "./Options/Classes/Particles/Number/ParticlesNumber.js", "./Options/Classes/Particles/Number/ParticlesNumberLimit.js", "./Options/Classes/Particles/Number/ParticlesDensity.js", "./Options/Classes/Particles/Opacity/Opacity.js", "./Options/Classes/Particles/Opacity/OpacityAnimation.js", "./Options/Classes/Particles/Shape/Shape.js", "./Options/Classes/Particles/Size/Size.js", "./Options/Classes/Particles/Size/SizeAnimation.js", "./Options/Classes/Particles/ZIndex/ZIndex.js", "./Options/Classes/Responsive.js", "./Options/Classes/Theme/Theme.js", "./Options/Classes/Theme/ThemeDefault.js", "./Options/Classes/ValueWithRandom.js", "./Utils/CanvasUtils.js", "./Utils/ColorUtils.js", "./Utils/HslColorManager.js", "./Utils/NumberUtils.js", "./Utils/OptionsUtils.js", "./Utils/RgbColorManager.js", "./Utils/Utils.js", "./Utils/TypeUtils.js"], factory);
22
22
  }
23
23
  })(function (require, exports) {
24
24
  "use strict";
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- __exportStar(require("./Core/Utils/Circle.js"), exports);
27
26
  __exportStar(require("./Core/Utils/Constants.js"), exports);
28
27
  __exportStar(require("./Core/Utils/ExternalInteractorBase.js"), exports);
29
28
  __exportStar(require("./Core/Utils/ParticlesInteractorBase.js"), exports);
30
29
  __exportStar(require("./Core/Utils/Point.js"), exports);
31
- __exportStar(require("./Core/Utils/Range.js"), exports);
32
- __exportStar(require("./Core/Utils/Rectangle.js"), exports);
33
- __exportStar(require("./Core/Utils/Vector.js"), exports);
34
- __exportStar(require("./Core/Utils/Vector3d.js"), exports);
30
+ __exportStar(require("./Core/Utils/Ranges.js"), exports);
31
+ __exportStar(require("./Core/Utils/Vectors.js"), exports);
35
32
  __exportStar(require("./Enums/Directions/MoveDirection.js"), exports);
36
33
  __exportStar(require("./Enums/Directions/RotateDirection.js"), exports);
37
34
  __exportStar(require("./Enums/Directions/OutModeDirection.js"), exports);
@@ -111,4 +108,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
111
108
  __exportStar(require("./Utils/OptionsUtils.js"), exports);
112
109
  __exportStar(require("./Utils/RgbColorManager.js"), exports);
113
110
  __exportStar(require("./Utils/Utils.js"), exports);
111
+ __exportStar(require("./Utils/TypeUtils.js"), exports);
114
112
  });
package/373.min.js DELETED
@@ -1,2 +0,0 @@
1
- /*! For license information please see 373.min.js.LICENSE.txt */
2
- (this.webpackChunk_tsparticles_engine=this.webpackChunk_tsparticles_engine||[]).push([[373],{2373:(t,i,e)=>{e.d(i,{Particle:()=>u});var s=e(3635),o=e(8279),a=e(5084),n=e(2418),h=e(7788),r=e(7162),c=e(7326),l=e(9087),p=e(3893);const d=.5;function f(t){if(!(0,o.dB)(t.outMode,t.checkModes))return;const i=2*t.radius;t.coord>t.maxCoord-i?t.setCb(-t.radius):t.coord<i&&t.setCb(t.radius)}class u{constructor(t,i){this.container=i,this._calcPosition=(t,i,e,o=0)=>{for(const[,s]of t.plugins){const t=void 0!==s.particlePosition?s.particlePosition(i,this):void 0;if(t)return c.U.create(t.x,t.y,e)}const a=t.canvas.size,n=(0,s.mC)({size:a,position:i}),h=c.U.create(n.x,n.y,e),r=this.getRadius(),l=this.options.move.outModes,p=i=>{f({outMode:i,checkModes:["bounce"],coord:h.x,maxCoord:t.canvas.size.width,setCb:t=>h.x+=t,radius:r})},d=i=>{f({outMode:i,checkModes:["bounce"],coord:h.y,maxCoord:t.canvas.size.height,setCb:t=>h.y+=t,radius:r})};if(p(l.left??l.default),p(l.right??l.default),d(l.top??l.default),d(l.bottom??l.default),this._checkOverlap(h,o)){const i=1;return this._calcPosition(t,void 0,e,o+i)}return h},this._calculateVelocity=()=>{const t=(0,s.lQ)(this.direction).copy(),i=this.options.move;if("inside"===i.direction||"outside"===i.direction)return t;const e=(0,s.Id)((0,s.Gu)(i.angle.value)),o=(0,s.Id)((0,s.Gu)(i.angle.offset)),a={left:o-e*d,right:o+e*d};return i.straight||(t.angle+=(0,s.vd)((0,s.Cs)(a.left,a.right))),i.random&&"number"==typeof i.speed&&(t.length*=(0,s.sZ)()),t},this._checkOverlap=(t,i=0)=>{const e=this.options.collisions,o=this.getRadius();if(!e.enable)return!1;const n=e.overlap;if(n.enable)return!1;const h=n.retries;if(h>=0&&i>h)throw new Error(`${a.gK} particle is overlapping and can't be placed`);return!!this.container.particles.find((i=>(0,s.Sp)(t,i.position)<o+i.getRadius()))},this._getRollColor=t=>{if(!t||!this.roll||!this.backColor&&!this.roll.alter)return t;const i=this.roll.horizontal&&this.roll.vertical?2:1,e=this.roll.horizontal?Math.PI*d:0;return Math.floor(((this.roll.angle??0)+e)/(Math.PI/i))%2?this.backColor?this.backColor:this.roll.alter?(0,l.PL)(t,this.roll.alter.type,this.roll.alter.value):t:t},this._initPosition=t=>{const i=this.container,e=(0,s.Gu)(this.options.zIndex.value);this.position=this._calcPosition(i,t,(0,s.uZ)(e,0,i.zLayers)),this.initialPosition=this.position.copy();const a=i.canvas.size;switch(this.moveCenter={...(0,o.bt)(this.options.move.center,a),radius:this.options.move.center.radius??0,mode:this.options.move.center.mode??"percent"},this.direction=(0,s.Gk)(this.options.move.direction,this.position,this.moveCenter),this.options.move.direction){case"inside":this.outType="inside";break;case"outside":this.outType="outside"}this.offset=r.O.origin},this._engine=t}destroy(t){if(this.unbreakable||this.destroyed)return;this.destroyed=!0,this.bubble.inRange=!1,this.slow.inRange=!1;const i=this.container,e=this.pathGenerator,s=i.shapeDrawers.get(this.shape);s?.particleDestroy?.(this);for(const[,e]of i.plugins)e.particleDestroyed?.(this,t);for(const e of i.particles.updaters)e.particleDestroyed?.(this,t);e?.reset(this),this._engine.dispatchEvent("particleDestroyed",{container:this.container,data:{particle:this}})}async draw(t){const i=this.container,e=i.canvas;for(const[,s]of i.plugins)await e.drawParticlePlugin(s,this,t);await e.drawParticle(this,t)}getFillColor(){return this._getRollColor(this.bubble.color??(0,n.gW)(this.color))}getMass(){return this.getRadius()**2*Math.PI*d}getPosition(){return{x:this.position.x+this.offset.x,y:this.position.y+this.offset.y,z:this.position.z}}getRadius(){return this.bubble.radius??this.size.value}getStrokeColor(){return this._getRollColor(this.bubble.color??(0,n.gW)(this.strokeColor))}async init(t,i,e,r){const c=this.container,l=this._engine;this.id=t,this.group=r,this.effectClose=!0,this.effectFill=!0,this.shapeClose=!0,this.shapeFill=!0,this.pathRotation=!1,this.lastPathTime=0,this.destroyed=!1,this.unbreakable=!1,this.rotation=0,this.misplaced=!1,this.retina={maxDistance:{}},this.outType="normal",this.ignoresResizeRatio=!0;const d=c.retina.pixelRatio,f=c.actualOptions,u=(0,p.x)(this._engine,c,f.particles),g=u.effect.type,y=u.shape.type,{reduceDuplicates:v}=u;this.effect=(0,o.wA)(g,this.id,v),this.shape=(0,o.wA)(y,this.id,v);const w=u.effect,b=u.shape;if(e){if(e.effect?.type){const t=e.effect.type,i=(0,o.wA)(t,this.id,v);i&&(this.effect=i,w.load(e.effect))}if(e.shape?.type){const t=e.shape.type,i=(0,o.wA)(t,this.id,v);i&&(this.shape=i,b.load(e.shape))}}this.effectData=function(t,i,e,s){const a=i.options[t];if(a)return(0,o.ZB)({close:i.close,fill:i.fill},(0,o.wA)(a,e,s))}(this.effect,w,this.id,v),this.shapeData=function(t,i,e,s){const a=i.options[t];if(a)return(0,o.ZB)({close:i.close,fill:i.fill},(0,o.wA)(a,e,s))}(this.shape,b,this.id,v),u.load(e);const C=this.effectData;C&&u.load(C.particles);const m=this.shapeData;m&&u.load(m.particles);const _=new h.o(l,c);_.load(c.actualOptions.interactivity),_.load(u.interactivity),this.interactivity=_,this.effectFill=C?.fill??u.effect.fill,this.effectClose=C?.close??u.effect.close,this.shapeFill=m?.fill??u.shape.fill,this.shapeClose=m?.close??u.shape.close,this.options=u;const P=this.options.move.path;this.pathDelay=(0,s.Gu)(P.delay.value)*a.X5,P.generator&&(this.pathGenerator=this._engine.getPathGenerator(P.generator),this.pathGenerator&&c.addPath(P.generator,this.pathGenerator)&&await this.pathGenerator.init(c)),c.retina.initParticle(this),this.size=(0,o.V0)(this.options.size,d),this.bubble={inRange:!1},this.slow={inRange:!1,factor:1},this._initPosition(i),this.initialVelocity=this._calculateVelocity(),this.velocity=this.initialVelocity.copy();this.moveDecay=1-(0,s.Gu)(this.options.move.decay);const z=c.particles;z.setLastZIndex(this.position.z),this.zIndexFactor=this.position.z/c.zLayers,this.sides=24;let D=c.effectDrawers.get(this.effect);D||(D=this._engine.getEffectDrawer(this.effect),D&&c.effectDrawers.set(this.effect,D)),D?.loadEffect&&await D.loadEffect(this);let k=c.shapeDrawers.get(this.shape);k||(k=this._engine.getShapeDrawer(this.shape),k&&c.shapeDrawers.set(this.shape,k)),k?.loadShape&&await k.loadShape(this);const x=k?.getSidesCount;x&&(this.sides=x(this)),this.spawning=!1,this.shadowColor=(0,n.tX)(this.options.shadow.color);for(const t of z.updaters)await t.init(this);for(const t of z.movers)await(t.init?.(this));await(D?.particleInit?.(c,this)),await(k?.particleInit?.(c,this));for(const[,t]of c.plugins)t.particleCreated?.(this)}isInsideCanvas(){const t=this.getRadius(),i=this.container.canvas.size,e=this.position;return e.x>=-t&&e.y>=-t&&e.y<=i.height+t&&e.x<=i.width+t}isVisible(){return!this.destroyed&&!this.spawning&&this.isInsideCanvas()}reset(){for(const t of this.container.particles.updaters)t.reset?.(this)}}}}]);
@@ -1 +0,0 @@
1
- /*! tsParticles Engine v3.2.1 by Matteo Bruni */
package/438.min.js DELETED
@@ -1,2 +0,0 @@
1
- /*! For license information please see 438.min.js.LICENSE.txt */
2
- (this.webpackChunk_tsparticles_engine=this.webpackChunk_tsparticles_engine||[]).push([[438],{4438:(t,i,e)=>{e.d(i,{Container:()=>P});var s=e(5084),n=e(8279),a=e(9087),r=e(2418);function o(t,i,e){const s=i[e];void 0!==s&&(t[e]=(t[e]??1)*s)}function h(t,i,e=!1){if(!i)return;if(!t)return;const s=t.style;if(s)for(const t in i){const n=i[t];n&&s.setProperty(t,n,e?"important":"")}}class c{constructor(t){this.container=t,this._applyPostDrawUpdaters=t=>{for(const i of this._postDrawUpdaters)i.afterDraw?.(t)},this._applyPreDrawUpdaters=(t,i,e,s,n,a)=>{for(const r of this._preDrawUpdaters){if(r.getColorStyles){const{fill:a,stroke:o}=r.getColorStyles(i,t,e,s);a&&(n.fill=a),o&&(n.stroke=o)}if(r.getTransformValues){const t=r.getTransformValues(i);for(const i in t)o(a,t,i)}r.beforeDraw?.(i)}},this._applyResizePlugins=()=>{for(const t of this._resizePlugins)t.resize?.()},this._getPluginParticleColors=t=>{let i,e;for(const s of this._colorPlugins)if(!i&&s.particleFillColor&&(i=(0,r.lN)(s.particleFillColor(t))),!e&&s.particleStrokeColor&&(e=(0,r.lN)(s.particleStrokeColor(t))),i&&e)break;return[i,e]},this._initCover=async()=>{const t=this.container.actualOptions.backgroundMask.cover,i=t.color;if(i){const e=(0,r.tX)(i);if(e){const i={...e,a:t.opacity};this._coverColorStyle=(0,r.iz)(i,i.a)}}else await new Promise(((i,e)=>{if(!t.image)return;const s=document.createElement("img");s.addEventListener("load",(()=>{this._coverImage={image:s,opacity:t.opacity},i()})),s.addEventListener("error",(t=>{e(t.error)})),s.src=t.image}))},this._initStyle=()=>{const t=this.element,i=this.container.actualOptions;if(t){this._fullScreen?(this._originalStyle=(0,n.ZB)({},t.style),this._setFullScreenStyle()):this._resetOriginalStyle();for(const e in i.style){if(!e||!i.style)continue;const s=i.style[e];s&&t.style.setProperty(e,s,"important")}}},this._initTrail=async()=>{const t=this.container.actualOptions.particles.move.trail,i=t.fill;if(!t.enable)return;const e=1/t.length;if(i.color){const t=(0,r.tX)(i.color);if(!t)return;this._trailFill={color:{...t},opacity:e}}else await new Promise(((t,s)=>{if(!i.image)return;const n=document.createElement("img");n.addEventListener("load",(()=>{this._trailFill={image:n,opacity:e},t()})),n.addEventListener("error",(t=>{s(t.error)})),n.src=i.image}))},this._paintBase=t=>{this.draw((i=>(0,a.TQ)(i,this.size,t)))},this._paintImage=(t,i)=>{this.draw((e=>(0,a.C3)(e,this.size,t,i)))},this._repairStyle=()=>{const t=this.element;t&&(this._safeMutationObserver((t=>t.disconnect())),this._initStyle(),this.initBackground(),this._safeMutationObserver((i=>i.observe(t,{attributes:!0}))))},this._resetOriginalStyle=()=>{const t=this.element,i=this._originalStyle;t&&i&&h(t,i)},this._safeMutationObserver=t=>{this._mutationObserver&&t(this._mutationObserver)},this._setFullScreenStyle=()=>{const t=this.element;if(!t)return;h(t,{position:"fixed",zIndex:this.container.actualOptions.fullScreen.zIndex.toString(10),top:"0",left:"0",width:"100%",height:"100%"},!0)},this.size={height:0,width:0},this._context=null,this._generated=!1,this._preDrawUpdaters=[],this._postDrawUpdaters=[],this._resizePlugins=[],this._colorPlugins=[]}get _fullScreen(){return this.container.actualOptions.fullScreen.enable}clear(){const t=this.container.actualOptions,i=t.particles.move.trail,e=this._trailFill;t.backgroundMask.enable?this.paint():i.enable&&i.length>0&&e?e.color?this._paintBase((0,r.iz)(e.color,e.opacity)):e.image&&this._paintImage(e.image,e.opacity):t.clear&&this.draw((t=>{(0,a.ZH)(t,this.size)}))}destroy(){if(this.stop(),this._generated){const t=this.element;t?.remove()}else this._resetOriginalStyle();this._preDrawUpdaters=[],this._postDrawUpdaters=[],this._resizePlugins=[],this._colorPlugins=[]}draw(t){const i=this._context;if(i)return t(i)}drawAsync(t){const i=this._context;return i?t(i):Promise.resolve(void 0)}async drawParticle(t,i){if(t.spawning||t.destroyed)return;const e=t.getRadius();if(e<=0)return;const s=t.getFillColor(),n=t.getStrokeColor()??s;let[o,h]=this._getPluginParticleColors(t);o||(o=s),h||(h=n),(o||h)&&await this.drawAsync((async s=>{const n=this.container,c=n.actualOptions,l=t.options.zIndex,d=1-t.zIndexFactor,u=d**l.opacityRate,p=t.bubble.opacity??t.opacity?.value??1,_=p*u,f=(t.strokeOpacity??p)*u,m={},g={fill:o?(0,r.vz)(o,_):void 0};g.stroke=h?(0,r.vz)(h,f):g.fill,this._applyPreDrawUpdaters(s,t,e,_,g,m),await(0,a.zv)({container:n,context:s,particle:t,delta:i,colorStyles:g,backgroundMask:c.backgroundMask.enable,composite:c.backgroundMask.composite,radius:e*d**l.sizeRate,opacity:_,shadow:t.options.shadow,transform:m}),this._applyPostDrawUpdaters(t)}))}async drawParticlePlugin(t,i,e){await this.drawAsync((s=>(0,a.$F)(s,t,i,e)))}async drawPlugin(t,i){await this.drawAsync((e=>(0,a.Zw)(e,t,i)))}async init(){this._safeMutationObserver((t=>t.disconnect())),this._mutationObserver=(0,n.yf)((t=>{for(const i of t)"attributes"===i.type&&"style"===i.attributeName&&this._repairStyle()})),this.resize(),this._initStyle(),await this._initCover();try{await this._initTrail()}catch(t){(0,n.jl)().error(t)}this.initBackground(),this._safeMutationObserver((t=>{this.element&&t.observe(this.element,{attributes:!0})})),this.initUpdaters(),this.initPlugins(),this.paint()}initBackground(){const t=this.container.actualOptions.background,i=this.element;if(!i)return;const e=i.style;if(e){if(t.color){const i=(0,r.tX)(t.color);e.backgroundColor=i?(0,r.iz)(i,t.opacity):""}else e.backgroundColor="";e.backgroundImage=t.image||"",e.backgroundPosition=t.position||"",e.backgroundRepeat=t.repeat||"",e.backgroundSize=t.size||""}}initPlugins(){this._resizePlugins=[];for(const[,t]of this.container.plugins)t.resize&&this._resizePlugins.push(t),(t.particleFillColor??t.particleStrokeColor)&&this._colorPlugins.push(t)}initUpdaters(){this._preDrawUpdaters=[],this._postDrawUpdaters=[];for(const t of this.container.particles.updaters)t.afterDraw&&this._postDrawUpdaters.push(t),(t.getColorStyles??t.getTransformValues??t.beforeDraw)&&this._preDrawUpdaters.push(t)}loadCanvas(t){this._generated&&this.element&&this.element.remove(),this._generated=t.dataset&&s.YU in t.dataset?"true"===t.dataset[s.YU]:this._generated,this.element=t,this.element.ariaHidden="true",this._originalStyle=(0,n.ZB)({},this.element.style),this.size.height=t.offsetHeight,this.size.width=t.offsetWidth,this._context=this.element.getContext("2d"),this._safeMutationObserver((t=>{this.element&&t.observe(this.element,{attributes:!0})})),this.container.retina.init(),this.initBackground()}paint(){const t=this.container.actualOptions;this.draw((i=>{t.backgroundMask.enable&&t.backgroundMask.cover?((0,a.ZH)(i,this.size),this._coverImage?this._paintImage(this._coverImage.image,this._coverImage.opacity):this._coverColorStyle?this._paintBase(this._coverColorStyle):this._paintBase()):this._paintBase()}))}resize(){if(!this.element)return!1;const t=this.container,i=t.retina.pixelRatio,e=t.canvas.size,s=this.element.offsetWidth*i,n=this.element.offsetHeight*i;if(n===e.height&&s===e.width&&n===this.element.height&&s===this.element.width)return!1;const a={...e};return this.element.width=e.width=this.element.offsetWidth*i,this.element.height=e.height=this.element.offsetHeight*i,this.container.started&&t.particles.setResizeFactor({width:e.width/a.width,height:e.height/a.height}),!0}stop(){this._safeMutationObserver((t=>t.disconnect())),this._mutationObserver=void 0,this.draw((t=>(0,a.ZH)(t,this.size)))}async windowResize(){if(!this.element||!this.resize())return;const t=this.container,i=t.updateActualOptions();await t.particles.setDensity(),this._applyResizePlugins(),i&&await t.refresh()}}function l(t,i,e,s,a){if(s){let s={passive:!0};(0,n.jn)(a)?s.capture=a:void 0!==a&&(s=a),t.addEventListener(i,e,s)}else{const s=a;t.removeEventListener(i,e,s)}}class d{constructor(t){this.container=t,this._doMouseTouchClick=t=>{const i=this.container,e=i.actualOptions;if(this._canPush){const t=i.interactivity.mouse,s=t.position;if(!s)return;t.clickPosition={...s},t.clickTime=(new Date).getTime();const a=e.interactivity.events.onClick;(0,n.KH)(a.mode,(t=>this.container.handleClickMode(t)))}if("touchend"===t.type){setTimeout((()=>this._mouseTouchFinish()),500)}},this._handleThemeChange=t=>{const i=t,e=this.container,s=e.options,n=s.defaultThemes,a=i.matches?n.dark:n.light,r=s.themes.find((t=>t.name===a));r&&r.default.auto&&e.loadTheme(a)},this._handleVisibilityChange=()=>{const t=this.container,i=t.actualOptions;this._mouseTouchFinish(),i.pauseOnBlur&&(document&&document.hidden?(t.pageHidden=!0,t.pause()):(t.pageHidden=!1,t.animationStatus?t.play(!0):t.draw(!0)))},this._handleWindowResize=()=>{this._resizeTimeout&&(clearTimeout(this._resizeTimeout),delete this._resizeTimeout);const t=async()=>{const t=this.container.canvas;await(t?.windowResize())};this._resizeTimeout=setTimeout((()=>{t()}),this.container.actualOptions.interactivity.events.resize.delay*s.X5)},this._manageInteractivityListeners=(t,i)=>{const e=this._handlers,n=this.container,a=n.actualOptions,r=n.interactivity.element;if(!r)return;const o=r,h=n.canvas.element;h&&(h.style.pointerEvents=o===h?"initial":"none"),(a.interactivity.events.onHover.enable||a.interactivity.events.onClick.enable)&&(l(r,s.Wt,e.mouseMove,i),l(r,s.Re,e.touchStart,i),l(r,s.zX,e.touchMove,i),a.interactivity.events.onClick.enable?(l(r,s.$o,e.touchEndClick,i),l(r,s.zw,e.mouseUp,i),l(r,s.ZL,e.mouseDown,i)):l(r,s.$o,e.touchEnd,i),l(r,t,e.mouseLeave,i),l(r,s.VH,e.touchCancel,i))},this._manageListeners=t=>{const i=this._handlers,e=this.container,n=e.actualOptions.interactivity.detectsOn,a=e.canvas.element;let r=s.aM;"window"===n?(e.interactivity.element=window,r=s.G1):e.interactivity.element="parent"===n&&a?a.parentElement??a.parentNode:a,this._manageMediaMatch(t),this._manageResize(t),this._manageInteractivityListeners(r,t),document&&l(document,s.QL,i.visibilityChange,t,!1)},this._manageMediaMatch=t=>{const i=this._handlers,e=(0,n.HY)("(prefers-color-scheme: dark)");e&&(void 0===e.addEventListener?void 0!==e.addListener&&(t?e.addListener(i.oldThemeChange):e.removeListener(i.oldThemeChange)):l(e,"change",i.themeChange,t))},this._manageResize=t=>{const i=this._handlers,e=this.container;if(!e.actualOptions.interactivity.events.resize)return;if("undefined"==typeof ResizeObserver)return void l(window,s.rR,i.resize,t);const n=e.canvas.element;this._resizeObserver&&!t?(n&&this._resizeObserver.unobserve(n),this._resizeObserver.disconnect(),delete this._resizeObserver):!this._resizeObserver&&t&&n&&(this._resizeObserver=new ResizeObserver((t=>{t.find((t=>t.target===n))&&this._handleWindowResize()})),this._resizeObserver.observe(n))},this._mouseDown=()=>{const{interactivity:t}=this.container;if(!t)return;const{mouse:i}=t;i.clicking=!0,i.downPosition=i.position},this._mouseTouchClick=t=>{const i=this.container,e=i.actualOptions,{mouse:s}=i.interactivity;s.inside=!0;let n=!1;const a=s.position;if(a&&e.interactivity.events.onClick.enable){for(const[,t]of i.plugins)if(t.clickPositionValid&&(n=t.clickPositionValid(a),n))break;n||this._doMouseTouchClick(t),s.clicking=!1}},this._mouseTouchFinish=()=>{const t=this.container.interactivity;if(!t)return;const i=t.mouse;delete i.position,delete i.clickPosition,delete i.downPosition,t.status=s.aM,i.inside=!1,i.clicking=!1},this._mouseTouchMove=t=>{const i=this.container,e=i.actualOptions,n=i.interactivity,a=i.canvas.element;if(!n?.element)return;let r;if(n.mouse.inside=!0,t.type.startsWith("pointer")){this._canPush=!0;const i=t;if(n.element===window){if(a){const t=a.getBoundingClientRect();r={x:i.clientX-t.left,y:i.clientY-t.top}}}else if("parent"===e.interactivity.detectsOn){const t=i.target,e=i.currentTarget;if(t&&e&&a){const s=t.getBoundingClientRect(),n=e.getBoundingClientRect(),o=a.getBoundingClientRect();r={x:i.offsetX+2*s.left-(n.left+o.left),y:i.offsetY+2*s.top-(n.top+o.top)}}else r={x:i.offsetX??i.clientX,y:i.offsetY??i.clientY}}else i.target===a&&(r={x:i.offsetX??i.clientX,y:i.offsetY??i.clientY})}else if(this._canPush="touchmove"!==t.type,a){const i=t,e=1,s=i.touches[i.touches.length-e],n=a.getBoundingClientRect(),o=0;r={x:s.clientX-(n.left??o),y:s.clientY-(n.top??o)}}const o=i.retina.pixelRatio;r&&(r.x*=o,r.y*=o),n.mouse.position=r,n.status=s.Wt},this._touchEnd=t=>{const i=t,e=Array.from(i.changedTouches);for(const t of e)this._touches.delete(t.identifier);this._mouseTouchFinish()},this._touchEndClick=t=>{const i=t,e=Array.from(i.changedTouches);for(const t of e)this._touches.delete(t.identifier);this._mouseTouchClick(t)},this._touchStart=t=>{const i=t,e=Array.from(i.changedTouches);for(const t of e)this._touches.set(t.identifier,performance.now());this._mouseTouchMove(t)},this._canPush=!0,this._touches=new Map,this._handlers={mouseDown:()=>this._mouseDown(),mouseLeave:()=>this._mouseTouchFinish(),mouseMove:t=>this._mouseTouchMove(t),mouseUp:t=>this._mouseTouchClick(t),touchStart:t=>this._touchStart(t),touchMove:t=>this._mouseTouchMove(t),touchEnd:t=>this._touchEnd(t),touchCancel:t=>this._touchEnd(t),touchEndClick:t=>this._touchEndClick(t),visibilityChange:()=>this._handleVisibilityChange(),themeChange:t=>this._handleThemeChange(t),oldThemeChange:t=>this._handleThemeChange(t),resize:()=>{this._handleWindowResize()}}}addListeners(){this._manageListeners(!0)}removeListeners(){this._manageListeners(!1)}}var u=e(1875);class p{constructor(t,i){this.container=i,this._engine=t,this._interactors=[],this._externalInteractors=[],this._particleInteractors=[]}async externalInteract(t){for(const i of this._externalInteractors)i.isEnabled()&&await i.interact(t)}handleClickMode(t){for(const i of this._externalInteractors)i.handleClickMode?.(t)}async init(){this._interactors=await this._engine.getInteractors(this.container,!0),this._externalInteractors=[],this._particleInteractors=[];for(const t of this._interactors){switch(t.type){case"external":this._externalInteractors.push(t);break;case"particles":this._particleInteractors.push(t)}t.init()}}async particlesInteract(t,i){for(const e of this._externalInteractors)e.clear(t,i);for(const e of this._particleInteractors)e.isEnabled(t)&&await e.interact(t,i)}reset(t){for(const i of this._externalInteractors)i.isEnabled()&&i.reset(t);for(const i of this._particleInteractors)i.isEnabled(t)&&i.reset(t)}}var _=e(4116),f=e(9338),m=e(1363),g=e(3635);const v=.5;class y{constructor(t,i){this.rectangle=t,this.capacity=i,this._subdivide=()=>{const{x:t,y:i}=this.rectangle.position,{width:e,height:s}=this.rectangle.size,{capacity:n}=this;for(let a=0;a<4;a++){const r=a%2;this._subs.push(new y(new m.A(t+e*v*r,i+s*v*(Math.round(a*v)-r),e*v,s*v),n))}this._divided=!0},this._points=[],this._divided=!1,this._subs=[]}insert(t){return!!this.rectangle.contains(t.position)&&(this._points.length<this.capacity?(this._points.push(t),!0):(this._divided||this._subdivide(),this._subs.some((i=>i.insert(t)))))}query(t,i,e){const s=e??[];if(!t.intersects(this.rectangle))return[];for(const e of this._points)!t.contains(e.position)&&(0,g.Sp)(t.position,e.position)>e.particle.getRadius()&&(!i||i(e.particle))||s.push(e.particle);if(this._divided)for(const e of this._subs)e.query(t,i,s);return s}queryCircle(t,i,e){return this.query(new f.C(t.x,t.y,i),e)}queryRectangle(t,i,e){return this.query(new m.A(t.x,t.y,i.width,i.height),e)}}const w=t=>{const{height:i,width:e}=t;return new m.A(-.25*e,-.25*i,1.5*e,1.5*i)};class z{constructor(t,i){this._addToPool=(...t)=>{for(const i of t)this._pool.push(i)},this._applyDensity=async(t,i,e)=>{const s=t.number;if(!t.number.density?.enable)return void(void 0===e?this._limit=s.limit.value:s.limit&&this._groupLimits.set(e,s.limit.value));const n=this._initDensityFactor(s.density),a=s.value,r=s.limit.value>0?s.limit.value:a,o=Math.min(a,r)*n+i,h=Math.min(this.count,this.filter((t=>t.group===e)).length);void 0===e?this._limit=s.limit.value*n:this._groupLimits.set(e,s.limit.value*n),h<o?await this.push(Math.abs(o-h),void 0,t,e):h>o&&this.removeQuantity(h-o,e)},this._initDensityFactor=t=>{const i=this._container;if(!i.canvas.element||!t.enable)return 1;const e=i.canvas.element,s=i.retina.pixelRatio;return e.width*e.height/(t.height*t.width*s**2)},this._pushParticle=async(t,i,a,r)=>{try{let s=this._pool.pop();if(!s){const{Particle:t}=await e.e(373).then(e.bind(e,2373));s=new t(this._engine,this._container)}await s.init(this._nextId,t,i,a);let n=!0;if(r&&(n=r(s)),!n)return;return this._array.push(s),this._zArray.push(s),this._nextId++,this._engine.dispatchEvent("particleAdded",{container:this._container,data:{particle:s}}),s}catch(t){(0,n.jl)().warning(`${s.gK} adding particle: ${t}`)}},this._removeParticle=(t,i,e)=>{const s=this._array[t];if(!s||s.group!==i)return!1;const n=this._zArray.indexOf(s);return this._array.splice(t,1),this._zArray.splice(n,1),s.destroy(e),this._engine.dispatchEvent("particleRemoved",{container:this._container,data:{particle:s}}),this._addToPool(s),!0},this._engine=t,this._container=i,this._nextId=0,this._array=[],this._zArray=[],this._pool=[],this._limit=0,this._groupLimits=new Map,this._needsSort=!1,this._lastZIndex=0,this._interactionManager=new p(t,i),this._pluginsInitialized=!1;const a=i.canvas.size;this.quadTree=new y(w(a),4),this.movers=[],this.updaters=[]}get count(){return this._array.length}async addManualParticles(){const t=this._container,i=t.actualOptions;for(const e of i.manualParticles)await this.addParticle(e.position?(0,n.bt)(e.position,t.canvas.size):void 0,e.options)}async addParticle(t,i,e,s){const n=this._container.actualOptions.particles.number.limit,a=void 0===e?this._limit:this._groupLimits.get(e)??this._limit,r=this.count;if(a>0)if("delete"===n.mode){const t=r+1-a;t>0&&this.removeQuantity(t)}else if("wait"===n.mode&&r>=a)return;return await this._pushParticle(t,i,e,s)}clear(){this._array=[],this._zArray=[],this._pluginsInitialized=!1}destroy(){this._array=[],this._zArray=[],this.movers=[],this.updaters=[]}async draw(t){const i=this._container,e=i.canvas;e.clear(),await this.update(t);for(const[,s]of i.plugins)await e.drawPlugin(s,t);for(const i of this._zArray)await i.draw(t)}filter(t){return this._array.filter(t)}find(t){return this._array.find(t)}get(t){return this._array[t]}handleClickMode(t){this._interactionManager.handleClickMode(t)}async init(){const t=this._container,i=t.actualOptions;this._lastZIndex=0,this._needsSort=!1,await this.initPlugins();let e=!1;for(const[,i]of t.plugins)if(void 0!==i.particlesInitialization&&(e=i.particlesInitialization()),e)break;if(await this.addManualParticles(),!e){const t=i.particles,e=t.groups;for(const i in e){const s=e[i];for(let e=this.count,n=0;n<s.number?.value&&e<t.number.value;e++,n++)await this.addParticle(void 0,s,i)}for(let i=this.count;i<t.number.value;i++)await this.addParticle()}}async initPlugins(){if(this._pluginsInitialized)return;const t=this._container;this.movers=await this._engine.getMovers(t,!0),this.updaters=await this._engine.getUpdaters(t,!0),await this._interactionManager.init();for(const[,i]of t.pathGenerators)await i.init(t)}async push(t,i,e,s){for(let n=0;n<t;n++)await this.addParticle(i?.position,e,s)}async redraw(){this.clear(),await this.init(),await this.draw({value:0,factor:0})}remove(t,i,e){this.removeAt(this._array.indexOf(t),void 0,i,e)}removeAt(t,i=1,e,s){if(t<0||t>this.count)return;let n=0;for(let a=t;n<i&&a<this.count;a++)this._removeParticle(a--,e,s)&&n++}removeQuantity(t,i){this.removeAt(0,t,i)}async setDensity(){const t=this._container.actualOptions,i=t.particles.groups;for(const t in i)await this._applyDensity(i[t],0,t);await this._applyDensity(t.particles,t.manualParticles.length)}setLastZIndex(t){this._lastZIndex=t,this._needsSort=this._needsSort||this._lastZIndex<t}setResizeFactor(t){this._resizeFactor=t}async update(t){const i=this._container,e=new Set;this.quadTree=new y(w(i.canvas.size),4);for(const[,t]of i.pathGenerators)t.update();for(const[,e]of i.plugins)await(e.update?.(t));const s=this._resizeFactor;for(const i of this._array){s&&!i.ignoresResizeRatio&&(i.position.x*=s.width,i.position.y*=s.height,i.initialPosition.x*=s.width,i.initialPosition.y*=s.height),i.ignoresResizeRatio=!1,this._interactionManager.reset(i);for(const[,e]of this._container.plugins){if(i.destroyed)break;e.particleUpdate?.(i,t)}for(const e of this.movers)e.isEnabled(i)&&await e.move(i,t);i.destroyed?e.add(i):this.quadTree.insert(new _.E(i.getPosition(),i))}if(e.size){const t=t=>!e.has(t);this._array=this.filter(t),this._zArray=this._zArray.filter(t);for(const t of e)this._engine.dispatchEvent("particleRemoved",{container:this._container,data:{particle:t}});this._addToPool(...e)}await this._interactionManager.externalInteract(t);for(const i of this._array){for(const e of this.updaters)await e.update(i,t);i.destroyed||i.spawning||await this._interactionManager.particlesInteract(i,t)}if(delete this._resizeFactor,this._needsSort){const t=this._zArray;t.sort(((t,i)=>i.position.z-t.position.z||t.id-i.id));const i=1;this._lastZIndex=t[t.length-i].position.z,this._needsSort=!1}}}class b{constructor(t){this.container=t,this.pixelRatio=1,this.reduceFactor=1}init(){const t=this.container,i=t.actualOptions;this.pixelRatio=!i.detectRetina||(0,n.Kr)()?1:window.devicePixelRatio,this.reduceFactor=1;const e=this.pixelRatio,s=t.canvas;if(s.element){const t=s.element;s.size.width=t.offsetWidth*e,s.size.height=t.offsetHeight*e}const a=i.particles,r=a.move;this.maxSpeed=(0,g.Gu)(r.gravity.maxSpeed)*e,this.sizeAnimationSpeed=(0,g.Gu)(a.size.animation.speed)*e}initParticle(t){const i=t.options,e=this.pixelRatio,s=i.move,n=s.distance,a=t.retina;a.moveDrift=(0,g.Gu)(s.drift)*e,a.moveSpeed=(0,g.Gu)(s.speed)*e,a.sizeAnimationSpeed=(0,g.Gu)(i.size.animation.speed)*e;const r=a.maxDistance;r.horizontal=void 0!==n.horizontal?n.horizontal*e:void 0,r.vertical=void 0!==n.vertical?n.vertical*e:void 0,a.maxSpeed=(0,g.Gu)(s.gravity.maxSpeed)*e}}var O=e(3893);function k(t){return t&&!t.destroyed}function T(t,i,...e){const s=new u.E(t,i);return(0,O.h)(s,...e),s}class P{constructor(t,i,e){this._intersectionManager=t=>{if(k(this)&&this.actualOptions.pauseOnOutsideViewport)for(const i of t)i.target===this.interactivity.element&&(i.isIntersecting?this.play():this.pause())},this._nextFrame=async t=>{try{if(!this._smooth&&void 0!==this._lastFrameTime&&t<this._lastFrameTime+s.X5/this.fpsLimit)return void this.draw(!1);this._lastFrameTime??=t;const i=function(t,i=60,e=!1){return{value:t,factor:e?60/i:60*t/s.X5}}(t-this._lastFrameTime,this.fpsLimit,this._smooth);if(this.addLifeTime(i.value),this._lastFrameTime=t,i.value>s.X5)return void this.draw(!1);if(await this.particles.draw(i),!this.alive())return void this.destroy();this.animationStatus&&this.draw(!1)}catch(t){(0,n.jl)().error(`${s.gK} in animation loop`,t)}},this._engine=t,this.id=Symbol(i),this.fpsLimit=120,this._smooth=!1,this._delay=0,this._duration=0,this._lifeTime=0,this._firstStart=!0,this.started=!1,this.destroyed=!1,this._paused=!0,this._lastFrameTime=0,this.zLayers=100,this.pageHidden=!1,this._sourceOptions=e,this._initialSourceOptions=e,this.retina=new b(this),this.canvas=new c(this),this.particles=new z(this._engine,this),this.pathGenerators=new Map,this.interactivity={mouse:{clicking:!1,inside:!1}},this.plugins=new Map,this.effectDrawers=new Map,this.shapeDrawers=new Map,this._options=T(this._engine,this),this.actualOptions=T(this._engine,this),this._eventListeners=new d(this),this._intersectionObserver=(0,n.NM)((t=>this._intersectionManager(t))),this._engine.dispatchEvent("containerBuilt",{container:this})}get animationStatus(){return!this._paused&&!this.pageHidden&&k(this)}get options(){return this._options}get sourceOptions(){return this._sourceOptions}addClickHandler(t){if(!k(this))return;const i=this.interactivity.element;if(!i)return;const e=(i,e,s)=>{if(!k(this))return;const n=this.retina.pixelRatio,a={x:e.x*n,y:e.y*n},r=this.particles.quadTree.queryCircle(a,s*n);t(i,r)};let s=!1,n=!1;i.addEventListener("click",(t=>{if(!k(this))return;const i=t,s={x:i.offsetX||i.clientX,y:i.offsetY||i.clientY};e(t,s,1)})),i.addEventListener("touchstart",(()=>{k(this)&&(s=!0,n=!1)})),i.addEventListener("touchmove",(()=>{k(this)&&(n=!0)})),i.addEventListener("touchend",(t=>{if(k(this)){if(s&&!n){const i=t,s=1;let n=i.touches[i.touches.length-s];if(!n&&(n=i.changedTouches[i.changedTouches.length-s],!n))return;const a=this.canvas.element,r=a?a.getBoundingClientRect():void 0,o=0,h={x:n.clientX-(r?r.left:o),y:n.clientY-(r?r.top:o)};e(t,h,Math.max(n.radiusX,n.radiusY))}s=!1,n=!1}})),i.addEventListener("touchcancel",(()=>{k(this)&&(s=!1,n=!1)}))}addLifeTime(t){this._lifeTime+=t}addPath(t,i,e=!1){return!(!k(this)||!e&&this.pathGenerators.has(t))&&(this.pathGenerators.set(t,i),!0)}alive(){return!this._duration||this._lifeTime<=this._duration}destroy(){if(!k(this))return;this.stop(),this.particles.destroy(),this.canvas.destroy();for(const[,t]of this.effectDrawers)t.destroy?.(this);for(const[,t]of this.shapeDrawers)t.destroy?.(this);for(const t of this.effectDrawers.keys())this.effectDrawers.delete(t);for(const t of this.shapeDrawers.keys())this.shapeDrawers.delete(t);this._engine.clearPlugins(this),this.destroyed=!0;const t=this._engine.dom(),i=t.findIndex((t=>t===this));if(i>=0){const e=1;t.splice(i,e)}this._engine.dispatchEvent("containerDestroyed",{container:this})}draw(t){if(!k(this))return;let i=t;const e=async t=>{i&&(this._lastFrameTime=void 0,i=!1),await this._nextFrame(t)};this._drawAnimationFrame=requestAnimationFrame((t=>{e(t)}))}async export(t,i={}){for(const[,e]of this.plugins){if(!e.export)continue;const s=await e.export(t,i);if(s.supported)return s.blob}(0,n.jl)().error(`${s.gK} - Export plugin with type ${t} not found`)}handleClickMode(t){if(k(this)){this.particles.handleClickMode(t);for(const[,i]of this.plugins)i.handleClickMode?.(t)}}async init(){if(!k(this))return;const t=this._engine.getSupportedEffects();for(const i of t){const t=this._engine.getEffectDrawer(i);t&&this.effectDrawers.set(i,t)}const i=this._engine.getSupportedShapes();for(const t of i){const i=this._engine.getShapeDrawer(t);i&&this.shapeDrawers.set(t,i)}await this.particles.initPlugins(),this._options=T(this._engine,this,this._initialSourceOptions,this.sourceOptions),this.actualOptions=T(this._engine,this,this._options);const e=await this._engine.getAvailablePlugins(this);for(const[t,i]of e)this.plugins.set(t,i);this.retina.init(),await this.canvas.init(),this.updateActualOptions(),this.canvas.initBackground(),this.canvas.resize(),this.zLayers=this.actualOptions.zLayers,this._duration=(0,g.Gu)(this.actualOptions.duration)*s.X5,this._delay=(0,g.Gu)(this.actualOptions.delay)*s.X5,this._lifeTime=0;this.fpsLimit=this.actualOptions.fpsLimit>0?this.actualOptions.fpsLimit:120,this._smooth=this.actualOptions.smooth;for(const[,t]of this.effectDrawers)await(t.init?.(this));for(const[,t]of this.shapeDrawers)await(t.init?.(this));for(const[,t]of this.plugins)await(t.init?.());this._engine.dispatchEvent("containerInit",{container:this}),await this.particles.init(),await this.particles.setDensity();for(const[,t]of this.plugins)t.particlesSetup?.();this._engine.dispatchEvent("particlesSetup",{container:this})}async loadTheme(t){k(this)&&(this._currentTheme=t,await this.refresh())}pause(){if(k(this)&&(void 0!==this._drawAnimationFrame&&(cancelAnimationFrame(this._drawAnimationFrame),delete this._drawAnimationFrame),!this._paused)){for(const[,t]of this.plugins)t.pause?.();this.pageHidden||(this._paused=!0),this._engine.dispatchEvent("containerPaused",{container:this})}}play(t){if(!k(this))return;const i=this._paused||t;if(!this._firstStart||this.actualOptions.autoPlay){if(this._paused&&(this._paused=!1),i)for(const[,t]of this.plugins)t.play&&t.play();this._engine.dispatchEvent("containerPlay",{container:this}),this.draw(i??!1)}else this._firstStart=!1}async refresh(){if(k(this))return this.stop(),this.start()}async reset(){if(k(this))return this._initialSourceOptions=void 0,this._options=T(this._engine,this),this.actualOptions=T(this._engine,this,this._options),this.refresh()}async start(){k(this)&&!this.started&&(await this.init(),this.started=!0,await new Promise((t=>{const i=async()=>{this._eventListeners.addListeners(),this.interactivity.element instanceof HTMLElement&&this._intersectionObserver&&this._intersectionObserver.observe(this.interactivity.element);for(const[,t]of this.plugins)await(t.start?.());this._engine.dispatchEvent("containerStarted",{container:this}),this.play(),t()};this._delayTimeout=setTimeout((()=>{i()}),this._delay)})))}stop(){if(k(this)&&this.started){this._delayTimeout&&(clearTimeout(this._delayTimeout),delete this._delayTimeout),this._firstStart=!0,this.started=!1,this._eventListeners.removeListeners(),this.pause(),this.particles.clear(),this.canvas.stop(),this.interactivity.element instanceof HTMLElement&&this._intersectionObserver&&this._intersectionObserver.unobserve(this.interactivity.element);for(const[,t]of this.plugins)t.stop?.();for(const t of this.plugins.keys())this.plugins.delete(t);this._sourceOptions=this._options,this._engine.dispatchEvent("containerStopped",{container:this})}}updateActualOptions(){this.actualOptions.responsive=[];const t=this.actualOptions.setResponsive(this.canvas.size.width,this.retina.pixelRatio,this._options);return this.actualOptions.setTheme(this._currentTheme),this._responsiveMaxWidth!==t&&(this._responsiveMaxWidth=t,!0)}}}}]);
@@ -1 +0,0 @@
1
- /*! tsParticles Engine v3.2.1 by Matteo Bruni */
@@ -1,28 +0,0 @@
1
- import { Range } from "./Range.js";
2
- import { Rectangle } from "./Rectangle.js";
3
- import { getDistance } from "../../Utils/NumberUtils.js";
4
- const squareExp = 2;
5
- export class Circle extends Range {
6
- constructor(x, y, radius) {
7
- super(x, y);
8
- this.radius = radius;
9
- }
10
- contains(point) {
11
- return getDistance(point, this.position) <= this.radius;
12
- }
13
- intersects(range) {
14
- const pos1 = this.position, pos2 = range.position, distPos = { x: Math.abs(pos2.x - pos1.x), y: Math.abs(pos2.y - pos1.y) }, r = this.radius;
15
- if (range instanceof Circle) {
16
- const rSum = r + range.radius, dist = Math.sqrt(distPos.x ** squareExp + distPos.y ** squareExp);
17
- return rSum > dist;
18
- }
19
- else if (range instanceof Rectangle) {
20
- const { width, height } = range.size, edges = Math.pow(distPos.x - width, squareExp) + Math.pow(distPos.y - height, squareExp);
21
- return (edges <= r ** squareExp ||
22
- (distPos.x <= r + width && distPos.y <= r + height) ||
23
- distPos.x <= width ||
24
- distPos.y <= height);
25
- }
26
- return false;
27
- }
28
- }
@@ -1,8 +0,0 @@
1
- export class Range {
2
- constructor(x, y) {
3
- this.position = {
4
- x: x,
5
- y: y,
6
- };
7
- }
8
- }
@@ -1,22 +0,0 @@
1
- import { Circle } from "./Circle.js";
2
- import { Range } from "./Range.js";
3
- export class Rectangle extends Range {
4
- constructor(x, y, width, height) {
5
- super(x, y);
6
- this.size = {
7
- height: height,
8
- width: width,
9
- };
10
- }
11
- contains(point) {
12
- const w = this.size.width, h = this.size.height, pos = this.position;
13
- return point.x >= pos.x && point.x <= pos.x + w && point.y >= pos.y && point.y <= pos.y + h;
14
- }
15
- intersects(range) {
16
- if (range instanceof Circle) {
17
- range.intersects(this);
18
- }
19
- const w = this.size.width, h = this.size.height, pos1 = this.position, pos2 = range.position, size2 = range instanceof Rectangle ? range.size : { width: 0, height: 0 }, w2 = size2.width, h2 = size2.height;
20
- return pos2.x < pos1.x + w && pos2.x + w2 > pos1.x && pos2.y < pos1.y + h && pos2.y + h2 > pos1.y;
21
- }
22
- }
@@ -1,20 +0,0 @@
1
- import { Vector3d } from "./Vector3d.js";
2
- const origin = {
3
- x: 0,
4
- y: 0,
5
- z: 0,
6
- };
7
- export class Vector extends Vector3d {
8
- constructor(xOrCoords, y) {
9
- super(xOrCoords, y, origin.z);
10
- }
11
- static get origin() {
12
- return Vector.create(origin.x, origin.y);
13
- }
14
- static clone(source) {
15
- return Vector.create(source.x, source.y);
16
- }
17
- static create(x, y) {
18
- return new Vector(x, y);
19
- }
20
- }
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Circle = void 0;
4
- const Range_js_1 = require("./Range.js");
5
- const Rectangle_js_1 = require("./Rectangle.js");
6
- const NumberUtils_js_1 = require("../../Utils/NumberUtils.js");
7
- const squareExp = 2;
8
- class Circle extends Range_js_1.Range {
9
- constructor(x, y, radius) {
10
- super(x, y);
11
- this.radius = radius;
12
- }
13
- contains(point) {
14
- return (0, NumberUtils_js_1.getDistance)(point, this.position) <= this.radius;
15
- }
16
- intersects(range) {
17
- const pos1 = this.position, pos2 = range.position, distPos = { x: Math.abs(pos2.x - pos1.x), y: Math.abs(pos2.y - pos1.y) }, r = this.radius;
18
- if (range instanceof Circle) {
19
- const rSum = r + range.radius, dist = Math.sqrt(distPos.x ** squareExp + distPos.y ** squareExp);
20
- return rSum > dist;
21
- }
22
- else if (range instanceof Rectangle_js_1.Rectangle) {
23
- const { width, height } = range.size, edges = Math.pow(distPos.x - width, squareExp) + Math.pow(distPos.y - height, squareExp);
24
- return (edges <= r ** squareExp ||
25
- (distPos.x <= r + width && distPos.y <= r + height) ||
26
- distPos.x <= width ||
27
- distPos.y <= height);
28
- }
29
- return false;
30
- }
31
- }
32
- exports.Circle = Circle;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Range = void 0;
4
- class Range {
5
- constructor(x, y) {
6
- this.position = {
7
- x: x,
8
- y: y,
9
- };
10
- }
11
- }
12
- exports.Range = Range;
@@ -1,26 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Rectangle = void 0;
4
- const Circle_js_1 = require("./Circle.js");
5
- const Range_js_1 = require("./Range.js");
6
- class Rectangle extends Range_js_1.Range {
7
- constructor(x, y, width, height) {
8
- super(x, y);
9
- this.size = {
10
- height: height,
11
- width: width,
12
- };
13
- }
14
- contains(point) {
15
- const w = this.size.width, h = this.size.height, pos = this.position;
16
- return point.x >= pos.x && point.x <= pos.x + w && point.y >= pos.y && point.y <= pos.y + h;
17
- }
18
- intersects(range) {
19
- if (range instanceof Circle_js_1.Circle) {
20
- range.intersects(this);
21
- }
22
- const w = this.size.width, h = this.size.height, pos1 = this.position, pos2 = range.position, size2 = range instanceof Rectangle ? range.size : { width: 0, height: 0 }, w2 = size2.width, h2 = size2.height;
23
- return pos2.x < pos1.x + w && pos2.x + w2 > pos1.x && pos2.y < pos1.y + h && pos2.y + h2 > pos1.y;
24
- }
25
- }
26
- exports.Rectangle = Rectangle;
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Vector = void 0;
4
- const Vector3d_js_1 = require("./Vector3d.js");
5
- const origin = {
6
- x: 0,
7
- y: 0,
8
- z: 0,
9
- };
10
- class Vector extends Vector3d_js_1.Vector3d {
11
- constructor(xOrCoords, y) {
12
- super(xOrCoords, y, origin.z);
13
- }
14
- static get origin() {
15
- return Vector.create(origin.x, origin.y);
16
- }
17
- static clone(source) {
18
- return Vector.create(source.x, source.y);
19
- }
20
- static create(x, y) {
21
- return new Vector(x, y);
22
- }
23
- }
24
- exports.Vector = Vector;
@@ -1,32 +0,0 @@
1
- /*!
2
- * tsParticles Engine v3.2.1
3
- * Author: Matteo Bruni
4
- * MIT license: https://opensource.org/licenses/MIT
5
- * Website: https://particles.js.org/
6
- * Confetti Website: https://confetti.js.org
7
- * GitHub: https://www.github.com/matteobruni/tsparticles
8
- * How to use?: Check the GitHub README
9
- * ------------------------------------------------------
10
- */
11
- "use strict";
12
- /*
13
- * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
14
- * This devtool is neither made for production nor for readable output files.
15
- * It uses "eval()" calls to create a separate source file in the browser devtools.
16
- * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
17
- * or disable the default devtool with "devtool: false".
18
- * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
19
- */
20
- (this["webpackChunk_tsparticles_engine"] = this["webpackChunk_tsparticles_engine"] || []).push([["dist_browser_Core_Particle_js"],{
21
-
22
- /***/ "./dist/browser/Core/Particle.js":
23
- /*!***************************************!*\
24
- !*** ./dist/browser/Core/Particle.js ***!
25
- \***************************************/
26
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
27
-
28
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Particle: () => (/* binding */ Particle)\n/* harmony export */ });\n/* harmony import */ var _Utils_NumberUtils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Utils/NumberUtils.js */ \"./dist/browser/Utils/NumberUtils.js\");\n/* harmony import */ var _Utils_Utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Utils/Utils.js */ \"./dist/browser/Utils/Utils.js\");\n/* harmony import */ var _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Utils/Constants.js */ \"./dist/browser/Core/Utils/Constants.js\");\n/* harmony import */ var _Utils_ColorUtils_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../Utils/ColorUtils.js */ \"./dist/browser/Utils/ColorUtils.js\");\n/* harmony import */ var _Options_Classes_Interactivity_Interactivity_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../Options/Classes/Interactivity/Interactivity.js */ \"./dist/browser/Options/Classes/Interactivity/Interactivity.js\");\n/* harmony import */ var _Utils_Vector_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Utils/Vector.js */ \"./dist/browser/Core/Utils/Vector.js\");\n/* harmony import */ var _Utils_Vector3d_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Utils/Vector3d.js */ \"./dist/browser/Core/Utils/Vector3d.js\");\n/* harmony import */ var _Utils_CanvasUtils_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Utils/CanvasUtils.js */ \"./dist/browser/Utils/CanvasUtils.js\");\n/* harmony import */ var _Utils_OptionsUtils_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../Utils/OptionsUtils.js */ \"./dist/browser/Utils/OptionsUtils.js\");\n\n\n\n\n\n\n\n\n\nconst defaultRetryCount = 0,\n double = 2,\n half = 0.5,\n squareExp = 2;\nfunction loadEffectData(effect, effectOptions, id, reduceDuplicates) {\n const effectData = effectOptions.options[effect];\n if (!effectData) {\n return;\n }\n return (0,_Utils_Utils_js__WEBPACK_IMPORTED_MODULE_0__.deepExtend)({\n close: effectOptions.close,\n fill: effectOptions.fill\n }, (0,_Utils_Utils_js__WEBPACK_IMPORTED_MODULE_0__.itemFromSingleOrMultiple)(effectData, id, reduceDuplicates));\n}\nfunction loadShapeData(shape, shapeOptions, id, reduceDuplicates) {\n const shapeData = shapeOptions.options[shape];\n if (!shapeData) {\n return;\n }\n return (0,_Utils_Utils_js__WEBPACK_IMPORTED_MODULE_0__.deepExtend)({\n close: shapeOptions.close,\n fill: shapeOptions.fill\n }, (0,_Utils_Utils_js__WEBPACK_IMPORTED_MODULE_0__.itemFromSingleOrMultiple)(shapeData, id, reduceDuplicates));\n}\nfunction fixOutMode(data) {\n if (!(0,_Utils_Utils_js__WEBPACK_IMPORTED_MODULE_0__.isInArray)(data.outMode, data.checkModes)) {\n return;\n }\n const diameter = data.radius * double;\n if (data.coord > data.maxCoord - diameter) {\n data.setCb(-data.radius);\n } else if (data.coord < diameter) {\n data.setCb(data.radius);\n }\n}\nclass Particle {\n constructor(engine, container) {\n this.container = container;\n this._calcPosition = (container, position, zIndex, tryCount = defaultRetryCount) => {\n for (const [, plugin] of container.plugins) {\n const pluginPos = plugin.particlePosition !== undefined ? plugin.particlePosition(position, this) : undefined;\n if (pluginPos) {\n return _Utils_Vector3d_js__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create(pluginPos.x, pluginPos.y, zIndex);\n }\n }\n const canvasSize = container.canvas.size,\n exactPosition = (0,_Utils_NumberUtils_js__WEBPACK_IMPORTED_MODULE_2__.calcExactPositionOrRandomFromSize)({\n size: canvasSize,\n position: position\n }),\n pos = _Utils_Vector3d_js__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create(exactPosition.x, exactPosition.y, zIndex),\n radius = this.getRadius(),\n outModes = this.options.move.outModes,\n fixHorizontal = outMode => {\n fixOutMode({\n outMode,\n checkModes: [\"bounce\"],\n coord: pos.x,\n maxCoord: container.canvas.size.width,\n setCb: value => pos.x += value,\n radius\n });\n },\n fixVertical = outMode => {\n fixOutMode({\n outMode,\n checkModes: [\"bounce\"],\n coord: pos.y,\n maxCoord: container.canvas.size.height,\n setCb: value => pos.y += value,\n radius\n });\n };\n fixHorizontal(outModes.left ?? outModes.default);\n fixHorizontal(outModes.right ?? outModes.default);\n fixVertical(outModes.top ?? outModes.default);\n fixVertical(outModes.bottom ?? outModes.default);\n if (this._checkOverlap(pos, tryCount)) {\n const increment = 1;\n return this._calcPosition(container, undefined, zIndex, tryCount + increment);\n }\n return pos;\n };\n this._calculateVelocity = () => {\n const baseVelocity = (0,_Utils_NumberUtils_js__WEBPACK_IMPORTED_MODULE_2__.getParticleBaseVelocity)(this.direction),\n res = baseVelocity.copy(),\n moveOptions = this.options.move;\n if (moveOptions.direction === \"inside\" || moveOptions.direction === \"outside\") {\n return res;\n }\n const rad = (0,_Utils_NumberUtils_js__WEBPACK_IMPORTED_MODULE_2__.degToRad)((0,_Utils_NumberUtils_js__WEBPACK_IMPORTED_MODULE_2__.getRangeValue)(moveOptions.angle.value)),\n radOffset = (0,_Utils_NumberUtils_js__WEBPACK_IMPORTED_MODULE_2__.degToRad)((0,_Utils_NumberUtils_js__WEBPACK_IMPORTED_MODULE_2__.getRangeValue)(moveOptions.angle.offset)),\n range = {\n left: radOffset - rad * half,\n right: radOffset + rad * half\n };\n if (!moveOptions.straight) {\n res.angle += (0,_Utils_NumberUtils_js__WEBPACK_IMPORTED_MODULE_2__.randomInRange)((0,_Utils_NumberUtils_js__WEBPACK_IMPORTED_MODULE_2__.setRangeValue)(range.left, range.right));\n }\n if (moveOptions.random && typeof moveOptions.speed === \"number\") {\n res.length *= (0,_Utils_NumberUtils_js__WEBPACK_IMPORTED_MODULE_2__.getRandom)();\n }\n return res;\n };\n this._checkOverlap = (pos, tryCount = defaultRetryCount) => {\n const collisionsOptions = this.options.collisions,\n radius = this.getRadius();\n if (!collisionsOptions.enable) {\n return false;\n }\n const overlapOptions = collisionsOptions.overlap;\n if (overlapOptions.enable) {\n return false;\n }\n const retries = overlapOptions.retries,\n minRetries = 0;\n if (retries >= minRetries && tryCount > retries) {\n throw new Error(`${_Utils_Constants_js__WEBPACK_IMPORTED_MODULE_3__.errorPrefix} particle is overlapping and can't be placed`);\n }\n return !!this.container.particles.find(particle => (0,_Utils_NumberUtils_js__WEBPACK_IMPORTED_MODULE_2__.getDistance)(pos, particle.position) < radius + particle.getRadius());\n };\n this._getRollColor = color => {\n if (!color || !this.roll || !this.backColor && !this.roll.alter) {\n return color;\n }\n const rollFactor = 1,\n none = 0,\n backFactor = this.roll.horizontal && this.roll.vertical ? double * rollFactor : rollFactor,\n backSum = this.roll.horizontal ? Math.PI * half : none,\n rolled = Math.floor(((this.roll.angle ?? none) + backSum) / (Math.PI / backFactor)) % double;\n if (!rolled) {\n return color;\n }\n if (this.backColor) {\n return this.backColor;\n }\n if (this.roll.alter) {\n return (0,_Utils_CanvasUtils_js__WEBPACK_IMPORTED_MODULE_4__.alterHsl)(color, this.roll.alter.type, this.roll.alter.value);\n }\n return color;\n };\n this._initPosition = position => {\n const container = this.container,\n zIndexValue = (0,_Utils_NumberUtils_js__WEBPACK_IMPORTED_MODULE_2__.getRangeValue)(this.options.zIndex.value),\n minZ = 0;\n this.position = this._calcPosition(container, position, (0,_Utils_NumberUtils_js__WEBPACK_IMPORTED_MODULE_2__.clamp)(zIndexValue, minZ, container.zLayers));\n this.initialPosition = this.position.copy();\n const canvasSize = container.canvas.size,\n defaultRadius = 0;\n this.moveCenter = {\n ...(0,_Utils_Utils_js__WEBPACK_IMPORTED_MODULE_0__.getPosition)(this.options.move.center, canvasSize),\n radius: this.options.move.center.radius ?? defaultRadius,\n mode: this.options.move.center.mode ?? \"percent\"\n };\n this.direction = (0,_Utils_NumberUtils_js__WEBPACK_IMPORTED_MODULE_2__.getParticleDirectionAngle)(this.options.move.direction, this.position, this.moveCenter);\n switch (this.options.move.direction) {\n case \"inside\":\n this.outType = \"inside\";\n break;\n case \"outside\":\n this.outType = \"outside\";\n break;\n }\n this.offset = _Utils_Vector_js__WEBPACK_IMPORTED_MODULE_5__.Vector.origin;\n };\n this._engine = engine;\n }\n destroy(override) {\n if (this.unbreakable || this.destroyed) {\n return;\n }\n this.destroyed = true;\n this.bubble.inRange = false;\n this.slow.inRange = false;\n const container = this.container,\n pathGenerator = this.pathGenerator,\n shapeDrawer = container.shapeDrawers.get(this.shape);\n shapeDrawer?.particleDestroy?.(this);\n for (const [, plugin] of container.plugins) {\n plugin.particleDestroyed?.(this, override);\n }\n for (const updater of container.particles.updaters) {\n updater.particleDestroyed?.(this, override);\n }\n pathGenerator?.reset(this);\n this._engine.dispatchEvent(\"particleDestroyed\", {\n container: this.container,\n data: {\n particle: this\n }\n });\n }\n async draw(delta) {\n const container = this.container,\n canvas = container.canvas;\n for (const [, plugin] of container.plugins) {\n await canvas.drawParticlePlugin(plugin, this, delta);\n }\n await canvas.drawParticle(this, delta);\n }\n getFillColor() {\n return this._getRollColor(this.bubble.color ?? (0,_Utils_ColorUtils_js__WEBPACK_IMPORTED_MODULE_6__.getHslFromAnimation)(this.color));\n }\n getMass() {\n return this.getRadius() ** squareExp * Math.PI * half;\n }\n getPosition() {\n return {\n x: this.position.x + this.offset.x,\n y: this.position.y + this.offset.y,\n z: this.position.z\n };\n }\n getRadius() {\n return this.bubble.radius ?? this.size.value;\n }\n getStrokeColor() {\n return this._getRollColor(this.bubble.color ?? (0,_Utils_ColorUtils_js__WEBPACK_IMPORTED_MODULE_6__.getHslFromAnimation)(this.strokeColor));\n }\n async init(id, position, overrideOptions, group) {\n const container = this.container,\n engine = this._engine;\n this.id = id;\n this.group = group;\n this.effectClose = true;\n this.effectFill = true;\n this.shapeClose = true;\n this.shapeFill = true;\n this.pathRotation = false;\n this.lastPathTime = 0;\n this.destroyed = false;\n this.unbreakable = false;\n this.rotation = 0;\n this.misplaced = false;\n this.retina = {\n maxDistance: {}\n };\n this.outType = \"normal\";\n this.ignoresResizeRatio = true;\n const pxRatio = container.retina.pixelRatio,\n mainOptions = container.actualOptions,\n particlesOptions = (0,_Utils_OptionsUtils_js__WEBPACK_IMPORTED_MODULE_7__.loadParticlesOptions)(this._engine, container, mainOptions.particles),\n effectType = particlesOptions.effect.type,\n shapeType = particlesOptions.shape.type,\n {\n reduceDuplicates\n } = particlesOptions;\n this.effect = (0,_Utils_Utils_js__WEBPACK_IMPORTED_MODULE_0__.itemFromSingleOrMultiple)(effectType, this.id, reduceDuplicates);\n this.shape = (0,_Utils_Utils_js__WEBPACK_IMPORTED_MODULE_0__.itemFromSingleOrMultiple)(shapeType, this.id, reduceDuplicates);\n const effectOptions = particlesOptions.effect,\n shapeOptions = particlesOptions.shape;\n if (overrideOptions) {\n if (overrideOptions.effect?.type) {\n const overrideEffectType = overrideOptions.effect.type,\n effect = (0,_Utils_Utils_js__WEBPACK_IMPORTED_MODULE_0__.itemFromSingleOrMultiple)(overrideEffectType, this.id, reduceDuplicates);\n if (effect) {\n this.effect = effect;\n effectOptions.load(overrideOptions.effect);\n }\n }\n if (overrideOptions.shape?.type) {\n const overrideShapeType = overrideOptions.shape.type,\n shape = (0,_Utils_Utils_js__WEBPACK_IMPORTED_MODULE_0__.itemFromSingleOrMultiple)(overrideShapeType, this.id, reduceDuplicates);\n if (shape) {\n this.shape = shape;\n shapeOptions.load(overrideOptions.shape);\n }\n }\n }\n this.effectData = loadEffectData(this.effect, effectOptions, this.id, reduceDuplicates);\n this.shapeData = loadShapeData(this.shape, shapeOptions, this.id, reduceDuplicates);\n particlesOptions.load(overrideOptions);\n const effectData = this.effectData;\n if (effectData) {\n particlesOptions.load(effectData.particles);\n }\n const shapeData = this.shapeData;\n if (shapeData) {\n particlesOptions.load(shapeData.particles);\n }\n const interactivity = new _Options_Classes_Interactivity_Interactivity_js__WEBPACK_IMPORTED_MODULE_8__.Interactivity(engine, container);\n interactivity.load(container.actualOptions.interactivity);\n interactivity.load(particlesOptions.interactivity);\n this.interactivity = interactivity;\n this.effectFill = effectData?.fill ?? particlesOptions.effect.fill;\n this.effectClose = effectData?.close ?? particlesOptions.effect.close;\n this.shapeFill = shapeData?.fill ?? particlesOptions.shape.fill;\n this.shapeClose = shapeData?.close ?? particlesOptions.shape.close;\n this.options = particlesOptions;\n const pathOptions = this.options.move.path;\n this.pathDelay = (0,_Utils_NumberUtils_js__WEBPACK_IMPORTED_MODULE_2__.getRangeValue)(pathOptions.delay.value) * _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_3__.millisecondsToSeconds;\n if (pathOptions.generator) {\n this.pathGenerator = this._engine.getPathGenerator(pathOptions.generator);\n if (this.pathGenerator && container.addPath(pathOptions.generator, this.pathGenerator)) {\n await this.pathGenerator.init(container);\n }\n }\n container.retina.initParticle(this);\n this.size = (0,_Utils_Utils_js__WEBPACK_IMPORTED_MODULE_0__.initParticleNumericAnimationValue)(this.options.size, pxRatio);\n this.bubble = {\n inRange: false\n };\n this.slow = {\n inRange: false,\n factor: 1\n };\n this._initPosition(position);\n this.initialVelocity = this._calculateVelocity();\n this.velocity = this.initialVelocity.copy();\n const decayOffset = 1;\n this.moveDecay = decayOffset - (0,_Utils_NumberUtils_js__WEBPACK_IMPORTED_MODULE_2__.getRangeValue)(this.options.move.decay);\n const particles = container.particles;\n particles.setLastZIndex(this.position.z);\n this.zIndexFactor = this.position.z / container.zLayers;\n this.sides = 24;\n let effectDrawer = container.effectDrawers.get(this.effect);\n if (!effectDrawer) {\n effectDrawer = this._engine.getEffectDrawer(this.effect);\n if (effectDrawer) {\n container.effectDrawers.set(this.effect, effectDrawer);\n }\n }\n if (effectDrawer?.loadEffect) {\n await effectDrawer.loadEffect(this);\n }\n let shapeDrawer = container.shapeDrawers.get(this.shape);\n if (!shapeDrawer) {\n shapeDrawer = this._engine.getShapeDrawer(this.shape);\n if (shapeDrawer) {\n container.shapeDrawers.set(this.shape, shapeDrawer);\n }\n }\n if (shapeDrawer?.loadShape) {\n await shapeDrawer.loadShape(this);\n }\n const sideCountFunc = shapeDrawer?.getSidesCount;\n if (sideCountFunc) {\n this.sides = sideCountFunc(this);\n }\n this.spawning = false;\n this.shadowColor = (0,_Utils_ColorUtils_js__WEBPACK_IMPORTED_MODULE_6__.rangeColorToRgb)(this.options.shadow.color);\n for (const updater of particles.updaters) {\n await updater.init(this);\n }\n for (const mover of particles.movers) {\n await mover.init?.(this);\n }\n await effectDrawer?.particleInit?.(container, this);\n await shapeDrawer?.particleInit?.(container, this);\n for (const [, plugin] of container.plugins) {\n plugin.particleCreated?.(this);\n }\n }\n isInsideCanvas() {\n const radius = this.getRadius(),\n canvasSize = this.container.canvas.size,\n position = this.position;\n return position.x >= -radius && position.y >= -radius && position.y <= canvasSize.height + radius && position.x <= canvasSize.width + radius;\n }\n isVisible() {\n return !this.destroyed && !this.spawning && this.isInsideCanvas();\n }\n reset() {\n for (const updater of this.container.particles.updaters) {\n updater.reset?.(this);\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/engine/./dist/browser/Core/Particle.js?");
29
-
30
- /***/ })
31
-
32
- }]);
@@ -1,28 +0,0 @@
1
- import { Range } from "./Range.js";
2
- import { Rectangle } from "./Rectangle.js";
3
- import { getDistance } from "../../Utils/NumberUtils.js";
4
- const squareExp = 2;
5
- export class Circle extends Range {
6
- constructor(x, y, radius) {
7
- super(x, y);
8
- this.radius = radius;
9
- }
10
- contains(point) {
11
- return getDistance(point, this.position) <= this.radius;
12
- }
13
- intersects(range) {
14
- const pos1 = this.position, pos2 = range.position, distPos = { x: Math.abs(pos2.x - pos1.x), y: Math.abs(pos2.y - pos1.y) }, r = this.radius;
15
- if (range instanceof Circle) {
16
- const rSum = r + range.radius, dist = Math.sqrt(distPos.x ** squareExp + distPos.y ** squareExp);
17
- return rSum > dist;
18
- }
19
- else if (range instanceof Rectangle) {
20
- const { width, height } = range.size, edges = Math.pow(distPos.x - width, squareExp) + Math.pow(distPos.y - height, squareExp);
21
- return (edges <= r ** squareExp ||
22
- (distPos.x <= r + width && distPos.y <= r + height) ||
23
- distPos.x <= width ||
24
- distPos.y <= height);
25
- }
26
- return false;
27
- }
28
- }
@@ -1,8 +0,0 @@
1
- export class Range {
2
- constructor(x, y) {
3
- this.position = {
4
- x: x,
5
- y: y,
6
- };
7
- }
8
- }
@@ -1,22 +0,0 @@
1
- import { Circle } from "./Circle.js";
2
- import { Range } from "./Range.js";
3
- export class Rectangle extends Range {
4
- constructor(x, y, width, height) {
5
- super(x, y);
6
- this.size = {
7
- height: height,
8
- width: width,
9
- };
10
- }
11
- contains(point) {
12
- const w = this.size.width, h = this.size.height, pos = this.position;
13
- return point.x >= pos.x && point.x <= pos.x + w && point.y >= pos.y && point.y <= pos.y + h;
14
- }
15
- intersects(range) {
16
- if (range instanceof Circle) {
17
- range.intersects(this);
18
- }
19
- const w = this.size.width, h = this.size.height, pos1 = this.position, pos2 = range.position, size2 = range instanceof Rectangle ? range.size : { width: 0, height: 0 }, w2 = size2.width, h2 = size2.height;
20
- return pos2.x < pos1.x + w && pos2.x + w2 > pos1.x && pos2.y < pos1.y + h && pos2.y + h2 > pos1.y;
21
- }
22
- }
@@ -1,20 +0,0 @@
1
- import { Vector3d } from "./Vector3d.js";
2
- const origin = {
3
- x: 0,
4
- y: 0,
5
- z: 0,
6
- };
7
- export class Vector extends Vector3d {
8
- constructor(xOrCoords, y) {
9
- super(xOrCoords, y, origin.z);
10
- }
11
- static get origin() {
12
- return Vector.create(origin.x, origin.y);
13
- }
14
- static clone(source) {
15
- return Vector.create(source.x, source.y);
16
- }
17
- static create(x, y) {
18
- return new Vector(x, y);
19
- }
20
- }
@@ -1,8 +0,0 @@
1
- import type { ICoordinates } from "../Interfaces/ICoordinates.js";
2
- import { Range } from "./Range.js";
3
- export declare class Circle extends Range {
4
- readonly radius: number;
5
- constructor(x: number, y: number, radius: number);
6
- contains(point: ICoordinates): boolean;
7
- intersects(range: Range): boolean;
8
- }