@tsparticles/confetti 3.0.0-beta.0 → 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.
- package/browser/confetti.js +1 -1
- package/browser/index.js +1 -1
- package/browser/package.json +1 -0
- package/cjs/confetti.js +2 -2
- package/cjs/index.js +1 -1
- package/cjs/package.json +1 -0
- package/esm/confetti.js +1 -1
- package/esm/index.js +1 -1
- package/esm/package.json +1 -0
- package/package.json +32 -20
- package/report.html +2 -2
- package/tsparticles.confetti.bundle.js +164 -164
- package/tsparticles.confetti.bundle.min.js +1 -1
- package/tsparticles.confetti.bundle.min.js.LICENSE.txt +1 -1
- package/tsparticles.confetti.js +19 -19
- package/tsparticles.confetti.min.js +1 -1
- package/tsparticles.confetti.min.js.LICENSE.txt +1 -1
- package/types/ConfettiOptions.d.ts +1 -1
- package/types/confetti.d.ts +1 -1
- package/types/index.d.ts +2 -2
- package/umd/confetti.js +3 -3
- package/umd/index.js +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! tsParticles Confetti v3.0.0-beta.
|
|
1
|
+
/*! tsParticles Confetti v3.0.0-beta.1 by Matteo Bruni */
|
package/tsparticles.confetti.js
CHANGED
|
@@ -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-beta.
|
|
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/
|
|
11
|
+
module.exports = factory(require("@tsparticles/engine"), 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/shape-cards"), require("@tsparticles/plugin-emitters"), require("@tsparticles/shape-heart"), require("@tsparticles/shape-image"), require("@tsparticles/updater-life"), require("@tsparticles/plugin-motion"), require("@tsparticles/shape-polygon"), require("@tsparticles/updater-roll"), require("@tsparticles/shape-square"), require("@tsparticles/shape-star"), require("@tsparticles/shape-text"), require("@tsparticles/updater-tilt"), require("@tsparticles/updater-wobble"));
|
|
12
12
|
else if(typeof define === 'function' && define.amd)
|
|
13
|
-
define(["@tsparticles/engine", "@tsparticles/
|
|
13
|
+
define(["@tsparticles/engine", "@tsparticles/move-base", "@tsparticles/shape-circle", "@tsparticles/updater-color", "@tsparticles/updater-opacity", "@tsparticles/updater-out-modes", "@tsparticles/updater-size", "@tsparticles/shape-cards", "@tsparticles/plugin-emitters", "@tsparticles/shape-heart", "@tsparticles/shape-image", "@tsparticles/updater-life", "@tsparticles/plugin-motion", "@tsparticles/shape-polygon", "@tsparticles/updater-roll", "@tsparticles/shape-square", "@tsparticles/shape-star", "@tsparticles/shape-text", "@tsparticles/updater-tilt", "@tsparticles/updater-wobble"], factory);
|
|
14
14
|
else {
|
|
15
|
-
var a = typeof exports === 'object' ? factory(require("@tsparticles/engine"), require("@tsparticles/
|
|
15
|
+
var a = typeof exports === 'object' ? factory(require("@tsparticles/engine"), 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/shape-cards"), require("@tsparticles/plugin-emitters"), require("@tsparticles/shape-heart"), require("@tsparticles/shape-image"), require("@tsparticles/updater-life"), require("@tsparticles/plugin-motion"), require("@tsparticles/shape-polygon"), require("@tsparticles/updater-roll"), require("@tsparticles/shape-square"), require("@tsparticles/shape-star"), require("@tsparticles/shape-text"), 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"], 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__686__, __WEBPACK_EXTERNAL_MODULE__68__, __WEBPACK_EXTERNAL_MODULE__12__, __WEBPACK_EXTERNAL_MODULE__885__, __WEBPACK_EXTERNAL_MODULE__84__, __WEBPACK_EXTERNAL_MODULE__82__, __WEBPACK_EXTERNAL_MODULE__907__, __WEBPACK_EXTERNAL_MODULE__734__,
|
|
18
|
+
})(this, (__WEBPACK_EXTERNAL_MODULE__533__, __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__345__, __WEBPACK_EXTERNAL_MODULE__68__, __WEBPACK_EXTERNAL_MODULE__12__, __WEBPACK_EXTERNAL_MODULE__885__, __WEBPACK_EXTERNAL_MODULE__84__, __WEBPACK_EXTERNAL_MODULE__82__, __WEBPACK_EXTERNAL_MODULE__907__, __WEBPACK_EXTERNAL_MODULE__734__, __WEBPACK_EXTERNAL_MODULE__652__, __WEBPACK_EXTERNAL_MODULE__960__, __WEBPACK_EXTERNAL_MODULE__727__, __WEBPACK_EXTERNAL_MODULE__448__, __WEBPACK_EXTERNAL_MODULE__83__) => {
|
|
19
19
|
return /******/ (() => { // webpackBootstrap
|
|
20
20
|
/******/ "use strict";
|
|
21
21
|
/******/ var __webpack_modules__ = ({
|
|
@@ -48,10 +48,10 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__82__;
|
|
|
48
48
|
|
|
49
49
|
/***/ }),
|
|
50
50
|
|
|
51
|
-
/***/
|
|
51
|
+
/***/ 345:
|
|
52
52
|
/***/ ((module) => {
|
|
53
53
|
|
|
54
|
-
module.exports =
|
|
54
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__345__;
|
|
55
55
|
|
|
56
56
|
/***/ }),
|
|
57
57
|
|
|
@@ -83,10 +83,10 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__907__;
|
|
|
83
83
|
|
|
84
84
|
/***/ }),
|
|
85
85
|
|
|
86
|
-
/***/
|
|
86
|
+
/***/ 652:
|
|
87
87
|
/***/ ((module) => {
|
|
88
88
|
|
|
89
|
-
module.exports =
|
|
89
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__652__;
|
|
90
90
|
|
|
91
91
|
/***/ }),
|
|
92
92
|
|
|
@@ -118,10 +118,10 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__84__;
|
|
|
118
118
|
|
|
119
119
|
/***/ }),
|
|
120
120
|
|
|
121
|
-
/***/
|
|
121
|
+
/***/ 686:
|
|
122
122
|
/***/ ((module) => {
|
|
123
123
|
|
|
124
|
-
module.exports =
|
|
124
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__686__;
|
|
125
125
|
|
|
126
126
|
/***/ }),
|
|
127
127
|
|
|
@@ -354,12 +354,12 @@ var shape_circle_root_window_ = __webpack_require__(163);
|
|
|
354
354
|
// EXTERNAL MODULE: external {"commonjs":"@tsparticles/updater-color","commonjs2":"@tsparticles/updater-color","amd":"@tsparticles/updater-color","root":"window"}
|
|
355
355
|
var updater_color_root_window_ = __webpack_require__(501);
|
|
356
356
|
// EXTERNAL MODULE: external {"commonjs":"@tsparticles/updater-opacity","commonjs2":"@tsparticles/updater-opacity","amd":"@tsparticles/updater-opacity","root":"window"}
|
|
357
|
-
var updater_opacity_root_window_ = __webpack_require__(
|
|
357
|
+
var updater_opacity_root_window_ = __webpack_require__(686);
|
|
358
358
|
// EXTERNAL MODULE: external {"commonjs":"@tsparticles/updater-out-modes","commonjs2":"@tsparticles/updater-out-modes","amd":"@tsparticles/updater-out-modes","root":"window"}
|
|
359
359
|
var updater_out_modes_root_window_ = __webpack_require__(290);
|
|
360
360
|
// EXTERNAL MODULE: external {"commonjs":"@tsparticles/updater-size","commonjs2":"@tsparticles/updater-size","amd":"@tsparticles/updater-size","root":"window"}
|
|
361
361
|
var updater_size_root_window_ = __webpack_require__(2);
|
|
362
|
-
;// CONCATENATED MODULE: ../basic/dist/
|
|
362
|
+
;// CONCATENATED MODULE: ../basic/dist/browser/index.js
|
|
363
363
|
|
|
364
364
|
|
|
365
365
|
|
|
@@ -376,7 +376,7 @@ async function loadBasic(engine, refresh = true) {
|
|
|
376
376
|
await engine.refresh(refresh);
|
|
377
377
|
}
|
|
378
378
|
// EXTERNAL MODULE: external {"commonjs":"@tsparticles/shape-cards","commonjs2":"@tsparticles/shape-cards","amd":"@tsparticles/shape-cards","root":"window"}
|
|
379
|
-
var shape_cards_root_window_ = __webpack_require__(
|
|
379
|
+
var shape_cards_root_window_ = __webpack_require__(345);
|
|
380
380
|
// EXTERNAL MODULE: external {"commonjs":"@tsparticles/plugin-emitters","commonjs2":"@tsparticles/plugin-emitters","amd":"@tsparticles/plugin-emitters","root":"window"}
|
|
381
381
|
var plugin_emitters_root_window_ = __webpack_require__(68);
|
|
382
382
|
// EXTERNAL MODULE: external {"commonjs":"@tsparticles/shape-heart","commonjs2":"@tsparticles/shape-heart","amd":"@tsparticles/shape-heart","root":"window"}
|
|
@@ -391,7 +391,7 @@ var plugin_motion_root_window_ = __webpack_require__(82);
|
|
|
391
391
|
var shape_polygon_root_window_ = __webpack_require__(907);
|
|
392
392
|
// EXTERNAL MODULE: external {"commonjs":"@tsparticles/updater-roll","commonjs2":"@tsparticles/updater-roll","amd":"@tsparticles/updater-roll","root":"window"}
|
|
393
393
|
var updater_roll_root_window_ = __webpack_require__(734);
|
|
394
|
-
;// CONCATENATED MODULE: ../../updaters/rotate/dist/
|
|
394
|
+
;// CONCATENATED MODULE: ../../updaters/rotate/dist/browser/Options/Classes/RotateAnimation.js
|
|
395
395
|
|
|
396
396
|
class RotateAnimation {
|
|
397
397
|
constructor() {
|
|
@@ -418,7 +418,7 @@ class RotateAnimation {
|
|
|
418
418
|
}
|
|
419
419
|
}
|
|
420
420
|
}
|
|
421
|
-
;// CONCATENATED MODULE: ../../updaters/rotate/dist/
|
|
421
|
+
;// CONCATENATED MODULE: ../../updaters/rotate/dist/browser/Options/Classes/Rotate.js
|
|
422
422
|
|
|
423
423
|
|
|
424
424
|
class Rotate extends engine_root_window_.ValueWithRandom {
|
|
@@ -443,7 +443,7 @@ class Rotate extends engine_root_window_.ValueWithRandom {
|
|
|
443
443
|
}
|
|
444
444
|
}
|
|
445
445
|
}
|
|
446
|
-
;// CONCATENATED MODULE: ../../updaters/rotate/dist/
|
|
446
|
+
;// CONCATENATED MODULE: ../../updaters/rotate/dist/browser/RotateUpdater.js
|
|
447
447
|
|
|
448
448
|
|
|
449
449
|
function updateRotate(particle, delta) {
|
|
@@ -539,13 +539,13 @@ class RotateUpdater {
|
|
|
539
539
|
particle.rotation = particle.rotate?.value ?? 0;
|
|
540
540
|
}
|
|
541
541
|
}
|
|
542
|
-
;// CONCATENATED MODULE: ../../updaters/rotate/dist/
|
|
542
|
+
;// CONCATENATED MODULE: ../../updaters/rotate/dist/browser/index.js
|
|
543
543
|
|
|
544
544
|
async function loadRotateUpdater(engine, refresh = true) {
|
|
545
545
|
await engine.addParticleUpdater("rotate", container => new RotateUpdater(container), refresh);
|
|
546
546
|
}
|
|
547
547
|
// EXTERNAL MODULE: external {"commonjs":"@tsparticles/shape-square","commonjs2":"@tsparticles/shape-square","amd":"@tsparticles/shape-square","root":"window"}
|
|
548
|
-
var shape_square_root_window_ = __webpack_require__(
|
|
548
|
+
var shape_square_root_window_ = __webpack_require__(652);
|
|
549
549
|
// EXTERNAL MODULE: external {"commonjs":"@tsparticles/shape-star","commonjs2":"@tsparticles/shape-star","amd":"@tsparticles/shape-star","root":"window"}
|
|
550
550
|
var shape_star_root_window_ = __webpack_require__(960);
|
|
551
551
|
// EXTERNAL MODULE: external {"commonjs":"@tsparticles/shape-text","commonjs2":"@tsparticles/shape-text","amd":"@tsparticles/shape-text","root":"window"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see tsparticles.confetti.min.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/engine"),require("@tsparticles/shape-cards"),require("@tsparticles/plugin-emitters"),require("@tsparticles/shape-heart"),require("@tsparticles/shape-image"),require("@tsparticles/updater-life"),require("@tsparticles/plugin-motion"),require("@tsparticles/shape-polygon"),require("@tsparticles/updater-roll"),require("@tsparticles/shape-square"),require("@tsparticles/shape-star"),require("@tsparticles/shape-text"),require("@tsparticles/updater-tilt"),require("@tsparticles/updater-wobble"),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"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine","@tsparticles/shape-cards","@tsparticles/plugin-emitters","@tsparticles/shape-heart","@tsparticles/shape-image","@tsparticles/updater-life","@tsparticles/plugin-motion","@tsparticles/shape-polygon","@tsparticles/updater-roll","@tsparticles/shape-square","@tsparticles/shape-star","@tsparticles/shape-text","@tsparticles/updater-tilt","@tsparticles/updater-wobble","@tsparticles/move-base","@tsparticles/shape-circle","@tsparticles/updater-color","@tsparticles/updater-opacity","@tsparticles/updater-out-modes","@tsparticles/updater-size"],t);else{var i="object"==typeof exports?t(require("@tsparticles/engine"),require("@tsparticles/shape-cards"),require("@tsparticles/plugin-emitters"),require("@tsparticles/shape-heart"),require("@tsparticles/shape-image"),require("@tsparticles/updater-life"),require("@tsparticles/plugin-motion"),require("@tsparticles/shape-polygon"),require("@tsparticles/updater-roll"),require("@tsparticles/shape-square"),require("@tsparticles/shape-star"),require("@tsparticles/shape-text"),require("@tsparticles/updater-tilt"),require("@tsparticles/updater-wobble"),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")):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,e.window,e.window,e.window,e.window,e.window);for(var a in i)("object"==typeof exports?exports:e)[a]=i[a]}}(this,((e,t,i,a,s,r,o,n,l,c,p,d,u,h,y,v,f,w,m,g)=>(()=>{"use strict";var x={533:t=>{t.exports=e},619:e=>{e.exports=y},68:e=>{e.exports=i},82:e=>{e.exports=o},686:e=>{e.exports=t},163:e=>{e.exports=v},12:e=>{e.exports=a},885:e=>{e.exports=s},907:e=>{e.exports=n},55:e=>{e.exports=c},960:e=>{e.exports=p},727:e=>{e.exports=d},501:e=>{e.exports=f},84:e=>{e.exports=r},446:e=>{e.exports=w},290:e=>{e.exports=m},734:e=>{e.exports=l},2:e=>{e.exports=g},448:e=>{e.exports=u},83:e=>{e.exports=h}},b={};function q(e){var t=b[e];if(void 0!==t)return t.exports;var i=b[e]={exports:{}};return x[e](i,i.exports,q),i.exports}q.d=(e,t)=>{for(var i in t)q.o(t,i)&&!q.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},q.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),q.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var S={};return(()=>{q.r(S),q.d(S,{confetti:()=>I});var e=q(533);class t{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=["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],this.shapes=["square","circle"],this.scalar=1,this.zIndex=100,this.disableForReducedMotion=!0,this.shapeOptions={}}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(t){if(!t)return;void 0!==t.angle&&(this.angle=t.angle);const i=t.count??t.particleCount;void 0!==i&&(this.count=i),void 0!==t.spread&&(this.spread=t.spread),void 0!==t.startVelocity&&(this.startVelocity=t.startVelocity),void 0!==t.decay&&(this.decay=t.decay),void 0!==t.gravity&&(this.gravity=t.gravity),void 0!==t.drift&&(this.drift=t.drift),void 0!==t.ticks&&(this.ticks=t.ticks);const a=t.origin;a&&!t.position&&(t.position={x:void 0!==a.x?100*a.x:void 0,y:void 0!==a.y?100*a.y:void 0});const s=t.position;s&&(void 0!==s.x&&(this.position.x=s.x),void 0!==s.y&&(this.position.y=s.y)),void 0!==t.colors&&((0,e.isArray)(t.colors)?this.colors=[...t.colors]:this.colors=t.colors);const r=t.shapeOptions;if(void 0!==r)for(const t in r){const i=r[t];i&&(this.shapeOptions[t]=(0,e.deepExtend)(this.shapeOptions[t]??{},i))}void 0!==t.shapes&&((0,e.isArray)(t.shapes)?this.shapes=[...t.shapes]:this.shapes=t.shapes),void 0!==t.scalar&&(this.scalar=t.scalar),void 0!==t.zIndex&&(this.zIndex=t.zIndex),void 0!==t.disableForReducedMotion&&(this.disableForReducedMotion=t.disableForReducedMotion)}}var i=q(619),a=q(163),s=q(501),r=q(446),o=q(290),n=q(2);var l=q(686),c=q(68),p=q(12),d=q(885),u=q(84),h=q(82),y=q(907),v=q(734);class f{constructor(){this.enable=!1,this.speed=0,this.decay=0,this.sync=!1}load(t){t&&(void 0!==t.enable&&(this.enable=t.enable),void 0!==t.speed&&(this.speed=(0,e.setRangeValue)(t.speed)),void 0!==t.decay&&(this.decay=(0,e.setRangeValue)(t.decay)),void 0!==t.sync&&(this.sync=t.sync))}}class w extends e.ValueWithRandom{constructor(){super(),this.animation=new f,this.direction="clockwise",this.path=!1,this.value=0}load(e){e&&(super.load(e),void 0!==e.direction&&(this.direction=e.direction),this.animation.load(e.animation),void 0!==e.path&&(this.path=e.path))}}class m{constructor(e){this.container=e}init(t){const i=t.options.rotate;if(!i)return;t.rotate={enable:i.animation.enable,value:(0,e.getRangeValue)(i.value)*Math.PI/180},t.pathRotation=i.path;let a=i.direction;if("random"===a){a=Math.floor(2*(0,e.getRandom)())>0?"counter-clockwise":"clockwise"}switch(a){case"counter-clockwise":case"counterClockwise":t.rotate.status="decreasing";break;case"clockwise":t.rotate.status="increasing"}const s=i.animation;s.enable&&(t.rotate.decay=1-(0,e.getRangeValue)(s.decay),t.rotate.velocity=(0,e.getRangeValue)(s.speed)/360*this.container.retina.reduceFactor,s.sync||(t.rotate.velocity*=(0,e.getRandom)())),t.rotation=t.rotate.value}isEnabled(e){const t=e.options.rotate;return!!t&&(!e.destroyed&&!e.spawning&&t.animation.enable&&!t.path)}loadOptions(e,...t){e.rotate||(e.rotate=new w);for(const i of t)e.rotate.load(i?.rotate)}update(e,t){this.isEnabled(e)&&(!function(e,t){const i=e.rotate,a=e.options.rotate;if(!i||!a)return;const s=a.animation,r=(i.velocity??0)*t.factor,o=2*Math.PI,n=i.decay??1;s.enable&&("increasing"===i.status?(i.value+=r,i.value>o&&(i.value-=o)):(i.value-=r,i.value<0&&(i.value+=o)),i.velocity&&1!==n&&(i.velocity*=n))}(e,t),e.rotation=e.rotate?.value??0)}}var g=q(55),x=q(960),b=q(727),R=q(448),M=q(83);let P=!1,k=!1;const z=new Map;async function O(e){if(!P){if(k)return new Promise((e=>{const t=setInterval((()=>{P&&(clearInterval(t),e())}),100)}));k=!0,await(0,c.loadEmittersPlugin)(e,!1),await(0,h.loadMotionPlugin)(e,!1),await(0,l.loadCardsShape)(e,!1),await(0,p.loadHeartShape)(e,!1),await(0,d.loadImageShape)(e,!1),await(0,y.loadPolygonShape)(e,!1),await(0,g.loadSquareShape)(e,!1),await(0,x.loadStarShape)(e,!1),await(0,b.loadTextShape)(e,!1),await async function(e,t=!0){await e.addParticleUpdater("rotate",(e=>new m(e)),t)}(e,!1),await(0,u.loadLifeUpdater)(e,!1),await(0,v.loadRollUpdater)(e,!1),await(0,R.loadTiltUpdater)(e,!1),await(0,M.loadWobbleUpdater)(e,!1),await async function(e,t=!0){await(0,i.loadBaseMover)(e,!1),await(0,a.loadCircleShape)(e,!1),await(0,s.loadColorUpdater)(e,!1),await(0,r.loadOpacityUpdater)(e,!1),await(0,o.loadOutModesUpdater)(e,!1),await(0,n.loadSizeUpdater)(e,!1),await e.refresh(t)}(e),k=!1,P=!0}}async function V(i){const a=new t;let s;a.load(i.options);const r=1e3*a.ticks/432e3;if(z.has(i.id)&&(s=z.get(i.id),s&&!s.destroyed)){const e=s;if(e.addEmitter)return void e.addEmitter({startCount:a.count,position:a.position,size:{width:0,height:0},rate:{delay:0,quantity:0},life:{duration:.1,count:1},particles:{color:{value:a.colors},shape:{type:a.shapes,options:a.shapeOptions},life:{count:1},opacity:{value:{min:0,max:1},animation:{enable:!0,sync:!0,speed:r,startValue:"max",destroy:"min"}},size:{value:5*a.scalar},move:{angle:{value:a.spread,offset:0},drift:{min:-a.drift,max:a.drift},gravity:{acceleration:9.81*a.gravity},speed:3*a.startVelocity,decay:1-a.decay,direction:-a.angle}}})}const o={fullScreen:{enable:!i.canvas,zIndex:a.zIndex},fpsLimit:120,particles:{number:{value:0},color:{value:a.colors},shape:{type:a.shapes,options:a.shapeOptions},opacity:{value:{min:0,max:1},animation:{enable:!0,sync:!0,speed:r,startValue:"max",destroy:"min"}},size:{value:5*a.scalar},links:{enable:!1},life:{count:1},move:{angle:{value:a.spread,offset:0},drift:{min:-a.drift,max:a.drift},enable:!0,gravity:{enable:!0,acceleration:9.81*a.gravity},speed:3*a.startVelocity,decay:1-a.decay,direction:-a.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:a.disableForReducedMotion},emitters:{name:"confetti",startCount:a.count,position:a.position,size:{width:0,height:0},rate:{delay:0,quantity:0},life:{duration:.1,count:1}}};return s=await e.tsParticles.load({id:i.id,element:i.canvas,options:o}),z.set(i.id,s),s}async function I(t,i){let a,s;return await O(e.tsParticles),(0,e.isString)(t)?(s=t,a=i??{}):(s="confetti",a=t),V({id:s,options:a})}I.create=async(t,i)=>{if(!t)return I;await O(e.tsParticles);const a=t.getAttribute("id")||"confetti";return t.setAttribute("id",a),async(s,r)=>{let o,n;return(0,e.isString)(s)?(n=s,o=r??i):(n=a,o=s),V({id:n,canvas:t,options:o})}},I.version=e.tsParticles.version,(0,e.isSsr)()||(window.confetti=I)})(),S})()));
|
|
2
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/engine"),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/shape-cards"),require("@tsparticles/plugin-emitters"),require("@tsparticles/shape-heart"),require("@tsparticles/shape-image"),require("@tsparticles/updater-life"),require("@tsparticles/plugin-motion"),require("@tsparticles/shape-polygon"),require("@tsparticles/updater-roll"),require("@tsparticles/shape-square"),require("@tsparticles/shape-star"),require("@tsparticles/shape-text"),require("@tsparticles/updater-tilt"),require("@tsparticles/updater-wobble"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine","@tsparticles/move-base","@tsparticles/shape-circle","@tsparticles/updater-color","@tsparticles/updater-opacity","@tsparticles/updater-out-modes","@tsparticles/updater-size","@tsparticles/shape-cards","@tsparticles/plugin-emitters","@tsparticles/shape-heart","@tsparticles/shape-image","@tsparticles/updater-life","@tsparticles/plugin-motion","@tsparticles/shape-polygon","@tsparticles/updater-roll","@tsparticles/shape-square","@tsparticles/shape-star","@tsparticles/shape-text","@tsparticles/updater-tilt","@tsparticles/updater-wobble"],t);else{var i="object"==typeof exports?t(require("@tsparticles/engine"),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/shape-cards"),require("@tsparticles/plugin-emitters"),require("@tsparticles/shape-heart"),require("@tsparticles/shape-image"),require("@tsparticles/updater-life"),require("@tsparticles/plugin-motion"),require("@tsparticles/shape-polygon"),require("@tsparticles/updater-roll"),require("@tsparticles/shape-square"),require("@tsparticles/shape-star"),require("@tsparticles/shape-text"),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,e.window,e.window,e.window,e.window,e.window);for(var a in i)("object"==typeof exports?exports:e)[a]=i[a]}}(this,((e,t,i,a,s,r,o,n,l,c,p,d,u,h,y,v,f,w,m,g)=>(()=>{"use strict";var x={533:t=>{t.exports=e},619:e=>{e.exports=t},68:e=>{e.exports=l},82:e=>{e.exports=u},345:e=>{e.exports=n},163:e=>{e.exports=i},12:e=>{e.exports=c},885:e=>{e.exports=p},907:e=>{e.exports=h},652:e=>{e.exports=v},960:e=>{e.exports=f},727:e=>{e.exports=w},501:e=>{e.exports=a},84:e=>{e.exports=d},686:e=>{e.exports=s},290:e=>{e.exports=r},734:e=>{e.exports=y},2:e=>{e.exports=o},448:e=>{e.exports=m},83:e=>{e.exports=g}},b={};function q(e){var t=b[e];if(void 0!==t)return t.exports;var i=b[e]={exports:{}};return x[e](i,i.exports,q),i.exports}q.d=(e,t)=>{for(var i in t)q.o(t,i)&&!q.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},q.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),q.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var S={};return(()=>{q.r(S),q.d(S,{confetti:()=>I});var e=q(533);class t{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=["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],this.shapes=["square","circle"],this.scalar=1,this.zIndex=100,this.disableForReducedMotion=!0,this.shapeOptions={}}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(t){if(!t)return;void 0!==t.angle&&(this.angle=t.angle);const i=t.count??t.particleCount;void 0!==i&&(this.count=i),void 0!==t.spread&&(this.spread=t.spread),void 0!==t.startVelocity&&(this.startVelocity=t.startVelocity),void 0!==t.decay&&(this.decay=t.decay),void 0!==t.gravity&&(this.gravity=t.gravity),void 0!==t.drift&&(this.drift=t.drift),void 0!==t.ticks&&(this.ticks=t.ticks);const a=t.origin;a&&!t.position&&(t.position={x:void 0!==a.x?100*a.x:void 0,y:void 0!==a.y?100*a.y:void 0});const s=t.position;s&&(void 0!==s.x&&(this.position.x=s.x),void 0!==s.y&&(this.position.y=s.y)),void 0!==t.colors&&((0,e.isArray)(t.colors)?this.colors=[...t.colors]:this.colors=t.colors);const r=t.shapeOptions;if(void 0!==r)for(const t in r){const i=r[t];i&&(this.shapeOptions[t]=(0,e.deepExtend)(this.shapeOptions[t]??{},i))}void 0!==t.shapes&&((0,e.isArray)(t.shapes)?this.shapes=[...t.shapes]:this.shapes=t.shapes),void 0!==t.scalar&&(this.scalar=t.scalar),void 0!==t.zIndex&&(this.zIndex=t.zIndex),void 0!==t.disableForReducedMotion&&(this.disableForReducedMotion=t.disableForReducedMotion)}}var i=q(619),a=q(163),s=q(501),r=q(686),o=q(290),n=q(2);var l=q(345),c=q(68),p=q(12),d=q(885),u=q(84),h=q(82),y=q(907),v=q(734);class f{constructor(){this.enable=!1,this.speed=0,this.decay=0,this.sync=!1}load(t){t&&(void 0!==t.enable&&(this.enable=t.enable),void 0!==t.speed&&(this.speed=(0,e.setRangeValue)(t.speed)),void 0!==t.decay&&(this.decay=(0,e.setRangeValue)(t.decay)),void 0!==t.sync&&(this.sync=t.sync))}}class w extends e.ValueWithRandom{constructor(){super(),this.animation=new f,this.direction="clockwise",this.path=!1,this.value=0}load(e){e&&(super.load(e),void 0!==e.direction&&(this.direction=e.direction),this.animation.load(e.animation),void 0!==e.path&&(this.path=e.path))}}class m{constructor(e){this.container=e}init(t){const i=t.options.rotate;if(!i)return;t.rotate={enable:i.animation.enable,value:(0,e.getRangeValue)(i.value)*Math.PI/180},t.pathRotation=i.path;let a=i.direction;if("random"===a){a=Math.floor(2*(0,e.getRandom)())>0?"counter-clockwise":"clockwise"}switch(a){case"counter-clockwise":case"counterClockwise":t.rotate.status="decreasing";break;case"clockwise":t.rotate.status="increasing"}const s=i.animation;s.enable&&(t.rotate.decay=1-(0,e.getRangeValue)(s.decay),t.rotate.velocity=(0,e.getRangeValue)(s.speed)/360*this.container.retina.reduceFactor,s.sync||(t.rotate.velocity*=(0,e.getRandom)())),t.rotation=t.rotate.value}isEnabled(e){const t=e.options.rotate;return!!t&&(!e.destroyed&&!e.spawning&&t.animation.enable&&!t.path)}loadOptions(e,...t){e.rotate||(e.rotate=new w);for(const i of t)e.rotate.load(i?.rotate)}update(e,t){this.isEnabled(e)&&(!function(e,t){const i=e.rotate,a=e.options.rotate;if(!i||!a)return;const s=a.animation,r=(i.velocity??0)*t.factor,o=2*Math.PI,n=i.decay??1;s.enable&&("increasing"===i.status?(i.value+=r,i.value>o&&(i.value-=o)):(i.value-=r,i.value<0&&(i.value+=o)),i.velocity&&1!==n&&(i.velocity*=n))}(e,t),e.rotation=e.rotate?.value??0)}}var g=q(652),x=q(960),b=q(727),R=q(448),M=q(83);let P=!1,k=!1;const z=new Map;async function O(e){if(!P){if(k)return new Promise((e=>{const t=setInterval((()=>{P&&(clearInterval(t),e())}),100)}));k=!0,await(0,c.loadEmittersPlugin)(e,!1),await(0,h.loadMotionPlugin)(e,!1),await(0,l.loadCardsShape)(e,!1),await(0,p.loadHeartShape)(e,!1),await(0,d.loadImageShape)(e,!1),await(0,y.loadPolygonShape)(e,!1),await(0,g.loadSquareShape)(e,!1),await(0,x.loadStarShape)(e,!1),await(0,b.loadTextShape)(e,!1),await async function(e,t=!0){await e.addParticleUpdater("rotate",(e=>new m(e)),t)}(e,!1),await(0,u.loadLifeUpdater)(e,!1),await(0,v.loadRollUpdater)(e,!1),await(0,R.loadTiltUpdater)(e,!1),await(0,M.loadWobbleUpdater)(e,!1),await async function(e,t=!0){await(0,i.loadBaseMover)(e,!1),await(0,a.loadCircleShape)(e,!1),await(0,s.loadColorUpdater)(e,!1),await(0,r.loadOpacityUpdater)(e,!1),await(0,o.loadOutModesUpdater)(e,!1),await(0,n.loadSizeUpdater)(e,!1),await e.refresh(t)}(e),k=!1,P=!0}}async function V(i){const a=new t;let s;a.load(i.options);const r=1e3*a.ticks/432e3;if(z.has(i.id)&&(s=z.get(i.id),s&&!s.destroyed)){const e=s;if(e.addEmitter)return void e.addEmitter({startCount:a.count,position:a.position,size:{width:0,height:0},rate:{delay:0,quantity:0},life:{duration:.1,count:1},particles:{color:{value:a.colors},shape:{type:a.shapes,options:a.shapeOptions},life:{count:1},opacity:{value:{min:0,max:1},animation:{enable:!0,sync:!0,speed:r,startValue:"max",destroy:"min"}},size:{value:5*a.scalar},move:{angle:{value:a.spread,offset:0},drift:{min:-a.drift,max:a.drift},gravity:{acceleration:9.81*a.gravity},speed:3*a.startVelocity,decay:1-a.decay,direction:-a.angle}}})}const o={fullScreen:{enable:!i.canvas,zIndex:a.zIndex},fpsLimit:120,particles:{number:{value:0},color:{value:a.colors},shape:{type:a.shapes,options:a.shapeOptions},opacity:{value:{min:0,max:1},animation:{enable:!0,sync:!0,speed:r,startValue:"max",destroy:"min"}},size:{value:5*a.scalar},links:{enable:!1},life:{count:1},move:{angle:{value:a.spread,offset:0},drift:{min:-a.drift,max:a.drift},enable:!0,gravity:{enable:!0,acceleration:9.81*a.gravity},speed:3*a.startVelocity,decay:1-a.decay,direction:-a.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:a.disableForReducedMotion},emitters:{name:"confetti",startCount:a.count,position:a.position,size:{width:0,height:0},rate:{delay:0,quantity:0},life:{duration:.1,count:1}}};return s=await e.tsParticles.load({id:i.id,element:i.canvas,options:o}),z.set(i.id,s),s}async function I(t,i){let a,s;return await O(e.tsParticles),(0,e.isString)(t)?(s=t,a=i??{}):(s="confetti",a=t),V({id:s,options:a})}I.create=async(t,i)=>{if(!t)return I;await O(e.tsParticles);const a=t.getAttribute("id")||"confetti";return t.setAttribute("id",a),async(s,r)=>{let o,n;return(0,e.isString)(s)?(n=s,o=r??i):(n=a,o=s),V({id:n,canvas:t,options:o})}},I.version=e.tsParticles.version,(0,e.isSsr)()||(window.confetti=I)})(),S})()));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! tsParticles Confetti v3.0.0-beta.
|
|
1
|
+
/*! tsParticles Confetti v3.0.0-beta.1 by Matteo Bruni */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ICoordinates, type IOptionLoader, type RecursivePartial, type ShapeData, type SingleOrMultiple } from "@tsparticles/engine";
|
|
2
|
-
import type { IConfettiOptions } from "./IConfettiOptions";
|
|
2
|
+
import type { IConfettiOptions } from "./IConfettiOptions.js";
|
|
3
3
|
export declare class ConfettiOptions implements IConfettiOptions, IOptionLoader<IConfettiOptions> {
|
|
4
4
|
angle: number;
|
|
5
5
|
colors: SingleOrMultiple<string>;
|
package/types/confetti.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Container, type RecursivePartial } from "@tsparticles/engine";
|
|
2
|
-
import type { IConfettiOptions } from "./IConfettiOptions";
|
|
2
|
+
import type { IConfettiOptions } from "./IConfettiOptions.js";
|
|
3
3
|
export type ConfettiFirstParam = string | RecursivePartial<IConfettiOptions>;
|
|
4
4
|
declare global {
|
|
5
5
|
interface Window {
|
package/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IConfettiOptions } from "./IConfettiOptions";
|
|
1
|
+
import type { IConfettiOptions } from "./IConfettiOptions.js";
|
|
2
2
|
import type { RecursivePartial } from "@tsparticles/engine";
|
|
3
3
|
export type ConfettiOptions = RecursivePartial<IConfettiOptions>;
|
|
4
|
-
export * from "./confetti";
|
|
4
|
+
export * from "./confetti.js";
|
package/umd/confetti.js
CHANGED
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "@tsparticles/engine", "./ConfettiOptions", "@tsparticles/basic", "@tsparticles/shape-cards", "@tsparticles/plugin-emitters", "@tsparticles/shape-heart", "@tsparticles/shape-image", "@tsparticles/updater-life", "@tsparticles/plugin-motion", "@tsparticles/shape-polygon", "@tsparticles/updater-roll", "@tsparticles/updater-rotate", "@tsparticles/shape-square", "@tsparticles/shape-star", "@tsparticles/shape-text", "@tsparticles/updater-tilt", "@tsparticles/updater-wobble"], factory);
|
|
7
|
+
define(["require", "exports", "@tsparticles/engine", "./ConfettiOptions.js", "@tsparticles/basic", "@tsparticles/shape-cards", "@tsparticles/plugin-emitters", "@tsparticles/shape-heart", "@tsparticles/shape-image", "@tsparticles/updater-life", "@tsparticles/plugin-motion", "@tsparticles/shape-polygon", "@tsparticles/updater-roll", "@tsparticles/updater-rotate", "@tsparticles/shape-square", "@tsparticles/shape-star", "@tsparticles/shape-text", "@tsparticles/updater-tilt", "@tsparticles/updater-wobble"], factory);
|
|
8
8
|
}
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.confetti = void 0;
|
|
13
13
|
const engine_1 = require("@tsparticles/engine");
|
|
14
|
-
const
|
|
14
|
+
const ConfettiOptions_js_1 = require("./ConfettiOptions.js");
|
|
15
15
|
const basic_1 = require("@tsparticles/basic");
|
|
16
16
|
const shape_cards_1 = require("@tsparticles/shape-cards");
|
|
17
17
|
const plugin_emitters_1 = require("@tsparticles/plugin-emitters");
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
initialized = true;
|
|
66
66
|
}
|
|
67
67
|
async function setConfetti(params) {
|
|
68
|
-
const actualOptions = new
|
|
68
|
+
const actualOptions = new ConfettiOptions_js_1.ConfettiOptions();
|
|
69
69
|
actualOptions.load(params.options);
|
|
70
70
|
let container;
|
|
71
71
|
const fpsLimit = 120, opacitySpeed = (actualOptions.ticks * 1000) / (3600 * fpsLimit);
|
package/umd/index.js
CHANGED
|
@@ -18,10 +18,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
18
18
|
if (v !== undefined) module.exports = v;
|
|
19
19
|
}
|
|
20
20
|
else if (typeof define === "function" && define.amd) {
|
|
21
|
-
define(["require", "exports", "./confetti"], factory);
|
|
21
|
+
define(["require", "exports", "./confetti.js"], factory);
|
|
22
22
|
}
|
|
23
23
|
})(function (require, exports) {
|
|
24
24
|
"use strict";
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
__exportStar(require("./confetti"), exports);
|
|
26
|
+
__exportStar(require("./confetti.js"), exports);
|
|
27
27
|
});
|