@tsparticles/preset-confetti 3.0.0-alpha.1 → 3.0.0-beta.2

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.
@@ -4,33 +4,26 @@
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.0.0-alpha.1
7
+ * v3.0.0-beta.2
8
8
  */
9
9
  (function webpackUniversalModuleDefinition(root, factory) {
10
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"));
11
+ module.exports = factory(require("@tsparticles/basic"), require("@tsparticles/plugin-emitters"), require("@tsparticles/updater-life"), require("@tsparticles/plugin-motion"), require("@tsparticles/updater-roll"), require("@tsparticles/updater-rotate"), require("@tsparticles/shape-square"), require("@tsparticles/updater-tilt"), require("@tsparticles/updater-wobble"));
12
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);
13
+ define(["@tsparticles/basic", "@tsparticles/plugin-emitters", "@tsparticles/updater-life", "@tsparticles/plugin-motion", "@tsparticles/updater-roll", "@tsparticles/updater-rotate", "@tsparticles/shape-square", "@tsparticles/updater-tilt", "@tsparticles/updater-wobble"], factory);
14
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"]);
15
+ var a = typeof exports === 'object' ? factory(require("@tsparticles/basic"), require("@tsparticles/plugin-emitters"), require("@tsparticles/updater-life"), require("@tsparticles/plugin-motion"), require("@tsparticles/updater-roll"), require("@tsparticles/updater-rotate"), 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"]);
16
16
  for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
17
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__) => {
18
+ })(this, (__WEBPACK_EXTERNAL_MODULE__574__, __WEBPACK_EXTERNAL_MODULE__68__, __WEBPACK_EXTERNAL_MODULE__84__, __WEBPACK_EXTERNAL_MODULE__433__, __WEBPACK_EXTERNAL_MODULE__734__, __WEBPACK_EXTERNAL_MODULE__59__, __WEBPACK_EXTERNAL_MODULE__652__, __WEBPACK_EXTERNAL_MODULE__448__, __WEBPACK_EXTERNAL_MODULE__83__) => {
19
19
  return /******/ (() => { // webpackBootstrap
20
20
  /******/ "use strict";
21
21
  /******/ var __webpack_modules__ = ({
22
22
 
23
- /***/ 533:
23
+ /***/ 574:
24
24
  /***/ ((module) => {
25
25
 
26
- module.exports = __WEBPACK_EXTERNAL_MODULE__533__;
27
-
28
- /***/ }),
29
-
30
- /***/ 619:
31
- /***/ ((module) => {
32
-
33
- module.exports = __WEBPACK_EXTERNAL_MODULE__619__;
26
+ module.exports = __WEBPACK_EXTERNAL_MODULE__574__;
34
27
 
35
28
  /***/ }),
36
29
 
@@ -41,17 +34,10 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__68__;
41
34
 
42
35
  /***/ }),
43
36
 
44
- /***/ 82:
37
+ /***/ 433:
45
38
  /***/ ((module) => {
46
39
 
47
- module.exports = __WEBPACK_EXTERNAL_MODULE__82__;
48
-
49
- /***/ }),
50
-
51
- /***/ 163:
52
- /***/ ((module) => {
53
-
54
- module.exports = __WEBPACK_EXTERNAL_MODULE__163__;
40
+ module.exports = __WEBPACK_EXTERNAL_MODULE__433__;
55
41
 
56
42
  /***/ }),
57
43
 
@@ -62,20 +48,6 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__652__;
62
48
 
63
49
  /***/ }),
64
50
 
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
51
  /***/ 84:
80
52
  /***/ ((module) => {
81
53
 
@@ -83,20 +55,6 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__84__;
83
55
 
84
56
  /***/ }),
85
57
 
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
58
  /***/ 734:
101
59
  /***/ ((module) => {
102
60
 
@@ -104,10 +62,10 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__734__;
104
62
 
105
63
  /***/ }),
106
64
 
107
- /***/ 2:
65
+ /***/ 59:
108
66
  /***/ ((module) => {
109
67
 
110
- module.exports = __WEBPACK_EXTERNAL_MODULE__2__;
68
+ module.exports = __WEBPACK_EXTERNAL_MODULE__59__;
111
69
 
112
70
  /***/ }),
113
71
 
@@ -189,274 +147,158 @@ __webpack_require__.r(__webpack_exports__);
189
147
 
190
148
  // EXPORTS
191
149
  __webpack_require__.d(__webpack_exports__, {
192
- "confetti": () => (/* binding */ confetti),
193
- "loadConfettiPreset": () => (/* binding */ loadConfettiPreset)
150
+ loadConfettiPreset: () => (/* binding */ loadConfettiPreset)
194
151
  });
195
152
 
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);
153
+ // EXTERNAL MODULE: external {"commonjs":"@tsparticles/basic","commonjs2":"@tsparticles/basic","amd":"@tsparticles/basic","root":"window"}
154
+ var basic_root_window_ = __webpack_require__(574);
206
155
  // EXTERNAL MODULE: external {"commonjs":"@tsparticles/plugin-emitters","commonjs2":"@tsparticles/plugin-emitters","amd":"@tsparticles/plugin-emitters","root":"window"}
207
156
  var plugin_emitters_root_window_ = __webpack_require__(68);
208
157
  // EXTERNAL MODULE: external {"commonjs":"@tsparticles/updater-life","commonjs2":"@tsparticles/updater-life","amd":"@tsparticles/updater-life","root":"window"}
209
158
  var updater_life_root_window_ = __webpack_require__(84);
210
159
  // 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
- }
160
+ var plugin_motion_root_window_ = __webpack_require__(433);
161
+ // EXTERNAL MODULE: external {"commonjs":"@tsparticles/updater-roll","commonjs2":"@tsparticles/updater-roll","amd":"@tsparticles/updater-roll","root":"window"}
162
+ var updater_roll_root_window_ = __webpack_require__(734);
163
+ // EXTERNAL MODULE: external {"commonjs":"@tsparticles/updater-rotate","commonjs2":"@tsparticles/updater-rotate","amd":"@tsparticles/updater-rotate","root":"window"}
164
+ var updater_rotate_root_window_ = __webpack_require__(59);
165
+ // EXTERNAL MODULE: external {"commonjs":"@tsparticles/shape-square","commonjs2":"@tsparticles/shape-square","amd":"@tsparticles/shape-square","root":"window"}
166
+ var shape_square_root_window_ = __webpack_require__(652);
167
+ // EXTERNAL MODULE: external {"commonjs":"@tsparticles/updater-tilt","commonjs2":"@tsparticles/updater-tilt","amd":"@tsparticles/updater-tilt","root":"window"}
168
+ var updater_tilt_root_window_ = __webpack_require__(448);
169
+ // EXTERNAL MODULE: external {"commonjs":"@tsparticles/updater-wobble","commonjs2":"@tsparticles/updater-wobble","amd":"@tsparticles/updater-wobble","root":"window"}
170
+ var updater_wobble_root_window_ = __webpack_require__(83);
313
171
  ;// 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
