@tsparticles/preset-fireworks 3.1.0 → 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.
@@ -1 +1 @@
1
- /*! tsParticles Fireworks Preset v3.1.0 by Matteo Bruni */
1
+ /*! tsParticles Fireworks Preset v3.2.0 by Matteo Bruni */
@@ -4,7 +4,7 @@
4
4
  * Demo / Generator : https://particles.js.org/
5
5
  * GitHub : https://www.github.com/matteobruni/tsparticles
6
6
  * How to use? : Check the GitHub README
7
- * v3.1.0
7
+ * v3.2.0
8
8
  */
9
9
  /*
10
10
  * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
@@ -16,14 +16,14 @@
16
16
  */
17
17
  (function webpackUniversalModuleDefinition(root, factory) {
18
18
  if(typeof exports === 'object' && typeof module === 'object')
19
- module.exports = factory(require("@tsparticles/basic"), require("@tsparticles/updater-destroy"), require("@tsparticles/plugin-emitters"), require("@tsparticles/plugin-emitters-shape-square"), require("@tsparticles/updater-life"), require("@tsparticles/shape-line"), require("@tsparticles/updater-rotate"), require("@tsparticles/plugin-sounds"), require("@tsparticles/updater-stroke-color"), require("@tsparticles/engine"));
19
+ module.exports = factory(require("@tsparticles/engine"), require("@tsparticles/basic"), require("@tsparticles/updater-destroy"), require("@tsparticles/plugin-emitters"), require("@tsparticles/plugin-emitters-shape-square"), require("@tsparticles/updater-life"), require("@tsparticles/shape-line"), require("@tsparticles/updater-rotate"), require("@tsparticles/plugin-sounds"), require("@tsparticles/updater-stroke-color"));
20
20
  else if(typeof define === 'function' && define.amd)
21
- define(["@tsparticles/basic", "@tsparticles/updater-destroy", "@tsparticles/plugin-emitters", "@tsparticles/plugin-emitters-shape-square", "@tsparticles/updater-life", "@tsparticles/shape-line", "@tsparticles/updater-rotate", "@tsparticles/plugin-sounds", "@tsparticles/updater-stroke-color", "@tsparticles/engine"], factory);
21
+ define(["@tsparticles/engine", "@tsparticles/basic", "@tsparticles/updater-destroy", "@tsparticles/plugin-emitters", "@tsparticles/plugin-emitters-shape-square", "@tsparticles/updater-life", "@tsparticles/shape-line", "@tsparticles/updater-rotate", "@tsparticles/plugin-sounds", "@tsparticles/updater-stroke-color"], factory);
22
22
  else {
23
- var a = typeof exports === 'object' ? factory(require("@tsparticles/basic"), require("@tsparticles/updater-destroy"), require("@tsparticles/plugin-emitters"), require("@tsparticles/plugin-emitters-shape-square"), require("@tsparticles/updater-life"), require("@tsparticles/shape-line"), require("@tsparticles/updater-rotate"), require("@tsparticles/plugin-sounds"), require("@tsparticles/updater-stroke-color"), require("@tsparticles/engine")) : factory(root["window"], root["window"], root["window"], root["window"], root["window"], root["window"], root["window"], root["window"], root["window"], root["window"]);
23
+ var a = typeof exports === 'object' ? factory(require("@tsparticles/engine"), require("@tsparticles/basic"), require("@tsparticles/updater-destroy"), require("@tsparticles/plugin-emitters"), require("@tsparticles/plugin-emitters-shape-square"), require("@tsparticles/updater-life"), require("@tsparticles/shape-line"), require("@tsparticles/updater-rotate"), require("@tsparticles/plugin-sounds"), require("@tsparticles/updater-stroke-color")) : factory(root["window"], root["window"], root["window"], root["window"], root["window"], root["window"], root["window"], root["window"], root["window"], root["window"]);
24
24
  for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
25
25
  }
26
- })(this, (__WEBPACK_EXTERNAL_MODULE__tsparticles_basic__, __WEBPACK_EXTERNAL_MODULE__tsparticles_updater_destroy__, __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_emitters__, __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_emitters_shape_square__, __WEBPACK_EXTERNAL_MODULE__tsparticles_updater_life__, __WEBPACK_EXTERNAL_MODULE__tsparticles_shape_line__, __WEBPACK_EXTERNAL_MODULE__tsparticles_updater_rotate__, __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_sounds__, __WEBPACK_EXTERNAL_MODULE__tsparticles_updater_stroke_color__, __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__) => {
26
+ })(this, (__WEBPACK_EXTERNAL_MODULE__tsparticles_engine__, __WEBPACK_EXTERNAL_MODULE__tsparticles_basic__, __WEBPACK_EXTERNAL_MODULE__tsparticles_updater_destroy__, __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_emitters__, __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_emitters_shape_square__, __WEBPACK_EXTERNAL_MODULE__tsparticles_updater_life__, __WEBPACK_EXTERNAL_MODULE__tsparticles_shape_line__, __WEBPACK_EXTERNAL_MODULE__tsparticles_updater_rotate__, __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_sounds__, __WEBPACK_EXTERNAL_MODULE__tsparticles_updater_stroke_color__) => {
27
27
  return /******/ (() => { // webpackBootstrap
28
28
  /******/ "use strict";
29
29
  /******/ var __webpack_modules__ = ({
@@ -34,7 +34,7 @@ return /******/ (() => { // webpackBootstrap
34
34
  \*******************************/
35
35
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
36
36
 
37
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadFireworksPreset: () => (/* binding */ loadFireworksPreset)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_basic__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/basic */ \"@tsparticles/basic\");\n/* harmony import */ var _tsparticles_basic__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_basic__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _tsparticles_updater_destroy__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @tsparticles/updater-destroy */ \"@tsparticles/updater-destroy\");\n/* harmony import */ var _tsparticles_updater_destroy__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_updater_destroy__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _tsparticles_plugin_emitters__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @tsparticles/plugin-emitters */ \"@tsparticles/plugin-emitters\");\n/* harmony import */ var _tsparticles_plugin_emitters__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_plugin_emitters__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _tsparticles_plugin_emitters_shape_square__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @tsparticles/plugin-emitters-shape-square */ \"@tsparticles/plugin-emitters-shape-square\");\n/* harmony import */ var _tsparticles_plugin_emitters_shape_square__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_plugin_emitters_shape_square__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _tsparticles_updater_life__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @tsparticles/updater-life */ \"@tsparticles/updater-life\");\n/* harmony import */ var _tsparticles_updater_life__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_updater_life__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _tsparticles_shape_line__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @tsparticles/shape-line */ \"@tsparticles/shape-line\");\n/* harmony import */ var _tsparticles_shape_line__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_shape_line__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _tsparticles_updater_rotate__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @tsparticles/updater-rotate */ \"@tsparticles/updater-rotate\");\n/* harmony import */ var _tsparticles_updater_rotate__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_updater_rotate__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _tsparticles_plugin_sounds__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @tsparticles/plugin-sounds */ \"@tsparticles/plugin-sounds\");\n/* harmony import */ var _tsparticles_plugin_sounds__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_plugin_sounds__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var _tsparticles_updater_stroke_color__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @tsparticles/updater-stroke-color */ \"@tsparticles/updater-stroke-color\");\n/* harmony import */ var _tsparticles_updater_stroke_color__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_updater_stroke_color__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var _options_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./options.js */ \"./dist/browser/options.js\");\n\n\n\n\n\n\n\n\n\n\nasync function loadFireworksPreset(engine, refresh = true) {\n await (0,_tsparticles_basic__WEBPACK_IMPORTED_MODULE_0__.loadBasic)(engine, false);\n await (0,_tsparticles_plugin_emitters__WEBPACK_IMPORTED_MODULE_2__.loadEmittersPlugin)(engine, false);\n await (0,_tsparticles_plugin_emitters_shape_square__WEBPACK_IMPORTED_MODULE_3__.loadEmittersShapeSquare)(engine, false);\n await (0,_tsparticles_plugin_sounds__WEBPACK_IMPORTED_MODULE_7__.loadSoundsPlugin)(engine, false);\n await (0,_tsparticles_shape_line__WEBPACK_IMPORTED_MODULE_5__.loadLineShape)(engine, false);\n await (0,_tsparticles_updater_rotate__WEBPACK_IMPORTED_MODULE_6__.loadRotateUpdater)(engine, false);\n await (0,_tsparticles_updater_destroy__WEBPACK_IMPORTED_MODULE_1__.loadDestroyUpdater)(engine, false);\n await (0,_tsparticles_updater_life__WEBPACK_IMPORTED_MODULE_4__.loadLifeUpdater)(engine, false);\n await (0,_tsparticles_updater_stroke_color__WEBPACK_IMPORTED_MODULE_8__.loadStrokeColorUpdater)(engine, false);\n await engine.addPreset(\"fireworks\", _options_js__WEBPACK_IMPORTED_MODULE_9__.options, false);\n await engine.refresh(refresh);\n}\n\n//# sourceURL=webpack://@tsparticles/preset-fireworks/./dist/browser/index.js?");
37
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadFireworksPreset: () => (/* binding */ loadFireworksPreset)\n/* harmony export */ });\n/* harmony import */ var _options_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./options.js */ \"./dist/browser/options.js\");\n/* harmony import */ var _tsparticles_basic__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @tsparticles/basic */ \"@tsparticles/basic\");\n/* harmony import */ var _tsparticles_basic__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_basic__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _tsparticles_updater_destroy__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @tsparticles/updater-destroy */ \"@tsparticles/updater-destroy\");\n/* harmony import */ var _tsparticles_updater_destroy__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_updater_destroy__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _tsparticles_plugin_emitters__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @tsparticles/plugin-emitters */ \"@tsparticles/plugin-emitters\");\n/* harmony import */ var _tsparticles_plugin_emitters__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_plugin_emitters__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _tsparticles_plugin_emitters_shape_square__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @tsparticles/plugin-emitters-shape-square */ \"@tsparticles/plugin-emitters-shape-square\");\n/* harmony import */ var _tsparticles_plugin_emitters_shape_square__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_plugin_emitters_shape_square__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _tsparticles_updater_life__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @tsparticles/updater-life */ \"@tsparticles/updater-life\");\n/* harmony import */ var _tsparticles_updater_life__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_updater_life__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _tsparticles_shape_line__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @tsparticles/shape-line */ \"@tsparticles/shape-line\");\n/* harmony import */ var _tsparticles_shape_line__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_shape_line__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _tsparticles_updater_rotate__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @tsparticles/updater-rotate */ \"@tsparticles/updater-rotate\");\n/* harmony import */ var _tsparticles_updater_rotate__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_updater_rotate__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var _tsparticles_plugin_sounds__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @tsparticles/plugin-sounds */ \"@tsparticles/plugin-sounds\");\n/* harmony import */ var _tsparticles_plugin_sounds__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_plugin_sounds__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var _tsparticles_updater_stroke_color__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @tsparticles/updater-stroke-color */ \"@tsparticles/updater-stroke-color\");\n/* harmony import */ var _tsparticles_updater_stroke_color__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_updater_stroke_color__WEBPACK_IMPORTED_MODULE_9__);\n\n\n\n\n\n\n\n\n\n\nasync function loadFireworksPreset(engine, refresh = true) {\n await (0,_tsparticles_basic__WEBPACK_IMPORTED_MODULE_1__.loadBasic)(engine, false);\n await (0,_tsparticles_plugin_emitters__WEBPACK_IMPORTED_MODULE_3__.loadEmittersPlugin)(engine, false);\n await (0,_tsparticles_plugin_emitters_shape_square__WEBPACK_IMPORTED_MODULE_4__.loadEmittersShapeSquare)(engine, false);\n await (0,_tsparticles_plugin_sounds__WEBPACK_IMPORTED_MODULE_8__.loadSoundsPlugin)(engine, false);\n await (0,_tsparticles_shape_line__WEBPACK_IMPORTED_MODULE_6__.loadLineShape)(engine, false);\n await (0,_tsparticles_updater_rotate__WEBPACK_IMPORTED_MODULE_7__.loadRotateUpdater)(engine, false);\n await (0,_tsparticles_updater_destroy__WEBPACK_IMPORTED_MODULE_2__.loadDestroyUpdater)(engine, false);\n await (0,_tsparticles_updater_life__WEBPACK_IMPORTED_MODULE_5__.loadLifeUpdater)(engine, false);\n await (0,_tsparticles_updater_stroke_color__WEBPACK_IMPORTED_MODULE_9__.loadStrokeColorUpdater)(engine, false);\n await engine.addPreset(\"fireworks\", (0,_options_js__WEBPACK_IMPORTED_MODULE_0__.initOptions)(engine), false);\n await engine.refresh(refresh);\n}\n\n//# sourceURL=webpack://@tsparticles/preset-fireworks/./dist/browser/index.js?");
38
38
 
39
39
  /***/ }),
40
40
 
@@ -44,7 +44,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
44
44
  \*********************************/
45
45
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
46
46
 
47
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ options: () => (/* binding */ options)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n\nconst explodeSoundCheck = args => {\n const data = args.data;\n return data.particle.shape === \"line\";\n};\nconst fixRange = (value, min, max) => {\n const minValue = 0,\n diffSMax = value.max > max ? value.max - max : minValue;\n let res = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(value);\n if (diffSMax) {\n res = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(value.min - diffSMax, max);\n }\n const diffSMin = value.min < min ? value.min : minValue;\n if (diffSMin) {\n res = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(minValue, value.max + diffSMin);\n }\n return res;\n};\nconst fireworksOptions = [\"#ff595e\", \"#ffca3a\", \"#8ac926\", \"#1982c4\", \"#6a4c93\"].map(color => {\n const rgb = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.stringToRgb)(color);\n if (!rgb) {\n return undefined;\n }\n const hsl = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.rgbToHsl)(rgb),\n sOffset = 30,\n lOffset = 30,\n sBounds = {\n min: 0,\n max: 100\n },\n lBounds = {\n min: 0,\n max: 100\n },\n sRange = fixRange({\n min: hsl.s - sOffset,\n max: hsl.s + sOffset\n }, sBounds.min, sBounds.max),\n lRange = fixRange({\n min: hsl.l - lOffset,\n max: hsl.l + lOffset\n }, lBounds.min, lBounds.max);\n return {\n color: {\n value: {\n h: hsl.h,\n s: sRange,\n l: lRange\n }\n },\n stroke: {\n width: 0\n },\n number: {\n value: 0\n },\n opacity: {\n value: {\n min: 0.1,\n max: 1\n },\n animation: {\n enable: true,\n speed: 0.7,\n sync: false,\n startValue: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.StartValueType.max,\n destroy: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.DestroyType.min\n }\n },\n shape: {\n type: \"circle\"\n },\n size: {\n value: {\n min: 1,\n max: 2\n },\n animation: {\n enable: true,\n speed: 5,\n count: 1,\n sync: false,\n startValue: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.StartValueType.min,\n destroy: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.DestroyType.none\n }\n },\n life: {\n count: 1,\n duration: {\n value: {\n min: 1,\n max: 2\n }\n }\n },\n move: {\n decay: {\n min: 0.075,\n max: 0.1\n },\n enable: true,\n gravity: {\n enable: true,\n inverse: false,\n acceleration: 5\n },\n speed: {\n min: 5,\n max: 15\n },\n direction: \"none\",\n outModes: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OutMode.destroy\n }\n };\n}).filter(t => t !== undefined);\nconst options = {\n detectRetina: true,\n background: {\n color: \"#000\"\n },\n fpsLimit: 120,\n emitters: {\n direction: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.MoveDirection.top,\n life: {\n count: 0,\n duration: 0.1,\n delay: 0.1\n },\n rate: {\n delay: 0.05,\n quantity: 1\n },\n size: {\n width: 100,\n height: 0\n },\n position: {\n y: 100,\n x: 50\n }\n },\n particles: {\n number: {\n value: 0\n },\n destroy: {\n mode: \"split\",\n bounds: {\n top: {\n min: 10,\n max: 30\n }\n },\n split: {\n sizeOffset: false,\n count: 1,\n factor: {\n value: 0.333333\n },\n rate: {\n value: {\n min: 75,\n max: 150\n }\n },\n particles: fireworksOptions\n }\n },\n life: {\n count: 1\n },\n shape: {\n type: \"line\"\n },\n size: {\n value: {\n min: 0.1,\n max: 50\n },\n animation: {\n enable: true,\n sync: true,\n speed: 90,\n startValue: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.StartValueType.max,\n destroy: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.DestroyType.min\n }\n },\n stroke: {\n color: {\n value: \"#ffffff\"\n },\n width: 1\n },\n rotate: {\n path: true\n },\n move: {\n enable: true,\n gravity: {\n acceleration: 15,\n enable: true,\n inverse: true,\n maxSpeed: 100\n },\n speed: {\n min: 10,\n max: 20\n },\n outModes: {\n default: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OutMode.destroy,\n top: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OutMode.none\n },\n trail: {\n fill: {\n color: \"#000\"\n },\n enable: true,\n length: 10\n }\n }\n },\n sounds: {\n enable: true,\n events: [{\n event: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.EventType.particleRemoved,\n filter: explodeSoundCheck,\n audio: [\"https://particles.js.org/audio/explosion0.mp3\", \"https://particles.js.org/audio/explosion1.mp3\", \"https://particles.js.org/audio/explosion2.mp3\"]\n }],\n volume: 50\n }\n};\n\n//# sourceURL=webpack://@tsparticles/preset-fireworks/./dist/browser/options.js?");
47
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ initOptions: () => (/* binding */ initOptions)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n\nfunction initOptions(engine) {\n const explodeSoundCheck = args => {\n const data = args.data;\n return data.particle.shape === \"line\";\n },\n fixRange = (value, min, max) => {\n const minValue = 0,\n diffSMax = value.max > max ? value.max - max : minValue;\n let res = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(value);\n if (diffSMax) {\n res = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(value.min - diffSMax, max);\n }\n const diffSMin = value.min < min ? value.min : minValue;\n if (diffSMin) {\n res = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(minValue, value.max + diffSMin);\n }\n return res;\n },\n fireworksOptions = [\"#ff595e\", \"#ffca3a\", \"#8ac926\", \"#1982c4\", \"#6a4c93\"].map(color => {\n const rgb = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.stringToRgb)(engine, color);\n if (!rgb) {\n return undefined;\n }\n const hsl = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.rgbToHsl)(rgb),\n sOffset = 30,\n lOffset = 30,\n sBounds = {\n min: 0,\n max: 100\n },\n lBounds = {\n min: 0,\n max: 100\n },\n sRange = fixRange({\n min: hsl.s - sOffset,\n max: hsl.s + sOffset\n }, sBounds.min, sBounds.max),\n lRange = fixRange({\n min: hsl.l - lOffset,\n max: hsl.l + lOffset\n }, lBounds.min, lBounds.max);\n return {\n color: {\n value: {\n h: hsl.h,\n s: sRange,\n l: lRange\n }\n },\n stroke: {\n width: 0\n },\n number: {\n value: 0\n },\n opacity: {\n value: {\n min: 0.1,\n max: 1\n },\n animation: {\n enable: true,\n speed: 0.7,\n sync: false,\n startValue: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.StartValueType.max,\n destroy: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.DestroyType.min\n }\n },\n shape: {\n type: \"circle\"\n },\n size: {\n value: {\n min: 1,\n max: 2\n },\n animation: {\n enable: true,\n speed: 5,\n count: 1,\n sync: false,\n startValue: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.StartValueType.min,\n destroy: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.DestroyType.none\n }\n },\n life: {\n count: 1,\n duration: {\n value: {\n min: 1,\n max: 2\n }\n }\n },\n move: {\n decay: {\n min: 0.075,\n max: 0.1\n },\n enable: true,\n gravity: {\n enable: true,\n inverse: false,\n acceleration: 5\n },\n speed: {\n min: 5,\n max: 15\n },\n direction: \"none\",\n outModes: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OutMode.destroy\n }\n };\n }).filter(t => t !== undefined);\n return {\n detectRetina: true,\n background: {\n color: \"#000\"\n },\n fpsLimit: 120,\n emitters: {\n direction: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.MoveDirection.top,\n life: {\n count: 0,\n duration: 0.1,\n delay: 0.1\n },\n rate: {\n delay: 0.05,\n quantity: 1\n },\n size: {\n width: 100,\n height: 0\n },\n position: {\n y: 100,\n x: 50\n }\n },\n particles: {\n number: {\n value: 0\n },\n destroy: {\n mode: \"split\",\n bounds: {\n top: {\n min: 10,\n max: 30\n }\n },\n split: {\n sizeOffset: false,\n count: 1,\n factor: {\n value: 0.333333\n },\n rate: {\n value: {\n min: 75,\n max: 150\n }\n },\n particles: fireworksOptions\n }\n },\n life: {\n count: 1\n },\n shape: {\n type: \"line\"\n },\n size: {\n value: {\n min: 0.1,\n max: 50\n },\n animation: {\n enable: true,\n sync: true,\n speed: 90,\n startValue: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.StartValueType.max,\n destroy: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.DestroyType.min\n }\n },\n stroke: {\n color: {\n value: \"#ffffff\"\n },\n width: 1\n },\n rotate: {\n path: true\n },\n move: {\n enable: true,\n gravity: {\n acceleration: 15,\n enable: true,\n inverse: true,\n maxSpeed: 100\n },\n speed: {\n min: 10,\n max: 20\n },\n outModes: {\n default: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OutMode.destroy,\n top: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OutMode.none\n },\n trail: {\n fill: {\n color: \"#000\"\n },\n enable: true,\n length: 10\n }\n }\n },\n sounds: {\n enable: true,\n events: [{\n event: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.EventType.particleRemoved,\n filter: explodeSoundCheck,\n audio: [\"https://particles.js.org/audio/explosion0.mp3\", \"https://particles.js.org/audio/explosion1.mp3\", \"https://particles.js.org/audio/explosion2.mp3\"]\n }],\n volume: 50\n }\n };\n}\n\n//# sourceURL=webpack://@tsparticles/preset-fireworks/./dist/browser/options.js?");
48
48
 
49
49
  /***/ }),
50
50
 
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see tsparticles.preset.fireworks.min.js.LICENSE.txt */
2
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/basic"),require("@tsparticles/updater-destroy"),require("@tsparticles/plugin-emitters"),require("@tsparticles/plugin-emitters-shape-square"),require("@tsparticles/updater-life"),require("@tsparticles/shape-line"),require("@tsparticles/updater-rotate"),require("@tsparticles/plugin-sounds"),require("@tsparticles/updater-stroke-color"),require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/basic","@tsparticles/updater-destroy","@tsparticles/plugin-emitters","@tsparticles/plugin-emitters-shape-square","@tsparticles/updater-life","@tsparticles/shape-line","@tsparticles/updater-rotate","@tsparticles/plugin-sounds","@tsparticles/updater-stroke-color","@tsparticles/engine"],t);else{var r="object"==typeof exports?t(require("@tsparticles/basic"),require("@tsparticles/updater-destroy"),require("@tsparticles/plugin-emitters"),require("@tsparticles/plugin-emitters-shape-square"),require("@tsparticles/updater-life"),require("@tsparticles/shape-line"),require("@tsparticles/updater-rotate"),require("@tsparticles/plugin-sounds"),require("@tsparticles/updater-stroke-color"),require("@tsparticles/engine")):t(e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window);for(var a in r)("object"==typeof exports?exports:e)[a]=r[a]}}(this,((e,t,r,a,i,s,o,n,l,p)=>(()=>{var u={145:t=>{t.exports=e},303:e=>{e.exports=p},526:e=>{e.exports=r},140:e=>{e.exports=a},933:e=>{e.exports=n},983:e=>{e.exports=s},173:e=>{e.exports=t},75:e=>{e.exports=i},668:e=>{e.exports=o},227:e=>{e.exports=l}},d={};function c(e){var t=d[e];if(void 0!==t)return t.exports;var r=d[e]={exports:{}};return u[e](r,r.exports,c),r.exports}c.d=(e,t)=>{for(var r in t)c.o(t,r)&&!c.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),c.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var m={};return(()=>{c.r(m),c.d(m,{loadFireworksPreset:()=>y});var e=c(145),t=c(173),r=c(526),a=c(140),i=c(75),s=c(983),o=c(668),n=c(933),l=c(227),p=c(303);const u=(e,t,r)=>{const a=e.max>r?e.max-r:0;let i=(0,p.setRangeValue)(e);a&&(i=(0,p.setRangeValue)(e.min-a,r));const s=e.min<t?e.min:0;return s&&(i=(0,p.setRangeValue)(0,e.max+s)),i},d=["#ff595e","#ffca3a","#8ac926","#1982c4","#6a4c93"].map((e=>{const t=(0,p.stringToRgb)(e);if(!t)return;const r=(0,p.rgbToHsl)(t),a=0,i=100,s=0,o=100,n=u({min:r.s-30,max:r.s+30},a,i),l=u({min:r.l-30,max:r.l+30},s,o);return{color:{value:{h:r.h,s:n,l}},stroke:{width:0},number:{value:0},opacity:{value:{min:.1,max:1},animation:{enable:!0,speed:.7,sync:!1,startValue:p.StartValueType.max,destroy:p.DestroyType.min}},shape:{type:"circle"},size:{value:{min:1,max:2},animation:{enable:!0,speed:5,count:1,sync:!1,startValue:p.StartValueType.min,destroy:p.DestroyType.none}},life:{count:1,duration:{value:{min:1,max:2}}},move:{decay:{min:.075,max:.1},enable:!0,gravity:{enable:!0,inverse:!1,acceleration:5},speed:{min:5,max:15},direction:"none",outModes:p.OutMode.destroy}}})).filter((e=>void 0!==e)),f={detectRetina:!0,background:{color:"#000"},fpsLimit:120,emitters:{direction:p.MoveDirection.top,life:{count:0,duration:.1,delay:.1},rate:{delay:.05,quantity:1},size:{width:100,height:0},position:{y:100,x:50}},particles:{number:{value:0},destroy:{mode:"split",bounds:{top:{min:10,max:30}},split:{sizeOffset:!1,count:1,factor:{value:.333333},rate:{value:{min:75,max:150}},particles:d}},life:{count:1},shape:{type:"line"},size:{value:{min:.1,max:50},animation:{enable:!0,sync:!0,speed:90,startValue:p.StartValueType.max,destroy:p.DestroyType.min}},stroke:{color:{value:"#ffffff"},width:1},rotate:{path:!0},move:{enable:!0,gravity:{acceleration:15,enable:!0,inverse:!0,maxSpeed:100},speed:{min:10,max:20},outModes:{default:p.OutMode.destroy,top:p.OutMode.none},trail:{fill:{color:"#000"},enable:!0,length:10}}},sounds:{enable:!0,events:[{event:p.EventType.particleRemoved,filter:e=>"line"===e.data.particle.shape,audio:["https://particles.js.org/audio/explosion0.mp3","https://particles.js.org/audio/explosion1.mp3","https://particles.js.org/audio/explosion2.mp3"]}],volume:50}};async function y(p,u=!0){await(0,e.loadBasic)(p,!1),await(0,r.loadEmittersPlugin)(p,!1),await(0,a.loadEmittersShapeSquare)(p,!1),await(0,n.loadSoundsPlugin)(p,!1),await(0,s.loadLineShape)(p,!1),await(0,o.loadRotateUpdater)(p,!1),await(0,t.loadDestroyUpdater)(p,!1),await(0,i.loadLifeUpdater)(p,!1),await(0,l.loadStrokeColorUpdater)(p,!1),await p.addPreset("fireworks",f,!1),await p.refresh(u)}})(),m})()));
2
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/engine"),require("@tsparticles/basic"),require("@tsparticles/updater-destroy"),require("@tsparticles/plugin-emitters"),require("@tsparticles/plugin-emitters-shape-square"),require("@tsparticles/updater-life"),require("@tsparticles/shape-line"),require("@tsparticles/updater-rotate"),require("@tsparticles/plugin-sounds"),require("@tsparticles/updater-stroke-color"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine","@tsparticles/basic","@tsparticles/updater-destroy","@tsparticles/plugin-emitters","@tsparticles/plugin-emitters-shape-square","@tsparticles/updater-life","@tsparticles/shape-line","@tsparticles/updater-rotate","@tsparticles/plugin-sounds","@tsparticles/updater-stroke-color"],t);else{var r="object"==typeof exports?t(require("@tsparticles/engine"),require("@tsparticles/basic"),require("@tsparticles/updater-destroy"),require("@tsparticles/plugin-emitters"),require("@tsparticles/plugin-emitters-shape-square"),require("@tsparticles/updater-life"),require("@tsparticles/shape-line"),require("@tsparticles/updater-rotate"),require("@tsparticles/plugin-sounds"),require("@tsparticles/updater-stroke-color")):t(e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window,e.window);for(var a in r)("object"==typeof exports?exports:e)[a]=r[a]}}(this,((e,t,r,a,i,s,o,n,l,p)=>(()=>{var u={145:e=>{e.exports=t},303:t=>{t.exports=e},526:e=>{e.exports=a},140:e=>{e.exports=i},933:e=>{e.exports=l},983:e=>{e.exports=o},173:e=>{e.exports=r},75:e=>{e.exports=s},668:e=>{e.exports=n},227:e=>{e.exports=p}},d={};function c(e){var t=d[e];if(void 0!==t)return t.exports;var r=d[e]={exports:{}};return u[e](r,r.exports,c),r.exports}c.d=(e,t)=>{for(var r in t)c.o(t,r)&&!c.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),c.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var m={};return(()=>{c.r(m),c.d(m,{loadFireworksPreset:()=>u});var e=c(303);var t=c(145),r=c(173),a=c(526),i=c(140),s=c(75),o=c(983),n=c(668),l=c(933),p=c(227);async function u(u,d=!0){await(0,t.loadBasic)(u,!1),await(0,a.loadEmittersPlugin)(u,!1),await(0,i.loadEmittersShapeSquare)(u,!1),await(0,l.loadSoundsPlugin)(u,!1),await(0,o.loadLineShape)(u,!1),await(0,n.loadRotateUpdater)(u,!1),await(0,r.loadDestroyUpdater)(u,!1),await(0,s.loadLifeUpdater)(u,!1),await(0,p.loadStrokeColorUpdater)(u,!1),await u.addPreset("fireworks",function(t){const r=(t,r,a)=>{const i=t.max>a?t.max-a:0;let s=(0,e.setRangeValue)(t);i&&(s=(0,e.setRangeValue)(t.min-i,a));const o=t.min<r?t.min:0;return o&&(s=(0,e.setRangeValue)(0,t.max+o)),s},a=["#ff595e","#ffca3a","#8ac926","#1982c4","#6a4c93"].map((a=>{const i=(0,e.stringToRgb)(t,a);if(!i)return;const s=(0,e.rgbToHsl)(i),o=0,n=100,l=0,p=100,u=r({min:s.s-30,max:s.s+30},o,n),d=r({min:s.l-30,max:s.l+30},l,p);return{color:{value:{h:s.h,s:u,l:d}},stroke:{width:0},number:{value:0},opacity:{value:{min:.1,max:1},animation:{enable:!0,speed:.7,sync:!1,startValue:e.StartValueType.max,destroy:e.DestroyType.min}},shape:{type:"circle"},size:{value:{min:1,max:2},animation:{enable:!0,speed:5,count:1,sync:!1,startValue:e.StartValueType.min,destroy:e.DestroyType.none}},life:{count:1,duration:{value:{min:1,max:2}}},move:{decay:{min:.075,max:.1},enable:!0,gravity:{enable:!0,inverse:!1,acceleration:5},speed:{min:5,max:15},direction:"none",outModes:e.OutMode.destroy}}})).filter((e=>void 0!==e));return{detectRetina:!0,background:{color:"#000"},fpsLimit:120,emitters:{direction:e.MoveDirection.top,life:{count:0,duration:.1,delay:.1},rate:{delay:.05,quantity:1},size:{width:100,height:0},position:{y:100,x:50}},particles:{number:{value:0},destroy:{mode:"split",bounds:{top:{min:10,max:30}},split:{sizeOffset:!1,count:1,factor:{value:.333333},rate:{value:{min:75,max:150}},particles:a}},life:{count:1},shape:{type:"line"},size:{value:{min:.1,max:50},animation:{enable:!0,sync:!0,speed:90,startValue:e.StartValueType.max,destroy:e.DestroyType.min}},stroke:{color:{value:"#ffffff"},width:1},rotate:{path:!0},move:{enable:!0,gravity:{acceleration:15,enable:!0,inverse:!0,maxSpeed:100},speed:{min:10,max:20},outModes:{default:e.OutMode.destroy,top:e.OutMode.none},trail:{fill:{color:"#000"},enable:!0,length:10}}},sounds:{enable:!0,events:[{event:e.EventType.particleRemoved,filter:e=>"line"===e.data.particle.shape,audio:["https://particles.js.org/audio/explosion0.mp3","https://particles.js.org/audio/explosion1.mp3","https://particles.js.org/audio/explosion2.mp3"]}],volume:50}}}(u),!1),await u.refresh(d)}})(),m})()));
@@ -1 +1 @@
1
- /*! tsParticles Fireworks Preset v3.1.0 by Matteo Bruni */
1
+ /*! tsParticles Fireworks Preset v3.2.0 by Matteo Bruni */
@@ -1,2 +1,2 @@
1
- import { type ISourceOptions } from "@tsparticles/engine";
2
- export declare const options: ISourceOptions;
1
+ import { type Engine, type ISourceOptions } from "@tsparticles/engine";
2
+ export declare function initOptions(engine: Engine): ISourceOptions;
package/umd/index.js CHANGED
@@ -4,12 +4,13 @@
4
4
  if (v !== undefined) module.exports = v;
