1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | (function webpackUniversalModuleDefinition(root, factory) {
|
18 | if(typeof exports === 'object' && typeof module === 'object')
|
19 | module.exports = factory(require("@tsparticles/engine"), require("@tsparticles/basic"), require("@tsparticles/effect-trail"), require("@tsparticles/updater-life"), require("@tsparticles/updater-destroy"), require("@tsparticles/updater-rotate"), require("@tsparticles/plugin-sounds"), require("@tsparticles/plugin-emitters-shape-square"), require("@tsparticles/plugin-emitters"));
|
20 | else if(typeof define === 'function' && define.amd)
|
21 | define(["@tsparticles/engine", "@tsparticles/basic", "@tsparticles/effect-trail", "@tsparticles/updater-life", "@tsparticles/updater-destroy", "@tsparticles/updater-rotate", "@tsparticles/plugin-sounds", "@tsparticles/plugin-emitters-shape-square", "@tsparticles/plugin-emitters"], factory);
|
22 | else {
|
23 | var a = typeof exports === 'object' ? factory(require("@tsparticles/engine"), require("@tsparticles/basic"), require("@tsparticles/effect-trail"), require("@tsparticles/updater-life"), require("@tsparticles/updater-destroy"), require("@tsparticles/updater-rotate"), require("@tsparticles/plugin-sounds"), require("@tsparticles/plugin-emitters-shape-square"), require("@tsparticles/plugin-emitters")) : factory(root["window"], root["window"], root["window"], root["window"], root["window"], root["window"], root["window"], root["window"], root["window"]);
|
24 | for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
|
25 | }
|
26 | })(this, (__WEBPACK_EXTERNAL_MODULE__tsparticles_engine__, __WEBPACK_EXTERNAL_MODULE__tsparticles_basic__, __WEBPACK_EXTERNAL_MODULE__tsparticles_effect_trail__, __WEBPACK_EXTERNAL_MODULE__tsparticles_updater_life__, __WEBPACK_EXTERNAL_MODULE__tsparticles_updater_destroy__, __WEBPACK_EXTERNAL_MODULE__tsparticles_updater_rotate__, __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_sounds__, __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_emitters_shape_square__, __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_emitters__) => {
|
27 | return (() => {
|
28 | "use strict";
|
29 | var __webpack_modules__ = ({
|
30 |
|
31 | "./dist/browser/FireworkOptions.js":
|
32 |
|
33 |
|
34 |
|
35 | ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
36 |
|
37 | eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ FireworkOptions: () => (/* binding */ FireworkOptions)\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\nclass FireworkOptions {\n constructor() {\n this.background = \"none\";\n this.brightness = {\n min: -30,\n max: 30\n };\n this.colors = [\"#ff595e\", \"#ffca3a\", \"#8ac926\", \"#1982c4\", \"#6a4c93\"];\n this.gravity = 5;\n this.minHeight = {\n min: 10,\n max: 30\n };\n this.rate = 10;\n this.saturation = {\n min: -30,\n max: 30\n };\n this.sounds = true;\n this.speed = {\n min: 5,\n max: 15\n };\n this.splitCount = {\n min: 75,\n max: 150\n };\n }\n load(data) {\n if (!data) {\n return;\n }\n if (data.background !== undefined) {\n this.background = data.background;\n }\n if (data.colors !== undefined) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isArray)(data.colors)) {\n this.colors = [...data.colors];\n } else {\n this.colors = data.colors;\n }\n }\n if (data.brightness !== undefined) {\n this.brightness = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.brightness);\n }\n if (data.gravity !== undefined) {\n this.gravity = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.gravity);\n }\n if (data.minHeight !== undefined) {\n this.minHeight = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.minHeight);\n }\n if (data.rate !== undefined) {\n this.rate = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.rate);\n }\n if (data.saturation !== undefined) {\n this.saturation = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.saturation);\n }\n if (data.sounds !== undefined) {\n this.sounds = data.sounds;\n }\n if (data.speed !== undefined) {\n this.speed = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.speed);\n }\n if (data.splitCount !== undefined) {\n this.splitCount = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.splitCount);\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/fireworks/./dist/browser/FireworkOptions.js?");
|
38 |
|
39 | }),
|
40 |
|
41 | "./dist/browser/fireworks.js":
|
42 |
|
43 |
|
44 |
|
45 | ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
46 |
|
47 | eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ fireworks: () => (/* binding */ fireworks)\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/* harmony import */ var _FireworkOptions_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./FireworkOptions.js */ \"./dist/browser/FireworkOptions.js\");\n\n\nconst minSplitCount = 2;\nlet initialized = false;\nlet initializing = false;\nconst explodeSoundCheck = args => {\n const data = args.data;\n return data.particle.shape === \"circle\" && !!data.particle.splitCount && data.particle.splitCount < minSplitCount;\n};\nclass FireworksInstance {\n constructor(container) {\n this._container = container;\n }\n pause() {\n this._container.pause();\n }\n play() {\n this._container.play();\n }\n stop() {\n this._container.stop();\n }\n}\nasync function initPlugins() {\n if (initialized) {\n return;\n }\n if (initializing) {\n return new Promise(resolve => {\n const timeout = 100,\n interval = setInterval(() => {\n if (!initialized) {\n return;\n }\n clearInterval(interval);\n resolve();\n }, timeout);\n });\n }\n initializing = true;\n const {\n loadEmittersPlugin\n } = await Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! @tsparticles/plugin-emitters */ \"@tsparticles/plugin-emitters\", 23)),\n {\n loadEmittersShapeSquare\n } = await Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! @tsparticles/plugin-emitters-shape-square */ \"@tsparticles/plugin-emitters-shape-square\", 23)),\n {\n loadSoundsPlugin\n } = await Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! @tsparticles/plugin-sounds */ \"@tsparticles/plugin-sounds\", 23)),\n {\n loadRotateUpdater\n } = await Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! @tsparticles/updater-rotate */ \"@tsparticles/updater-rotate\", 23)),\n {\n loadDestroyUpdater\n } = await Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! @tsparticles/updater-destroy */ \"@tsparticles/updater-destroy\", 23)),\n {\n loadLifeUpdater\n } = await Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! @tsparticles/updater-life */ \"@tsparticles/updater-life\", 23)),\n {\n loadTrailEffect\n } = await Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! @tsparticles/effect-trail */ \"@tsparticles/effect-trail\", 23)),\n {\n loadBasic\n } = await Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! @tsparticles/basic */ \"@tsparticles/basic\", 23));\n await loadEmittersPlugin(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.tsParticles, false);\n await loadEmittersShapeSquare(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.tsParticles, false);\n await loadSoundsPlugin(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.tsParticles, false);\n await loadRotateUpdater(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.tsParticles, false);\n await loadDestroyUpdater(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.tsParticles, false);\n await loadLifeUpdater(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.tsParticles, false);\n await loadTrailEffect(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.tsParticles, false);\n await loadBasic(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.tsParticles, false);\n initializing = false;\n initialized = true;\n}\nasync function fireworks(idOrOptions, sourceOptions) {\n await initPlugins();\n let id;\n const options = new _FireworkOptions_js__WEBPACK_IMPORTED_MODULE_1__.FireworkOptions();\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isString)(idOrOptions)) {\n id = idOrOptions;\n options.load(sourceOptions);\n } else {\n id = \"fireworks\";\n options.load(idOrOptions);\n }\n const identity = 1,\n particlesOptions = {\n detectRetina: true,\n background: {\n color: options.background\n },\n fpsLimit: 60,\n emitters: {\n direction: \"top\",\n life: {\n count: 0,\n duration: 0.1,\n delay: 0.1\n },\n rate: {\n delay: (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNumber)(options.rate) ? identity / options.rate : {\n min: identity / (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeMin)(options.rate),\n max: identity / (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeMax)(options.rate)\n },\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 color: {\n value: \"#fff\"\n },\n destroy: {\n mode: \"split\",\n bounds: {\n top: (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(options.minHeight)\n },\n split: {\n sizeOffset: false,\n count: 1,\n factor: {\n value: 0.333333\n },\n rate: {\n value: options.splitCount\n },\n colorOffset: {\n s: options.saturation,\n l: options.brightness\n },\n particles: {\n color: {\n value: options.colors\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: 1,\n sync: false,\n startValue: \"max\",\n destroy: \"min\"\n }\n },\n effect: {\n type: \"trail\",\n options: {\n trail: {\n length: {\n min: 5,\n max: 10\n }\n }\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: \"min\",\n destroy: \"none\"\n }\n },\n life: {\n count: 1,\n duration: {\n value: {\n min: 0.25,\n max: 0.5\n }\n }\n },\n move: {\n decay: {\n min: 0.05,\n max: 0.1\n },\n enable: true,\n gravity: {\n enable: true,\n inverse: false,\n acceleration: (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(options.gravity)\n },\n speed: (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(options.speed),\n direction: \"none\",\n outModes: \"destroy\"\n }\n }\n }\n },\n life: {\n count: 1\n },\n effect: {\n type: \"trail\",\n options: {\n trail: {\n length: {\n min: 10,\n max: 30\n },\n minWidth: 1,\n maxWidth: 1\n }\n }\n },\n shape: {\n type: \"circle\"\n },\n size: {\n value: 1\n },\n opacity: {\n value: 0.5\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: \"destroy\",\n top: \"none\"\n }\n }\n },\n sounds: {\n enable: options.sounds,\n events: [{\n event: \"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 const container = await _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.tsParticles.load({\n id,\n options: particlesOptions\n });\n if (!container) {\n return;\n }\n return new FireworksInstance(container);\n}\nfireworks.version = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.tsParticles.version;\nif (!(0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isSsr)()) {\n window.fireworks = fireworks;\n}\n\n//# sourceURL=webpack://@tsparticles/fireworks/./dist/browser/fireworks.js?");
|
48 |
|
49 | }),
|
50 |
|
51 | "./dist/browser/index.js":
|
52 |
|
53 |
|
54 |
|
55 | ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
56 |
|
57 | eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ fireworks: () => (/* reexport safe */ _fireworks_js__WEBPACK_IMPORTED_MODULE_0__.fireworks)\n/* harmony export */ });\n/* harmony import */ var _fireworks_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./fireworks.js */ \"./dist/browser/fireworks.js\");\n\n\n//# sourceURL=webpack://@tsparticles/fireworks/./dist/browser/index.js?");
|
58 |
|
59 | }),
|
60 |
|
61 | "@tsparticles/basic":
|
62 |
|
63 |
|
64 |
|
65 | ((module) => {
|
66 |
|
67 | module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_basic__;
|
68 |
|
69 | }),
|
70 |
|
71 | "@tsparticles/effect-trail":
|
72 |
|
73 |
|
74 |
|
75 | ((module) => {
|
76 |
|
77 | module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_effect_trail__;
|
78 |
|
79 | }),
|
80 |
|
81 | "@tsparticles/engine":
|
82 |
|
83 |
|
84 |
|
85 | ((module) => {
|
86 |
|
87 | module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
|
88 |
|
89 | }),
|
90 |
|
91 | "@tsparticles/plugin-emitters":
|
92 |
|
93 |
|
94 |
|
95 | ((module) => {
|
96 |
|
97 | module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_emitters__;
|
98 |
|
99 | }),
|
100 |
|
101 | "@tsparticles/plugin-emitters-shape-square":
|
102 |
|
103 |
|
104 |
|
105 | ((module) => {
|
106 |
|
107 | module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_emitters_shape_square__;
|
108 |
|
109 | }),
|
110 |
|
111 | "@tsparticles/plugin-sounds":
|
112 |
|
113 |
|
114 |
|
115 | ((module) => {
|
116 |
|
117 | module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_sounds__;
|
118 |
|
119 | }),
|
120 |
|
121 | "@tsparticles/updater-destroy":
|
122 |
|
123 |
|
124 |
|
125 | ((module) => {
|
126 |
|
127 | module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_updater_destroy__;
|
128 |
|
129 | }),
|
130 |
|
131 | "@tsparticles/updater-life":
|
132 |
|
133 |
|
134 |
|
135 | ((module) => {
|
136 |
|
137 | module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_updater_life__;
|
138 |
|
139 | }),
|
140 |
|
141 | "@tsparticles/updater-rotate":
|
142 |
|
143 |
|
144 |
|
145 | ((module) => {
|
146 |
|
147 | module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_updater_rotate__;
|
148 |
|
149 | })
|
150 |
|
151 | });
|
152 |
|
153 |
|
154 | var __webpack_module_cache__ = {};
|
155 |
|
156 |
|
157 | function __webpack_require__(moduleId) {
|
158 |
|
159 | var cachedModule = __webpack_module_cache__[moduleId];
|
160 | if (cachedModule !== undefined) {
|
161 | return cachedModule.exports;
|
162 | }
|
163 |
|
164 | var module = __webpack_module_cache__[moduleId] = {
|
165 |
|
166 |
|
167 | exports: {}
|
168 | };
|
169 |
|
170 |
|
171 | __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
172 |
|
173 |
|
174 | return module.exports;
|
175 | }
|
176 |
|
177 |
|
178 |
|
179 | (() => {
|
180 |
|
181 | __webpack_require__.n = (module) => {
|
182 | var getter = module && module.__esModule ?
|
183 | () => (module['default']) :
|
184 | () => (module);
|
185 | __webpack_require__.d(getter, { a: getter });
|
186 | return getter;
|
187 | };
|
188 | })();
|
189 |
|
190 |
|
191 | (() => {
|
192 | var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);
|
193 | var leafPrototypes;
|
194 |
|
195 |
|
196 |
|
197 |
|
198 |
|
199 |
|
200 | __webpack_require__.t = function(value, mode) {
|
201 | if(mode & 1) value = this(value);
|
202 | if(mode & 8) return value;
|
203 | if(typeof value === 'object' && value) {
|
204 | if((mode & 4) && value.__esModule) return value;
|
205 | if((mode & 16) && typeof value.then === 'function') return value;
|
206 | }
|
207 | var ns = Object.create(null);
|
208 | __webpack_require__.r(ns);
|
209 | var def = {};
|
210 | leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];
|
211 | for(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {
|
212 | Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));
|
213 | }
|
214 | def['default'] = () => (value);
|
215 | __webpack_require__.d(ns, def);
|
216 | return ns;
|
217 | };
|
218 | })();
|
219 |
|
220 |
|
221 | (() => {
|
222 |
|
223 | __webpack_require__.d = (exports, definition) => {
|
224 | for(var key in definition) {
|
225 | if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
226 | Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
227 | }
|
228 | }
|
229 | };
|
230 | })();
|
231 |
|
232 |
|
233 | (() => {
|
234 | __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
235 | })();
|
236 |
|
237 |
|
238 | (() => {
|
239 |
|
240 | __webpack_require__.r = (exports) => {
|
241 | if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
242 | Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
243 | }
|
244 | Object.defineProperty(exports, '__esModule', { value: true });
|
245 | };
|
246 | })();
|
247 |
|
248 |
|
249 |
|
250 |
|
251 |
|
252 |
|
253 | var __webpack_exports__ = __webpack_require__("./dist/browser/index.js");
|
254 |
|
255 | return __webpack_exports__;
|
256 | })()
|
257 | ;
|
258 | }); |
\ | No newline at end of file |