172
+ const options = {
173
+ fullScreen: {
174
+ enable: true,
175
+ zIndex: 100
176
+ },
177
+ fpsLimit: 120,
178
+ particles: {
179
+ number: {
180
+ value: 0
322
181
  },
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
182
+ color: {
183
+ value: ["#26ccff", "#a25afd", "#ff5e7e", "#88ff5a", "#fcff42", "#ffa62d", "#ff36ff"]
184
+ },
185
+ shape: {
186
+ type: ["square", "circle"]
187
+ },
188
+ opacity: {
189
+ value: {
190
+ min: 0,
191
+ max: 1
358
192
  },
359
- move: {
360
- angle: {
361
- value: actualOptions.spread,
362
- offset: 0
363
- },
364
- drift: {
365
- min: -actualOptions.drift,
366
- max: actualOptions.drift
367
- },
193
+ animation: {
368
194
  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
- }
195
+ speed: 0.5,
196
+ startValue: "max",
197
+ destroy: "min"
198
+ }
199
+ },
200
+ size: {
201
+ value: 5
202
+ },
203
+ links: {
204
+ enable: false
205
+ },
206
+ life: {
207
+ duration: {
208
+ sync: true,
209
+ value: 20 / 6
382
210
  },
383
- rotate: {
384
- value: {
385
- min: 0,
386
- max: 360
387
- },
388
- direction: "random",
389
- animation: {
390
- enable: true,
391
- speed: 60
392
- }
211
+ count: 1
212
+ },
213
+ move: {
214
+ angle: {
215
+ value: 45,
216
+ offset: 0
393
217
  },
394
- tilt: {
395
- direction: "random",
218
+ drift: 0,
219
+ enable: true,
220
+ gravity: {
396
221
  enable: true,
397
- value: {
398
- min: 0,
399
- max: 360
400
- },
401
- animation: {
402
- enable: true,
403
- speed: 60
404
- }
222
+ acceleration: 9.81
405
223
  },
406
- roll: {
407
- darken: {
408
- enable: true,
409
- value: 25
410
- },
411
- enable: true,
412
- speed: {
413
- min: 15,
414
- max: 25
415
- }
224
+ speed: 45,
225
+ decay: 0.1,
226
+ direction: -90,
227
+ random: true,
228
+ straight: false,
229
+ outModes: {
230
+ default: "none",
231
+ bottom: "destroy"
232
+ }
233
+ },
234
+ rotate: {
235
+ value: {
236
+ min: 0,
237
+ max: 360
416
238
  },
417
- wobble: {
418
- distance: 30,
239
+ direction: "random",
240
+ animation: {
419
241
  enable: true,
420
- speed: {
421
- min: -15,
422
- max: 15
423
- }
242
+ speed: 60
424
243
  }
425
244
  },
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
245
+ tilt: {
246
+ direction: "random",
247
+ enable: true,
248
+ value: {
249
+ min: 0,
250
+ max: 360
436
251
  },
437
- rate: {
438
- delay: 0,
439
- quantity: 0
252
+ animation: {
253
+ enable: true,
254
+ speed: 60
255
+ }
256
+ },
257
+ roll: {
258
+ darken: {
259
+ enable: true,
260
+ value: 25
440
261
  },
441
- life: {
442
- duration: 0.1,
443
- count: 1
262
+ enable: true,
263
+ speed: {
264
+ min: 15,
265
+ max: 25
266
+ }
267
+ },
268
+ wobble: {
269
+ distance: 30,
270
+ enable: true,
271
+ speed: {
272
+ min: -15,
273
+ max: 15
444
274
  }
445
275
  }
446
- };
276
+ },
277
+ detectRetina: true,
278
+ motion: {
279
+ disable: true
280
+ },
281
+ emitters: {
282
+ name: "confetti",
283
+ startCount: 50,
284
+ position: {
285
+ x: 50,
286
+ y: 50
287
+ },
288
+ size: {
289
+ width: 0,
290
+ height: 0
291
+ },
292
+ rate: {
293
+ delay: 0,
294
+ quantity: 0
295
+ },
296
+ life: {
297
+ duration: 0.1,
298
+ count: 1
299
+ }
300
+ }
447
301
  };
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
302
  ;// CONCATENATED MODULE: ./dist/browser/index.js
461
303
 
462
304
 
@@ -468,49 +310,20 @@ var updater_wobble_root_window_ = __webpack_require__(83);
468
310
 
469
311
 
470
312
 
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);
313
+ async function loadPreset(engine, refresh = true) {
314
+ await (0,basic_root_window_.loadBasic)(engine, false);
315
+ await (0,shape_square_root_window_.loadSquareShape)(engine, false);
316
+ await (0,plugin_emitters_root_window_.loadEmittersPlugin)(engine, false);
317
+ await (0,plugin_motion_root_window_.loadMotionPlugin)(engine, false);
318
+ await (0,updater_wobble_root_window_.loadWobbleUpdater)(engine, false);
319
+ await (0,updater_roll_root_window_.loadRollUpdater)(engine, false);
320
+ await (0,updater_rotate_root_window_.loadRotateUpdater)(engine, false);
321
+ await (0,updater_tilt_root_window_.loadTiltUpdater)(engine, false);
322
+ await (0,updater_life_root_window_.loadLifeUpdater)(engine, false);
323
+ await engine.addPreset("confetti", options, refresh);
493
324
  }
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
- });
325
+ async function loadConfettiPreset(engine) {
326
+ await loadPreset(engine);
514
327
  }
515
328
  })();