5
5
  }
6
6
  else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "@tsparticles/basic", "@tsparticles/updater-destroy", "@tsparticles/plugin-emitters", "@tsparticles/plugin-emitters-shape-square", "@tsparticles/updater-life", "@tsparticles/shape-line", "@tsparticles/updater-rotate", "@tsparticles/plugin-sounds", "@tsparticles/updater-stroke-color", "./options.js"], factory);
7
+ define(["require", "exports", "./options.js", "@tsparticles/basic", "@tsparticles/updater-destroy", "@tsparticles/plugin-emitters", "@tsparticles/plugin-emitters-shape-square", "@tsparticles/updater-life", "@tsparticles/shape-line", "@tsparticles/updater-rotate", "@tsparticles/plugin-sounds", "@tsparticles/updater-stroke-color"], factory);
8
8
  }
9
9
  })(function (require, exports) {
10
10
  "use strict";
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.loadFireworksPreset = void 0;
13
+ const options_js_1 = require("./options.js");
13
14
  const basic_1 = require("@tsparticles/basic");
14
15
  const updater_destroy_1 = require("@tsparticles/updater-destroy");
15
16
  const plugin_emitters_1 = require("@tsparticles/plugin-emitters");
@@ -19,7 +20,6 @@
19
20
  const updater_rotate_1 = require("@tsparticles/updater-rotate");
20
21
  const plugin_sounds_1 = require("@tsparticles/plugin-sounds");
21
22
  const updater_stroke_color_1 = require("@tsparticles/updater-stroke-color");
22
- const options_js_1 = require("./options.js");
23
23
  async function loadFireworksPreset(engine, refresh = true) {
24
24
  await (0, basic_1.loadBasic)(engine, false);
25
25
  await (0, plugin_emitters_1.loadEmittersPlugin)(engine, false);
@@ -30,7 +30,7 @@
30
30
  await (0, updater_destroy_1.loadDestroyUpdater)(engine, false);
31
31
  await (0, updater_life_1.loadLifeUpdater)(engine, false);
32
32
  await (0, updater_stroke_color_1.loadStrokeColorUpdater)(engine, false);
33
- await engine.addPreset("fireworks", options_js_1.options, false);
33
+ await engine.addPreset("fireworks", (0, options_js_1.initOptions)(engine), false);
34
34
  await engine.refresh(refresh);
35
35
  }
36
36
  exports.loadFireworksPreset = loadFireworksPreset;
package/umd/options.js CHANGED
@@ -9,216 +9,223 @@
9
9
  })(function (require, exports) {
10
10
  "use strict";
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.options = void 0;
12
+ exports.initOptions = void 0;
13
13
  const engine_1 = require("@tsparticles/engine");
14
- const explodeSoundCheck = (args) => {
15
- const data = args.data;
16
- return data.particle.shape === "line";
17
- };
18
- const fixRange = (value, min, max) => {
19
- const minValue = 0, diffSMax = value.max > max ? value.max - max : minValue;
20
- let res = (0, engine_1.setRangeValue)(value);
21
- if (diffSMax) {
22
- res = (0, engine_1.setRangeValue)(value.min - diffSMax, max);
23
- }
24
- const diffSMin = value.min < min ? value.min : minValue;
25
- if (diffSMin) {
26
- res = (0, engine_1.setRangeValue)(minValue, value.max + diffSMin);
27
- }
28
- return res;
29
- };
30
- const fireworksOptions = ["#ff595e", "#ffca3a", "#8ac926", "#1982c4", "#6a4c93"]
31
- .map(color => {
32
- const rgb = (0, engine_1.stringToRgb)(color);
33
- if (!rgb) {
34
- return undefined;
35
- }
36
- const hsl = (0, engine_1.rgbToHsl)(rgb), sOffset = 30, lOffset = 30, sBounds = {
37
- min: 0,
38
- max: 100,
39
- }, lBounds = {
40
- min: 0,
41
- max: 100,
42
- }, sRange = fixRange({ min: hsl.s - sOffset, max: hsl.s + sOffset }, sBounds.min, sBounds.max), lRange = fixRange({ min: hsl.l - lOffset, max: hsl.l + lOffset }, lBounds.min, lBounds.max);
43
- return {
44
- color: {
45
- value: {
46
- h: hsl.h,
47
- s: sRange,
48
- l: lRange,
14
+ function initOptions(engine) {
15
+ const explodeSoundCheck = (args) => {
16
+ const data = args.data;
17
+ return data.particle.shape === "line";
18
+ }, fixRange = (value, min, max) => {
19
+ const minValue = 0, diffSMax = value.max > max ? value.max - max : minValue;
20
+ let res = (0, engine_1.setRangeValue)(value);
21
+ if (diffSMax) {
22
+ res = (0, engine_1.setRangeValue)(value.min - diffSMax, max);
23
+ }
24
+ const diffSMin = value.min < min ? value.min : minValue;
25
+ if (diffSMin) {
26
+ res = (0, engine_1.setRangeValue)(minValue, value.max + diffSMin);
27
+ }
28
+ return res;
29
+ }, fireworksOptions = [
30
+ "#ff595e",
31
+ "#ffca3a",
32
+ "#8ac926",
33
+ "#1982c4",
34
+ "#6a4c93",
35
+ ]
36
+ .map(color => {
37
+ const rgb = (0, engine_1.stringToRgb)(engine, color);
38
+ if (!rgb) {
39
+ return undefined;
40
+ }
41
+ const hsl = (0, engine_1.rgbToHsl)(rgb), sOffset = 30, lOffset = 30, sBounds = {
42
+ min: 0,
43
+ max: 100,
44
+ }, lBounds = {
45
+ min: 0,
46
+ max: 100,
47
+ }, sRange = fixRange({ min: hsl.s - sOffset, max: hsl.s + sOffset }, sBounds.min, sBounds.max), lRange = fixRange({ min: hsl.l - lOffset, max: hsl.l + lOffset }, lBounds.min, lBounds.max);
48
+ return {
49
+ color: {
50
+ value: {
51
+ h: hsl.h,
52
+ s: sRange,
53
+ l: lRange,
54
+ },
49
55
  },
50
- },
51
- stroke: {
52
- width: 0,
53
- },
54
- number: {
55
- value: 0,
56
- },
57
- opacity: {
58
- value: {
59
- min: 0.1,
60
- max: 1,
56
+ stroke: {
57
+ width: 0,
61
58
  },
62
- animation: {
63
- enable: true,
64
- speed: 0.7,
65
- sync: false,
66
- startValue: engine_1.StartValueType.max,
67
- destroy: engine_1.DestroyType.min,
59
+ number: {
60
+ value: 0,
68
61
  },
69
- },
70
- shape: {
71
- type: "circle",
72
- },
73
- size: {
74
- value: { min: 1, max: 2 },
75
- animation: {
76
- enable: true,
77
- speed: 5,
78
- count: 1,
79
- sync: false,
80
- startValue: engine_1.StartValueType.min,
81
- destroy: engine_1.DestroyType.none,
82
- },
83
- },
84
- life: {
85
- count: 1,
86
- duration: {
62
+ opacity: {
87
63
  value: {
88
- min: 1,
89
- max: 2,
64
+ min: 0.1,
65
+ max: 1,
66
+ },
67
+ animation: {
68
+ enable: true,
69
+ speed: 0.7,
70
+ sync: false,
71
+ startValue: engine_1.StartValueType.max,
72
+ destroy: engine_1.DestroyType.min,
90
73
  },
91
74
  },
92
- },
93
- move: {
94
- decay: { min: 0.075, max: 0.1 },
95
- enable: true,
96
- gravity: {
97
- enable: true,
98
- inverse: false,
99
- acceleration: 5,
100
- },
101
- speed: { min: 5, max: 15 },
102
- direction: "none",
103
- outModes: engine_1.OutMode.destroy,
104
- },
105
- };
106
- })
107
- .filter(t => t !== undefined);
108
- exports.options = {
109
- detectRetina: true,
110
- background: {
111
- color: "#000",
112
- },
113
- fpsLimit: 120,
114
- emitters: {
115
- direction: engine_1.MoveDirection.top,
116
- life: {
117
- count: 0,
118
- duration: 0.1,
119
- delay: 0.1,
120
- },
121
- rate: {
122
- delay: 0.05,
123
- quantity: 1,
124
- },
125
- size: {
126
- width: 100,
127
- height: 0,
128
- },
129
- position: {
130
- y: 100,
131
- x: 50,
132
- },
133
- },
134
- particles: {
135
- number: {
136
- value: 0,
137
- },
138
- destroy: {
139
- mode: "split",
140
- bounds: {
141
- top: { min: 10, max: 30 },
75
+ shape: {
76
+ type: "circle",
77
+ },
78
+ size: {
79
+ value: { min: 1, max: 2 },
80
+ animation: {
81
+ enable: true,
82
+ speed: 5,
83
+ count: 1,
84
+ sync: false,
85
+ startValue: engine_1.StartValueType.min,
86
+ destroy: engine_1.DestroyType.none,
87
+ },
142
88
  },
143
- split: {
144
- sizeOffset: false,
89
+ life: {
145
90
  count: 1,
146
- factor: {
147
- value: 0.333333,
148
- },
149
- rate: {
150
- value: { min: 75, max: 150 },
91
+ duration: {
92
+ value: {
93
+ min: 1,
94
+ max: 2,
95
+ },
151
96
  },
152
- particles: fireworksOptions,
153
97
  },
154
- },
155
- life: {
156
- count: 1,
157
- },
158
- shape: {
159
- type: "line",
160
- },
161
- size: {
162
- value: {
163
- min: 0.1,
164
- max: 50,
165
- },
166
- animation: {
98
+ move: {
99
+ decay: { min: 0.075, max: 0.1 },
167
100
  enable: true,
168
- sync: true,
169
- speed: 90,
170
- startValue: engine_1.StartValueType.max,
171
- destroy: engine_1.DestroyType.min,
101
+ gravity: {
102
+ enable: true,
103
+ inverse: false,
104
+ acceleration: 5,
105
+ },
106
+ speed: { min: 5, max: 15 },
107
+ direction: "none",
108
+ outModes: engine_1.OutMode.destroy,
172
109
  },
173
- },
174
- stroke: {
175
- color: {
176
- value: "#ffffff",
110
+ };
111
+ })
112
+ .filter(t => t !== undefined);
113
+ return {
114
+ detectRetina: true,
115
+ background: {
116
+ color: "#000",
117
+ },
118
+ fpsLimit: 120,
119
+ emitters: {
120
+ direction: engine_1.MoveDirection.top,
121
+ life: {
122
+ count: 0,
123
+ duration: 0.1,
124
+ delay: 0.1,
125
+ },
126
+ rate: {
127
+ delay: 0.05,
128
+ quantity: 1,
129
+ },
130
+ size: {
131
+ width: 100,
132
+ height: 0,
133
+ },
134
+ position: {
135
+ y: 100,
136
+ x: 50,
137
+ },
138
+ },
139
+ particles: {
140
+ number: {
141
+ value: 0,
142
+ },
143
+ destroy: {
144
+ mode: "split",
145
+ bounds: {
146
+ top: { min: 10, max: 30 },
147
+ },
148
+ split: {
149
+ sizeOffset: false,
150
+ count: 1,
151
+ factor: {
152
+ value: 0.333333,
153
+ },
154
+ rate: {
155
+ value: { min: 75, max: 150 },
156
+ },
157
+ particles: fireworksOptions,
158
+ },
177
159
  },
178
- width: 1,
179
- },
180
- rotate: {
181
- path: true,
182
- },
183
- move: {
184
- enable: true,
185
- gravity: {
186
- acceleration: 15,
187
- enable: true,
188
- inverse: true,
189
- maxSpeed: 100,
160
+ life: {
161
+ count: 1,
190
162
  },
191
- speed: {
192
- min: 10,
193
- max: 20,
163
+ shape: {
164
+ type: "line",
194
165
  },
195
- outModes: {
196
- default: engine_1.OutMode.destroy,
197
- top: engine_1.OutMode.none,
166
+ size: {
167
+ value: {
168
+ min: 0.1,
169
+ max: 50,
170
+ },
171
+ animation: {
172
+ enable: true,
173
+ sync: true,
174
+ speed: 90,
175
+ startValue: engine_1.StartValueType.max,
176
+ destroy: engine_1.DestroyType.min,
177
+ },
198
178
  },
199
- trail: {
200
- fill: {
201
- color: "#000",
179
+ stroke: {
180
+ color: {
181
+ value: "#ffffff",
202
182
  },
183
+ width: 1,
184
+ },
185
+ rotate: {
186
+ path: true,
187
+ },
188
+ move: {
203
189
  enable: true,
204
- length: 10,
190
+ gravity: {
191
+ acceleration: 15,
192
+ enable: true,
193
+ inverse: true,
194
+ maxSpeed: 100,
195
+ },
196
+ speed: {
197
+ min: 10,
198
+ max: 20,
199
+ },
200
+ outModes: {
201
+ default: engine_1.OutMode.destroy,
202
+ top: engine_1.OutMode.none,
203
+ },
204
+ trail: {
205
+ fill: {
206
+ color: "#000",
207
+ },
208
+ enable: true,
209
+ length: 10,
210
+ },
205
211
  },
206
212
  },
207
- },
208
- sounds: {
209
- enable: true,
210
- events: [
211
- {
212
- event: engine_1.EventType.particleRemoved,
213
- filter: explodeSoundCheck,
214
- audio: [
215
- "https://particles.js.org/audio/explosion0.mp3",
216
- "https://particles.js.org/audio/explosion1.mp3",
217
- "https://particles.js.org/audio/explosion2.mp3",
218
- ],
219
- },
220
- ],
221
- volume: 50,
222
- },
223
- };
213
+ sounds: {
214
+ enable: true,
215
+ events: [
216
+ {
217
+ event: engine_1.EventType.particleRemoved,
218
+ filter: explodeSoundCheck,
219
+ audio: [
220
+ "https://particles.js.org/audio/explosion0.mp3",
221
+ "https://particles.js.org/audio/explosion1.mp3",
222
+ "https://particles.js.org/audio/explosion2.mp3",
223
+ ],
224
+ },
225
+ ],
226
+ volume: 50,
227
+ },
228
+ };
229
+ }
230
+ exports.initOptions = initOptions;
224
231
  });