@tsparticles/preset-confetti 3.0.0-alpha.1 → 3.0.0-beta.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.
@@ -4,18 +4,18 @@
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.1
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/move-base"), require("@tsparticles/shape-circle"), require("@tsparticles/updater-color"), require("@tsparticles/updater-opacity"), require("@tsparticles/updater-out-modes"), require("@tsparticles/updater-size"), require("@tsparticles/plugin-emitters"), require("@tsparticles/updater-life"), require("@tsparticles/plugin-motion"), require("@tsparticles/updater-roll"), require("@tsparticles/engine"), 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/move-base", "@tsparticles/shape-circle", "@tsparticles/updater-color", "@tsparticles/updater-opacity", "@tsparticles/updater-out-modes", "@tsparticles/updater-size", "@tsparticles/plugin-emitters", "@tsparticles/updater-life", "@tsparticles/plugin-motion", "@tsparticles/updater-roll", "@tsparticles/engine", "@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/move-base"), require("@tsparticles/shape-circle"), require("@tsparticles/updater-color"), require("@tsparticles/updater-opacity"), require("@tsparticles/updater-out-modes"), require("@tsparticles/updater-size"), require("@tsparticles/plugin-emitters"), require("@tsparticles/updater-life"), require("@tsparticles/plugin-motion"), require("@tsparticles/updater-roll"), require("@tsparticles/engine"), 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"]);
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__619__, __WEBPACK_EXTERNAL_MODULE__163__, __WEBPACK_EXTERNAL_MODULE__501__, __WEBPACK_EXTERNAL_MODULE__686__, __WEBPACK_EXTERNAL_MODULE__290__, __WEBPACK_EXTERNAL_MODULE__2__, __WEBPACK_EXTERNAL_MODULE__68__, __WEBPACK_EXTERNAL_MODULE__84__, __WEBPACK_EXTERNAL_MODULE__82__, __WEBPACK_EXTERNAL_MODULE__734__, __WEBPACK_EXTERNAL_MODULE__533__, __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__ = ({
@@ -62,13 +62,6 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__652__;
62
62
 
63
63
  /***/ }),
64
64
 
65
- /***/ 71:
66
- /***/ ((module) => {
67
-
68
- module.exports = __WEBPACK_EXTERNAL_MODULE__71__;
69
-
70
- /***/ }),
71
-
72
65
  /***/ 501:
73
66
  /***/ ((module) => {
74
67
 
@@ -189,274 +182,339 @@ __webpack_require__.r(__webpack_exports__);
189
182
 
190
183
  // EXPORTS
191
184
  __webpack_require__.d(__webpack_exports__, {
192
- "confetti": () => (/* binding */ confetti),
193
- "loadConfettiPreset": () => (/* binding */ loadConfettiPreset)
185
+ loadConfettiPreset: () => (/* binding */ loadConfettiPreset)
194
186
  });
195
187
 
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
188
  // EXTERNAL MODULE: external {"commonjs":"@tsparticles/move-base","commonjs2":"@tsparticles/move-base","amd":"@tsparticles/move-base","root":"window"}
201
189
  var move_base_root_window_ = __webpack_require__(619);
202
190
  // EXTERNAL MODULE: external {"commonjs":"@tsparticles/shape-circle","commonjs2":"@tsparticles/shape-circle","amd":"@tsparticles/shape-circle","root":"window"}
203
191
  var shape_circle_root_window_ = __webpack_require__(163);
204
192
  // EXTERNAL MODULE: external {"commonjs":"@tsparticles/updater-color","commonjs2":"@tsparticles/updater-color","amd":"@tsparticles/updater-color","root":"window"}
205
193
  var updater_color_root_window_ = __webpack_require__(501);
194
+ // EXTERNAL MODULE: external {"commonjs":"@tsparticles/updater-opacity","commonjs2":"@tsparticles/updater-opacity","amd":"@tsparticles/updater-opacity","root":"window"}
195
+ var updater_opacity_root_window_ = __webpack_require__(686);
196
+ // EXTERNAL MODULE: external {"commonjs":"@tsparticles/updater-out-modes","commonjs2":"@tsparticles/updater-out-modes","amd":"@tsparticles/updater-out-modes","root":"window"}
197
+ var updater_out_modes_root_window_ = __webpack_require__(290);
198
+ // EXTERNAL MODULE: external {"commonjs":"@tsparticles/updater-size","commonjs2":"@tsparticles/updater-size","amd":"@tsparticles/updater-size","root":"window"}
199
+ var updater_size_root_window_ = __webpack_require__(2);
200
+ ;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+basic@3.0.0-beta.1/node_modules/@tsparticles/basic/browser/index.js
201
+
202
+
203
+
204
+
205
+
206
+
207
+ async function loadBasic(engine, refresh = true) {
208
+ await (0,move_base_root_window_.loadBaseMover)(engine, false);
209
+ await (0,shape_circle_root_window_.loadCircleShape)(engine, false);
210
+ await (0,updater_color_root_window_.loadColorUpdater)(engine, false);
211
+ await (0,updater_opacity_root_window_.loadOpacityUpdater)(engine, false);
212
+ await (0,updater_out_modes_root_window_.loadOutModesUpdater)(engine, false);
213
+ await (0,updater_size_root_window_.loadSizeUpdater)(engine, false);
214
+ await engine.refresh(refresh);
215
+ }
216
+
206
217
  // EXTERNAL MODULE: external {"commonjs":"@tsparticles/plugin-emitters","commonjs2":"@tsparticles/plugin-emitters","amd":"@tsparticles/plugin-emitters","root":"window"}
207
218
  var plugin_emitters_root_window_ = __webpack_require__(68);
208
219
  // EXTERNAL MODULE: external {"commonjs":"@tsparticles/updater-life","commonjs2":"@tsparticles/updater-life","amd":"@tsparticles/updater-life","root":"window"}
209
220
  var updater_life_root_window_ = __webpack_require__(84);
210
221
  // EXTERNAL MODULE: external {"commonjs":"@tsparticles/plugin-motion","commonjs2":"@tsparticles/plugin-motion","amd":"@tsparticles/plugin-motion","root":"window"}
211
222
  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;
223
+ // EXTERNAL MODULE: external {"commonjs":"@tsparticles/updater-roll","commonjs2":"@tsparticles/updater-roll","amd":"@tsparticles/updater-roll","root":"window"}
224
+ var updater_roll_root_window_ = __webpack_require__(734);
225
+ // EXTERNAL MODULE: external {"commonjs":"@tsparticles/engine","commonjs2":"@tsparticles/engine","amd":"@tsparticles/engine","root":"window"}
226
+ var engine_root_window_ = __webpack_require__(533);
227
+ ;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+updater-rotate@3.0.0-beta.1/node_modules/@tsparticles/updater-rotate/browser/Options/Classes/RotateAnimation.js
228
+
229
+ class RotateAnimation {
230
+ constructor() {
231
+ this.enable = false;
232
+ this.speed = 0;
233
+ this.decay = 0;
234
+ this.sync = false;
265
235
  }
266
- if (data.startVelocity !== undefined) {
267
- this.startVelocity = data.startVelocity;
236
+ load(data) {
237
+ if (!data) {
238
+ return;
239
+ }
240
+ if (data.enable !== undefined) {
241
+ this.enable = data.enable;
242
+ }
243
+ if (data.speed !== undefined) {
244
+ this.speed = (0,engine_root_window_.setRangeValue)(data.speed);
245
+ }
246
+ if (data.decay !== undefined) {
247
+ this.decay = (0,engine_root_window_.setRangeValue)(data.decay);
248
+ }
249
+ if (data.sync !== undefined) {
250
+ this.sync = data.sync;
251
+ }
268
252
  }
269
- if (data.decay !== undefined) {
270
- this.decay = data.decay;
253
+ }
254
+
255
+ ;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+updater-rotate@3.0.0-beta.1/node_modules/@tsparticles/updater-rotate/browser/Options/Classes/Rotate.js
256
+
257
+
258
+ class Rotate extends engine_root_window_.ValueWithRandom {
259
+ constructor() {
260
+ super();
261
+ this.animation = new RotateAnimation();
262
+ this.direction = "clockwise";
263
+ this.path = false;
264
+ this.value = 0;
271
265
  }
272
- if (data.gravity !== undefined) {
273
- this.gravity = data.gravity;
266
+ load(data) {
267
+ if (!data) {
268
+ return;
269
+ }
270
+ super.load(data);
271
+ if (data.direction !== undefined) {
272
+ this.direction = data.direction;
273
+ }
274
+ this.animation.load(data.animation);
275
+ if (data.path !== undefined) {
276
+ this.path = data.path;
277
+ }
274
278
  }
275
- if (data.drift !== undefined) {
276
- this.drift = data.drift;
279
+ }
280
+
281
+ ;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+updater-rotate@3.0.0-beta.1/node_modules/@tsparticles/updater-rotate/browser/RotateUpdater.js
282
+
283
+
284
+ function updateRotate(particle, delta) {
285
+ const rotate = particle.rotate, rotateOptions = particle.options.rotate;
286
+ if (!rotate || !rotateOptions) {
287
+ return;
277
288
  }
278
- if (data.ticks !== undefined) {
279
- this.ticks = data.ticks;
289
+ const rotateAnimation = rotateOptions.animation, speed = (rotate.velocity ?? 0) * delta.factor, max = 2 * Math.PI, decay = rotate.decay ?? 1;
290
+ if (!rotateAnimation.enable) {
291
+ return;
280
292
  }
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;
293
+ switch (rotate.status) {
294
+ case "increasing":
295
+ rotate.value += speed;
296
+ if (rotate.value > max) {
297
+ rotate.value -= max;
298
+ }
299
+ break;
300
+ case "decreasing":
301
+ default:
302
+ rotate.value -= speed;
303
+ if (rotate.value < 0) {
304
+ rotate.value += max;
305
+ }
306
+ break;
284
307
  }
285
- if ((position === null || position === void 0 ? void 0 : position.y) !== undefined) {
286
- this.position.y = position.y;
308
+ if (rotate.velocity && decay !== 1) {
309
+ rotate.velocity *= decay;
287
310
  }
288
- if (data.colors !== undefined) {
289
- if (data.colors instanceof Array) {
290
- this.colors = [...data.colors];
291
- } else {
292
- this.colors = data.colors;
293
- }
311
+ }
312
+ class RotateUpdater {
313
+ constructor(container) {
314
+ this.container = container;
294
315
  }
295
- if (data.shapes !== undefined) {
296
- if (data.shapes instanceof Array) {
297
- this.shapes = [...data.shapes];
298
- } else {
299
- this.shapes = data.shapes;
300
- }
316
+ init(particle) {
317
+ const rotateOptions = particle.options.rotate;
318
+ if (!rotateOptions) {
319
+ return;
320
+ }
321
+ particle.rotate = {
322
+ enable: rotateOptions.animation.enable,
323
+ value: ((0,engine_root_window_.getRangeValue)(rotateOptions.value) * Math.PI) / 180,
324
+ };
325
+ particle.pathRotation = rotateOptions.path;
326
+ let rotateDirection = rotateOptions.direction;
327
+ if (rotateDirection === "random") {
328
+ const index = Math.floor((0,engine_root_window_.getRandom)() * 2);
329
+ rotateDirection = index > 0 ? "counter-clockwise" : "clockwise";
330
+ }
331
+ switch (rotateDirection) {
332
+ case "counter-clockwise":
333
+ case "counterClockwise":
334
+ particle.rotate.status = "decreasing";
335
+ break;
336
+ case "clockwise":
337
+ particle.rotate.status = "increasing";
338
+ break;
339
+ }
340
+ const rotateAnimation = rotateOptions.animation;
341
+ if (rotateAnimation.enable) {
342
+ particle.rotate.decay = 1 - (0,engine_root_window_.getRangeValue)(rotateAnimation.decay);
343
+ particle.rotate.velocity =
344
+ ((0,engine_root_window_.getRangeValue)(rotateAnimation.speed) / 360) * this.container.retina.reduceFactor;
345
+ if (!rotateAnimation.sync) {
346
+ particle.rotate.velocity *= (0,engine_root_window_.getRandom)();
347
+ }
348
+ }
349
+ particle.rotation = particle.rotate.value;
301
350
  }
302
- if (data.scalar !== undefined) {
303
- this.scalar = data.scalar;
351
+ isEnabled(particle) {
352
+ const rotate = particle.options.rotate;
353
+ if (!rotate) {
354
+ return false;
355
+ }
356
+ return !particle.destroyed && !particle.spawning && rotate.animation.enable && !rotate.path;
304
357
  }
305
- if (data.zIndex !== undefined) {
306
- this.zIndex = data.zIndex;
358
+ loadOptions(options, ...sources) {
359
+ if (!options.rotate) {
360
+ options.rotate = new Rotate();
361
+ }
362
+ for (const source of sources) {
363
+ options.rotate.load(source?.rotate);
364
+ }
307
365
  }
308
- if (data.disableForReducedMotion !== undefined) {
309
- this.disableForReducedMotion = data.disableForReducedMotion;
366
+ update(particle, delta) {
367
+ if (!this.isEnabled(particle)) {
368
+ return;
369
+ }
370
+ updateRotate(particle, delta);
371
+ particle.rotation = particle.rotate?.value ?? 0;
310
372
  }
311
- }
312
373
  }
313
- ;// CONCATENATED MODULE: ./dist/browser/options.js
314
374
 
315
- const loadOptions = confettiOptions => {
316
- const actualOptions = new ConfettiOptions();
317
- actualOptions.load(confettiOptions);
318
- return {
319
- fullScreen: {
320
- enable: true,
321
- zIndex: actualOptions.zIndex
375
+ ;// CONCATENATED MODULE: ../../node_modules/.pnpm/@tsparticles+updater-rotate@3.0.0-beta.1/node_modules/@tsparticles/updater-rotate/browser/index.js
376
+
377
+ async function loadRotateUpdater(engine, refresh = true) {
378
+ await engine.addParticleUpdater("rotate", (container) => new RotateUpdater(container), refresh);
379
+ }
380
+
381
+ // EXTERNAL MODULE: external {"commonjs":"@tsparticles/shape-square","commonjs2":"@tsparticles/shape-square","amd":"@tsparticles/shape-square","root":"window"}
382
+ var shape_square_root_window_ = __webpack_require__(652);
383
+ // EXTERNAL MODULE: external {"commonjs":"@tsparticles/updater-tilt","commonjs2":"@tsparticles/updater-tilt","amd":"@tsparticles/updater-tilt","root":"window"}
384
+ var updater_tilt_root_window_ = __webpack_require__(448);
385
+ // EXTERNAL MODULE: external {"commonjs":"@tsparticles/updater-wobble","commonjs2":"@tsparticles/updater-wobble","amd":"@tsparticles/updater-wobble","root":"window"}
386
+ var updater_wobble_root_window_ = __webpack_require__(83);
387
+ ;// CONCATENATED MODULE: ./dist/browser/options.js
388
+ const options = {
389
+ fullScreen: {
390
+ enable: true,
391
+ zIndex: 100
392
+ },
393
+ fpsLimit: 120,
394
+ particles: {
395
+ number: {
396
+ value: 0
322
397
  },
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
398
+ color: {
399
+ value: ["#26ccff", "#a25afd", "#ff5e7e", "#88ff5a", "#fcff42", "#ffa62d", "#ff36ff"]
400
+ },
401
+ shape: {
402
+ type: ["square", "circle"]
403
+ },
404
+ opacity: {
405
+ value: {
406
+ min: 0,
407
+ max: 1
358
408
  },
359
- move: {
360
- angle: {
361
- value: actualOptions.spread,
362
- offset: 0
363
- },
364
- drift: {
365
- min: -actualOptions.drift,
366
- max: actualOptions.drift
367
- },
409
+ animation: {
368
410
  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
- }
411
+ speed: 0.5,
412
+ startValue: "max",
413
+ destroy: "min"
414
+ }
415
+ },
416
+ size: {
417
+ value: 5
418
+ },
419
+ links: {
420
+ enable: false
421
+ },
422
+ life: {
423
+ duration: {
424
+ sync: true,
425
+ value: 20 / 6
382
426
  },
383
- rotate: {
384
- value: {
385
- min: 0,
386
- max: 360
387
- },
388
- direction: "random",
389
- animation: {
390
- enable: true,
391
- speed: 60
392
- }
427
+ count: 1
428
+ },
429
+ move: {
430
+ angle: {
431
+ value: 45,
432
+ offset: 0
393
433
  },
394
- tilt: {
395
- direction: "random",
434
+ drift: 0,
435
+ enable: true,
436
+ gravity: {
396
437
  enable: true,
397
- value: {
398
- min: 0,
399
- max: 360
400
- },
401
- animation: {
402
- enable: true,
403
- speed: 60
404
- }
438
+ acceleration: 9.81
405
439
  },
406
- roll: {
407
- darken: {
408
- enable: true,
409
- value: 25
410
- },
411
- enable: true,
412
- speed: {
413
- min: 15,
414
- max: 25
415
- }
440
+ speed: 45,
441
+ decay: 0.1,
442
+ direction: -90,
443
+ random: true,
444
+ straight: false,
445
+ outModes: {
446
+ default: "none",
447
+ bottom: "destroy"
448
+ }
449
+ },
450
+ rotate: {
451
+ value: {
452
+ min: 0,
453
+ max: 360
416
454
  },
417
- wobble: {
418
- distance: 30,
455
+ direction: "random",
456
+ animation: {
419
457
  enable: true,
420
- speed: {
421
- min: -15,
422
- max: 15
423
- }
458
+ speed: 60
424
459
  }
425
460
  },
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
461
+ tilt: {
462
+ direction: "random",
463
+ enable: true,
464
+ value: {
465
+ min: 0,
466
+ max: 360
436
467
  },
437
- rate: {
438
- delay: 0,
439
- quantity: 0
468
+ animation: {
469
+ enable: true,
470
+ speed: 60
471
+ }
472
+ },
473
+ roll: {
474
+ darken: {
475
+ enable: true,
476
+ value: 25
440
477
  },
441
- life: {
442
- duration: 0.1,
443
- count: 1
478
+ enable: true,
479
+ speed: {
480
+ min: 15,
481
+ max: 25
482
+ }
483
+ },
484
+ wobble: {
485
+ distance: 30,
486
+ enable: true,
487
+ speed: {
488
+ min: -15,
489
+ max: 15
444
490
  }
445
491
  }
446
- };
492
+ },
493
+ detectRetina: true,
494
+ motion: {
495
+ disable: true
496
+ },
497
+ emitters: {
498
+ name: "confetti",
499
+ startCount: 50,
500
+ position: {
501
+ x: 50,
502
+ y: 50
503
+ },
504
+ size: {
505
+ width: 0,
506
+ height: 0
507
+ },
508
+ rate: {
509
+ delay: 0,
510
+ quantity: 0
511
+ },
512
+ life: {
513
+ duration: 0.1,
514
+ count: 1
515
+ }
516
+ }
447
517
  };
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
518
  ;// CONCATENATED MODULE: ./dist/browser/index.js
461
519
 
462
520
 
@@ -468,49 +526,20 @@ var updater_wobble_root_window_ = __webpack_require__(83);
468
526
 
469
527
 
470
528
 
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);
529
+ async function loadPreset(engine, refresh = true) {
530
+ await loadBasic(engine, false);
531
+ await (0,shape_square_root_window_.loadSquareShape)(engine, false);
532
+ await (0,plugin_emitters_root_window_.loadEmittersPlugin)(engine, false);
533
+ await (0,plugin_motion_root_window_.loadMotionPlugin)(engine, false);
534
+ await (0,updater_wobble_root_window_.loadWobbleUpdater)(engine, false);
535
+ await (0,updater_roll_root_window_.loadRollUpdater)(engine, false);
536
+ await loadRotateUpdater(engine, false);
537
+ await (0,updater_tilt_root_window_.loadTiltUpdater)(engine, false);
538
+ await (0,updater_life_root_window_.loadLifeUpdater)(engine, false);
539
+ await engine.addPreset("confetti", options, refresh);
496
540
  }
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
- });
541
+ async function loadConfettiPreset(engine) {
542
+ await loadPreset(engine);
514
543
  }
515
544
  })();
516
545