516
329
 
@@ -1,2 +1,2 @@
1
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})()));
2
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/basic"),require("@tsparticles/plugin-emitters"),require("@tsparticles/updater-life"),require("@tsparticles/plugin-motion"),require("@tsparticles/updater-roll"),require("@tsparticles/updater-rotate"),require("@tsparticles/shape-square"),require("@tsparticles/updater-tilt"),require("@tsparticles/updater-wobble"));else if("function"==typeof define&&define.amd)define(["@tsparticles/basic","@tsparticles/plugin-emitters","@tsparticles/updater-life","@tsparticles/plugin-motion","@tsparticles/updater-roll","@tsparticles/updater-rotate","@tsparticles/shape-square","@tsparticles/updater-tilt","@tsparticles/updater-wobble"],t);else{var a="object"==typeof exports?t(require("@tsparticles/basic"),require("@tsparticles/plugin-emitters"),require("@tsparticles/updater-life"),require("@tsparticles/plugin-motion"),require("@tsparticles/updater-roll"),require("@tsparticles/updater-rotate"),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);for(var r in a)("object"==typeof exports?exports:e)[r]=a[r]}}(this,((e,t,a,r,i,o,s,l,n)=>(()=>{"use strict";var p={574:t=>{t.exports=e},68:e=>{e.exports=t},433:e=>{e.exports=r},652:e=>{e.exports=s},84:e=>{e.exports=a},734:e=>{e.exports=i},59:e=>{e.exports=o},448:e=>{e.exports=l},83:e=>{e.exports=n}},d={};function u(e){var t=d[e];if(void 0!==t)return t.exports;var a=d[e]={exports:{}};return p[e](a,a.exports,u),a.exports}u.d=(e,t)=>{for(var a in t)u.o(t,a)&&!u.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},u.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),u.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var c={};return(()=>{u.r(c),u.d(c,{loadConfettiPreset:()=>d});var e=u(574),t=u(68),a=u(84),r=u(433),i=u(734),o=u(59),s=u(652),l=u(448),n=u(83);const p={fullScreen:{enable:!0,zIndex:100},fpsLimit:120,particles:{number:{value:0},color:{value:["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"]},shape:{type:["square","circle"]},opacity:{value:{min:0,max:1},animation:{enable:!0,speed:.5,startValue:"max",destroy:"min"}},size:{value:5},links:{enable:!1},life:{duration:{sync:!0,value:20/6},count:1},move:{angle:{value:45,offset:0},drift:0,enable:!0,gravity:{enable:!0,acceleration:9.81},speed:45,decay:.1,direction:-90,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:!0},emitters:{name:"confetti",startCount:50,position:{x:50,y:50},size:{width:0,height:0},rate:{delay:0,quantity:0},life:{duration:.1,count:1}}};async function d(d){await async function(d,u=!0){await(0,e.loadBasic)(d,!1),await(0,s.loadSquareShape)(d,!1),await(0,t.loadEmittersPlugin)(d,!1),await(0,r.loadMotionPlugin)(d,!1),await(0,n.loadWobbleUpdater)(d,!1),await(0,i.loadRollUpdater)(d,!1),await(0,o.loadRotateUpdater)(d,!1),await(0,l.loadTiltUpdater)(d,!1),await(0,a.loadLifeUpdater)(d,!1),await d.addPreset("confetti",p,u)}(d)}})(),c})()));
@@ -1,8 +1 @@
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
- */
1
+ /*! tsParticles Confetti Preset v3.0.0-beta.2 by Matteo Bruni */
package/types/bundle.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- import { confetti, loadConfettiPreset } from "./index";
2
- import type { ConfettiOptions } from "./index";
1
+ import { loadConfettiPreset } from "./index";
3
2
  import { tsParticles } from "@tsparticles/engine";
4
- export type { ConfettiOptions };
5
- export { confetti, loadConfettiPreset, tsParticles };
3
+ export { loadConfettiPreset, tsParticles };
package/types/index.d.ts CHANGED
@@ -1,6 +1,2 @@
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>;
1
+ import type { Engine } from "@tsparticles/engine";
2
+ export declare function loadConfettiPreset(engine: Engine): Promise<void>;
@@ -1,3 +1,2 @@
1
- import type { ISourceOptions, RecursivePartial } from "@tsparticles/engine";
2
- import type { IConfettiOptions } from "./IConfettiOptions";
3
- export declare const loadOptions: (confettiOptions: RecursivePartial<IConfettiOptions>) => ISourceOptions;
1
+ import type { ISourceOptions } from "@tsparticles/engine";
2
+ export declare const options: ISourceOptions;