@tsparticles/fireworks 3.0.3 → 3.2.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 (136) hide show
  1. package/108.min.js +2 -0
  2. package/108.min.js.LICENSE.txt +1 -0
  3. package/120.min.js +2 -0
  4. package/120.min.js.LICENSE.txt +1 -0
  5. package/126.min.js +2 -0
  6. package/126.min.js.LICENSE.txt +1 -0
  7. package/132.min.js +2 -0
  8. package/132.min.js.LICENSE.txt +1 -0
  9. package/141.min.js +2 -0
  10. package/141.min.js.LICENSE.txt +1 -0
  11. package/163.min.js +2 -0
  12. package/163.min.js.LICENSE.txt +1 -0
  13. package/173.min.js +2 -0
  14. package/173.min.js.LICENSE.txt +1 -0
  15. package/196.min.js +2 -0
  16. package/196.min.js.LICENSE.txt +1 -0
  17. package/245.min.js +2 -0
  18. package/245.min.js.LICENSE.txt +1 -0
  19. package/274.min.js +2 -0
  20. package/274.min.js.LICENSE.txt +1 -0
  21. package/30.min.js +2 -0
  22. package/30.min.js.LICENSE.txt +1 -0
  23. package/308.min.js +2 -0
  24. package/308.min.js.LICENSE.txt +1 -0
  25. package/31.min.js +2 -0
  26. package/31.min.js.LICENSE.txt +1 -0
  27. package/328.min.js +2 -0
  28. package/328.min.js.LICENSE.txt +1 -0
  29. package/329.min.js +2 -0
  30. package/329.min.js.LICENSE.txt +1 -0
  31. package/376.min.js +2 -0
  32. package/376.min.js.LICENSE.txt +1 -0
  33. package/468.min.js +2 -0
  34. package/468.min.js.LICENSE.txt +1 -0
  35. package/49.min.js +2 -0
  36. package/49.min.js.LICENSE.txt +1 -0
  37. package/547.min.js +2 -0
  38. package/547.min.js.LICENSE.txt +1 -0
  39. package/560.min.js +2 -0
  40. package/560.min.js.LICENSE.txt +1 -0
  41. package/580.min.js +2 -0
  42. package/580.min.js.LICENSE.txt +1 -0
  43. package/610.min.js +2 -0
  44. package/610.min.js.LICENSE.txt +1 -0
  45. package/647.min.js +2 -0
  46. package/647.min.js.LICENSE.txt +1 -0
  47. package/648.min.js +2 -0
  48. package/648.min.js.LICENSE.txt +1 -0
  49. package/720.min.js +2 -0
  50. package/720.min.js.LICENSE.txt +1 -0
  51. package/725.min.js +2 -0
  52. package/725.min.js.LICENSE.txt +1 -0
  53. package/749.min.js +2 -0
  54. package/749.min.js.LICENSE.txt +1 -0
  55. package/757.min.js +2 -0
  56. package/757.min.js.LICENSE.txt +1 -0
  57. package/81.min.js +2 -0
  58. package/81.min.js.LICENSE.txt +1 -0
  59. package/835.min.js +2 -0
  60. package/835.min.js.LICENSE.txt +1 -0
  61. package/837.min.js +2 -0
  62. package/837.min.js.LICENSE.txt +1 -0
  63. package/859.min.js +2 -0
  64. package/859.min.js.LICENSE.txt +1 -0
  65. package/866.min.js +2 -0
  66. package/866.min.js.LICENSE.txt +1 -0
  67. package/88.min.js +2 -0
  68. package/88.min.js.LICENSE.txt +1 -0
  69. package/886.min.js +2 -0
  70. package/886.min.js.LICENSE.txt +1 -0
  71. package/921.min.js +2 -0
  72. package/921.min.js.LICENSE.txt +1 -0
  73. package/929.min.js +2 -0
  74. package/929.min.js.LICENSE.txt +1 -0
  75. package/937.min.js +2 -0
  76. package/937.min.js.LICENSE.txt +1 -0
  77. package/952.min.js +2 -0
  78. package/952.min.js.LICENSE.txt +1 -0
  79. package/973.min.js +2 -0
  80. package/973.min.js.LICENSE.txt +1 -0
  81. package/994.min.js +2 -0
  82. package/994.min.js.LICENSE.txt +1 -0
  83. package/basic_dist_browser_index_js.js +30 -0
  84. package/browser/fireworks.js +9 -19
  85. package/cjs/fireworks.js +40 -27
  86. package/effects_trail_dist_browser_TrailDrawer_js.js +30 -0
  87. package/effects_trail_dist_browser_index_js.js +30 -0
  88. package/engine_dist_browser_Core_Container_js.js +90 -0
  89. package/engine_dist_browser_Core_Particle_js.js +30 -0
  90. package/esm/fireworks.js +9 -19
  91. package/move_base_dist_browser_BaseMover_js.js +30 -0
  92. package/move_base_dist_browser_Utils_js.js +30 -0
  93. package/move_base_dist_browser_index_js.js +30 -0
  94. package/package.json +10 -12
  95. package/plugins_emittersShapes_square_dist_browser_EmittersSquareShapeGenerator_js.js +120 -0
  96. package/plugins_emittersShapes_square_dist_browser_index_js.js +30 -0
  97. package/plugins_emitters_dist_browser_EmitterInstance_js.js +30 -0
  98. package/plugins_emitters_dist_browser_EmittersPlugin_js.js +90 -0
  99. package/plugins_emitters_dist_browser_Emitters_js.js +30 -0
  100. package/plugins_emitters_dist_browser_ShapeManager_js.js +30 -0
  101. package/plugins_emitters_dist_browser_index_js.js +100 -0
  102. package/plugins_sounds_dist_browser_SoundsInstance_js.js +30 -0
  103. package/plugins_sounds_dist_browser_SoundsPlugin_js.js +120 -0
  104. package/plugins_sounds_dist_browser_index_js.js +30 -0
  105. package/report.html +3 -3
  106. package/shapes_circle_dist_browser_CircleDrawer_js.js +30 -0
  107. package/shapes_circle_dist_browser_Utils_js.js +30 -0
  108. package/shapes_circle_dist_browser_index_js.js +30 -0
  109. package/tsparticles.fireworks.bundle.js +2141 -8995
  110. package/tsparticles.fireworks.bundle.min.js +1 -1
  111. package/tsparticles.fireworks.bundle.min.js.LICENSE.txt +1 -1
  112. package/tsparticles.fireworks.js +128 -407
  113. package/tsparticles.fireworks.min.js +1 -1
  114. package/tsparticles.fireworks.min.js.LICENSE.txt +1 -1
  115. package/types/fireworks.d.ts +1 -1
  116. package/umd/fireworks.js +42 -28
  117. package/updaters_color_dist_browser_ColorUpdater_js.js +30 -0
  118. package/updaters_color_dist_browser_index_js.js +30 -0
  119. package/updaters_destroy_dist_browser_DestroyUpdater_js.js +90 -0
  120. package/updaters_destroy_dist_browser_index_js.js +30 -0
  121. package/updaters_life_dist_browser_LifeUpdater_js.js +60 -0
  122. package/updaters_life_dist_browser_Utils_js.js +30 -0
  123. package/updaters_life_dist_browser_index_js.js +30 -0
  124. package/updaters_opacity_dist_browser_OpacityUpdater_js.js +30 -0
  125. package/updaters_opacity_dist_browser_index_js.js +30 -0
  126. package/updaters_outModes_dist_browser_BounceOutMode_js.js +30 -0
  127. package/updaters_outModes_dist_browser_DestroyOutMode_js.js +30 -0
  128. package/updaters_outModes_dist_browser_NoneOutMode_js.js +30 -0
  129. package/updaters_outModes_dist_browser_OutOfCanvasUpdater_js.js +30 -0
  130. package/updaters_outModes_dist_browser_OutOutMode_js.js +30 -0
  131. package/updaters_outModes_dist_browser_Utils_js.js +30 -0
  132. package/updaters_outModes_dist_browser_index_js.js +30 -0
  133. package/updaters_rotate_dist_browser_RotateUpdater_js.js +50 -0
  134. package/updaters_rotate_dist_browser_index_js.js +30 -0
  135. package/updaters_size_dist_browser_SizeUpdater_js.js +30 -0
  136. package/updaters_size_dist_browser_index_js.js +30 -0
package/esm/fireworks.js CHANGED
@@ -1,20 +1,11 @@
1
1
  import { getRangeMax, getRangeMin, isNumber, isSsr, isString, setRangeValue, tsParticles, } from "@tsparticles/engine";
2
2
  import { FireworkOptions } from "./FireworkOptions.js";
3
- import { loadBasic } from "@tsparticles/basic";
4
- import { loadDestroyUpdater } from "@tsparticles/updater-destroy";
5
- import { loadEmittersPlugin } from "@tsparticles/plugin-emitters";
6
- import { loadEmittersShapeSquare } from "@tsparticles/plugin-emitters-shape-square";
7
- import { loadLifeUpdater } from "@tsparticles/updater-life";
8
- import { loadLineShape } from "@tsparticles/shape-line";
9
- import { loadRotateUpdater } from "@tsparticles/updater-rotate";
10
- import { loadSoundsPlugin } from "@tsparticles/plugin-sounds";
11
- import { loadStrokeColorUpdater } from "@tsparticles/updater-stroke-color";
12
- import { loadTrailEffect } from "@tsparticles/effect-trail";
3
+ const minSplitCount = 2;
13
4
  let initialized = false;
