@tsparticles/preset-fireworks 3.0.0-alpha.1

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.
@@ -0,0 +1,471 @@
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.0.0-alpha.1
8
+ */
9
+ (function webpackUniversalModuleDefinition(root, factory) {
10
+ if(typeof exports === 'object' && typeof module === 'object')
11
+ module.exports = factory(require("@tsparticles/updater-angle"), require("@tsparticles/move-base"), require("@tsparticles/shape-circle"), require("@tsparticles/updater-color"), require("@tsparticles/updater-destroy"), require("@tsparticles/plugin-emitters"), require("@tsparticles/updater-life"), require("@tsparticles/shape-line"), require("@tsparticles/updater-opacity"), require("@tsparticles/updater-out-modes"), require("@tsparticles/updater-size"), require("@tsparticles/plugin-sounds"), require("@tsparticles/updater-stroke-color"), require("@tsparticles/engine"));
12
+ else if(typeof define === 'function' && define.amd)
13
+ define(["@tsparticles/updater-angle", "@tsparticles/move-base", "@tsparticles/shape-circle", "@tsparticles/updater-color", "@tsparticles/updater-destroy", "@tsparticles/plugin-emitters", "@tsparticles/updater-life", "@tsparticles/shape-line", "@tsparticles/updater-opacity", "@tsparticles/updater-out-modes", "@tsparticles/updater-size", "@tsparticles/plugin-sounds", "@tsparticles/updater-stroke-color", "@tsparticles/engine"], factory);
14
+ else {
15
+ var a = typeof exports === 'object' ? factory(require("@tsparticles/updater-angle"), require("@tsparticles/move-base"), require("@tsparticles/shape-circle"), require("@tsparticles/updater-color"), require("@tsparticles/updater-destroy"), require("@tsparticles/plugin-emitters"), require("@tsparticles/updater-life"), require("@tsparticles/shape-line"), require("@tsparticles/updater-opacity"), require("@tsparticles/updater-out-modes"), require("@tsparticles/updater-size"), 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"], root["window"], root["window"], root["window"], root["window"]);
16
+ for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
17
+ }
18
+ })(this, (__WEBPACK_EXTERNAL_MODULE__71__, __WEBPACK_EXTERNAL_MODULE__619__, __WEBPACK_EXTERNAL_MODULE__163__, __WEBPACK_EXTERNAL_MODULE__501__, __WEBPACK_EXTERNAL_MODULE__344__, __WEBPACK_EXTERNAL_MODULE__68__, __WEBPACK_EXTERNAL_MODULE__84__, __WEBPACK_EXTERNAL_MODULE__137__, __WEBPACK_EXTERNAL_MODULE__686__, __WEBPACK_EXTERNAL_MODULE__290__, __WEBPACK_EXTERNAL_MODULE__2__, __WEBPACK_EXTERNAL_MODULE__490__, __WEBPACK_EXTERNAL_MODULE__204__, __WEBPACK_EXTERNAL_MODULE__533__) => {
19
+ return /******/ (() => { // webpackBootstrap
20
+ /******/ "use strict";
21
+ /******/ var __webpack_modules__ = ({
22
+
23
+ /***/ 533:
24
+ /***/ ((module) => {
25
+
26
+ module.exports = __WEBPACK_EXTERNAL_MODULE__533__;
27
+
28
+ /***/ }),
29
+
30
+ /***/ 619:
31
+ /***/ ((module) => {
32
+
33
+ module.exports = __WEBPACK_EXTERNAL_MODULE__619__;
34
+
35
+ /***/ }),
36
+
37
+ /***/ 68:
38
+ /***/ ((module) => {
39
+
40
+ module.exports = __WEBPACK_EXTERNAL_MODULE__68__;
41
+
42
+ /***/ }),
43
+
44
+ /***/ 490:
45
+ /***/ ((module) => {
46
+
47
+ module.exports = __WEBPACK_EXTERNAL_MODULE__490__;
48
+
49
+ /***/ }),
50
+
51
+ /***/ 163:
52
+ /***/ ((module) => {
53
+
54
+ module.exports = __WEBPACK_EXTERNAL_MODULE__163__;
55
+
56
+ /***/ }),
57
+
58
+ /***/ 137:
59
+ /***/ ((module) => {
60
+
61
+ module.exports = __WEBPACK_EXTERNAL_MODULE__137__;
62
+
63
+ /***/ }),
64
+
65
+ /***/ 71:
66
+ /***/ ((module) => {
67
+
68
+ module.exports = __WEBPACK_EXTERNAL_MODULE__71__;
69
+
70
+ /***/ }),
71
+
72
+ /***/ 501:
73
+ /***/ ((module) => {
74
+
75
+ module.exports = __WEBPACK_EXTERNAL_MODULE__501__;
76
+
77
+ /***/ }),
78
+
79
+ /***/ 344:
80
+ /***/ ((module) => {
81
+
82
+ module.exports = __WEBPACK_EXTERNAL_MODULE__344__;
83
+
84
+ /***/ }),
85
+
86
+ /***/ 84:
87
+ /***/ ((module) => {
88
+
89
+ module.exports = __WEBPACK_EXTERNAL_MODULE__84__;
90
+
91
+ /***/ }),
92
+
93
+ /***/ 686:
94
+ /***/ ((module) => {
95
+
96
+ module.exports = __WEBPACK_EXTERNAL_MODULE__686__;
97
+
98
+ /***/ }),
99
+
100
+ /***/ 290:
101
+ /***/ ((module) => {
102
+
103
+ module.exports = __WEBPACK_EXTERNAL_MODULE__290__;
104
+
105
+ /***/ }),
106
+
107
+ /***/ 2:
108
+ /***/ ((module) => {
109
+
110
+ module.exports = __WEBPACK_EXTERNAL_MODULE__2__;
111
+
112
+ /***/ }),
113
+
114
+ /***/ 204:
115
+ /***/ ((module) => {
116
+
117
+ module.exports = __WEBPACK_EXTERNAL_MODULE__204__;
118
+
119
+ /***/ })
120
+
121
+ /******/ });
122
+ /************************************************************************/
123
+ /******/ // The module cache
124
+ /******/ var __webpack_module_cache__ = {};
125
+ /******/
126
+ /******/ // The require function
127
+ /******/ function __webpack_require__(moduleId) {
128
+ /******/ // Check if module is in cache
129
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
130
+ /******/ if (cachedModule !== undefined) {
131
+ /******/ return cachedModule.exports;
132
+ /******/ }
133
+ /******/ // Create a new module (and put it into the cache)
134
+ /******/ var module = __webpack_module_cache__[moduleId] = {
135
+ /******/ // no module.id needed
136
+ /******/ // no module.loaded needed
137
+ /******/ exports: {}
138
+ /******/ };
139
+ /******/
140
+ /******/ // Execute the module function
141
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
142
+ /******/
143
+ /******/ // Return the exports of the module
144
+ /******/ return module.exports;
145
+ /******/ }
146
+ /******/
147
+ /************************************************************************/
148
+ /******/ /* webpack/runtime/define property getters */
149
+ /******/ (() => {
150
+ /******/ // define getter functions for harmony exports
151
+ /******/ __webpack_require__.d = (exports, definition) => {
152
+ /******/ for(var key in definition) {
153
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
154
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
155
+ /******/ }
156
+ /******/ }
157
+ /******/ };
158
+ /******/ })();
159
+ /******/
160
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
161
+ /******/ (() => {
162
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
163
+ /******/ })();
164
+ /******/
165
+ /******/ /* webpack/runtime/make namespace object */
166
+ /******/ (() => {
167
+ /******/ // define __esModule on exports
168
+ /******/ __webpack_require__.r = (exports) => {
169
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
170
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
171
+ /******/ }
172
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
173
+ /******/ };
174
+ /******/ })();
175
+ /******/
176
+ /************************************************************************/
177
+ var __webpack_exports__ = {};
178
+ // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
179
+ (() => {
180
+ // ESM COMPAT FLAG
181
+ __webpack_require__.r(__webpack_exports__);
182
+
183
+ // EXPORTS
184
+ __webpack_require__.d(__webpack_exports__, {
185
+ "loadFireworksPreset": () => (/* binding */ loadFireworksPreset)
186
+ });
187
+
188
+ // EXTERNAL MODULE: external {"commonjs":"@tsparticles/updater-angle","commonjs2":"@tsparticles/updater-angle","amd":"@tsparticles/updater-angle","root":"window"}
189
+ var updater_angle_root_window_ = __webpack_require__(71);
190
+ // EXTERNAL MODULE: external {"commonjs":"@tsparticles/move-base","commonjs2":"@tsparticles/move-base","amd":"@tsparticles/move-base","root":"window"}
191
+ var move_base_root_window_ = __webpack_require__(619);
192
+ // EXTERNAL MODULE: external {"commonjs":"@tsparticles/shape-circle","commonjs2":"@tsparticles/shape-circle","amd":"@tsparticles/shape-circle","root":"window"}
193
+ var shape_circle_root_window_ = __webpack_require__(163);
194
+ // EXTERNAL MODULE: external {"commonjs":"@tsparticles/updater-color","commonjs2":"@tsparticles/updater-color","amd":"@tsparticles/updater-color","root":"window"}
195
+ var updater_color_root_window_ = __webpack_require__(501);
196
+ // EXTERNAL MODULE: external {"commonjs":"@tsparticles/updater-destroy","commonjs2":"@tsparticles/updater-destroy","amd":"@tsparticles/updater-destroy","root":"window"}
197
+ var updater_destroy_root_window_ = __webpack_require__(344);
198
+ // EXTERNAL MODULE: external {"commonjs":"@tsparticles/plugin-emitters","commonjs2":"@tsparticles/plugin-emitters","amd":"@tsparticles/plugin-emitters","root":"window"}
199
+ var plugin_emitters_root_window_ = __webpack_require__(68);
200
+ // EXTERNAL MODULE: external {"commonjs":"@tsparticles/updater-life","commonjs2":"@tsparticles/updater-life","amd":"@tsparticles/updater-life","root":"window"}
201
+ var updater_life_root_window_ = __webpack_require__(84);
202
+ // EXTERNAL MODULE: external {"commonjs":"@tsparticles/shape-line","commonjs2":"@tsparticles/shape-line","amd":"@tsparticles/shape-line","root":"window"}
203
+ var shape_line_root_window_ = __webpack_require__(137);
204
+ // EXTERNAL MODULE: external {"commonjs":"@tsparticles/updater-opacity","commonjs2":"@tsparticles/updater-opacity","amd":"@tsparticles/updater-opacity","root":"window"}
205
+ var updater_opacity_root_window_ = __webpack_require__(686);
206
+ // EXTERNAL MODULE: external {"commonjs":"@tsparticles/updater-out-modes","commonjs2":"@tsparticles/updater-out-modes","amd":"@tsparticles/updater-out-modes","root":"window"}
207
+ var updater_out_modes_root_window_ = __webpack_require__(290);
208
+ // EXTERNAL MODULE: external {"commonjs":"@tsparticles/updater-size","commonjs2":"@tsparticles/updater-size","amd":"@tsparticles/updater-size","root":"window"}
209
+ var updater_size_root_window_ = __webpack_require__(2);
210
+ // EXTERNAL MODULE: external {"commonjs":"@tsparticles/plugin-sounds","commonjs2":"@tsparticles/plugin-sounds","amd":"@tsparticles/plugin-sounds","root":"window"}
211
+ var plugin_sounds_root_window_ = __webpack_require__(490);
212
+ // EXTERNAL MODULE: external {"commonjs":"@tsparticles/updater-stroke-color","commonjs2":"@tsparticles/updater-stroke-color","amd":"@tsparticles/updater-stroke-color","root":"window"}
213
+ var updater_stroke_color_root_window_ = __webpack_require__(204);
214
+ // EXTERNAL MODULE: external {"commonjs":"@tsparticles/engine","commonjs2":"@tsparticles/engine","amd":"@tsparticles/engine","root":"window"}
215
+ var engine_root_window_ = __webpack_require__(533);
216
+ ;// CONCATENATED MODULE: ./dist/browser/options.js
217
+
218
+ const explodeSoundCheck = args => {
219
+ const data = args.data;
220
+ return data.particle.shape === "line";
221
+ };
222
+ const fixRange = (value, min, max) => {
223
+ const diffSMax = value.max > max ? value.max - max : 0;
224
+ let res = (0,engine_root_window_.setRangeValue)(value);
225
+ if (diffSMax) {
226
+ res = (0,engine_root_window_.setRangeValue)(value.min - diffSMax, max);
227
+ }
228
+ const diffSMin = value.min < min ? value.min : 0;
229
+ if (diffSMin) {
230
+ res = (0,engine_root_window_.setRangeValue)(0, value.max + diffSMin);
231
+ }
232
+ return res;
233
+ };
234
+ const fireworksOptions = ["#ff595e", "#ffca3a", "#8ac926", "#1982c4", "#6a4c93"].map(color => {
235
+ const rgb = (0,engine_root_window_.stringToRgb)(color);
236
+ if (!rgb) {
237
+ return undefined;
238
+ }
239
+ const hsl = (0,engine_root_window_.rgbToHsl)(rgb),
240
+ sRange = fixRange({
241
+ min: hsl.s - 30,
242
+ max: hsl.s + 30
243
+ }, 0, 100),
244
+ lRange = fixRange({
245
+ min: hsl.l - 30,
246
+ max: hsl.l + 30
247
+ }, 0, 100);
248
+ return {
249
+ color: {
250
+ value: {
251
+ h: hsl.h,
252
+ s: sRange,
253
+ l: lRange
254
+ }
255
+ },
256
+ stroke: {
257
+ width: 0
258
+ },
259
+ number: {
260
+ value: 0
261
+ },
262
+ opacity: {
263
+ value: {
264
+ min: 0.1,
265
+ max: 1
266
+ },
267
+ animation: {
268
+ enable: true,
269
+ speed: 0.7,
270
+ sync: false,
271
+ startValue: "max",
272
+ destroy: "min"
273
+ }
274
+ },
275
+ shape: {
276
+ type: "circle"
277
+ },
278
+ size: {
279
+ value: {
280
+ min: 1,
281
+ max: 2
282
+ },
283
+ animation: {
284
+ enable: true,
285
+ speed: 5,
286
+ count: 1,
287
+ sync: false,
288
+ startValue: "min",
289
+ destroy: "none"
290
+ }
291
+ },
292
+ life: {
293
+ count: 1,
294
+ duration: {
295
+ value: {
296
+ min: 1,
297
+ max: 2
298
+ }
299
+ }
300
+ },
301
+ move: {
302
+ decay: {
303
+ min: 0.075,
304
+ max: 0.1
305
+ },
306
+ enable: true,
307
+ gravity: {
308
+ enable: true,
309
+ inverse: false,
310
+ acceleration: 5
311
+ },
312
+ speed: {
313
+ min: 5,
314
+ max: 15
315
+ },
316
+ direction: "none",
317
+ outModes: "destroy"
318
+ }
319
+ };
320
+ }).filter(t => t !== undefined);
321
+ const options = {
322
+ detectRetina: true,
323
+ background: {
324
+ color: "#000"
325
+ },
326
+ fpsLimit: 120,
327
+ emitters: {
328
+ direction: "top",
329
+ life: {
330
+ count: 0,
331
+ duration: 0.1,
332
+ delay: 0.1
333
+ },
334
+ rate: {
335
+ delay: 0.05,
336
+ quantity: 1
337
+ },
338
+ size: {
339
+ width: 100,
340
+ height: 0
341
+ },
342
+ position: {
343
+ y: 100,
344
+ x: 50
345
+ }
346
+ },
347
+ particles: {
348
+ number: {
349
+ value: 0
350
+ },
351
+ destroy: {
352
+ mode: "split",
353
+ bounds: {
354
+ top: {
355
+ min: 10,
356
+ max: 30
357
+ }
358
+ },
359
+ split: {
360
+ sizeOffset: false,
361
+ count: 1,
362
+ factor: {
363
+ value: 0.333333
364
+ },
365
+ rate: {
366
+ value: {
367
+ min: 75,
368
+ max: 150
369
+ }
370
+ },
371
+ particles: fireworksOptions
372
+ }
373
+ },
374
+ life: {
375
+ count: 1
376
+ },
377
+ shape: {
378
+ type: "line"
379
+ },
380
+ size: {
381
+ value: {
382
+ min: 0.1,
383
+ max: 50
384
+ },
385
+ animation: {
386
+ enable: true,
387
+ sync: true,
388
+ speed: 90,
389
+ startValue: "max",
390
+ destroy: "min"
391
+ }
392
+ },
393
+ stroke: {
394
+ color: {
395
+ value: "#ffffff"
396
+ },
397
+ width: 1
398
+ },
399
+ rotate: {
400
+ path: true
401
+ },
402
+ move: {
403
+ enable: true,
404
+ gravity: {
405
+ acceleration: 15,
406
+ enable: true,
407
+ inverse: true,
408
+ maxSpeed: 100
409
+ },
410
+ speed: {
411
+ min: 10,
412
+ max: 20
413
+ },
414
+ outModes: {
415
+ default: "destroy",
416
+ top: "none"
417
+ },
418
+ trail: {
419
+ fillColor: "#000",
420
+ enable: true,
421
+ length: 10
422
+ }
423
+ }
424
+ },
425
+ sounds: {
426
+ enable: true,
427
+ events: [{
428
+ event: "particleRemoved",
429
+ filter: explodeSoundCheck,
430
+ audio: ["https://particles.js.org/audio/explosion0.mp3", "https://particles.js.org/audio/explosion1.mp3", "https://particles.js.org/audio/explosion2.mp3"]
431
+ }],
432
+ volume: 50
433
+ }
434
+ };
435
+ ;// CONCATENATED MODULE: ./dist/browser/index.js
436
+
437
+
438
+
439
+
440
+
441
+
442
+
443
+
444
+
445
+
446
+
447
+
448
+
449
+
450
+ async function loadFireworksPreset(engine) {
451
+ await (0,move_base_root_window_.loadBaseMover)(engine);
452
+ await (0,plugin_emitters_root_window_.loadEmittersPlugin)(engine);
453
+ await (0,plugin_sounds_root_window_.loadSoundsPlugin)(engine);
454
+ await (0,shape_circle_root_window_.loadCircleShape)(engine);
455
+ await (0,shape_line_root_window_.loadLineShape)(engine);
456
+ await (0,updater_angle_root_window_.loadAngleUpdater)(engine);
457
+ await (0,updater_color_root_window_.loadColorUpdater)(engine);
458
+ await (0,updater_destroy_root_window_.loadDestroyUpdater)(engine);
459
+ await (0,updater_life_root_window_.loadLifeUpdater)(engine);
460
+ await (0,updater_opacity_root_window_.loadOpacityUpdater)(engine);
461
+ await (0,updater_out_modes_root_window_.loadOutModesUpdater)(engine);
462
+ await (0,updater_size_root_window_.loadSizeUpdater)(engine);
463
+ await (0,updater_stroke_color_root_window_.loadStrokeColorUpdater)(engine);
464
+ await engine.addPreset("fireworks", options);
465
+ }
466
+ })();
467
+
468
+ /******/ return __webpack_exports__;
469
+ /******/ })()
470
+ ;
471
+ });
@@ -0,0 +1,2 @@
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/updater-angle"),require("@tsparticles/move-base"),require("@tsparticles/shape-circle"),require("@tsparticles/updater-color"),require("@tsparticles/updater-destroy"),require("@tsparticles/plugin-emitters"),require("@tsparticles/updater-life"),require("@tsparticles/shape-line"),require("@tsparticles/updater-opacity"),require("@tsparticles/updater-out-modes"),require("@tsparticles/updater-size"),require("@tsparticles/plugin-sounds"),require("@tsparticles/updater-stroke-color"),require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/updater-angle","@tsparticles/move-base","@tsparticles/shape-circle","@tsparticles/updater-color","@tsparticles/updater-destroy","@tsparticles/plugin-emitters","@tsparticles/updater-life","@tsparticles/shape-line","@tsparticles/updater-opacity","@tsparticles/updater-out-modes","@tsparticles/updater-size","@tsparticles/plugin-sounds","@tsparticles/updater-stroke-color","@tsparticles/engine"],t);else{var r="object"==typeof exports?t(require("@tsparticles/updater-angle"),require("@tsparticles/move-base"),require("@tsparticles/shape-circle"),require("@tsparticles/updater-color"),require("@tsparticles/updater-destroy"),require("@tsparticles/plugin-emitters"),require("@tsparticles/updater-life"),require("@tsparticles/shape-line"),require("@tsparticles/updater-opacity"),require("@tsparticles/updater-out-modes"),require("@tsparticles/updater-size"),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,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,l,p,n,d,u,c,m)=>(()=>{"use strict";var f={533:e=>{e.exports=m},619:e=>{e.exports=t},68:e=>{e.exports=s},490:e=>{e.exports=u},163:e=>{e.exports=r},137:e=>{e.exports=l},71:t=>{t.exports=e},501:e=>{e.exports=a},344:e=>{e.exports=i},84:e=>{e.exports=o},686:e=>{e.exports=p},290:e=>{e.exports=n},2:e=>{e.exports=d},204:e=>{e.exports=c}},w={};function x(e){var t=w[e];if(void 0!==t)return t.exports;var r=w[e]={exports:{}};return f[e](r,r.exports,x),r.exports}x.d=(e,t)=>{for(var r in t)x.o(t,r)&&!x.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},x.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),x.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var y={};return(()=>{x.r(y),x.d(y,{loadFireworksPreset:()=>v});var e=x(71),t=x(619),r=x(163),a=x(501),i=x(344),s=x(68),o=x(84),l=x(137),p=x(686),n=x(290),d=x(2),u=x(490),c=x(204),m=x(533);const f=(e,t,r)=>{const a=e.max>r?e.max-r:0;let i=(0,m.setRangeValue)(e);a&&(i=(0,m.setRangeValue)(e.min-a,r));const s=e.min<t?e.min:0;return s&&(i=(0,m.setRangeValue)(0,e.max+s)),i},w={detectRetina:!0,background:{color:"#000"},fpsLimit:120,emitters:{direction:"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:["#ff595e","#ffca3a","#8ac926","#1982c4","#6a4c93"].map((e=>{const t=(0,m.stringToRgb)(e);if(!t)return;const r=(0,m.rgbToHsl)(t),a=f({min:r.s-30,max:r.s+30},0,100),i=f({min:r.l-30,max:r.l+30},0,100);return{color:{value:{h:r.h,s:a,l:i}},stroke:{width:0},number:{value:0},opacity:{value:{min:.1,max:1},animation:{enable:!0,speed:.7,sync:!1,startValue:"max",destroy:"min"}},shape:{type:"circle"},size:{value:{min:1,max:2},animation:{enable:!0,speed:5,count:1,sync:!1,startValue:"min",destroy:"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:"destroy"}}})).filter((e=>void 0!==e))}},life:{count:1},shape:{type:"line"},size:{value:{min:.1,max:50},animation:{enable:!0,sync:!0,speed:90,startValue:"max",destroy:"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:"destroy",top:"none"},trail:{fillColor:"#000",enable:!0,length:10}}},sounds:{enable:!0,events:[{event:"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 v(m){await(0,t.loadBaseMover)(m),await(0,s.loadEmittersPlugin)(m),await(0,u.loadSoundsPlugin)(m),await(0,r.loadCircleShape)(m),await(0,l.loadLineShape)(m),await(0,e.loadAngleUpdater)(m),await(0,a.loadColorUpdater)(m),await(0,i.loadDestroyUpdater)(m),await(0,o.loadLifeUpdater)(m),await(0,p.loadOpacityUpdater)(m),await(0,n.loadOutModesUpdater)(m),await(0,d.loadSizeUpdater)(m),await(0,c.loadStrokeColorUpdater)(m),await m.addPreset("fireworks",w)}})(),y})()));
@@ -0,0 +1,8 @@
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.0.0-alpha.1
8
+ */
@@ -0,0 +1,3 @@
1
+ import { loadFireworksPreset } from ".";
2
+ import { tsParticles } from "@tsparticles/engine";
3
+ export { loadFireworksPreset, tsParticles };
@@ -0,0 +1,2 @@
1
+ import type { Engine } from "@tsparticles/engine";
2
+ export declare function loadFireworksPreset(engine: Engine): Promise<void>;
@@ -0,0 +1,2 @@
1
+ import type { ISourceOptions } from "@tsparticles/engine";
2
+ export declare const options: ISourceOptions;
package/umd/bundle.js ADDED
@@ -0,0 +1,20 @@
1
+ (function (factory) {
2
+ if (typeof module === "object" && typeof module.exports === "object") {
3
+ var v = factory(require, exports);
4
+ if (v !== undefined) module.exports = v;
5
+ }
6
+ else if (typeof define === "function" && define.amd) {
7
+ define(["require", "exports", ".", "@tsparticles/engine"], factory);
8
+ }
9
+ })(function (require, exports) {
10
+ "use strict";
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.tsParticles = exports.loadFireworksPreset = void 0;
13
+ const _1 = require(".");
14
+ Object.defineProperty(exports, "loadFireworksPreset", { enumerable: true, get: function () { return _1.loadFireworksPreset; } });
15
+ const engine_1 = require("@tsparticles/engine");
16
+ Object.defineProperty(exports, "tsParticles", { enumerable: true, get: function () { return engine_1.tsParticles; } });
17
+ (async () => {
18
+ await (0, _1.loadFireworksPreset)(engine_1.tsParticles);
19
+ })();
20
+ });
package/umd/index.js ADDED
@@ -0,0 +1,44 @@
1
+ (function (factory) {
2
+ if (typeof module === "object" && typeof module.exports === "object") {
3
+ var v = factory(require, exports);
4
+ if (v !== undefined) module.exports = v;
5
+ }
6
+ else if (typeof define === "function" && define.amd) {
7
+ define(["require", "exports", "@tsparticles/updater-angle", "@tsparticles/move-base", "@tsparticles/shape-circle", "@tsparticles/updater-color", "@tsparticles/updater-destroy", "@tsparticles/plugin-emitters", "@tsparticles/updater-life", "@tsparticles/shape-line", "@tsparticles/updater-opacity", "@tsparticles/updater-out-modes", "@tsparticles/updater-size", "@tsparticles/plugin-sounds", "@tsparticles/updater-stroke-color", "./options"], factory);
8
+ }
9
+ })(function (require, exports) {
10
+ "use strict";
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.loadFireworksPreset = void 0;
13
+ const updater_angle_1 = require("@tsparticles/updater-angle");
14
+ const move_base_1 = require("@tsparticles/move-base");
15
+ const shape_circle_1 = require("@tsparticles/shape-circle");
16
+ const updater_color_1 = require("@tsparticles/updater-color");
17
+ const updater_destroy_1 = require("@tsparticles/updater-destroy");
18
+ const plugin_emitters_1 = require("@tsparticles/plugin-emitters");
19
+ const updater_life_1 = require("@tsparticles/updater-life");
20
+ const shape_line_1 = require("@tsparticles/shape-line");
21
+ const updater_opacity_1 = require("@tsparticles/updater-opacity");
22
+ const updater_out_modes_1 = require("@tsparticles/updater-out-modes");
23
+ const updater_size_1 = require("@tsparticles/updater-size");
24
+ const plugin_sounds_1 = require("@tsparticles/plugin-sounds");
25
+ const updater_stroke_color_1 = require("@tsparticles/updater-stroke-color");
26
+ const options_1 = require("./options");
27
+ async function loadFireworksPreset(engine) {
28
+ await (0, move_base_1.loadBaseMover)(engine);
29
+ await (0, plugin_emitters_1.loadEmittersPlugin)(engine);
30
+ await (0, plugin_sounds_1.loadSoundsPlugin)(engine);
31
+ await (0, shape_circle_1.loadCircleShape)(engine);
32
+ await (0, shape_line_1.loadLineShape)(engine);
33
+ await (0, updater_angle_1.loadAngleUpdater)(engine);
34
+ await (0, updater_color_1.loadColorUpdater)(engine);
35
+ await (0, updater_destroy_1.loadDestroyUpdater)(engine);
36
+ await (0, updater_life_1.loadLifeUpdater)(engine);
37
+ await (0, updater_opacity_1.loadOpacityUpdater)(engine);
38
+ await (0, updater_out_modes_1.loadOutModesUpdater)(engine);
39
+ await (0, updater_size_1.loadSizeUpdater)(engine);
40
+ await (0, updater_stroke_color_1.loadStrokeColorUpdater)(engine);
41
+ await engine.addPreset("fireworks", options_1.options);
42
+ }
43
+ exports.loadFireworksPreset = loadFireworksPreset;
44
+ });