@tsparticles/preset-confetti 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,520 @@
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/engine"), require("@tsparticles/updater-angle"), require("@tsparticles/move-base"), require("@tsparticles/shape-circle"), require("@tsparticles/updater-color"), require("@tsparticles/plugin-emitters"), require("@tsparticles/updater-life"), require("@tsparticles/plugin-motion"), require("@tsparticles/updater-opacity"), require("@tsparticles/updater-out-modes"), require("@tsparticles/updater-roll"), require("@tsparticles/updater-size"), require("@tsparticles/shape-square"), require("@tsparticles/updater-tilt"), require("@tsparticles/updater-wobble"));
12
+ else if(typeof define === 'function' && define.amd)
13
+ define(["@tsparticles/engine", "@tsparticles/updater-angle", "@tsparticles/move-base", "@tsparticles/shape-circle", "@tsparticles/updater-color", "@tsparticles/plugin-emitters", "@tsparticles/updater-life", "@tsparticles/plugin-motion", "@tsparticles/updater-opacity", "@tsparticles/updater-out-modes", "@tsparticles/updater-roll", "@tsparticles/updater-size", "@tsparticles/shape-square", "@tsparticles/updater-tilt", "@tsparticles/updater-wobble"], factory);
14
+ else {
15
+ var a = typeof exports === 'object' ? factory(require("@tsparticles/engine"), require("@tsparticles/updater-angle"), require("@tsparticles/move-base"), require("@tsparticles/shape-circle"), require("@tsparticles/updater-color"), require("@tsparticles/plugin-emitters"), require("@tsparticles/updater-life"), require("@tsparticles/plugin-motion"), require("@tsparticles/updater-opacity"), require("@tsparticles/updater-out-modes"), require("@tsparticles/updater-roll"), require("@tsparticles/updater-size"), require("@tsparticles/shape-square"), require("@tsparticles/updater-tilt"), require("@tsparticles/updater-wobble")) : 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"], root["window"]);
16
+ for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
17
+ }
18
+ })(this, (__WEBPACK_EXTERNAL_MODULE__533__, __WEBPACK_EXTERNAL_MODULE__71__, __WEBPACK_EXTERNAL_MODULE__619__, __WEBPACK_EXTERNAL_MODULE__163__, __WEBPACK_EXTERNAL_MODULE__501__, __WEBPACK_EXTERNAL_MODULE__68__, __WEBPACK_EXTERNAL_MODULE__84__, __WEBPACK_EXTERNAL_MODULE__82__, __WEBPACK_EXTERNAL_MODULE__686__, __WEBPACK_EXTERNAL_MODULE__290__, __WEBPACK_EXTERNAL_MODULE__734__, __WEBPACK_EXTERNAL_MODULE__2__, __WEBPACK_EXTERNAL_MODULE__652__, __WEBPACK_EXTERNAL_MODULE__448__, __WEBPACK_EXTERNAL_MODULE__83__) => {
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
+ /***/ 82:
45
+ /***/ ((module) => {
46
+
47
+ module.exports = __WEBPACK_EXTERNAL_MODULE__82__;
48
+
49
+ /***/ }),
50
+
51
+ /***/ 163:
52
+ /***/ ((module) => {
53
+
54
+ module.exports = __WEBPACK_EXTERNAL_MODULE__163__;
55
+
56
+ /***/ }),
57
+
58
+ /***/ 652:
59
+ /***/ ((module) => {
60
+
61
+ module.exports = __WEBPACK_EXTERNAL_MODULE__652__;
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
+ /***/ 84:
80
+ /***/ ((module) => {
81
+
82
+ module.exports = __WEBPACK_EXTERNAL_MODULE__84__;
83
+
84
+ /***/ }),
85
+
86
+ /***/ 686:
87
+ /***/ ((module) => {
88
+
89
+ module.exports = __WEBPACK_EXTERNAL_MODULE__686__;
90
+
91
+ /***/ }),
92
+
93
+ /***/ 290:
94
+ /***/ ((module) => {
95
+
96
+ module.exports = __WEBPACK_EXTERNAL_MODULE__290__;
97
+
98
+ /***/ }),
99
+
100
+ /***/ 734:
101
+ /***/ ((module) => {
102
+
103
+ module.exports = __WEBPACK_EXTERNAL_MODULE__734__;
104
+
105
+ /***/ }),
106
+
107
+ /***/ 2:
108
+ /***/ ((module) => {
109
+
110
+ module.exports = __WEBPACK_EXTERNAL_MODULE__2__;
111
+
112
+ /***/ }),
113
+
114
+ /***/ 448:
115
+ /***/ ((module) => {
116
+
117
+ module.exports = __WEBPACK_EXTERNAL_MODULE__448__;
118
+
119
+ /***/ }),
120
+
121
+ /***/ 83:
122
+ /***/ ((module) => {
123
+
124
+ module.exports = __WEBPACK_EXTERNAL_MODULE__83__;
125
+
126
+ /***/ })
127
+
128
+ /******/ });
129
+ /************************************************************************/
130
+ /******/ // The module cache
131
+ /******/ var __webpack_module_cache__ = {};
132
+ /******/
133
+ /******/ // The require function
134
+ /******/ function __webpack_require__(moduleId) {
135
+ /******/ // Check if module is in cache
136
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
137
+ /******/ if (cachedModule !== undefined) {
138
+ /******/ return cachedModule.exports;
139
+ /******/ }
140
+ /******/ // Create a new module (and put it into the cache)
141
+ /******/ var module = __webpack_module_cache__[moduleId] = {
142
+ /******/ // no module.id needed
143
+ /******/ // no module.loaded needed
144
+ /******/ exports: {}
145
+ /******/ };
146
+ /******/
147
+ /******/ // Execute the module function
148
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
149
+ /******/
150
+ /******/ // Return the exports of the module
151
+ /******/ return module.exports;
152
+ /******/ }
153
+ /******/
154
+ /************************************************************************/
155
+ /******/ /* webpack/runtime/define property getters */
156
+ /******/ (() => {
157
+ /******/ // define getter functions for harmony exports
158
+ /******/ __webpack_require__.d = (exports, definition) => {
159
+ /******/ for(var key in definition) {
160
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
161
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
162
+ /******/ }
163
+ /******/ }
164
+ /******/ };
165
+ /******/ })();
166
+ /******/
167
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
168
+ /******/ (() => {
169
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
170
+ /******/ })();
171
+ /******/
172
+ /******/ /* webpack/runtime/make namespace object */
173
+ /******/ (() => {
174
+ /******/ // define __esModule on exports
175
+ /******/ __webpack_require__.r = (exports) => {
176
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
177
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
178
+ /******/ }
179
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
180
+ /******/ };
181
+ /******/ })();
182
+ /******/
183
+ /************************************************************************/
184
+ var __webpack_exports__ = {};
185
+ // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
186
+ (() => {
187
+ // ESM COMPAT FLAG
188
+ __webpack_require__.r(__webpack_exports__);
189
+
190
+ // EXPORTS
191
+ __webpack_require__.d(__webpack_exports__, {
192
+ "confetti": () => (/* binding */ confetti),
193
+ "loadConfettiPreset": () => (/* binding */ loadConfettiPreset)
194
+ });
195
+
196
+ // EXTERNAL MODULE: external {"commonjs":"@tsparticles/engine","commonjs2":"@tsparticles/engine","amd":"@tsparticles/engine","root":"window"}
197
+ var engine_root_window_ = __webpack_require__(533);
198
+ // EXTERNAL MODULE: external {"commonjs":"@tsparticles/updater-angle","commonjs2":"@tsparticles/updater-angle","amd":"@tsparticles/updater-angle","root":"window"}
199
+ var updater_angle_root_window_ = __webpack_require__(71);
200
+ // EXTERNAL MODULE: external {"commonjs":"@tsparticles/move-base","commonjs2":"@tsparticles/move-base","amd":"@tsparticles/move-base","root":"window"}
201
+ var move_base_root_window_ = __webpack_require__(619);
202
+ // EXTERNAL MODULE: external {"commonjs":"@tsparticles/shape-circle","commonjs2":"@tsparticles/shape-circle","amd":"@tsparticles/shape-circle","root":"window"}
203
+ var shape_circle_root_window_ = __webpack_require__(163);
204
+ // EXTERNAL MODULE: external {"commonjs":"@tsparticles/updater-color","commonjs2":"@tsparticles/updater-color","amd":"@tsparticles/updater-color","root":"window"}
205
+ var updater_color_root_window_ = __webpack_require__(501);
206
+ // EXTERNAL MODULE: external {"commonjs":"@tsparticles/plugin-emitters","commonjs2":"@tsparticles/plugin-emitters","amd":"@tsparticles/plugin-emitters","root":"window"}
207
+ var plugin_emitters_root_window_ = __webpack_require__(68);
208
+ // EXTERNAL MODULE: external {"commonjs":"@tsparticles/updater-life","commonjs2":"@tsparticles/updater-life","amd":"@tsparticles/updater-life","root":"window"}
209
+ var updater_life_root_window_ = __webpack_require__(84);
210
+ // EXTERNAL MODULE: external {"commonjs":"@tsparticles/plugin-motion","commonjs2":"@tsparticles/plugin-motion","amd":"@tsparticles/plugin-motion","root":"window"}
211
+ var plugin_motion_root_window_ = __webpack_require__(82);
212
+ // EXTERNAL MODULE: external {"commonjs":"@tsparticles/updater-opacity","commonjs2":"@tsparticles/updater-opacity","amd":"@tsparticles/updater-opacity","root":"window"}
213
+ var updater_opacity_root_window_ = __webpack_require__(686);
214
+ ;// CONCATENATED MODULE: ./dist/browser/ConfettiOptions.js
215
+ class ConfettiOptions {
216
+ constructor() {
217
+ this.angle = 90;
218
+ this.count = 50;
219
+ this.spread = 45;
220
+ this.startVelocity = 45;
221
+ this.decay = 0.9;
222
+ this.gravity = 1;
223
+ this.drift = 0;
224
+ this.ticks = 200;
225
+ this.position = {
226
+ x: 50,
227
+ y: 50
228
+ };
229
+ this.colors = ["#ffffff", "#ff0000"];
230
+ this.shapes = ["square", "circle"];
231
+ this.scalar = 1;
232
+ this.zIndex = 100;
233
+ this.disableForReducedMotion = true;
234
+ }
235
+ get origin() {
236
+ return {
237
+ x: this.position.x / 100,
238
+ y: this.position.y / 100
239
+ };
240
+ }
241
+ set origin(value) {
242
+ this.position.x = value.x * 100;
243
+ this.position.y = value.y * 100;
244
+ }
245
+ get particleCount() {
246
+ return this.count;
247
+ }
248
+ set particleCount(value) {
249
+ this.count = value;
250
+ }
251
+ load(data) {
252
+ var _a, _b;
253
+ if (!data) {
254
+ return;
255
+ }
256
+ if (data.angle !== undefined) {
257
+ this.angle = data.angle;
258
+ }
259
+ const count = (_a = data.count) !== null && _a !== void 0 ? _a : data.particleCount;
260
+ if (count !== undefined) {
261
+ this.count = count;
262
+ }
263
+ if (data.spread !== undefined) {
264
+ this.spread = data.spread;
265
+ }
266
+ if (data.startVelocity !== undefined) {
267
+ this.startVelocity = data.startVelocity;
268
+ }
269
+ if (data.decay !== undefined) {
270
+ this.decay = data.decay;
271
+ }
272
+ if (data.gravity !== undefined) {
273
+ this.gravity = data.gravity;
274
+ }
275
+ if (data.drift !== undefined) {
276
+ this.drift = data.drift;
277
+ }
278
+ if (data.ticks !== undefined) {
279
+ this.ticks = data.ticks;
280
+ }
281
+ const position = (_b = data.position) !== null && _b !== void 0 ? _b : this.position;
282
+ if ((position === null || position === void 0 ? void 0 : position.x) !== undefined) {
283
+ this.position.x = position.x;
284
+ }
285
+ if ((position === null || position === void 0 ? void 0 : position.y) !== undefined) {
286
+ this.position.y = position.y;
287
+ }
288
+ if (data.colors !== undefined) {
289
+ if (data.colors instanceof Array) {
290
+ this.colors = [...data.colors];
291
+ } else {
292
+ this.colors = data.colors;
293
+ }
294
+ }
295
+ if (data.shapes !== undefined) {
296
+ if (data.shapes instanceof Array) {
297
+ this.shapes = [...data.shapes];
298
+ } else {
299
+ this.shapes = data.shapes;
300
+ }
301
+ }
302
+ if (data.scalar !== undefined) {
303
+ this.scalar = data.scalar;
304
+ }
305
+ if (data.zIndex !== undefined) {
306
+ this.zIndex = data.zIndex;
307
+ }
308
+ if (data.disableForReducedMotion !== undefined) {
309
+ this.disableForReducedMotion = data.disableForReducedMotion;
310
+ }
311
+ }
312
+ }
313
+ ;// CONCATENATED MODULE: ./dist/browser/options.js
314
+
315
+ const loadOptions = confettiOptions => {
316
+ const actualOptions = new ConfettiOptions();
317
+ actualOptions.load(confettiOptions);
318
+ return {
319
+ fullScreen: {
320
+ enable: true,
321
+ zIndex: actualOptions.zIndex
322
+ },
323
+ fpsLimit: 120,
324
+ particles: {
325
+ number: {
326
+ value: 0
327
+ },
328
+ color: {
329
+ value: actualOptions.colors
330
+ },
331
+ shape: {
332
+ type: actualOptions.shapes
333
+ },
334
+ opacity: {
335
+ value: {
336
+ min: 0,
337
+ max: 1
338
+ },
339
+ animation: {
340
+ enable: true,
341
+ speed: 0.5,
342
+ startValue: "max",
343
+ destroy: "min"
344
+ }
345
+ },
346
+ size: {
347
+ value: 5 * actualOptions.scalar
348
+ },
349
+ links: {
350
+ enable: false
351
+ },
352
+ life: {
353
+ duration: {
354
+ sync: true,
355
+ value: actualOptions.ticks / 60
356
+ },
357
+ count: 1
358
+ },
359
+ move: {
360
+ angle: {
361
+ value: actualOptions.spread,
362
+ offset: 0
363
+ },
364
+ drift: {
365
+ min: -actualOptions.drift,
366
+ max: actualOptions.drift
367
+ },
368
+ enable: true,
369
+ gravity: {
370
+ enable: true,
371
+ acceleration: actualOptions.gravity * 9.81
372
+ },
373
+ speed: actualOptions.startVelocity,
374
+ decay: 1 - actualOptions.decay,
375
+ direction: -actualOptions.angle,
376
+ random: true,
377
+ straight: false,
378
+ outModes: {
379
+ default: "none",
380
+ bottom: "destroy"
381
+ }
382
+ },
383
+ rotate: {
384
+ value: {
385
+ min: 0,
386
+ max: 360
387
+ },
388
+ direction: "random",
389
+ animation: {
390
+ enable: true,
391
+ speed: 60
392
+ }
393
+ },
394
+ tilt: {
395
+ direction: "random",
396
+ enable: true,
397
+ value: {
398
+ min: 0,
399
+ max: 360
400
+ },
401
+ animation: {
402
+ enable: true,
403
+ speed: 60
404
+ }
405
+ },
406
+ roll: {
407
+ darken: {
408
+ enable: true,
409
+ value: 25
410
+ },
411
+ enable: true,
412
+ speed: {
413
+ min: 15,
414
+ max: 25
415
+ }
416
+ },
417
+ wobble: {
418
+ distance: 30,
419
+ enable: true,
420
+ speed: {
421
+ min: -15,
422
+ max: 15
423
+ }
424
+ }
425
+ },
426
+ detectRetina: true,
427
+ motion: {
428
+ disable: actualOptions.disableForReducedMotion
429
+ },
430
+ emitters: {
431
+ startCount: actualOptions.count,
432
+ position: actualOptions.position,
433
+ size: {
434
+ width: 0,
435
+ height: 0
436
+ },
437
+ rate: {
438
+ delay: 0,
439
+ quantity: 0
440
+ },
441
+ life: {
442
+ duration: 0.1,
443
+ count: 1
444
+ }
445
+ }
446
+ };
447
+ };
448
+ // EXTERNAL MODULE: external {"commonjs":"@tsparticles/updater-out-modes","commonjs2":"@tsparticles/updater-out-modes","amd":"@tsparticles/updater-out-modes","root":"window"}
449
+ var updater_out_modes_root_window_ = __webpack_require__(290);
450
+ // EXTERNAL MODULE: external {"commonjs":"@tsparticles/updater-roll","commonjs2":"@tsparticles/updater-roll","amd":"@tsparticles/updater-roll","root":"window"}
451
+ var updater_roll_root_window_ = __webpack_require__(734);
452
+ // EXTERNAL MODULE: external {"commonjs":"@tsparticles/updater-size","commonjs2":"@tsparticles/updater-size","amd":"@tsparticles/updater-size","root":"window"}
453
+ var updater_size_root_window_ = __webpack_require__(2);
454
+ // EXTERNAL MODULE: external {"commonjs":"@tsparticles/shape-square","commonjs2":"@tsparticles/shape-square","amd":"@tsparticles/shape-square","root":"window"}
455
+ var shape_square_root_window_ = __webpack_require__(652);
456
+ // EXTERNAL MODULE: external {"commonjs":"@tsparticles/updater-tilt","commonjs2":"@tsparticles/updater-tilt","amd":"@tsparticles/updater-tilt","root":"window"}
457
+ var updater_tilt_root_window_ = __webpack_require__(448);
458
+ // EXTERNAL MODULE: external {"commonjs":"@tsparticles/updater-wobble","commonjs2":"@tsparticles/updater-wobble","amd":"@tsparticles/updater-wobble","root":"window"}
459
+ var updater_wobble_root_window_ = __webpack_require__(83);
460
+ ;// CONCATENATED MODULE: ./dist/browser/index.js
461
+
462
+
463
+
464
+
465
+
466
+
467
+
468
+
469
+
470
+
471
+
472
+
473
+
474
+
475
+
476
+
477
+ async function loadPreset(engine, confettiOptions, override = false) {
478
+ await (0,move_base_root_window_.loadBaseMover)(engine);
479
+ await (0,shape_circle_root_window_.loadCircleShape)(engine);
480
+ await (0,shape_square_root_window_.loadSquareShape)(engine);
481
+ await (0,updater_color_root_window_.loadColorUpdater)(engine);
482
+ await (0,updater_size_root_window_.loadSizeUpdater)(engine);
483
+ await (0,updater_opacity_root_window_.loadOpacityUpdater)(engine);
484
+ await (0,updater_out_modes_root_window_.loadOutModesUpdater)(engine);
485
+ await (0,plugin_emitters_root_window_.loadEmittersPlugin)(engine);
486
+ await (0,plugin_motion_root_window_.loadMotionPlugin)(engine);
487
+ await (0,updater_wobble_root_window_.loadWobbleUpdater)(engine);
488
+ await (0,updater_roll_root_window_.loadRollUpdater)(engine);
489
+ await (0,updater_angle_root_window_.loadAngleUpdater)(engine);
490
+ await (0,updater_tilt_root_window_.loadTiltUpdater)(engine);
491
+ await (0,updater_life_root_window_.loadLifeUpdater)(engine);
492
+ await engine.addPreset("confetti", loadOptions(confettiOptions), override);
493
+ }
494
+ async function loadConfettiPreset(main) {
495
+ await loadPreset(main, {}, true);
496
+ }
497
+ async function confetti(idOrOptions, confettiOptions) {
498
+ let options;
499
+ let id;
500
+ if (typeof idOrOptions === "string") {
501
+ id = idOrOptions;
502
+ options = confettiOptions !== null && confettiOptions !== void 0 ? confettiOptions : {};
503
+ } else {
504
+ id = `tsparticles_${Math.floor((0,engine_root_window_.getRandom)() * 1000)}`;
505
+ options = idOrOptions;
506
+ }
507
+ await loadPreset(engine_root_window_.tsParticles, options, true);
508
+ await engine_root_window_.tsParticles.load({
509
+ id,
510
+ options: {
511
+ preset: "confetti"
512
+ }
513
+ });
514
+ }
515
+ })();
516
+
517
+ /******/ return __webpack_exports__;
518
+ /******/ })()
519
+ ;
520
+ });
@@ -0,0 +1,2 @@
1
+ /*! For license information please see tsparticles.preset.confetti.min.js.LICENSE.txt */
2
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/engine"),require("@tsparticles/updater-angle"),require("@tsparticles/move-base"),require("@tsparticles/shape-circle"),require("@tsparticles/updater-color"),require("@tsparticles/plugin-emitters"),require("@tsparticles/updater-life"),require("@tsparticles/plugin-motion"),require("@tsparticles/updater-opacity"),require("@tsparticles/updater-out-modes"),require("@tsparticles/updater-roll"),require("@tsparticles/updater-size"),require("@tsparticles/shape-square"),require("@tsparticles/updater-tilt"),require("@tsparticles/updater-wobble"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine","@tsparticles/updater-angle","@tsparticles/move-base","@tsparticles/shape-circle","@tsparticles/updater-color","@tsparticles/plugin-emitters","@tsparticles/updater-life","@tsparticles/plugin-motion","@tsparticles/updater-opacity","@tsparticles/updater-out-modes","@tsparticles/updater-roll","@tsparticles/updater-size","@tsparticles/shape-square","@tsparticles/updater-tilt","@tsparticles/updater-wobble"],t);else{var i="object"==typeof exports?t(require("@tsparticles/engine"),require("@tsparticles/updater-angle"),require("@tsparticles/move-base"),require("@tsparticles/shape-circle"),require("@tsparticles/updater-color"),require("@tsparticles/plugin-emitters"),require("@tsparticles/updater-life"),require("@tsparticles/plugin-motion"),require("@tsparticles/updater-opacity"),require("@tsparticles/updater-out-modes"),require("@tsparticles/updater-roll"),require("@tsparticles/updater-size"),require("@tsparticles/shape-square"),require("@tsparticles/updater-tilt"),require("@tsparticles/updater-wobble")):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,e.window);for(var r in i)("object"==typeof exports?exports:e)[r]=i[r]}}(this,((e,t,i,r,a,s,o,l,n,p,d,c,u,h,f)=>(()=>{"use strict";var y={533:t=>{t.exports=e},619:e=>{e.exports=i},68:e=>{e.exports=s},82:e=>{e.exports=l},163:e=>{e.exports=r},652:e=>{e.exports=u},71:e=>{e.exports=t},501:e=>{e.exports=a},84:e=>{e.exports=o},686:e=>{e.exports=n},290:e=>{e.exports=p},734:e=>{e.exports=d},2:e=>{e.exports=c},448:e=>{e.exports=h},83:e=>{e.exports=f}},w={};function v(e){var t=w[e];if(void 0!==t)return t.exports;var i=w[e]={exports:{}};return y[e](i,i.exports,v),i.exports}v.d=(e,t)=>{for(var i in t)v.o(t,i)&&!v.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},v.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),v.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var m={};return(()=>{v.r(m),v.d(m,{confetti:()=>b,loadConfettiPreset:()=>x});var e=v(533),t=v(71),i=v(619),r=v(163),a=v(501),s=v(68),o=v(84),l=v(82),n=v(686);class p{constructor(){this.angle=90,this.count=50,this.spread=45,this.startVelocity=45,this.decay=.9,this.gravity=1,this.drift=0,this.ticks=200,this.position={x:50,y:50},this.colors=["#ffffff","#ff0000"],this.shapes=["square","circle"],this.scalar=1,this.zIndex=100,this.disableForReducedMotion=!0}get origin(){return{x:this.position.x/100,y:this.position.y/100}}set origin(e){this.position.x=100*e.x,this.position.y=100*e.y}get particleCount(){return this.count}set particleCount(e){this.count=e}load(e){var t,i;if(!e)return;void 0!==e.angle&&(this.angle=e.angle);const r=null!==(t=e.count)&&void 0!==t?t:e.particleCount;void 0!==r&&(this.count=r),void 0!==e.spread&&(this.spread=e.spread),void 0!==e.startVelocity&&(this.startVelocity=e.startVelocity),void 0!==e.decay&&(this.decay=e.decay),void 0!==e.gravity&&(this.gravity=e.gravity),void 0!==e.drift&&(this.drift=e.drift),void 0!==e.ticks&&(this.ticks=e.ticks);const a=null!==(i=e.position)&&void 0!==i?i:this.position;void 0!==(null==a?void 0:a.x)&&(this.position.x=a.x),void 0!==(null==a?void 0:a.y)&&(this.position.y=a.y),void 0!==e.colors&&(e.colors instanceof Array?this.colors=[...e.colors]:this.colors=e.colors),void 0!==e.shapes&&(e.shapes instanceof Array?this.shapes=[...e.shapes]:this.shapes=e.shapes),void 0!==e.scalar&&(this.scalar=e.scalar),void 0!==e.zIndex&&(this.zIndex=e.zIndex),void 0!==e.disableForReducedMotion&&(this.disableForReducedMotion=e.disableForReducedMotion)}}var d=v(290),c=v(734),u=v(2),h=v(652),f=v(448),y=v(83);async function w(e,w,v=!1){await(0,i.loadBaseMover)(e),await(0,r.loadCircleShape)(e),await(0,h.loadSquareShape)(e),await(0,a.loadColorUpdater)(e),await(0,u.loadSizeUpdater)(e),await(0,n.loadOpacityUpdater)(e),await(0,d.loadOutModesUpdater)(e),await(0,s.loadEmittersPlugin)(e),await(0,l.loadMotionPlugin)(e),await(0,y.loadWobbleUpdater)(e),await(0,c.loadRollUpdater)(e),await(0,t.loadAngleUpdater)(e),await(0,f.loadTiltUpdater)(e),await(0,o.loadLifeUpdater)(e),await e.addPreset("confetti",(e=>{const t=new p;return t.load(e),{fullScreen:{enable:!0,zIndex:t.zIndex},fpsLimit:120,particles:{number:{value:0},color:{value:t.colors},shape:{type:t.shapes},opacity:{value:{min:0,max:1},animation:{enable:!0,speed:.5,startValue:"max",destroy:"min"}},size:{value:5*t.scalar},links:{enable:!1},life:{duration:{sync:!0,value:t.ticks/60},count:1},move:{angle:{value:t.spread,offset:0},drift:{min:-t.drift,max:t.drift},enable:!0,gravity:{enable:!0,acceleration:9.81*t.gravity},speed:t.startVelocity,decay:1-t.decay,direction:-t.angle,random:!0,straight:!1,outModes:{default:"none",bottom:"destroy"}},rotate:{value:{min:0,max:360},direction:"random",animation:{enable:!0,speed:60}},tilt:{direction:"random",enable:!0,value:{min:0,max:360},animation:{enable:!0,speed:60}},roll:{darken:{enable:!0,value:25},enable:!0,speed:{min:15,max:25}},wobble:{distance:30,enable:!0,speed:{min:-15,max:15}}},detectRetina:!0,motion:{disable:t.disableForReducedMotion},emitters:{startCount:t.count,position:t.position,size:{width:0,height:0},rate:{delay:0,quantity:0},life:{duration:.1,count:1}}}})(w),v)}async function x(e){await w(e,{},!0)}async function b(t,i){let r,a;"string"==typeof t?(a=t,r=null!=i?i:{}):(a=`tsparticles_${Math.floor(1e3*(0,e.getRandom)())}`,r=t),await w(e.tsParticles,r,!0),await e.tsParticles.load({id:a,options:{preset:"confetti"}})}})(),m})()));
@@ -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,24 @@
1
+ import type { ICoordinates, IOptionLoader, RecursivePartial, SingleOrMultiple } from "@tsparticles/engine";
2
+ import type { IConfettiOptions } from "./IConfettiOptions";
3
+ export declare class ConfettiOptions implements IConfettiOptions, IOptionLoader<IConfettiOptions> {
4
+ angle: number;
5
+ colors: SingleOrMultiple<string>;
6
+ count: number;
7
+ decay: number;
8
+ disableForReducedMotion: boolean;
9
+ drift: number;
10
+ gravity: number;
11
+ position: ICoordinates;
12
+ scalar: number;
13
+ shapes: SingleOrMultiple<string>;
14
+ spread: number;
15
+ startVelocity: number;
16
+ ticks: number;
17
+ zIndex: number;
18
+ constructor();
19
+ get origin(): ICoordinates;
20
+ set origin(value: ICoordinates);
21
+ get particleCount(): number;
22
+ set particleCount(value: number);
23
+ load(data?: RecursivePartial<IConfettiOptions>): void;
24
+ }
@@ -0,0 +1,19 @@
1
+ import type { ICoordinates, SingleOrMultiple } from "@tsparticles/engine";
2
+ export interface IConfettiOptions {
3
+ angle: number;
4
+ colors: SingleOrMultiple<string>;
5
+ count: number;
6
+ decay: number;
7
+ disableForReducedMotion: boolean;
8
+ drift: number;
9
+ gravity: number;
10
+ origin: ICoordinates;
11
+ particleCount: number;
12
+ position: ICoordinates;
13
+ scalar: number;
14
+ shapes: SingleOrMultiple<string>;
15
+ spread: number;
16
+ startVelocity: number;
17
+ ticks: number;
18
+ zIndex: number;
19
+ }
@@ -0,0 +1,5 @@
1
+ import { confetti, loadConfettiPreset } from "./index";
2
+ import type { ConfettiOptions } from "./index";
3
+ import { tsParticles } from "@tsparticles/engine";
4
+ export type { ConfettiOptions };
5
+ export { confetti, loadConfettiPreset, tsParticles };
@@ -0,0 +1,6 @@
1
+ import type { Engine, RecursivePartial } from "@tsparticles/engine";
2
+ import type { IConfettiOptions } from "./IConfettiOptions";
3
+ export declare function loadConfettiPreset(main: Engine): Promise<void>;
4
+ export type ConfettiOptions = RecursivePartial<IConfettiOptions>;
5
+ export type ConfettiFirstParam = string | ConfettiOptions;
6
+ export declare function confetti(idOrOptions: ConfettiFirstParam, confettiOptions?: RecursivePartial<IConfettiOptions>): Promise<void>;
@@ -0,0 +1,3 @@
1
+ import type { ISourceOptions, RecursivePartial } from "@tsparticles/engine";
2
+ import type { IConfettiOptions } from "./IConfettiOptions";
3
+ export declare const loadOptions: (confettiOptions: RecursivePartial<IConfettiOptions>) => ISourceOptions;