14
5
  let initializing = false;
15
6
  const explodeSoundCheck = (args) => {
16
7
  const data = args.data;
17
- return data.particle.shape === "circle" && !!data.particle.splitCount && data.particle.splitCount < 2;
8
+ return data.particle.shape === "circle" && !!data.particle.splitCount && data.particle.splitCount < minSplitCount;
18
9
  };
19
10
  class FireworksInstance {
20
11
  constructor(container) {
@@ -36,24 +27,23 @@ async function initPlugins() {
36
27
  }
37
28
  if (initializing) {
38
29
  return new Promise((resolve) => {
39
- const interval = setInterval(() => {
30
+ const timeout = 100, interval = setInterval(() => {
40
31
  if (!initialized) {
41
32
  return;
42
33
  }
43
34
  clearInterval(interval);
44
35
  resolve();
45
- }, 100);
36
+ }, timeout);
46
37
  });
47
38
  }
48
39
  initializing = true;
40
+ const { loadEmittersPlugin } = await import("@tsparticles/plugin-emitters"), { loadEmittersShapeSquare } = await import("@tsparticles/plugin-emitters-shape-square"), { loadSoundsPlugin } = await import("@tsparticles/plugin-sounds"), { loadRotateUpdater } = await import("@tsparticles/updater-rotate"), { loadDestroyUpdater } = await import("@tsparticles/updater-destroy"), { loadLifeUpdater } = await import("@tsparticles/updater-life"), { loadTrailEffect } = await import("@tsparticles/effect-trail"), { loadBasic } = await import("@tsparticles/basic");
49
41
  await loadEmittersPlugin(tsParticles, false);
50
42
  await loadEmittersShapeSquare(tsParticles, false);
51
43
  await loadSoundsPlugin(tsParticles, false);
52
- await loadLineShape(tsParticles, false);
53
44
  await loadRotateUpdater(tsParticles, false);
54
45
  await loadDestroyUpdater(tsParticles, false);
55
46
  await loadLifeUpdater(tsParticles, false);
56
- await loadStrokeColorUpdater(tsParticles, false);
57
47
  await loadTrailEffect(tsParticles, false);
58
48
  await loadBasic(tsParticles, false);
59
49
  initializing = false;
@@ -71,7 +61,7 @@ export async function fireworks(idOrOptions, sourceOptions) {
71
61
  id = "fireworks";
72
62
  options.load(idOrOptions);
73
63
  }
74
- const particlesOptions = {
64
+ const identity = 1, particlesOptions = {
75
65
  detectRetina: true,
76
66
  background: {
77
67
  color: options.background,
@@ -86,8 +76,8 @@ export async function fireworks(idOrOptions, sourceOptions) {
86
76
  },
87
77
  rate: {
88
78
  delay: isNumber(options.rate)
89
- ? 1 / options.rate
90
- : { min: 1 / getRangeMin(options.rate), max: 1 / getRangeMax(options.rate) },
79
+ ? identity / options.rate
80
+ : { min: identity / getRangeMin(options.rate), max: identity / getRangeMax(options.rate) },
91
81
  quantity: 1,
92
82
  },
93
83
  size: {
@@ -243,7 +233,7 @@ export async function fireworks(idOrOptions, sourceOptions) {
243
233
  enable: options.sounds,
244
234
  events: [
245
235
  {
246
- event: "particleDestroyed",
236
+ event: "particleRemoved",
247
237
  filter: explodeSoundCheck,
248
238
  audio: [
249
239
  "https://particles.js.org/audio/explosion0.mp3",
@@ -0,0 +1,30 @@
1
+ /*!
2
+ * Author : Matteo Bruni
3
+ * MIT license: https://opensource.org/licenses/MIT
4
+ * Demo / Generator : https://particles.js.org/
5
+ * GitHub : https://www.github.com/matteobruni/tsparticles
6
+ * How to use? : Check the GitHub README
7
+ * v3.2.0
8
+ */
9
+ "use strict";
10
+ /*
11
+ * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
12
+ * This devtool is neither made for production nor for readable output files.
13
+ * It uses "eval()" calls to create a separate source file in the browser devtools.
14
+ * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
15
+ * or disable the default devtool with "devtool: false".
16
+ * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
17
+ */
18
+ (this["webpackChunk_tsparticles_fireworks"] = this["webpackChunk_tsparticles_fireworks"] || []).push([["move_base_dist_browser_BaseMover_js"],{
19
+
20
+ /***/ "../../move/base/dist/browser/BaseMover.js":
21
+ /*!*************************************************!*\
22
+ !*** ../../move/base/dist/browser/BaseMover.js ***!
23
+ \*************************************************/
24
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
25
+
26
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ BaseMover: () => (/* binding */ BaseMover)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"../../engine/dist/browser/index.js\");\n\nconst diffFactor = 2,\n defaultSizeFactor = 1,\n defaultDeltaFactor = 1;\nclass BaseMover {\n async init(particle) {\n const options = particle.options,\n gravityOptions = options.move.gravity;\n particle.gravity = {\n enable: gravityOptions.enable,\n acceleration: (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(gravityOptions.acceleration),\n inverse: gravityOptions.inverse\n };\n const {\n initSpin\n } = await __webpack_require__.e(/*! import() */ \"move_base_dist_browser_Utils_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./Utils.js */ \"../../move/base/dist/browser/Utils.js\"));\n initSpin(particle);\n await Promise.resolve();\n }\n isEnabled(particle) {\n return !particle.destroyed && particle.options.move.enable;\n }\n async move(particle, delta) {\n const particleOptions = particle.options,\n moveOptions = particleOptions.move;\n if (!moveOptions.enable) {\n return;\n }\n const container = particle.container,\n pxRatio = container.retina.pixelRatio;\n particle.retina.moveSpeed ??= (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(moveOptions.speed) * pxRatio;\n particle.retina.moveDrift ??= (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(particle.options.move.drift) * pxRatio;\n const {\n getProximitySpeedFactor\n } = await __webpack_require__.e(/*! import() */ \"move_base_dist_browser_Utils_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./Utils.js */ \"../../move/base/dist/browser/Utils.js\")),\n slowFactor = getProximitySpeedFactor(particle),\n baseSpeed = particle.retina.moveSpeed * container.retina.reduceFactor,\n moveDrift = particle.retina.moveDrift,\n maxSize = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeMax)(particleOptions.size.value) * pxRatio,\n sizeFactor = moveOptions.size ? particle.getRadius() / maxSize : defaultSizeFactor,\n deltaFactor = delta.factor || defaultDeltaFactor,\n moveSpeed = baseSpeed * sizeFactor * slowFactor * deltaFactor / diffFactor,\n maxSpeed = particle.retina.maxSpeed ?? container.retina.maxSpeed;\n if (moveOptions.spin.enable) {\n const {\n spin\n } = await __webpack_require__.e(/*! import() */ \"move_base_dist_browser_Utils_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./Utils.js */ \"../../move/base/dist/browser/Utils.js\"));\n spin(particle, moveSpeed);\n } else {\n const {\n move\n } = await __webpack_require__.e(/*! import() */ \"move_base_dist_browser_Utils_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./Utils.js */ \"../../move/base/dist/browser/Utils.js\"));\n await move(particle, moveOptions, moveSpeed, maxSpeed, moveDrift, delta);\n }\n const {\n applyDistance\n } = await __webpack_require__.e(/*! import() */ \"move_base_dist_browser_Utils_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./Utils.js */ \"../../move/base/dist/browser/Utils.js\"));\n applyDistance(particle);\n }\n}\n\n//# sourceURL=webpack://@tsparticles/fireworks/../../move/base/dist/browser/BaseMover.js?");
27
+
28
+ /***/ })
29
+
30
+ }]);
@@ -0,0 +1,30 @@
1
+ /*!
2
+ * Author : Matteo Bruni
3
+ * MIT license: https://opensource.org/licenses/MIT
4
+ * Demo / Generator : https://particles.js.org/
5
+ * GitHub : https://www.github.com/matteobruni/tsparticles
6
+ * How to use? : Check the GitHub README
7
+ * v3.2.0
8
+ */
9
+ "use strict";
10
+ /*
11
+ * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
12
+ * This devtool is neither made for production nor for readable output files.
13
+ * It uses "eval()" calls to create a separate source file in the browser devtools.
14
+ * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
15
+ * or disable the default devtool with "devtool: false".
16
+ * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
17
+ */
18
+ (this["webpackChunk_tsparticles_fireworks"] = this["webpackChunk_tsparticles_fireworks"] || []).push([["move_base_dist_browser_Utils_js"],{
19
+
20
+ /***/ "../../move/base/dist/browser/Utils.js":
21
+ /*!*********************************************!*\
22
+ !*** ../../move/base/dist/browser/Utils.js ***!
23
+ \*********************************************/
24
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
25
+
26
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ applyDistance: () => (/* binding */ applyDistance),\n/* harmony export */ applyPath: () => (/* binding */ applyPath),\n/* harmony export */ getProximitySpeedFactor: () => (/* binding */ getProximitySpeedFactor),\n/* harmony export */ initSpin: () => (/* binding */ initSpin),\n/* harmony export */ move: () => (/* binding */ move),\n/* harmony export */ spin: () => (/* binding */ spin)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"../../engine/dist/browser/index.js\");\n\nconst half = 0.5,\n minVelocity = 0,\n identity = 1,\n moveSpeedFactor = 60,\n minSpinRadius = 0,\n spinFactor = 0.01;\nfunction applyDistance(particle) {\n const initialPosition = particle.initialPosition,\n {\n dx,\n dy\n } = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getDistances)(initialPosition, particle.position),\n dxFixed = Math.abs(dx),\n dyFixed = Math.abs(dy),\n {\n maxDistance\n } = particle.retina,\n hDistance = maxDistance.horizontal,\n vDistance = maxDistance.vertical;\n if (!hDistance && !vDistance) {\n return;\n }\n const hasHDistance = (hDistance && dxFixed >= hDistance) ?? false,\n hasVDistance = (vDistance && dyFixed >= vDistance) ?? false;\n if ((hasHDistance || hasVDistance) && !particle.misplaced) {\n particle.misplaced = !!hDistance && dxFixed > hDistance || !!vDistance && dyFixed > vDistance;\n if (hDistance) {\n particle.velocity.x = particle.velocity.y * half - particle.velocity.x;\n }\n if (vDistance) {\n particle.velocity.y = particle.velocity.x * half - particle.velocity.y;\n }\n } else if ((!hDistance || dxFixed < hDistance) && (!vDistance || dyFixed < vDistance) && particle.misplaced) {\n particle.misplaced = false;\n } else if (particle.misplaced) {\n const pos = particle.position,\n vel = particle.velocity;\n if (hDistance && (pos.x < initialPosition.x && vel.x < minVelocity || pos.x > initialPosition.x && vel.x > minVelocity)) {\n vel.x *= -(0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRandom)();\n }\n if (vDistance && (pos.y < initialPosition.y && vel.y < minVelocity || pos.y > initialPosition.y && vel.y > minVelocity)) {\n vel.y *= -(0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRandom)();\n }\n }\n}\nasync function move(particle, moveOptions, moveSpeed, maxSpeed, moveDrift, delta) {\n await applyPath(particle, delta);\n const gravityOptions = particle.gravity,\n gravityFactor = gravityOptions?.enable && gravityOptions.inverse ? -identity : identity;\n if (moveDrift && moveSpeed) {\n particle.velocity.x += moveDrift * delta.factor / (moveSpeedFactor * moveSpeed);\n }\n if (gravityOptions?.enable && moveSpeed) {\n particle.velocity.y += gravityFactor * (gravityOptions.acceleration * delta.factor) / (moveSpeedFactor * moveSpeed);\n }\n const decay = particle.moveDecay;\n particle.velocity.multTo(decay);\n const velocity = particle.velocity.mult(moveSpeed);\n if (gravityOptions?.enable && maxSpeed > minVelocity && (!gravityOptions.inverse && velocity.y >= minVelocity && velocity.y >= maxSpeed || gravityOptions.inverse && velocity.y <= minVelocity && velocity.y <= -maxSpeed)) {\n velocity.y = gravityFactor * maxSpeed;\n if (moveSpeed) {\n particle.velocity.y = velocity.y / moveSpeed;\n }\n }\n const zIndexOptions = particle.options.zIndex,\n zVelocityFactor = (identity - particle.zIndexFactor) ** zIndexOptions.velocityRate;\n velocity.multTo(zVelocityFactor);\n const {\n position\n } = particle;\n position.addTo(velocity);\n if (moveOptions.vibrate) {\n position.x += Math.sin(position.x * Math.cos(position.y));\n position.y += Math.cos(position.y * Math.sin(position.x));\n }\n}\nfunction spin(particle, moveSpeed) {\n const container = particle.container;\n if (!particle.spin) {\n return;\n }\n const updateFunc = {\n x: particle.spin.direction === \"clockwise\" ? Math.cos : Math.sin,\n y: particle.spin.direction === \"clockwise\" ? Math.sin : Math.cos\n };\n particle.position.x = particle.spin.center.x + particle.spin.radius * updateFunc.x(particle.spin.angle);\n particle.position.y = particle.spin.center.y + particle.spin.radius * updateFunc.y(particle.spin.angle);\n particle.spin.radius += particle.spin.acceleration;\n const maxCanvasSize = Math.max(container.canvas.size.width, container.canvas.size.height),\n halfMaxSize = maxCanvasSize * half;\n if (particle.spin.radius > halfMaxSize) {\n particle.spin.radius = halfMaxSize;\n particle.spin.acceleration *= -identity;\n } else if (particle.spin.radius < minSpinRadius) {\n particle.spin.radius = minSpinRadius;\n particle.spin.acceleration *= -identity;\n }\n particle.spin.angle += moveSpeed * spinFactor * (identity - particle.spin.radius / maxCanvasSize);\n}\nasync function applyPath(particle, delta) {\n const particlesOptions = particle.options,\n pathOptions = particlesOptions.move.path,\n pathEnabled = pathOptions.enable;\n if (!pathEnabled) {\n return;\n }\n if (particle.lastPathTime <= particle.pathDelay) {\n particle.lastPathTime += delta.value;\n return;\n }\n const path = await particle.pathGenerator?.generate(particle, delta);\n if (path) {\n particle.velocity.addTo(path);\n }\n if (pathOptions.clamp) {\n particle.velocity.x = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.clamp)(particle.velocity.x, -identity, identity);\n particle.velocity.y = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.clamp)(particle.velocity.y, -identity, identity);\n }\n particle.lastPathTime -= particle.pathDelay;\n}\nfunction getProximitySpeedFactor(particle) {\n return particle.slow.inRange ? particle.slow.factor : identity;\n}\nfunction initSpin(particle) {\n const container = particle.container,\n options = particle.options,\n spinOptions = options.move.spin;\n if (!spinOptions.enable) {\n return;\n }\n const spinPos = spinOptions.position ?? {\n x: 50,\n y: 50\n },\n spinFactor = 0.01,\n spinCenter = {\n x: spinPos.x * spinFactor * container.canvas.size.width,\n y: spinPos.y * spinFactor * container.canvas.size.height\n },\n pos = particle.getPosition(),\n distance = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getDistance)(pos, spinCenter),\n spinAcceleration = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(spinOptions.acceleration);\n particle.retina.spinAcceleration = spinAcceleration * container.retina.pixelRatio;\n const minVelocity = 0;\n particle.spin = {\n center: spinCenter,\n direction: particle.velocity.x >= minVelocity ? \"clockwise\" : \"counter-clockwise\",\n angle: particle.velocity.angle,\n radius: distance,\n acceleration: particle.retina.spinAcceleration\n };\n}\n\n//# sourceURL=webpack://@tsparticles/fireworks/../../move/base/dist/browser/Utils.js?");
27
+
28
+ /***/ })
29
+
30
+ }]);
@@ -0,0 +1,30 @@
1
+ /*!
2
+ * Author : Matteo Bruni
3
+ * MIT license: https://opensource.org/licenses/MIT
4
+ * Demo / Generator : https://particles.js.org/
5
+ * GitHub : https://www.github.com/matteobruni/tsparticles
6
+ * How to use? : Check the GitHub README
7
+ * v3.2.0
8
+ */
9
+ "use strict";
10
+ /*
11
+ * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
12
+ * This devtool is neither made for production nor for readable output files.
13
+ * It uses "eval()" calls to create a separate source file in the browser devtools.
14
+ * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
15
+ * or disable the default devtool with "devtool: false".
16
+ * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
17
+ */
18
+ (this["webpackChunk_tsparticles_fireworks"] = this["webpackChunk_tsparticles_fireworks"] || []).push([["move_base_dist_browser_index_js"],{
19
+
20
+ /***/ "../../move/base/dist/browser/index.js":
21
+ /*!*********************************************!*\
22
+ !*** ../../move/base/dist/browser/index.js ***!
23
+ \*********************************************/
24
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
25
+
26
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadBaseMover: () => (/* binding */ loadBaseMover)\n/* harmony export */ });\nasync function loadBaseMover(engine, refresh = true) {\n await engine.addMover(\"base\", async () => {\n const {\n BaseMover\n } = await __webpack_require__.e(/*! import() */ \"move_base_dist_browser_BaseMover_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./BaseMover.js */ \"../../move/base/dist/browser/BaseMover.js\"));\n return new BaseMover();\n }, refresh);\n}\n\n//# sourceURL=webpack://@tsparticles/fireworks/../../move/base/dist/browser/index.js?");
27
+
28
+ /***/ })
29
+
30
+ }]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsparticles/fireworks",
3
- "version": "3.0.3",
3
+ "version": "3.2.0",
4
4
  "description": "Easily create highly customizable particle animations and use them as animated backgrounds for your website. Ready to use components available also for React, Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact, Riot.js, Inferno.",
5
5
  "homepage": "https://particles.js.org",
6
6
  "repository": {
@@ -99,17 +99,15 @@
99
99
  "./package.json": "./package.json"
100
100
  },
101
101
  "dependencies": {
102
- "@tsparticles/basic": "^3.0.3",
103
- "@tsparticles/effect-trail": "^3.0.3",
104
- "@tsparticles/engine": "^3.0.3",
105
- "@tsparticles/plugin-emitters": "^3.0.3",
106
- "@tsparticles/plugin-emitters-shape-square": "^3.0.3",
107
- "@tsparticles/plugin-sounds": "^3.0.3",
108
- "@tsparticles/shape-line": "^3.0.3",
109
- "@tsparticles/updater-destroy": "^3.0.3",
110
- "@tsparticles/updater-life": "^3.0.3",
111
- "@tsparticles/updater-rotate": "^3.0.3",
112
- "@tsparticles/updater-stroke-color": "^3.0.3"
102
+ "@tsparticles/basic": "^3.2.0",
103
+ "@tsparticles/effect-trail": "^3.2.0",
104
+ "@tsparticles/engine": "^3.2.0",
105
+ "@tsparticles/plugin-emitters": "^3.2.0",
106
+ "@tsparticles/plugin-emitters-shape-square": "^3.2.0",
107
+ "@tsparticles/plugin-sounds": "^3.2.0",
108
+ "@tsparticles/updater-destroy": "^3.2.0",
109
+ "@tsparticles/updater-life": "^3.2.0",
110
+ "@tsparticles/updater-rotate": "^3.2.0"
113
111
  },
114
112
  "publishConfig": {
115
113
  "access": "public"
@@ -0,0 +1,120 @@
1
+ /*!
2
+ * Author : Matteo Bruni
3
+ * MIT license: https://opensource.org/licenses/MIT
4
+ * Demo / Generator : https://particles.js.org/
5
+ * GitHub : https://www.github.com/matteobruni/tsparticles
6
+ * How to use? : Check the GitHub README
7
+ * v3.2.0
8
+ */
9
+ "use strict";
10
+ /*
11
+ * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
12
+ * This devtool is neither made for production nor for readable output files.
13
+ * It uses "eval()" calls to create a separate source file in the browser devtools.
14
+ * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
15
+ * or disable the default devtool with "devtool: false".
16
+ * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
17
+ */
18
+ (this["webpackChunk_tsparticles_fireworks"] = this["webpackChunk_tsparticles_fireworks"] || []).push([["plugins_emittersShapes_square_dist_browser_EmittersSquareShapeGenerator_js"],{
19
+
20
+ /***/ "../../plugins/emitters/dist/browser/EmitterContainer.js":
21
+ /*!***************************************************************!*\
22
+ !*** ../../plugins/emitters/dist/browser/EmitterContainer.js ***!
23
+ \***************************************************************/
24
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
25
+
26
+ eval("__webpack_require__.r(__webpack_exports__);\n\n\n//# sourceURL=webpack://@tsparticles/fireworks/../../plugins/emitters/dist/browser/EmitterContainer.js?");
27
+
28
+ /***/ }),
29
+
30
+ /***/ "../../plugins/emitters/dist/browser/EmitterShapeBase.js":
31
+ /*!***************************************************************!*\
32
+ !*** ../../plugins/emitters/dist/browser/EmitterShapeBase.js ***!
33
+ \***************************************************************/
34
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
35
+
36
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ EmitterShapeBase: () => (/* binding */ EmitterShapeBase)\n/* harmony export */ });\nclass EmitterShapeBase {\n constructor(position, size, fill, options) {\n this.position = position;\n this.size = size;\n this.fill = fill;\n this.options = options;\n }\n resize(position, size) {\n this.position = position;\n this.size = size;\n }\n}\n\n//# sourceURL=webpack://@tsparticles/fireworks/../../plugins/emitters/dist/browser/EmitterShapeBase.js?");
37
+
38
+ /***/ }),
39
+
40
+ /***/ "../../plugins/emitters/dist/browser/EmittersEngine.js":
41
+ /*!*************************************************************!*\
42
+ !*** ../../plugins/emitters/dist/browser/EmittersEngine.js ***!
43
+ \*************************************************************/
44
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
45
+
46
+ eval("__webpack_require__.r(__webpack_exports__);\n\n\n//# sourceURL=webpack://@tsparticles/fireworks/../../plugins/emitters/dist/browser/EmittersEngine.js?");
47
+
48
+ /***/ }),
49
+
50
+ /***/ "../../plugins/emitters/dist/browser/Enums/EmitterClickMode.js":
51
+ /*!*********************************************************************!*\
52
+ !*** ../../plugins/emitters/dist/browser/Enums/EmitterClickMode.js ***!
53
+ \*********************************************************************/
54
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
55
+
56
+ eval("__webpack_require__.r(__webpack_exports__);\n\n\n//# sourceURL=webpack://@tsparticles/fireworks/../../plugins/emitters/dist/browser/Enums/EmitterClickMode.js?");
57
+
58
+ /***/ }),
59
+
60
+ /***/ "../../plugins/emitters/dist/browser/IEmitterShape.js":
61
+ /*!************************************************************!*\
62
+ !*** ../../plugins/emitters/dist/browser/IEmitterShape.js ***!
63
+ \************************************************************/
64
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
65
+
66
+ eval("__webpack_require__.r(__webpack_exports__);\n\n\n//# sourceURL=webpack://@tsparticles/fireworks/../../plugins/emitters/dist/browser/IEmitterShape.js?");
67
+
68
+ /***/ }),
69
+
70
+ /***/ "../../plugins/emitters/dist/browser/IEmitterShapeGenerator.js":
71
+ /*!*********************************************************************!*\
72
+ !*** ../../plugins/emitters/dist/browser/IEmitterShapeGenerator.js ***!
73
+ \*********************************************************************/
74
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
75
+
76
+ eval("__webpack_require__.r(__webpack_exports__);\n\n\n//# sourceURL=webpack://@tsparticles/fireworks/../../plugins/emitters/dist/browser/IEmitterShapeGenerator.js?");
77
+
78
+ /***/ }),
79
+
80
+ /***/ "../../plugins/emitters/dist/browser/IRandomPositionData.js":
81
+ /*!******************************************************************!*\
82
+ !*** ../../plugins/emitters/dist/browser/IRandomPositionData.js ***!
83
+ \******************************************************************/
84
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
85
+
86
+ eval("__webpack_require__.r(__webpack_exports__);\n\n\n//# sourceURL=webpack://@tsparticles/fireworks/../../plugins/emitters/dist/browser/IRandomPositionData.js?");
87
+
88
+ /***/ }),
89
+
90
+ /***/ "../../plugins/emitters/dist/browser/index.js":
91
+ /*!****************************************************!*\
92
+ !*** ../../plugins/emitters/dist/browser/index.js ***!
93
+ \****************************************************/
94
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
95
+
96
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ EmitterShapeBase: () => (/* reexport safe */ _EmitterShapeBase_js__WEBPACK_IMPORTED_MODULE_1__.EmitterShapeBase),\n/* harmony export */ loadEmittersPlugin: () => (/* binding */ loadEmittersPlugin)\n/* harmony export */ });\n/* harmony import */ var _EmitterContainer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./EmitterContainer.js */ \"../../plugins/emitters/dist/browser/EmitterContainer.js\");\n/* harmony import */ var _EmitterShapeBase_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./EmitterShapeBase.js */ \"../../plugins/emitters/dist/browser/EmitterShapeBase.js\");\n/* harmony import */ var _EmittersEngine_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./EmittersEngine.js */ \"../../plugins/emitters/dist/browser/EmittersEngine.js\");\n/* harmony import */ var _IEmitterShape_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./IEmitterShape.js */ \"../../plugins/emitters/dist/browser/IEmitterShape.js\");\n/* harmony import */ var _IEmitterShapeGenerator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./IEmitterShapeGenerator.js */ \"../../plugins/emitters/dist/browser/IEmitterShapeGenerator.js\");\n/* harmony import */ var _Enums_EmitterClickMode_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Enums/EmitterClickMode.js */ \"../../plugins/emitters/dist/browser/Enums/EmitterClickMode.js\");\n/* harmony import */ var _IRandomPositionData_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./IRandomPositionData.js */ \"../../plugins/emitters/dist/browser/IRandomPositionData.js\");\nasync function loadEmittersPlugin(engine, refresh = true) {\n if (!engine.emitterShapeManager) {\n const {\n ShapeManager\n } = await __webpack_require__.e(/*! import() */ \"plugins_emitters_dist_browser_ShapeManager_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./ShapeManager.js */ \"../../plugins/emitters/dist/browser/ShapeManager.js\"));\n engine.emitterShapeManager = new ShapeManager(engine);\n }\n if (!engine.addEmitterShapeGenerator) {\n engine.addEmitterShapeGenerator = (name, generator) => {\n engine.emitterShapeManager?.addShapeGenerator(name, generator);\n };\n }\n const {\n EmittersPlugin\n } = await __webpack_require__.e(/*! import() */ \"plugins_emitters_dist_browser_EmittersPlugin_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./EmittersPlugin.js */ \"../../plugins/emitters/dist/browser/EmittersPlugin.js\")),\n plugin = new EmittersPlugin(engine);\n await engine.addPlugin(plugin, refresh);\n}\n\n\n\n\n\n\n\n\n//# sourceURL=webpack://@tsparticles/fireworks/../../plugins/emitters/dist/browser/index.js?");
97
+
98
+ /***/ }),
99
+
100
+ /***/ "../../plugins/emittersShapes/square/dist/browser/EmittersSquareShape.js":
101
+ /*!*******************************************************************************!*\
102
+ !*** ../../plugins/emittersShapes/square/dist/browser/EmittersSquareShape.js ***!
103
+ \*******************************************************************************/
104
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
105
+
106
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ EmittersSquareShape: () => (/* binding */ EmittersSquareShape)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_plugin_emitters__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/plugin-emitters */ \"../../plugins/emitters/dist/browser/index.js\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @tsparticles/engine */ \"../../engine/dist/browser/index.js\");\n\n\nconst half = 0.5,\n sides = 4,\n double = 2;\nfunction randomSquareCoordinate(position, offset) {\n return position + offset * ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__.getRandom)() - _tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__.halfRandom);\n}\nclass EmittersSquareShape extends _tsparticles_plugin_emitters__WEBPACK_IMPORTED_MODULE_0__.EmitterShapeBase {\n constructor(position, size, fill, options) {\n super(position, size, fill, options);\n }\n async init() {}\n async randomPosition() {\n return await new Promise(success => {\n const fill = this.fill,\n position = this.position,\n size = this.size;\n if (fill) {\n return success({\n position: {\n x: randomSquareCoordinate(position.x, size.width),\n y: randomSquareCoordinate(position.y, size.height)\n }\n });\n } else {\n const halfW = size.width * half,\n halfH = size.height * half,\n side = Math.floor((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__.getRandom)() * sides),\n v = ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__.getRandom)() - _tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__.halfRandom) * double;\n switch (side) {\n case 0:\n return success({\n position: {\n x: position.x + v * halfW,\n y: position.y - halfH\n }\n });\n case 1:\n return success({\n position: {\n x: position.x - halfW,\n y: position.y + v * halfH\n }\n });\n case 2:\n return success({\n position: {\n x: position.x + v * halfW,\n y: position.y + halfH\n }\n });\n case 3:\n default:\n return success({\n position: {\n x: position.x + halfW,\n y: position.y + v * halfH\n }\n });\n }\n }\n });\n }\n}\n\n//# sourceURL=webpack://@tsparticles/fireworks/../../plugins/emittersShapes/square/dist/browser/EmittersSquareShape.js?");
107
+
108
+ /***/ }),
109
+
110
+ /***/ "../../plugins/emittersShapes/square/dist/browser/EmittersSquareShapeGenerator.js":
111
+ /*!****************************************************************************************!*\
112
+ !*** ../../plugins/emittersShapes/square/dist/browser/EmittersSquareShapeGenerator.js ***!
113
+ \****************************************************************************************/
114
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
115
+
116
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ EmittersSquareShapeGenerator: () => (/* binding */ EmittersSquareShapeGenerator)\n/* harmony export */ });\n/* harmony import */ var _EmittersSquareShape_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./EmittersSquareShape.js */ \"../../plugins/emittersShapes/square/dist/browser/EmittersSquareShape.js\");\n\nclass EmittersSquareShapeGenerator {\n generate(position, size, fill, options) {\n return new _EmittersSquareShape_js__WEBPACK_IMPORTED_MODULE_0__.EmittersSquareShape(position, size, fill, options);\n }\n}\n\n//# sourceURL=webpack://@tsparticles/fireworks/../../plugins/emittersShapes/square/dist/browser/EmittersSquareShapeGenerator.js?");
117
+
118
+ /***/ })
119
+
120
+ }]);
@@ -0,0 +1,30 @@
1
+ /*!
2
+ * Author : Matteo Bruni
3
+ * MIT license: https://opensource.org/licenses/MIT
4
+ * Demo / Generator : https://particles.js.org/
5
+ * GitHub : https://www.github.com/matteobruni/tsparticles
6
+ * How to use? : Check the GitHub README
7
+ * v3.2.0
8
+ */
9
+ "use strict";
10
+ /*
11
+ * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
12
+ * This devtool is neither made for production nor for readable output files.
13
+ * It uses "eval()" calls to create a separate source file in the browser devtools.
14
+ * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
15
+ * or disable the default devtool with "devtool: false".
16
+ * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
17
+ */
18
+ (this["webpackChunk_tsparticles_fireworks"] = this["webpackChunk_tsparticles_fireworks"] || []).push([["plugins_emittersShapes_square_dist_browser_index_js"],{
19
+
20
+ /***/ "../../plugins/emittersShapes/square/dist/browser/index.js":
21
+ /*!*****************************************************************!*\
22
+ !*** ../../plugins/emittersShapes/square/dist/browser/index.js ***!
23
+ \*****************************************************************/
24
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
25
+
26
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadEmittersShapeSquare: () => (/* binding */ loadEmittersShapeSquare)\n/* harmony export */ });\nasync function loadEmittersShapeSquare(engine, refresh = true) {\n const emittersEngine = engine,\n {\n EmittersSquareShapeGenerator\n } = await __webpack_require__.e(/*! import() */ \"plugins_emittersShapes_square_dist_browser_EmittersSquareShapeGenerator_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./EmittersSquareShapeGenerator.js */ \"../../plugins/emittersShapes/square/dist/browser/EmittersSquareShapeGenerator.js\"));\n emittersEngine.addEmitterShapeGenerator?.(\"square\", new EmittersSquareShapeGenerator());\n await emittersEngine.refresh(refresh);\n}\n\n//# sourceURL=webpack://@tsparticles/fireworks/../../plugins/emittersShapes/square/dist/browser/index.js?");
27
+
28
+ /***/ })
29
+
30
+ }]);
@@ -0,0 +1,30 @@
1
+ /*!
2
+ * Author : Matteo Bruni
3
+ * MIT license: https://opensource.org/licenses/MIT
4
+ * Demo / Generator : https://particles.js.org/
5
+ * GitHub : https://www.github.com/matteobruni/tsparticles
6
+ * How to use? : Check the GitHub README
7
+ * v3.2.0
8
+ */
9
+ "use strict";
10
+ /*
11
+ * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
12
+ * This devtool is neither made for production nor for readable output files.
13
+ * It uses "eval()" calls to create a separate source file in the browser devtools.
14
+ * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
15
+ * or disable the default devtool with "devtool: false".
16
+ * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
17
+ */
18
+ (this["webpackChunk_tsparticles_fireworks"] = this["webpackChunk_tsparticles_fireworks"] || []).push([["plugins_emitters_dist_browser_EmitterInstance_js"],{
19
+
20
+ /***/ "../../plugins/emitters/dist/browser/EmitterInstance.js":
21
+ /*!**************************************************************!*\
22
+ !*** ../../plugins/emitters/dist/browser/EmitterInstance.js ***!
23
+ \**************************************************************/
24
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
25
+
26
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ EmitterInstance: () => (/* binding */ EmitterInstance)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"../../engine/dist/browser/index.js\");\n/* harmony import */ var _Options_Classes_Emitter_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Options/Classes/Emitter.js */ \"../../plugins/emitters/dist/browser/Options/Classes/Emitter.js\");\n/* harmony import */ var _Options_Classes_EmitterSize_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Options/Classes/EmitterSize.js */ \"../../plugins/emitters/dist/browser/Options/Classes/EmitterSize.js\");\n\n\n\nconst half = 0.5,\n defaultLifeDelay = 0,\n minLifeCount = 0,\n defaultSpawnDelay = 0,\n defaultEmitDelay = 0,\n defaultLifeCount = -1,\n defaultColorAnimationFactor = 1;\nfunction setParticlesOptionsColor(particlesOptions, color) {\n if (particlesOptions.color) {\n particlesOptions.color.value = color;\n } else {\n particlesOptions.color = {\n value: color\n };\n }\n}\nclass EmitterInstance {\n constructor(engine, emitters, container, options, position) {\n this.emitters = emitters;\n this.container = container;\n this._destroy = () => {\n this._mutationObserver?.disconnect();\n this._mutationObserver = undefined;\n this._resizeObserver?.disconnect();\n this._resizeObserver = undefined;\n this.emitters.removeEmitter(this);\n this._engine.dispatchEvent(\"emitterDestroyed\", {\n container: this.container,\n data: {\n emitter: this\n }\n });\n };\n this._prepareToDie = () => {\n if (this._paused) {\n return;\n }\n const duration = this.options.life?.duration !== undefined ? (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(this.options.life.duration) : undefined,\n minDuration = 0,\n minLifeCount = 0;\n if (this.container.retina.reduceFactor && (this._lifeCount > minLifeCount || this._immortal) && duration !== undefined && duration > minDuration) {\n this._duration = duration * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.millisecondsToSeconds;\n }\n };\n this._setColorAnimation = (animation, initValue, maxValue, factor = defaultColorAnimationFactor) => {\n const container = this.container;\n if (!animation.enable) {\n return initValue;\n }\n const colorOffset = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.randomInRange)(animation.offset),\n delay = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(this.options.rate.delay),\n emitFactor = delay * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.millisecondsToSeconds / container.retina.reduceFactor,\n defaultColorSpeed = 0,\n colorSpeed = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(animation.speed ?? defaultColorSpeed);\n return (initValue + colorSpeed * container.fpsLimit / emitFactor + colorOffset * factor) % maxValue;\n };\n this._engine = engine;\n this._currentDuration = 0;\n this._currentEmitDelay = 0;\n this._currentSpawnDelay = 0;\n this._initialPosition = position;\n if (options instanceof _Options_Classes_Emitter_js__WEBPACK_IMPORTED_MODULE_1__.Emitter) {\n this.options = options;\n } else {\n this.options = new _Options_Classes_Emitter_js__WEBPACK_IMPORTED_MODULE_1__.Emitter();\n this.options.load(options);\n }\n this._spawnDelay = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(this.options.life.delay ?? defaultLifeDelay) * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.millisecondsToSeconds / this.container.retina.reduceFactor;\n this.position = this._initialPosition ?? this._calcPosition();\n this.name = this.options.name;\n this.fill = this.options.fill;\n this._firstSpawn = !this.options.life.wait;\n this._startParticlesAdded = false;\n let particlesOptions = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.deepExtend)({}, this.options.particles);\n particlesOptions ??= {};\n particlesOptions.move ??= {};\n particlesOptions.move.direction ??= this.options.direction;\n if (this.options.spawnColor) {\n this.spawnColor = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.rangeColorToHsl)(this.options.spawnColor);\n }\n this._paused = !this.options.autoPlay;\n this._particlesOptions = particlesOptions;\n this._size = this._calcSize();\n this.size = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getSize)(this._size, this.container.canvas.size);\n this._lifeCount = this.options.life.count ?? defaultLifeCount;\n this._immortal = this._lifeCount <= minLifeCount;\n if (this.options.domId) {\n const element = document.getElementById(this.options.domId);\n if (element) {\n this._mutationObserver = new MutationObserver(() => {\n this.resize();\n });\n this._resizeObserver = new ResizeObserver(() => {\n this.resize();\n });\n this._mutationObserver.observe(element, {\n attributes: true,\n attributeFilter: [\"style\", \"width\", \"height\"]\n });\n this._resizeObserver.observe(element);\n }\n }\n const shapeOptions = this.options.shape,\n shapeGenerator = this._engine.emitterShapeManager?.getShapeGenerator(shapeOptions.type);\n if (shapeGenerator) {\n this._shape = shapeGenerator.generate(this.position, this.size, this.fill, shapeOptions.options);\n }\n this._engine.dispatchEvent(\"emitterCreated\", {\n container,\n data: {\n emitter: this\n }\n });\n this.play();\n }\n externalPause() {\n this._paused = true;\n this.pause();\n }\n externalPlay() {\n this._paused = false;\n this.play();\n }\n async init() {\n await this._shape?.init();\n }\n pause() {\n if (this._paused) {\n return;\n }\n delete this._emitDelay;\n }\n play() {\n if (this._paused) {\n return;\n }\n if (!(this.container.retina.reduceFactor && (this._lifeCount > minLifeCount || this._immortal || !this.options.life.count) && (this._firstSpawn || this._currentSpawnDelay >= (this._spawnDelay ?? defaultSpawnDelay)))) {\n return;\n }\n if (this._emitDelay === undefined) {\n const delay = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(this.options.rate.delay);\n this._emitDelay = delay * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.millisecondsToSeconds / this.container.retina.reduceFactor;\n }\n if (this._lifeCount > minLifeCount || this._immortal) {\n this._prepareToDie();\n }\n }\n resize() {\n const initialPosition = this._initialPosition;\n this.position = initialPosition && (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isPointInside)(initialPosition, this.container.canvas.size, _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.Vector.origin) ? initialPosition : this._calcPosition();\n this._size = this._calcSize();\n this.size = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getSize)(this._size, this.container.canvas.size);\n this._shape?.resize(this.position, this.size);\n }\n async update(delta) {\n if (this._paused) {\n return;\n }\n if (this._firstSpawn) {\n this._firstSpawn = false;\n this._currentSpawnDelay = this._spawnDelay ?? defaultSpawnDelay;\n this._currentEmitDelay = this._emitDelay ?? defaultEmitDelay;\n }\n if (!this._startParticlesAdded) {\n this._startParticlesAdded = true;\n await this._emitParticles(this.options.startCount);\n }\n if (this._duration !== undefined) {\n this._currentDuration += delta.value;\n if (this._currentDuration >= this._duration) {\n this.pause();\n if (this._spawnDelay !== undefined) {\n delete this._spawnDelay;\n }\n if (!this._immortal) {\n this._lifeCount--;\n }\n if (this._lifeCount > minLifeCount || this._immortal) {\n this.position = this._calcPosition();\n this._shape?.resize(this.position, this.size);\n this._spawnDelay = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(this.options.life.delay ?? defaultLifeDelay) * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.millisecondsToSeconds / this.container.retina.reduceFactor;\n } else {\n this._destroy();\n }\n this._currentDuration -= this._duration;\n delete this._duration;\n }\n }\n if (this._spawnDelay !== undefined) {\n this._currentSpawnDelay += delta.value;\n if (this._currentSpawnDelay >= this._spawnDelay) {\n this._engine.dispatchEvent(\"emitterPlay\", {\n container: this.container\n });\n this.play();\n this._currentSpawnDelay -= this._currentSpawnDelay;\n delete this._spawnDelay;\n }\n }\n if (this._emitDelay !== undefined) {\n this._currentEmitDelay += delta.value;\n if (this._currentEmitDelay >= this._emitDelay) {\n await this._emit();\n this._currentEmitDelay -= this._emitDelay;\n }\n }\n }\n _calcPosition() {\n if (this.options.domId) {\n const element = document.getElementById(this.options.domId);\n if (element) {\n const elRect = element.getBoundingClientRect(),\n pxRatio = this.container.retina.pixelRatio;\n return {\n x: (elRect.x + elRect.width * half) * pxRatio,\n y: (elRect.y + elRect.height * half) * pxRatio\n };\n }\n }\n return (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.calcPositionOrRandomFromSizeRanged)({\n size: this.container.canvas.size,\n position: this.options.position\n });\n }\n _calcSize() {\n const container = this.container;\n if (this.options.domId) {\n const element = document.getElementById(this.options.domId);\n if (element) {\n const elRect = element.getBoundingClientRect();\n return {\n width: elRect.width * container.retina.pixelRatio,\n height: elRect.height * container.retina.pixelRatio,\n mode: \"precise\"\n };\n }\n }\n return this.options.size ?? (() => {\n const size = new _Options_Classes_EmitterSize_js__WEBPACK_IMPORTED_MODULE_2__.EmitterSize();\n size.load({\n height: 0,\n mode: \"percent\",\n width: 0\n });\n return size;\n })();\n }\n async _emit() {\n if (this._paused) {\n return;\n }\n const quantity = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(this.options.rate.quantity);\n await this._emitParticles(quantity);\n }\n async _emitParticles(quantity) {\n const singleParticlesOptions = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.itemFromSingleOrMultiple)(this._particlesOptions);\n for (let i = 0; i < quantity; i++) {\n const particlesOptions = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.deepExtend)({}, singleParticlesOptions);\n if (this.spawnColor) {\n const hslAnimation = this.options.spawnColor?.animation;\n if (hslAnimation) {\n const maxValues = {\n h: 360,\n s: 100,\n l: 100\n },\n colorFactor = 3.6;\n this.spawnColor.h = this._setColorAnimation(hslAnimation.h, this.spawnColor.h, maxValues.h, colorFactor);\n this.spawnColor.s = this._setColorAnimation(hslAnimation.s, this.spawnColor.s, maxValues.s);\n this.spawnColor.l = this._setColorAnimation(hslAnimation.l, this.spawnColor.l, maxValues.l);\n }\n setParticlesOptionsColor(particlesOptions, this.spawnColor);\n }\n const shapeOptions = this.options.shape;\n let position = this.position;\n if (this._shape) {\n const shapePosData = await this._shape.randomPosition();\n if (shapePosData) {\n position = shapePosData.position;\n const replaceData = shapeOptions.replace;\n if (replaceData.color && shapePosData.color) {\n setParticlesOptionsColor(particlesOptions, shapePosData.color);\n }\n if (replaceData.opacity) {\n if (particlesOptions.opacity) {\n particlesOptions.opacity.value = shapePosData.opacity;\n } else {\n particlesOptions.opacity = {\n value: shapePosData.opacity\n };\n }\n }\n } else {\n position = null;\n }\n }\n if (position) {\n await this.container.particles.addParticle(position, particlesOptions);\n }\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/fireworks/../../plugins/emitters/dist/browser/EmitterInstance.js?");
27
+
28
+ /***/ })
29
+
30
+ }]);
@@ -0,0 +1,90 @@
1
+ /*!
2
+ * Author : Matteo Bruni
3
+ * MIT license: https://opensource.org/licenses/MIT
4
+ * Demo / Generator : https://particles.js.org/
5
+ * GitHub : https://www.github.com/matteobruni/tsparticles
6
+ * How to use? : Check the GitHub README
7
+ * v3.2.0
8
+ */
9
+ "use strict";
10
+ /*
11
+ * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
12
+ * This devtool is neither made for production nor for readable output files.
13
+ * It uses "eval()" calls to create a separate source file in the browser devtools.
14
+ * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
15
+ * or disable the default devtool with "devtool: false".
16
+ * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
17
+ */
18
+ (this["webpackChunk_tsparticles_fireworks"] = this["webpackChunk_tsparticles_fireworks"] || []).push([["plugins_emitters_dist_browser_EmittersPlugin_js"],{
19
+
20
+ /***/ "../../plugins/emitters/dist/browser/EmittersPlugin.js":
21
+ /*!*************************************************************!*\
22
+ !*** ../../plugins/emitters/dist/browser/EmittersPlugin.js ***!
23
+ \*************************************************************/
24
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
25
+
26
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ EmittersPlugin: () => (/* binding */ EmittersPlugin)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"../../engine/dist/browser/index.js\");\n/* harmony import */ var _Options_Classes_Emitter_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Options/Classes/Emitter.js */ \"../../plugins/emitters/dist/browser/Options/Classes/Emitter.js\");\n\n\nclass EmittersPlugin {\n constructor(engine) {\n this._engine = engine;\n this.id = \"emitters\";\n }\n async getPlugin(container) {\n const {\n Emitters\n } = await __webpack_require__.e(/*! import() */ \"plugins_emitters_dist_browser_Emitters_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./Emitters.js */ \"../../plugins/emitters/dist/browser/Emitters.js\"));\n return new Emitters(this._engine, container);\n }\n loadOptions(options, source) {\n if (!this.needsPlugin(options) && !this.needsPlugin(source)) {\n return;\n }\n if (source?.emitters) {\n options.emitters = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.executeOnSingleOrMultiple)(source.emitters, emitter => {\n const tmp = new _Options_Classes_Emitter_js__WEBPACK_IMPORTED_MODULE_1__.Emitter();\n tmp.load(emitter);\n return tmp;\n });\n }\n const interactivityEmitters = source?.interactivity?.modes?.emitters;\n if (interactivityEmitters) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isArray)(interactivityEmitters)) {\n options.interactivity.modes.emitters = {\n random: {\n count: 1,\n enable: true\n },\n value: interactivityEmitters.map(s => {\n const tmp = new _Options_Classes_Emitter_js__WEBPACK_IMPORTED_MODULE_1__.Emitter();\n tmp.load(s);\n return tmp;\n })\n };\n } else {\n const emitterMode = interactivityEmitters;\n if (emitterMode.value !== undefined) {\n const defaultCount = 1;\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isArray)(emitterMode.value)) {\n options.interactivity.modes.emitters = {\n random: {\n count: emitterMode.random.count ?? defaultCount,\n enable: emitterMode.random.enable ?? false\n },\n value: emitterMode.value.map(s => {\n const tmp = new _Options_Classes_Emitter_js__WEBPACK_IMPORTED_MODULE_1__.Emitter();\n tmp.load(s);\n return tmp;\n })\n };\n } else {\n const tmp = new _Options_Classes_Emitter_js__WEBPACK_IMPORTED_MODULE_1__.Emitter();\n tmp.load(emitterMode.value);\n options.interactivity.modes.emitters = {\n random: {\n count: emitterMode.random.count ?? defaultCount,\n enable: emitterMode.random.enable ?? false\n },\n value: tmp\n };\n }\n } else {\n const emitterOptions = options.interactivity.modes.emitters = {\n random: {\n count: 1,\n enable: false\n },\n value: new _Options_Classes_Emitter_js__WEBPACK_IMPORTED_MODULE_1__.Emitter()\n };\n emitterOptions.value.load(interactivityEmitters);\n }\n }\n }\n }\n needsPlugin(options) {\n if (!options) {\n return false;\n }\n const emitters = options.emitters;\n return (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isArray)(emitters) && !!emitters.length || emitters !== undefined || !!options.interactivity?.events?.onClick?.mode && (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isInArray)(\"emitter\", options.interactivity.events.onClick.mode);\n }\n}\n\n//# sourceURL=webpack://@tsparticles/fireworks/../../plugins/emitters/dist/browser/EmittersPlugin.js?");
27
+
28
+ /***/ }),
29
+
30
+ /***/ "../../plugins/emitters/dist/browser/Options/Classes/Emitter.js":
31
+ /*!**********************************************************************!*\
32
+ !*** ../../plugins/emitters/dist/browser/Options/Classes/Emitter.js ***!
33
+ \**********************************************************************/
34
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
35
+
36
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Emitter: () => (/* binding */ Emitter)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"../../engine/dist/browser/index.js\");\n/* harmony import */ var _EmitterLife_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./EmitterLife.js */ \"../../plugins/emitters/dist/browser/Options/Classes/EmitterLife.js\");\n/* harmony import */ var _EmitterRate_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./EmitterRate.js */ \"../../plugins/emitters/dist/browser/Options/Classes/EmitterRate.js\");\n/* harmony import */ var _EmitterShape_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./EmitterShape.js */ \"../../plugins/emitters/dist/browser/Options/Classes/EmitterShape.js\");\n/* harmony import */ var _EmitterSize_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./EmitterSize.js */ \"../../plugins/emitters/dist/browser/Options/Classes/EmitterSize.js\");\n\n\n\n\n\nclass Emitter {\n constructor() {\n this.autoPlay = true;\n this.fill = true;\n this.life = new _EmitterLife_js__WEBPACK_IMPORTED_MODULE_1__.EmitterLife();\n this.rate = new _EmitterRate_js__WEBPACK_IMPORTED_MODULE_2__.EmitterRate();\n this.shape = new _EmitterShape_js__WEBPACK_IMPORTED_MODULE_3__.EmitterShape();\n this.startCount = 0;\n }\n load(data) {\n if (!data) {\n return;\n }\n if (data.autoPlay !== undefined) {\n this.autoPlay = data.autoPlay;\n }\n if (data.size !== undefined) {\n if (!this.size) {\n this.size = new _EmitterSize_js__WEBPACK_IMPORTED_MODULE_4__.EmitterSize();\n }\n this.size.load(data.size);\n }\n if (data.direction !== undefined) {\n this.direction = data.direction;\n }\n this.domId = data.domId;\n if (data.fill !== undefined) {\n this.fill = data.fill;\n }\n this.life.load(data.life);\n this.name = data.name;\n this.particles = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.executeOnSingleOrMultiple)(data.particles, particles => {\n return (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.deepExtend)({}, particles);\n });\n this.rate.load(data.rate);\n this.shape.load(data.shape);\n if (data.position !== undefined) {\n this.position = {};\n if (data.position.x !== undefined) {\n this.position.x = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.position.x);\n }\n if (data.position.y !== undefined) {\n this.position.y = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.position.y);\n }\n }\n if (data.spawnColor !== undefined) {\n if (this.spawnColor === undefined) {\n this.spawnColor = new _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.AnimatableColor();\n }\n this.spawnColor.load(data.spawnColor);\n }\n if (data.startCount !== undefined) {\n this.startCount = data.startCount;\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/fireworks/../../plugins/emitters/dist/browser/Options/Classes/Emitter.js?");
37
+
38
+ /***/ }),
39
+
40
+ /***/ "../../plugins/emitters/dist/browser/Options/Classes/EmitterLife.js":
41
+ /*!**************************************************************************!*\
42
+ !*** ../../plugins/emitters/dist/browser/Options/Classes/EmitterLife.js ***!
43
+ \**************************************************************************/
44
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
45
+
46
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ EmitterLife: () => (/* binding */ EmitterLife)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"../../engine/dist/browser/index.js\");\n\nclass EmitterLife {\n constructor() {\n this.wait = false;\n }\n load(data) {\n if (!data) {\n return;\n }\n if (data.count !== undefined) {\n this.count = data.count;\n }\n if (data.delay !== undefined) {\n this.delay = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.delay);\n }\n if (data.duration !== undefined) {\n this.duration = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.duration);\n }\n if (data.wait !== undefined) {\n this.wait = data.wait;\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/fireworks/../../plugins/emitters/dist/browser/Options/Classes/EmitterLife.js?");
47
+
48
+ /***/ }),
49
+
50
+ /***/ "../../plugins/emitters/dist/browser/Options/Classes/EmitterRate.js":
51
+ /*!**************************************************************************!*\
52
+ !*** ../../plugins/emitters/dist/browser/Options/Classes/EmitterRate.js ***!
53
+ \**************************************************************************/
54
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
55
+
56
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ EmitterRate: () => (/* binding */ EmitterRate)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"../../engine/dist/browser/index.js\");\n\nclass EmitterRate {\n constructor() {\n this.quantity = 1;\n this.delay = 0.1;\n }\n load(data) {\n if (data === undefined) {\n return;\n }\n if (data.quantity !== undefined) {\n this.quantity = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.quantity);\n }\n if (data.delay !== undefined) {\n this.delay = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.delay);\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/fireworks/../../plugins/emitters/dist/browser/Options/Classes/EmitterRate.js?");
57
+
58
+ /***/ }),
59
+
60
+ /***/ "../../plugins/emitters/dist/browser/Options/Classes/EmitterShape.js":
61
+ /*!***************************************************************************!*\
62
+ !*** ../../plugins/emitters/dist/browser/Options/Classes/EmitterShape.js ***!
63
+ \***************************************************************************/
64
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
65
+
66
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ EmitterShape: () => (/* binding */ EmitterShape)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"../../engine/dist/browser/index.js\");\n/* harmony import */ var _EmitterShapeReplace_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./EmitterShapeReplace.js */ \"../../plugins/emitters/dist/browser/Options/Classes/EmitterShapeReplace.js\");\n\n\nclass EmitterShape {\n constructor() {\n this.options = {};\n this.replace = new _EmitterShapeReplace_js__WEBPACK_IMPORTED_MODULE_1__.EmitterShapeReplace();\n this.type = \"square\";\n }\n load(data) {\n if (!data) {\n return;\n }\n if (data.options !== undefined) {\n this.options = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.deepExtend)({}, data.options ?? {});\n }\n this.replace.load(data.replace);\n if (data.type !== undefined) {\n this.type = data.type;\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/fireworks/../../plugins/emitters/dist/browser/Options/Classes/EmitterShape.js?");
67
+
68
+ /***/ }),
69
+
70
+ /***/ "../../plugins/emitters/dist/browser/Options/Classes/EmitterShapeReplace.js":
71
+ /*!**********************************************************************************!*\
72
+ !*** ../../plugins/emitters/dist/browser/Options/Classes/EmitterShapeReplace.js ***!
73
+ \**********************************************************************************/
74
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
75
+
76
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ EmitterShapeReplace: () => (/* binding */ EmitterShapeReplace)\n/* harmony export */ });\nclass EmitterShapeReplace {\n constructor() {\n this.color = false;\n this.opacity = false;\n }\n load(data) {\n if (!data) {\n return;\n }\n if (data.color !== undefined) {\n this.color = data.color;\n }\n if (data.opacity !== undefined) {\n this.opacity = data.opacity;\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/fireworks/../../plugins/emitters/dist/browser/Options/Classes/EmitterShapeReplace.js?");
77
+
78
+ /***/ }),
79
+
80
+ /***/ "../../plugins/emitters/dist/browser/Options/Classes/EmitterSize.js":
81
+ /*!**************************************************************************!*\
82
+ !*** ../../plugins/emitters/dist/browser/Options/Classes/EmitterSize.js ***!
83
+ \**************************************************************************/
84
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
85
+
86
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ EmitterSize: () => (/* binding */ EmitterSize)\n/* harmony export */ });\nclass EmitterSize {\n constructor() {\n this.mode = \"percent\";\n this.height = 0;\n this.width = 0;\n }\n load(data) {\n if (data === undefined) {\n return;\n }\n if (data.mode !== undefined) {\n this.mode = data.mode;\n }\n if (data.height !== undefined) {\n this.height = data.height;\n }\n if (data.width !== undefined) {\n this.width = data.width;\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/fireworks/../../plugins/emitters/dist/browser/Options/Classes/EmitterSize.js?");
87
+
88
+ /***/ })
89
+
90
+ }]);
@@ -0,0 +1,30 @@
1
+ /*!
2
+ * Author : Matteo Bruni
3
+ * MIT license: https://opensource.org/licenses/MIT
4
+ * Demo / Generator : https://particles.js.org/
5
+ * GitHub : https://www.github.com/matteobruni/tsparticles
6
+ * How to use? : Check the GitHub README
7
+ * v3.2.0
8
+ */
9
+ "use strict";
10
+ /*
11
+ * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
12
+ * This devtool is neither made for production nor for readable output files.
13
+ * It uses "eval()" calls to create a separate source file in the browser devtools.
14
+ * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
15
+ * or disable the default devtool with "devtool: false".
16
+ * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
17
+ */
18
+ (this["webpackChunk_tsparticles_fireworks"] = this["webpackChunk_tsparticles_fireworks"] || []).push([["plugins_emitters_dist_browser_Emitters_js"],{
19
+
20
+ /***/ "../../plugins/emitters/dist/browser/Emitters.js":
21
+ /*!*******************************************************!*\
22
+ !*** ../../plugins/emitters/dist/browser/Emitters.js ***!
23
+ \*******************************************************/
24
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
25
+
26
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Emitters: () => (/* binding */ Emitters)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"../../engine/dist/browser/index.js\");\n\nclass Emitters {\n constructor(engine, container) {\n this.container = container;\n this._engine = engine;\n this.array = [];\n this.emitters = [];\n this.interactivityEmitters = {\n random: {\n count: 1,\n enable: false\n },\n value: []\n };\n const defaultIndex = 0;\n container.getEmitter = idxOrName => idxOrName === undefined || (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNumber)(idxOrName) ? this.array[idxOrName ?? defaultIndex] : this.array.find(t => t.name === idxOrName);\n container.addEmitter = async (options, position) => this.addEmitter(options, position);\n container.removeEmitter = idxOrName => {\n const emitter = container.getEmitter(idxOrName);\n if (emitter) {\n this.removeEmitter(emitter);\n }\n };\n container.playEmitter = idxOrName => {\n const emitter = container.getEmitter(idxOrName);\n if (emitter) {\n emitter.externalPlay();\n }\n };\n container.pauseEmitter = idxOrName => {\n const emitter = container.getEmitter(idxOrName);\n if (emitter) {\n emitter.externalPause();\n }\n };\n }\n async addEmitter(options, position) {\n const {\n Emitter\n } = await Promise.resolve(/*! import() */).then(__webpack_require__.bind(__webpack_require__, /*! ./Options/Classes/Emitter.js */ \"../../plugins/emitters/dist/browser/Options/Classes/Emitter.js\")),\n {\n EmitterInstance\n } = await __webpack_require__.e(/*! import() */ \"plugins_emitters_dist_browser_EmitterInstance_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./EmitterInstance.js */ \"../../plugins/emitters/dist/browser/EmitterInstance.js\")),\n emitterOptions = new Emitter();\n emitterOptions.load(options);\n const emitter = new EmitterInstance(this._engine, this, this.container, emitterOptions, position);\n await emitter.init();\n this.array.push(emitter);\n return emitter;\n }\n handleClickMode(mode) {\n const emitterOptions = this.emitters,\n modeEmitters = this.interactivityEmitters;\n if (mode !== \"emitter\") {\n return;\n }\n let emittersModeOptions;\n if (modeEmitters && (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isArray)(modeEmitters.value)) {\n const minLength = 0;\n if (modeEmitters.value.length > minLength && modeEmitters.random.enable) {\n emittersModeOptions = [];\n const usedIndexes = [];\n for (let i = 0; i < modeEmitters.random.count; i++) {\n const idx = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.arrayRandomIndex)(modeEmitters.value);\n if (usedIndexes.includes(idx) && usedIndexes.length < modeEmitters.value.length) {\n i--;\n continue;\n }\n usedIndexes.push(idx);\n emittersModeOptions.push((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.itemFromArray)(modeEmitters.value, idx));\n }\n } else {\n emittersModeOptions = modeEmitters.value;\n }\n } else {\n emittersModeOptions = modeEmitters?.value;\n }\n const emittersOptions = emittersModeOptions ?? emitterOptions,\n ePosition = this.container.interactivity.mouse.clickPosition;\n void (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.executeOnSingleOrMultiple)(emittersOptions, async emitter => {\n await this.addEmitter(emitter, ePosition);\n });\n }\n async init() {\n this.emitters = this.container.actualOptions.emitters;\n this.interactivityEmitters = this.container.actualOptions.interactivity.modes.emitters;\n if (!this.emitters) {\n return;\n }\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isArray)(this.emitters)) {\n for (const emitterOptions of this.emitters) {\n await this.addEmitter(emitterOptions);\n }\n } else {\n await this.addEmitter(this.emitters);\n }\n }\n pause() {\n for (const emitter of this.array) {\n emitter.pause();\n }\n }\n play() {\n for (const emitter of this.array) {\n emitter.play();\n }\n }\n removeEmitter(emitter) {\n const index = this.array.indexOf(emitter),\n minIndex = 0,\n deleteCount = 1;\n if (index >= minIndex) {\n this.array.splice(index, deleteCount);\n }\n }\n resize() {\n for (const emitter of this.array) {\n emitter.resize();\n }\n }\n stop() {\n this.array = [];\n }\n async update(delta) {\n for (const emitter of this.array) {\n await emitter.update(delta);\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/fireworks/../../plugins/emitters/dist/browser/Emitters.js?");
27
+
28
+ /***/ })
29
+
30
+ }]);