@tsparticles/confetti 3.0.3 → 3.2.0

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.
Files changed (224) hide show
  1. package/1308.min.js +2 -0
  2. package/1308.min.js.LICENSE.txt +1 -0
  3. package/1472.min.js +2 -0
  4. package/1472.min.js.LICENSE.txt +1 -0
  5. package/1513.min.js +2 -0
  6. package/1513.min.js.LICENSE.txt +1 -0
  7. package/1705.min.js +2 -0
  8. package/1705.min.js.LICENSE.txt +1 -0
  9. package/1810.min.js +2 -0
  10. package/1810.min.js.LICENSE.txt +1 -0
  11. package/196.min.js +2 -0
  12. package/196.min.js.LICENSE.txt +1 -0
  13. package/2124.min.js +2 -0
  14. package/2124.min.js.LICENSE.txt +1 -0
  15. package/2173.min.js +2 -0
  16. package/2173.min.js.LICENSE.txt +1 -0
  17. package/2580.min.js +2 -0
  18. package/2580.min.js.LICENSE.txt +1 -0
  19. package/2720.min.js +2 -0
  20. package/2720.min.js.LICENSE.txt +1 -0
  21. package/2765.min.js +2 -0
  22. package/2765.min.js.LICENSE.txt +1 -0
  23. package/3141.min.js +2 -0
  24. package/3141.min.js.LICENSE.txt +1 -0
  25. package/3261.min.js +2 -0
  26. package/3261.min.js.LICENSE.txt +1 -0
  27. package/3473.min.js +2 -0
  28. package/3473.min.js.LICENSE.txt +1 -0
  29. package/3610.min.js +2 -0
  30. package/3610.min.js.LICENSE.txt +1 -0
  31. package/3629.min.js +2 -0
  32. package/3629.min.js.LICENSE.txt +1 -0
  33. package/3648.min.js +2 -0
  34. package/3648.min.js.LICENSE.txt +1 -0
  35. package/3733.min.js +2 -0
  36. package/3733.min.js.LICENSE.txt +1 -0
  37. package/3862.min.js +2 -0
  38. package/3862.min.js.LICENSE.txt +1 -0
  39. package/3869.min.js +2 -0
  40. package/3869.min.js.LICENSE.txt +1 -0
  41. package/409.min.js +2 -0
  42. package/409.min.js.LICENSE.txt +1 -0
  43. package/4245.min.js +2 -0
  44. package/4245.min.js.LICENSE.txt +1 -0
  45. package/4328.min.js +2 -0
  46. package/4328.min.js.LICENSE.txt +1 -0
  47. package/4396.min.js +2 -0
  48. package/4396.min.js.LICENSE.txt +1 -0
  49. package/4547.min.js +2 -0
  50. package/4547.min.js.LICENSE.txt +1 -0
  51. package/4595.min.js +2 -0
  52. package/4595.min.js.LICENSE.txt +1 -0
  53. package/4794.min.js +2 -0
  54. package/4794.min.js.LICENSE.txt +1 -0
  55. package/482.min.js +2 -0
  56. package/482.min.js.LICENSE.txt +1 -0
  57. package/4866.min.js +2 -0
  58. package/4866.min.js.LICENSE.txt +1 -0
  59. package/4973.min.js +2 -0
  60. package/4973.min.js.LICENSE.txt +1 -0
  61. package/4994.min.js +2 -0
  62. package/4994.min.js.LICENSE.txt +1 -0
  63. package/5092.min.js +2 -0
  64. package/5092.min.js.LICENSE.txt +1 -0
  65. package/5120.min.js +2 -0
  66. package/5120.min.js.LICENSE.txt +1 -0
  67. package/5245.min.js +2 -0
  68. package/5245.min.js.LICENSE.txt +1 -0
  69. package/5308.min.js +2 -0
  70. package/5308.min.js.LICENSE.txt +1 -0
  71. package/5329.min.js +2 -0
  72. package/5329.min.js.LICENSE.txt +1 -0
  73. package/5437.min.js +2 -0
  74. package/5437.min.js.LICENSE.txt +1 -0
  75. package/5444.min.js +2 -0
  76. package/5444.min.js.LICENSE.txt +1 -0
  77. package/5534.min.js +2 -0
  78. package/5534.min.js.LICENSE.txt +1 -0
  79. package/560.min.js +2 -0
  80. package/560.min.js.LICENSE.txt +1 -0
  81. package/5647.min.js +2 -0
  82. package/5647.min.js.LICENSE.txt +1 -0
  83. package/571.min.js +2 -0
  84. package/571.min.js.LICENSE.txt +1 -0
  85. package/5742.min.js +2 -0
  86. package/5742.min.js.LICENSE.txt +1 -0
  87. package/6004.min.js +2 -0
  88. package/6004.min.js.LICENSE.txt +1 -0
  89. package/6132.min.js +2 -0
  90. package/6132.min.js.LICENSE.txt +1 -0
  91. package/6551.min.js +2 -0
  92. package/6551.min.js.LICENSE.txt +1 -0
  93. package/6772.min.js +2 -0
  94. package/6772.min.js.LICENSE.txt +1 -0
  95. package/7031.min.js +2 -0
  96. package/7031.min.js.LICENSE.txt +1 -0
  97. package/7049.min.js +2 -0
  98. package/7049.min.js.LICENSE.txt +1 -0
  99. package/7108.min.js +2 -0
  100. package/7108.min.js.LICENSE.txt +1 -0
  101. package/7331.min.js +2 -0
  102. package/7331.min.js.LICENSE.txt +1 -0
  103. package/7517.min.js +2 -0
  104. package/7517.min.js.LICENSE.txt +1 -0
  105. package/7687.min.js +2 -0
  106. package/7687.min.js.LICENSE.txt +1 -0
  107. package/7725.min.js +2 -0
  108. package/7725.min.js.LICENSE.txt +1 -0
  109. package/7757.min.js +2 -0
  110. package/7757.min.js.LICENSE.txt +1 -0
  111. package/7835.min.js +2 -0
  112. package/7835.min.js.LICENSE.txt +1 -0
  113. package/7859.min.js +2 -0
  114. package/7859.min.js.LICENSE.txt +1 -0
  115. package/7886.min.js +2 -0
  116. package/7886.min.js.LICENSE.txt +1 -0
  117. package/7890.min.js +2 -0
  118. package/7890.min.js.LICENSE.txt +1 -0
  119. package/8060.min.js +2 -0
  120. package/8060.min.js.LICENSE.txt +1 -0
  121. package/9062.min.js +2 -0
  122. package/9062.min.js.LICENSE.txt +1 -0
  123. package/9126.min.js +2 -0
  124. package/9126.min.js.LICENSE.txt +1 -0
  125. package/9331.min.js +2 -0
  126. package/9331.min.js.LICENSE.txt +1 -0
  127. package/9376.min.js +2 -0
  128. package/9376.min.js.LICENSE.txt +1 -0
  129. package/95.min.js +2 -0
  130. package/95.min.js.LICENSE.txt +1 -0
  131. package/9530.min.js +2 -0
  132. package/9530.min.js.LICENSE.txt +1 -0
  133. package/9532.min.js +2 -0
  134. package/9532.min.js.LICENSE.txt +1 -0
  135. package/9836.min.js +2 -0
  136. package/9836.min.js.LICENSE.txt +1 -0
  137. package/9921.min.js +2 -0
  138. package/9921.min.js.LICENSE.txt +1 -0
  139. package/basic_dist_browser_index_js.js +30 -0
  140. package/browser/ConfettiOptions.js +7 -7
  141. package/browser/confetti.js +18 -31
  142. package/cjs/ConfettiOptions.js +6 -6
  143. package/cjs/confetti.js +55 -45
  144. package/engine_dist_browser_Core_Container_js.js +90 -0
  145. package/engine_dist_browser_Core_Particle_js.js +30 -0
  146. package/esm/ConfettiOptions.js +7 -7
  147. package/esm/confetti.js +18 -31
  148. package/move_base_dist_browser_BaseMover_js.js +30 -0
  149. package/move_base_dist_browser_Utils_js.js +30 -0
  150. package/move_base_dist_browser_index_js.js +30 -0
  151. package/package.json +17 -17
  152. package/plugins_emitters_dist_browser_EmitterInstance_js.js +30 -0
  153. package/plugins_emitters_dist_browser_EmittersPlugin_js.js +90 -0
  154. package/plugins_emitters_dist_browser_Emitters_js.js +30 -0
  155. package/plugins_emitters_dist_browser_ShapeManager_js.js +30 -0
  156. package/plugins_emitters_dist_browser_index_js.js +100 -0
  157. package/plugins_motion_dist_browser_MotionInstance_js.js +30 -0
  158. package/plugins_motion_dist_browser_MotionPlugin_js.js +50 -0
  159. package/plugins_motion_dist_browser_index_js.js +30 -0
  160. package/report.html +3 -3
  161. package/shapes_cards_dist_browser_ClubDrawer_js.js +30 -0
  162. package/shapes_cards_dist_browser_DiamondDrawer_js.js +30 -0
  163. package/shapes_cards_dist_browser_HeartDrawer_js.js +30 -0
  164. package/shapes_cards_dist_browser_SpadeDrawer_js.js +30 -0
  165. package/shapes_cards_dist_browser_Utils_js.js +30 -0
  166. package/shapes_cards_dist_browser_index_js.js +30 -0
  167. package/shapes_circle_dist_browser_CircleDrawer_js.js +30 -0
  168. package/shapes_circle_dist_browser_Utils_js.js +30 -0
  169. package/shapes_circle_dist_browser_index_js.js +30 -0
  170. package/shapes_emoji_dist_browser_EmojiDrawer_js.js +30 -0
  171. package/shapes_emoji_dist_browser_Utils_js.js +30 -0
  172. package/shapes_emoji_dist_browser_index_js.js +40 -0
  173. package/shapes_heart_dist_browser_HeartDrawer_js.js +30 -0
  174. package/shapes_heart_dist_browser_Utils_js.js +30 -0
  175. package/shapes_heart_dist_browser_index_js.js +30 -0
  176. package/shapes_image_dist_browser_GifUtils_Utils_js.js +50 -0
  177. package/shapes_image_dist_browser_ImageDrawer_js.js +30 -0
  178. package/shapes_image_dist_browser_ImagePreloader_js.js +40 -0
  179. package/shapes_image_dist_browser_index_js.js +40 -0
  180. package/shapes_polygon_dist_browser_PolygonDrawer_js.js +40 -0
  181. package/shapes_polygon_dist_browser_TriangleDrawer_js.js +40 -0
  182. package/shapes_polygon_dist_browser_Utils_js.js +30 -0
  183. package/shapes_polygon_dist_browser_index_js.js +30 -0
  184. package/shapes_square_dist_browser_SquareDrawer_js.js +30 -0
  185. package/shapes_square_dist_browser_Utils_js.js +30 -0
  186. package/shapes_square_dist_browser_index_js.js +30 -0
  187. package/shapes_star_dist_browser_StarDrawer_js.js +30 -0
  188. package/shapes_star_dist_browser_Utils_js.js +30 -0
  189. package/shapes_star_dist_browser_index_js.js +30 -0
  190. package/tsparticles.confetti.bundle.js +2141 -9731
  191. package/tsparticles.confetti.bundle.min.js +1 -1
  192. package/tsparticles.confetti.bundle.min.js.LICENSE.txt +1 -1
  193. package/tsparticles.confetti.js +171 -516
  194. package/tsparticles.confetti.min.js +1 -1
  195. package/tsparticles.confetti.min.js.LICENSE.txt +1 -1
  196. package/types/confetti.d.ts +5 -0
  197. package/umd/ConfettiOptions.js +6 -6
  198. package/umd/confetti.js +57 -46
  199. package/updaters_color_dist_browser_ColorUpdater_js.js +30 -0
  200. package/updaters_color_dist_browser_index_js.js +30 -0
  201. package/updaters_life_dist_browser_LifeUpdater_js.js +60 -0
  202. package/updaters_life_dist_browser_Utils_js.js +30 -0
  203. package/updaters_life_dist_browser_index_js.js +30 -0
  204. package/updaters_opacity_dist_browser_OpacityUpdater_js.js +30 -0
  205. package/updaters_opacity_dist_browser_index_js.js +30 -0
  206. package/updaters_outModes_dist_browser_BounceOutMode_js.js +30 -0
  207. package/updaters_outModes_dist_browser_DestroyOutMode_js.js +30 -0
  208. package/updaters_outModes_dist_browser_NoneOutMode_js.js +30 -0
  209. package/updaters_outModes_dist_browser_OutOfCanvasUpdater_js.js +30 -0
  210. package/updaters_outModes_dist_browser_OutOutMode_js.js +30 -0
  211. package/updaters_outModes_dist_browser_Utils_js.js +30 -0
  212. package/updaters_outModes_dist_browser_index_js.js +30 -0
  213. package/updaters_roll_dist_browser_RollUpdater_js.js +50 -0
  214. package/updaters_roll_dist_browser_Utils_js.js +30 -0
  215. package/updaters_roll_dist_browser_index_js.js +30 -0
  216. package/updaters_rotate_dist_browser_RotateUpdater_js.js +50 -0
  217. package/updaters_rotate_dist_browser_index_js.js +30 -0
  218. package/updaters_size_dist_browser_SizeUpdater_js.js +30 -0
  219. package/updaters_size_dist_browser_index_js.js +30 -0
  220. package/updaters_tilt_dist_browser_TiltUpdater_js.js +50 -0
  221. package/updaters_tilt_dist_browser_index_js.js +30 -0
  222. package/updaters_wobble_dist_browser_Utils_js.js +30 -0
  223. package/updaters_wobble_dist_browser_WobbleUpdater_js.js +50 -0
  224. package/updaters_wobble_dist_browser_index_js.js +30 -0
@@ -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/basic"),require("@tsparticles/shape-cards"),require("@tsparticles/plugin-emitters"),require("@tsparticles/shape-emoji"),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/updater-rotate"),require("@tsparticles/shape-square"),require("@tsparticles/shape-star"),require("@tsparticles/updater-tilt"),require("@tsparticles/updater-wobble"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine","@tsparticles/basic","@tsparticles/shape-cards","@tsparticles/plugin-emitters","@tsparticles/shape-emoji","@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/updater-tilt","@tsparticles/updater-wobble"],t);else{var i="object"==typeof exports?t(require("@tsparticles/engine"),require("@tsparticles/basic"),require("@tsparticles/shape-cards"),require("@tsparticles/plugin-emitters"),require("@tsparticles/shape-emoji"),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/updater-rotate"),require("@tsparticles/shape-square"),require("@tsparticles/shape-star"),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);for(var a in i)("object"==typeof exports?exports:e)[a]=i[a]}}(this,((e,t,i,a,s,r,o,n,l,p,d,c,u,h,f,y)=>(()=>{"use strict";var v={574:e=>{e.exports=t},533:t=>{t.exports=e},68:e=>{e.exports=a},82:e=>{e.exports=l},686:e=>{e.exports=i},151:e=>{e.exports=s},12:e=>{e.exports=r},885:e=>{e.exports=o},907:e=>{e.exports=p},652:e=>{e.exports=u},960:e=>{e.exports=h},84:e=>{e.exports=n},734:e=>{e.exports=d},59:e=>{e.exports=c},448:e=>{e.exports=f},83:e=>{e.exports=y}},w={};function m(e){var t=w[e];if(void 0!==t)return t.exports;var i=w[e]={exports:{}};return v[e](i,i.exports,m),i.exports}m.d=(e,t)=>{for(var i in t)m.o(t,i)&&!m.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},m.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),m.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var x={};return(()=>{m.r(x),m.d(x,{confetti:()=>j});var e=m(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.flat=!1,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.flat&&(this.flat=t.flat),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=m(574),a=m(686),s=m(68),r=m(151),o=m(12),n=m(885),l=m(84),p=m(82),d=m(907),c=m(734),u=m(59),h=m(652),f=m(960),y=m(448),v=m(83);let w=!1,g=!1;const b=new Map;async function q(e){if(!w){if(g)return new Promise((e=>{const t=setInterval((()=>{w&&(clearInterval(t),e())}),100)}));g=!0,await(0,s.loadEmittersPlugin)(e,!1),await(0,p.loadMotionPlugin)(e,!1),await(0,a.loadCardsShape)(e,!1),await(0,o.loadHeartShape)(e,!1),await(0,n.loadImageShape)(e,!1),await(0,d.loadPolygonShape)(e,!1),await(0,h.loadSquareShape)(e,!1),await(0,f.loadStarShape)(e,!1),await(0,r.loadEmojiShape)(e,!1),await(0,u.loadRotateUpdater)(e,!1),await(0,l.loadLifeUpdater)(e,!1),await(0,c.loadRollUpdater)(e,!1),await(0,y.loadTiltUpdater)(e,!1),await(0,v.loadWobbleUpdater)(e,!1),await(0,i.loadBasic)(e),g=!1,w=!0}}async function S(i){const a=new t;let s;a.load(i.options);const r=1e3*a.ticks/432e3;if(b.has(i.id)&&(s=b.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:a.flat?0:{min:0,max:360},direction:"random",animation:{enable:!a.flat,speed:60}},tilt:{direction:"random",enable:!a.flat,value:a.flat?0:{min:0,max:360},animation:{enable:!0,speed:60}},roll:{darken:{enable:!0,value:25},enable:!a.flat,speed:{min:15,max:25}},wobble:{distance:30,enable:!a.flat,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}),b.set(i.id,s),s}async function j(t,i){let a,s;return await q(e.tsParticles),(0,e.isString)(t)?(s=t,a=i??{}):(s="confetti",a=t),S({id:s,options:a})}j.create=async(t,i)=>{if(!t)return j;await q(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),S({id:n,canvas:t,options:o})}},j.version=e.tsParticles.version,(0,e.isSsr)()||(window.confetti=j)})(),x})()));
2
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/engine"),require("@tsparticles/basic"),require("@tsparticles/updater-wobble"),require("@tsparticles/updater-tilt"),require("@tsparticles/updater-roll"),require("@tsparticles/updater-life"),require("@tsparticles/updater-rotate"),require("@tsparticles/shape-emoji"),require("@tsparticles/shape-star"),require("@tsparticles/shape-square"),require("@tsparticles/shape-polygon"),require("@tsparticles/shape-image"),require("@tsparticles/shape-heart"),require("@tsparticles/shape-cards"),require("@tsparticles/plugin-motion"),require("@tsparticles/plugin-emitters"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine","@tsparticles/basic","@tsparticles/updater-wobble","@tsparticles/updater-tilt","@tsparticles/updater-roll","@tsparticles/updater-life","@tsparticles/updater-rotate","@tsparticles/shape-emoji","@tsparticles/shape-star","@tsparticles/shape-square","@tsparticles/shape-polygon","@tsparticles/shape-image","@tsparticles/shape-heart","@tsparticles/shape-cards","@tsparticles/plugin-motion","@tsparticles/plugin-emitters"],t);else{var i="object"==typeof exports?t(require("@tsparticles/engine"),require("@tsparticles/basic"),require("@tsparticles/updater-wobble"),require("@tsparticles/updater-tilt"),require("@tsparticles/updater-roll"),require("@tsparticles/updater-life"),require("@tsparticles/updater-rotate"),require("@tsparticles/shape-emoji"),require("@tsparticles/shape-star"),require("@tsparticles/shape-square"),require("@tsparticles/shape-polygon"),require("@tsparticles/shape-image"),require("@tsparticles/shape-heart"),require("@tsparticles/shape-cards"),require("@tsparticles/plugin-motion"),require("@tsparticles/plugin-emitters")):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);for(var a in i)("object"==typeof exports?exports:e)[a]=i[a]}}(this,((e,t,i,a,s,r,o,n,l,p,d,c,u,h,f,m)=>(()=>{var v,w,y={574:e=>{e.exports=t},533:t=>{t.exports=e},68:e=>{e.exports=m},82:e=>{e.exports=f},686:e=>{e.exports=h},151:e=>{e.exports=n},12:e=>{e.exports=u},885:e=>{e.exports=c},907:e=>{e.exports=d},652:e=>{e.exports=p},960:e=>{e.exports=l},84:e=>{e.exports=r},734:e=>{e.exports=s},59:e=>{e.exports=o},448:e=>{e.exports=a},83:e=>{e.exports=i}},b={};function g(e){var t=b[e];if(void 0!==t)return t.exports;var i=b[e]={exports:{}};return y[e](i,i.exports,g),i.exports}w=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,g.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var i=Object.create(null);g.r(i);var a={};v=v||[null,w({}),w([]),w(w)];for(var s=2&t&&e;"object"==typeof s&&!~v.indexOf(s);s=w(s))Object.getOwnPropertyNames(s).forEach((t=>a[t]=()=>e[t]));return a.default=()=>e,g.d(i,a),i},g.d=(e,t)=>{for(var i in t)g.o(t,i)&&!g.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},g.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),g.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var x={};return(()=>{g.r(x),g.d(x,{confetti:()=>h});var e=g(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.flat=!1,this.shapeOptions={}}get origin(){return{x:this.position.x/e.percentDenominator,y:this.position.y/e.percentDenominator}}set origin(t){this.position.x=t.x*e.percentDenominator,this.position.y=t.y*e.percentDenominator}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.flat&&(this.flat=t.flat),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?a.x*e.percentDenominator:void 0,y:void 0!==a.y?a.y*e.percentDenominator: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)}}const i=9.81,a=5,s=3,r=1,o=0,n=0;let l=!1,p=!1;const d=new Map;async function c(e){if(l)return;if(p)return new Promise((e=>{const t=setInterval((()=>{l&&(clearInterval(t),e())}),100)}));p=!0;const{loadEmittersPlugin:t}=await Promise.resolve().then(g.t.bind(g,68,23)),{loadMotionPlugin:i}=await Promise.resolve().then(g.t.bind(g,82,23)),{loadCardsShape:a}=await Promise.resolve().then(g.t.bind(g,686,23)),{loadHeartShape:s}=await Promise.resolve().then(g.t.bind(g,12,23)),{loadImageShape:r}=await Promise.resolve().then(g.t.bind(g,885,23)),{loadPolygonShape:o}=await Promise.resolve().then(g.t.bind(g,907,23)),{loadSquareShape:n}=await Promise.resolve().then(g.t.bind(g,652,23)),{loadStarShape:d}=await Promise.resolve().then(g.t.bind(g,960,23)),{loadEmojiShape:c}=await Promise.resolve().then(g.t.bind(g,151,23)),{loadRotateUpdater:u}=await Promise.resolve().then(g.t.bind(g,59,23)),{loadLifeUpdater:h}=await Promise.resolve().then(g.t.bind(g,84,23)),{loadRollUpdater:f}=await Promise.resolve().then(g.t.bind(g,734,23)),{loadTiltUpdater:m}=await Promise.resolve().then(g.t.bind(g,448,23)),{loadWobbleUpdater:v}=await Promise.resolve().then(g.t.bind(g,83,23)),{loadBasic:w}=await Promise.resolve().then(g.t.bind(g,574,23));await t(e,!1),await i(e,!1),await a(e,!1),await s(e,!1),await r(e,!1),await o(e,!1),await n(e,!1),await d(e,!1),await c(e,!1),await u(e,!1),await h(e,!1),await f(e,!1),await m(e,!1),await v(e,!1),await w(e),p=!1,l=!0}async function u(l){const p=new t;let c;p.load(l.options);const u=p.ticks*e.millisecondsToSeconds/(3.6*e.millisecondsToSeconds*120);if(d.has(l.id)&&(c=d.get(l.id),c&&!c.destroyed)){const e=c;if(e.addEmitter)return void await e.addEmitter({startCount:p.count,position:p.position,size:{width:0,height:0},rate:{delay:0,quantity:0},life:{duration:.1,count:1},particles:{color:{value:p.colors},shape:{type:p.shapes,options:p.shapeOptions},life:{count:1},opacity:{value:{min:0,max:1},animation:{enable:!0,sync:!0,speed:u,startValue:"max",destroy:"min"}},size:{value:a*p.scalar},move:{angle:{value:p.spread,offset:0},drift:{min:-p.drift,max:p.drift},gravity:{acceleration:p.gravity*i},speed:p.startVelocity*s,decay:r-p.decay,direction:-p.angle}}})}const h={fullScreen:{enable:!l.canvas,zIndex:p.zIndex},fpsLimit:120,particles:{number:{value:0},color:{value:p.colors},shape:{type:p.shapes,options:p.shapeOptions},opacity:{value:{min:0,max:1},animation:{enable:!0,sync:!0,speed:u,startValue:"max",destroy:"min"}},size:{value:a*p.scalar},links:{enable:!1},life:{count:1},move:{angle:{value:p.spread,offset:0},drift:{min:-p.drift,max:p.drift},enable:!0,gravity:{enable:!0,acceleration:p.gravity*i},speed:p.startVelocity*s,decay:r-p.decay,direction:-p.angle,random:!0,straight:!1,outModes:{default:"none",bottom:"destroy"}},rotate:{value:p.flat?o:{min:0,max:360},direction:"random",animation:{enable:!p.flat,speed:60}},tilt:{direction:"random",enable:!p.flat,value:p.flat?n:{min:0,max:360},animation:{enable:!0,speed:60}},roll:{darken:{enable:!0,value:25},enable:!p.flat,speed:{min:15,max:25}},wobble:{distance:30,enable:!p.flat,speed:{min:-15,max:15}}},detectRetina:!0,motion:{disable:p.disableForReducedMotion},emitters:{name:"confetti",startCount:p.count,position:p.position,size:{width:0,height:0},rate:{delay:0,quantity:0},life:{duration:.1,count:1}}};return c=await e.tsParticles.load({id:l.id,element:l.canvas,options:h}),d.set(l.id,c),c}async function h(t,i){let a,s;return await c(e.tsParticles),(0,e.isString)(t)?(s=t,a=i??{}):(s="confetti",a=t),u({id:s,options:a})}h.create=async(t,i)=>{if(!t)return h;await c(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),u({id:n,canvas:t,options:o})}},h.version=e.tsParticles.version,(0,e.isSsr)()||(window.confetti=h)})(),x})()));
@@ -1 +1 @@
1
- /*! tsParticles Confetti v3.0.3 by Matteo Bruni */
1
+ /*! tsParticles Confetti v3.2.0 by Matteo Bruni */
@@ -9,6 +9,11 @@ declare global {
9
9
  };
10
10
  }
11
11
  }
12
+ export interface ConfettiParams {
13
+ canvas?: HTMLCanvasElement;
14
+ id: string;
15
+ options: RecursivePartial<IConfettiOptions>;
16
+ }
12
17
  type ConfettiFunc = (idOrOptions: ConfettiFirstParam, confettiOptions?: RecursivePartial<IConfettiOptions>) => Promise<Container | undefined>;
13
18
  export declare function confetti(idOrOptions: ConfettiFirstParam, confettiOptions?: RecursivePartial<IConfettiOptions>): Promise<Container | undefined>;
14
19
  export declare namespace confetti {
@@ -35,13 +35,13 @@
35
35
  }
36
36
  get origin() {
37
37
  return {
38
- x: this.position.x / 100,
39
- y: this.position.y / 100,
38
+ x: this.position.x / engine_1.percentDenominator,
39
+ y: this.position.y / engine_1.percentDenominator,
40
40
  };
41
41
  }
42
42
  set origin(value) {
43
- this.position.x = value.x * 100;
44
- this.position.y = value.y * 100;
43
+ this.position.x = value.x * engine_1.percentDenominator;
44
+ this.position.y = value.y * engine_1.percentDenominator;
45
45
  }
46
46
  get particleCount() {
47
47
  return this.count;
@@ -84,8 +84,8 @@
84
84
  const origin = data.origin;
85
85
  if (origin && !data.position) {
86
86
  data.position = {
87
- x: origin.x !== undefined ? origin.x * 100 : undefined,
88
- y: origin.y !== undefined ? origin.y * 100 : undefined,
87
+ x: origin.x !== undefined ? origin.x * engine_1.percentDenominator : undefined,
88
+ y: origin.y !== undefined ? origin.y * engine_1.percentDenominator : undefined,
89
89
  };
90
90
  }
91
91
  const position = data.position;
package/umd/confetti.js CHANGED
@@ -1,32 +1,42 @@
1
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
2
+ if (k2 === undefined) k2 = k;
3
+ var desc = Object.getOwnPropertyDescriptor(m, k);
4
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
5
+ desc = { enumerable: true, get: function() { return m[k]; } };
6
+ }
7
+ Object.defineProperty(o, k2, desc);
8
+ }) : (function(o, m, k, k2) {
9
+ if (k2 === undefined) k2 = k;
10
+ o[k2] = m[k];
11
+ }));
12
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
13
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
14
+ }) : function(o, v) {
15
+ o["default"] = v;
16
+ });
17
+ var __importStar = (this && this.__importStar) || function (mod) {
18
+ if (mod && mod.__esModule) return mod;
19
+ var result = {};
20
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
21
+ __setModuleDefault(result, mod);
22
+ return result;
23
+ };
1
24
  (function (factory) {
2
25
  if (typeof module === "object" && typeof module.exports === "object") {
3
26
  var v = factory(require, exports);
4
27
  if (v !== undefined) module.exports = v;
5
28
  }
6
29
  else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "@tsparticles/engine", "./ConfettiOptions.js", "@tsparticles/basic", "@tsparticles/shape-cards", "@tsparticles/plugin-emitters", "@tsparticles/shape-emoji", "@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/updater-tilt", "@tsparticles/updater-wobble"], factory);
30
+ define(["require", "exports", "@tsparticles/engine", "./ConfettiOptions.js"], factory);
8
31
  }
9
32
  })(function (require, exports) {
10
33
  "use strict";
34
+ var __syncRequire = typeof module === "object" && typeof module.exports === "object";
11
35
  Object.defineProperty(exports, "__esModule", { value: true });
12
36
  exports.confetti = void 0;
13
37
  const engine_1 = require("@tsparticles/engine");
14
38
  const ConfettiOptions_js_1 = require("./ConfettiOptions.js");
15
- const basic_1 = require("@tsparticles/basic");
16
- const shape_cards_1 = require("@tsparticles/shape-cards");
17
- const plugin_emitters_1 = require("@tsparticles/plugin-emitters");
18
- const shape_emoji_1 = require("@tsparticles/shape-emoji");
19
- const shape_heart_1 = require("@tsparticles/shape-heart");
20
- const shape_image_1 = require("@tsparticles/shape-image");
21
- const updater_life_1 = require("@tsparticles/updater-life");
22
- const plugin_motion_1 = require("@tsparticles/plugin-motion");
23
- const shape_polygon_1 = require("@tsparticles/shape-polygon");
24
- const updater_roll_1 = require("@tsparticles/updater-roll");
25
- const updater_rotate_1 = require("@tsparticles/updater-rotate");
26
- const shape_square_1 = require("@tsparticles/shape-square");
27
- const shape_star_1 = require("@tsparticles/shape-star");
28
- const updater_tilt_1 = require("@tsparticles/updater-tilt");
29
- const updater_wobble_1 = require("@tsparticles/updater-wobble");
39
+ const defaultGravity = 9.81, sizeFactor = 5, speedFactor = 3, decayOffset = 1, disableRotate = 0, disableTilt = 0;
30
40
  let initialized = false;
31
41
  let initializing = false;
32
42
  const ids = new Map();
@@ -36,31 +46,32 @@
36
46
  }
37
47
  if (initializing) {
38
48
  return new Promise((resolve) => {
39
- const interval = setInterval(() => {
49
+ const timeout = 100, interval = setInterval(() => {
40
50
  if (!initialized) {
41
51
  return;
42
52
  }
43
53
  clearInterval(interval);
44
54
  resolve();
45
- }, 100);
55
+ }, timeout);
46
56
  });
47
57
  }
48
58
  initializing = true;
49
- await (0, plugin_emitters_1.loadEmittersPlugin)(engine, false);
50
- await (0, plugin_motion_1.loadMotionPlugin)(engine, false);
51
- await (0, shape_cards_1.loadCardsShape)(engine, false);
52
- await (0, shape_heart_1.loadHeartShape)(engine, false);
53
- await (0, shape_image_1.loadImageShape)(engine, false);
54
- await (0, shape_polygon_1.loadPolygonShape)(engine, false);
55
- await (0, shape_square_1.loadSquareShape)(engine, false);
56
- await (0, shape_star_1.loadStarShape)(engine, false);
57
- await (0, shape_emoji_1.loadEmojiShape)(engine, false);
58
- await (0, updater_rotate_1.loadRotateUpdater)(engine, false);
59
- await (0, updater_life_1.loadLifeUpdater)(engine, false);
60
- await (0, updater_roll_1.loadRollUpdater)(engine, false);
61
- await (0, updater_tilt_1.loadTiltUpdater)(engine, false);
62
- await (0, updater_wobble_1.loadWobbleUpdater)(engine, false);
63
- await (0, basic_1.loadBasic)(engine);
59
+ const { loadEmittersPlugin } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("@tsparticles/plugin-emitters"))) : new Promise((resolve_1, reject_1) => { require(["@tsparticles/plugin-emitters"], resolve_1, reject_1); }).then(__importStar)), { loadMotionPlugin } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("@tsparticles/plugin-motion"))) : new Promise((resolve_2, reject_2) => { require(["@tsparticles/plugin-motion"], resolve_2, reject_2); }).then(__importStar)), { loadCardsShape } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("@tsparticles/shape-cards"))) : new Promise((resolve_3, reject_3) => { require(["@tsparticles/shape-cards"], resolve_3, reject_3); }).then(__importStar)), { loadHeartShape } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("@tsparticles/shape-heart"))) : new Promise((resolve_4, reject_4) => { require(["@tsparticles/shape-heart"], resolve_4, reject_4); }).then(__importStar)), { loadImageShape } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("@tsparticles/shape-image"))) : new Promise((resolve_5, reject_5) => { require(["@tsparticles/shape-image"], resolve_5, reject_5); }).then(__importStar)), { loadPolygonShape } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("@tsparticles/shape-polygon"))) : new Promise((resolve_6, reject_6) => { require(["@tsparticles/shape-polygon"], resolve_6, reject_6); }).then(__importStar)), { loadSquareShape } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("@tsparticles/shape-square"))) : new Promise((resolve_7, reject_7) => { require(["@tsparticles/shape-square"], resolve_7, reject_7); }).then(__importStar)), { loadStarShape } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("@tsparticles/shape-star"))) : new Promise((resolve_8, reject_8) => { require(["@tsparticles/shape-star"], resolve_8, reject_8); }).then(__importStar)), { loadEmojiShape } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("@tsparticles/shape-emoji"))) : new Promise((resolve_9, reject_9) => { require(["@tsparticles/shape-emoji"], resolve_9, reject_9); }).then(__importStar)), { loadRotateUpdater } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("@tsparticles/updater-rotate"))) : new Promise((resolve_10, reject_10) => { require(["@tsparticles/updater-rotate"], resolve_10, reject_10); }).then(__importStar)), { loadLifeUpdater } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("@tsparticles/updater-life"))) : new Promise((resolve_11, reject_11) => { require(["@tsparticles/updater-life"], resolve_11, reject_11); }).then(__importStar)), { loadRollUpdater } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("@tsparticles/updater-roll"))) : new Promise((resolve_12, reject_12) => { require(["@tsparticles/updater-roll"], resolve_12, reject_12); }).then(__importStar)), { loadTiltUpdater } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("@tsparticles/updater-tilt"))) : new Promise((resolve_13, reject_13) => { require(["@tsparticles/updater-tilt"], resolve_13, reject_13); }).then(__importStar)), { loadWobbleUpdater } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("@tsparticles/updater-wobble"))) : new Promise((resolve_14, reject_14) => { require(["@tsparticles/updater-wobble"], resolve_14, reject_14); }).then(__importStar)), { loadBasic } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("@tsparticles/basic"))) : new Promise((resolve_15, reject_15) => { require(["@tsparticles/basic"], resolve_15, reject_15); }).then(__importStar));
60
+ await loadEmittersPlugin(engine, false);
61
+ await loadMotionPlugin(engine, false);
62
+ await loadCardsShape(engine, false);
63
+ await loadHeartShape(engine, false);
64
+ await loadImageShape(engine, false);
65
+ await loadPolygonShape(engine, false);
66
+ await loadSquareShape(engine, false);
67
+ await loadStarShape(engine, false);
68
+ await loadEmojiShape(engine, false);
69
+ await loadRotateUpdater(engine, false);
70
+ await loadLifeUpdater(engine, false);
71
+ await loadRollUpdater(engine, false);
72
+ await loadTiltUpdater(engine, false);
73
+ await loadWobbleUpdater(engine, false);
74
+ await loadBasic(engine);
64
75
  initializing = false;
65
76
  initialized = true;
66
77
  }
@@ -68,13 +79,13 @@
68
79
  const actualOptions = new ConfettiOptions_js_1.ConfettiOptions();
69
80
  actualOptions.load(params.options);
70
81
  let container;
71
- const fpsLimit = 120, opacitySpeed = (actualOptions.ticks * 1000) / (3600 * fpsLimit);
82
+ const fpsLimit = 120, fpsLimitFactor = 3.6, opacitySpeed = (actualOptions.ticks * engine_1.millisecondsToSeconds) / (fpsLimitFactor * engine_1.millisecondsToSeconds * fpsLimit);
72
83
  if (ids.has(params.id)) {
73
84
  container = ids.get(params.id);
74
85
  if (container && !container.destroyed) {
75
86
  const alias = container;
76
87
  if (alias.addEmitter) {
77
- alias.addEmitter({
88
+ await alias.addEmitter({
78
89
  startCount: actualOptions.count,
79
90
  position: actualOptions.position,
80
91
  size: {
@@ -111,7 +122,7 @@
111
122
  },
112
123
  },
113
124
  size: {
114
- value: 5 * actualOptions.scalar,
125
+ value: sizeFactor * actualOptions.scalar,
115
126
  },
116
127
  move: {
117
128
  angle: {
@@ -123,10 +134,10 @@
123
134
  max: actualOptions.drift,
124
135
  },
125
136
  gravity: {
126
- acceleration: actualOptions.gravity * 9.81,
137
+ acceleration: actualOptions.gravity * defaultGravity,
127
138
  },
128
- speed: actualOptions.startVelocity * 3,
129
- decay: 1 - actualOptions.decay,
139
+ speed: actualOptions.startVelocity * speedFactor,
140
+ decay: decayOffset - actualOptions.decay,
130
141
  direction: -actualOptions.angle,
131
142
  },
132
143
  },
@@ -163,7 +174,7 @@
163
174
  },
164
175
  },
165
176
  size: {
166
- value: 5 * actualOptions.scalar,
177
+ value: sizeFactor * actualOptions.scalar,
167
178
  },
168
179
  links: {
169
180
  enable: false,
@@ -183,10 +194,10 @@
183
194
  enable: true,
184
195
  gravity: {
185
196
  enable: true,
186
- acceleration: actualOptions.gravity * 9.81,
197
+ acceleration: actualOptions.gravity * defaultGravity,
187
198
  },
188
- speed: actualOptions.startVelocity * 3,
189
- decay: 1 - actualOptions.decay,
199
+ speed: actualOptions.startVelocity * speedFactor,
200
+ decay: decayOffset - actualOptions.decay,
190
201
  direction: -actualOptions.angle,
191
202
  random: true,
192
203
  straight: false,
@@ -197,7 +208,7 @@
197
208
  },
198
209
  rotate: {
199
210
  value: actualOptions.flat
200
- ? 0
211
+ ? disableRotate
201
212
  : {
202
213
  min: 0,
203
214
  max: 360,
@@ -212,7 +223,7 @@
212
223
  direction: "random",
213
224
  enable: !actualOptions.flat,
214
225
  value: actualOptions.flat
215
- ? 0
226
+ ? disableTilt
216
227
  : {
217
228
  min: 0,
218
229
  max: 360,
@@ -291,7 +302,7 @@
291
302
  return confetti;
292
303
  }
293
304
  await initPlugins(engine_1.tsParticles);
294
- const id = canvas.getAttribute("id") || "confetti";
305
+ const id = canvas.getAttribute("id") ?? "confetti";
295
306
  canvas.setAttribute("id", id);
296
307
  return async (idOrOptions, confettiOptions) => {
297
308
  let subOptions;
@@ -0,0 +1,30 @@
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.2.0
8
+ */
9
+ "use strict";
10
+ /*
11
+ * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
12
+ * This devtool is neither made for production nor for readable output files.
13
+ * It uses "eval()" calls to create a separate source file in the browser devtools.
14
+ * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
15
+ * or disable the default devtool with "devtool: false".
16
+ * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
17
+ */
18
+ (this["webpackChunk_tsparticles_confetti"] = this["webpackChunk_tsparticles_confetti"] || []).push([["updaters_color_dist_browser_ColorUpdater_js"],{
19
+
20
+ /***/ "../../updaters/color/dist/browser/ColorUpdater.js":
21
+ /*!*********************************************************!*\
22
+ !*** ../../updaters/color/dist/browser/ColorUpdater.js ***!
23
+ \*********************************************************/
24
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
25
+
26
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ColorUpdater: () => (/* binding */ ColorUpdater)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"../../engine/dist/browser/index.js\");\n\nclass ColorUpdater {\n constructor(container) {\n this.container = container;\n }\n async init(particle) {\n const hslColor = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.rangeColorToHsl)(particle.options.color, particle.id, particle.options.reduceDuplicates);\n if (hslColor) {\n particle.color = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getHslAnimationFromHsl)(hslColor, particle.options.color.animation, this.container.retina.reduceFactor);\n }\n await Promise.resolve();\n }\n isEnabled(particle) {\n const {\n h: hAnimation,\n s: sAnimation,\n l: lAnimation\n } = particle.options.color.animation,\n {\n color\n } = particle;\n return !particle.destroyed && !particle.spawning && (color?.h.value !== undefined && hAnimation.enable || color?.s.value !== undefined && sAnimation.enable || color?.l.value !== undefined && lAnimation.enable);\n }\n async update(particle, delta) {\n (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.updateColor)(particle.color, delta);\n await Promise.resolve();\n }\n}\n\n//# sourceURL=webpack://@tsparticles/confetti/../../updaters/color/dist/browser/ColorUpdater.js?");
27
+
28
+ /***/ })
29
+
30
+ }]);
@@ -0,0 +1,30 @@
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.2.0
8
+ */
9
+ "use strict";
10
+ /*
11
+ * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
12
+ * This devtool is neither made for production nor for readable output files.
13
+ * It uses "eval()" calls to create a separate source file in the browser devtools.
14
+ * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
15
+ * or disable the default devtool with "devtool: false".
16
+ * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
17
+ */
18
+ (this["webpackChunk_tsparticles_confetti"] = this["webpackChunk_tsparticles_confetti"] || []).push([["updaters_color_dist_browser_index_js"],{
19
+
20
+ /***/ "../../updaters/color/dist/browser/index.js":
21
+ /*!**************************************************!*\
22
+ !*** ../../updaters/color/dist/browser/index.js ***!
23
+ \**************************************************/
24
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
25
+
26
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadColorUpdater: () => (/* binding */ loadColorUpdater)\n/* harmony export */ });\nasync function loadColorUpdater(engine, refresh = true) {\n await engine.addParticleUpdater(\"color\", async container => {\n const {\n ColorUpdater\n } = await __webpack_require__.e(/*! import() */ \"updaters_color_dist_browser_ColorUpdater_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./ColorUpdater.js */ \"../../updaters/color/dist/browser/ColorUpdater.js\"));\n return new ColorUpdater(container);\n }, refresh);\n}\n\n//# sourceURL=webpack://@tsparticles/confetti/../../updaters/color/dist/browser/index.js?");
27
+
28
+ /***/ })
29
+
30
+ }]);
@@ -0,0 +1,60 @@
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.2.0
8
+ */
9
+ "use strict";
10
+ /*
11
+ * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
12
+ * This devtool is neither made for production nor for readable output files.
13
+ * It uses "eval()" calls to create a separate source file in the browser devtools.
14
+ * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
15
+ * or disable the default devtool with "devtool: false".
16
+ * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
17
+ */
18
+ (this["webpackChunk_tsparticles_confetti"] = this["webpackChunk_tsparticles_confetti"] || []).push([["updaters_life_dist_browser_LifeUpdater_js"],{
19
+
20
+ /***/ "../../updaters/life/dist/browser/LifeUpdater.js":
21
+ /*!*******************************************************!*\
22
+ !*** ../../updaters/life/dist/browser/LifeUpdater.js ***!
23
+ \*******************************************************/
24
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
25
+
26
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ LifeUpdater: () => (/* binding */ LifeUpdater)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"../../engine/dist/browser/index.js\");\n/* harmony import */ var _Options_Classes_Life_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Options/Classes/Life.js */ \"../../updaters/life/dist/browser/Options/Classes/Life.js\");\n\n\nconst noTime = 0,\n identity = 1,\n infiniteValue = -1;\nclass LifeUpdater {\n constructor(container) {\n this.container = container;\n }\n async init(particle) {\n const container = this.container,\n particlesOptions = particle.options,\n lifeOptions = particlesOptions.life;\n if (!lifeOptions) {\n return;\n }\n particle.life = {\n delay: container.retina.reduceFactor ? (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(lifeOptions.delay.value) * (lifeOptions.delay.sync ? identity : (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRandom)()) / container.retina.reduceFactor * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.millisecondsToSeconds : noTime,\n delayTime: noTime,\n duration: container.retina.reduceFactor ? (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(lifeOptions.duration.value) * (lifeOptions.duration.sync ? identity : (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRandom)()) / container.retina.reduceFactor * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.millisecondsToSeconds : noTime,\n time: noTime,\n count: lifeOptions.count\n };\n if (particle.life.duration <= noTime) {\n particle.life.duration = infiniteValue;\n }\n if (particle.life.count <= noTime) {\n particle.life.count = infiniteValue;\n }\n if (particle.life) {\n particle.spawning = particle.life.delay > noTime;\n }\n await Promise.resolve();\n }\n isEnabled(particle) {\n return !particle.destroyed;\n }\n loadOptions(options, ...sources) {\n if (!options.life) {\n options.life = new _Options_Classes_Life_js__WEBPACK_IMPORTED_MODULE_1__.Life();\n }\n for (const source of sources) {\n options.life.load(source?.life);\n }\n }\n async update(particle, delta) {\n if (!this.isEnabled(particle) || !particle.life) {\n return;\n }\n const {\n updateLife\n } = await __webpack_require__.e(/*! import() */ \"updaters_life_dist_browser_Utils_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./Utils.js */ \"../../updaters/life/dist/browser/Utils.js\"));\n updateLife(particle, delta, this.container.canvas.size);\n }\n}\n\n//# sourceURL=webpack://@tsparticles/confetti/../../updaters/life/dist/browser/LifeUpdater.js?");
27
+
28
+ /***/ }),
29
+
30
+ /***/ "../../updaters/life/dist/browser/Options/Classes/Life.js":
31
+ /*!****************************************************************!*\
32
+ !*** ../../updaters/life/dist/browser/Options/Classes/Life.js ***!
33
+ \****************************************************************/
34
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
35
+
36
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Life: () => (/* binding */ Life)\n/* harmony export */ });\n/* harmony import */ var _LifeDelay_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./LifeDelay.js */ \"../../updaters/life/dist/browser/Options/Classes/LifeDelay.js\");\n/* harmony import */ var _LifeDuration_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./LifeDuration.js */ \"../../updaters/life/dist/browser/Options/Classes/LifeDuration.js\");\n\n\nclass Life {\n constructor() {\n this.count = 0;\n this.delay = new _LifeDelay_js__WEBPACK_IMPORTED_MODULE_0__.LifeDelay();\n this.duration = new _LifeDuration_js__WEBPACK_IMPORTED_MODULE_1__.LifeDuration();\n }\n load(data) {\n if (!data) {\n return;\n }\n if (data.count !== undefined) {\n this.count = data.count;\n }\n this.delay.load(data.delay);\n this.duration.load(data.duration);\n }\n}\n\n//# sourceURL=webpack://@tsparticles/confetti/../../updaters/life/dist/browser/Options/Classes/Life.js?");
37
+
38
+ /***/ }),
39
+
40
+ /***/ "../../updaters/life/dist/browser/Options/Classes/LifeDelay.js":
41
+ /*!*********************************************************************!*\
42
+ !*** ../../updaters/life/dist/browser/Options/Classes/LifeDelay.js ***!
43
+ \*********************************************************************/
44
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
45
+
46
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ LifeDelay: () => (/* binding */ LifeDelay)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"../../engine/dist/browser/index.js\");\n\nclass LifeDelay extends _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.ValueWithRandom {\n constructor() {\n super();\n this.sync = false;\n }\n load(data) {\n if (!data) {\n return;\n }\n super.load(data);\n if (data.sync !== undefined) {\n this.sync = data.sync;\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/confetti/../../updaters/life/dist/browser/Options/Classes/LifeDelay.js?");
47
+
48
+ /***/ }),
49
+
50
+ /***/ "../../updaters/life/dist/browser/Options/Classes/LifeDuration.js":
51
+ /*!************************************************************************!*\
52
+ !*** ../../updaters/life/dist/browser/Options/Classes/LifeDuration.js ***!
53
+ \************************************************************************/
54
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
55
+
56
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ LifeDuration: () => (/* binding */ LifeDuration)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"../../engine/dist/browser/index.js\");\n\nclass LifeDuration extends _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.ValueWithRandom {\n constructor() {\n super();\n this.sync = false;\n }\n load(data) {\n if (!data) {\n return;\n }\n super.load(data);\n if (data.sync !== undefined) {\n this.sync = data.sync;\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/confetti/../../updaters/life/dist/browser/Options/Classes/LifeDuration.js?");
57
+
58
+ /***/ })
59
+
60
+ }]);
@@ -0,0 +1,30 @@
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.2.0
8
+ */
9
+ "use strict";
10
+ /*
11
+ * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
12
+ * This devtool is neither made for production nor for readable output files.
13
+ * It uses "eval()" calls to create a separate source file in the browser devtools.
14
+ * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
15
+ * or disable the default devtool with "devtool: false".
16
+ * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
17
+ */
18
+ (this["webpackChunk_tsparticles_confetti"] = this["webpackChunk_tsparticles_confetti"] || []).push([["updaters_life_dist_browser_Utils_js"],{
19
+
20
+ /***/ "../../updaters/life/dist/browser/Utils.js":
21
+ /*!*************************************************!*\
22
+ !*** ../../updaters/life/dist/browser/Utils.js ***!
23
+ \*************************************************/
24
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
25
+
26
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ updateLife: () => (/* binding */ updateLife)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"../../engine/dist/browser/index.js\");\n\nconst noTime = 0,\n infiniteValue = -1,\n noLife = 0,\n minCanvasSize = 0;\nfunction updateLife(particle, delta, canvasSize) {\n if (!particle.life) {\n return;\n }\n const life = particle.life;\n let justSpawned = false;\n if (particle.spawning) {\n life.delayTime += delta.value;\n if (life.delayTime >= particle.life.delay) {\n justSpawned = true;\n particle.spawning = false;\n life.delayTime = noTime;\n life.time = noTime;\n } else {\n return;\n }\n }\n if (life.duration === infiniteValue) {\n return;\n }\n if (particle.spawning) {\n return;\n }\n if (justSpawned) {\n life.time = noTime;\n } else {\n life.time += delta.value;\n }\n if (life.time < life.duration) {\n return;\n }\n life.time = noTime;\n if (particle.life.count > noLife) {\n particle.life.count--;\n }\n if (particle.life.count === noLife) {\n particle.destroy();\n return;\n }\n const widthRange = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(minCanvasSize, canvasSize.width),\n heightRange = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(minCanvasSize, canvasSize.width);\n particle.position.x = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.randomInRange)(widthRange);\n particle.position.y = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.randomInRange)(heightRange);\n particle.spawning = true;\n life.delayTime = noTime;\n life.time = noTime;\n particle.reset();\n const lifeOptions = particle.options.life;\n if (lifeOptions) {\n life.delay = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(lifeOptions.delay.value) * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.millisecondsToSeconds;\n life.duration = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(lifeOptions.duration.value) * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.millisecondsToSeconds;\n }\n}\n\n//# sourceURL=webpack://@tsparticles/confetti/../../updaters/life/dist/browser/Utils.js?");
27
+
28
+ /***/ })
29
+
30
+ }]);
@@ -0,0 +1,30 @@
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.2.0
8
+ */
9
+ "use strict";
10
+ /*
11
+ * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
12
+ * This devtool is neither made for production nor for readable output files.
13
+ * It uses "eval()" calls to create a separate source file in the browser devtools.
14
+ * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
15
+ * or disable the default devtool with "devtool: false".
16
+ * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
17
+ */
18
+ (this["webpackChunk_tsparticles_confetti"] = this["webpackChunk_tsparticles_confetti"] || []).push([["updaters_life_dist_browser_index_js"],{
19
+
20
+ /***/ "../../updaters/life/dist/browser/index.js":
21
+ /*!*************************************************!*\
22
+ !*** ../../updaters/life/dist/browser/index.js ***!
23
+ \*************************************************/
24
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
25
+
26
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadLifeUpdater: () => (/* binding */ loadLifeUpdater)\n/* harmony export */ });\nasync function loadLifeUpdater(engine, refresh = true) {\n await engine.addParticleUpdater(\"life\", async container => {\n const {\n LifeUpdater\n } = await __webpack_require__.e(/*! import() */ \"updaters_life_dist_browser_LifeUpdater_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./LifeUpdater.js */ \"../../updaters/life/dist/browser/LifeUpdater.js\"));\n return new LifeUpdater(container);\n }, refresh);\n}\n\n//# sourceURL=webpack://@tsparticles/confetti/../../updaters/life/dist/browser/index.js?");
27
+
28
+ /***/ })
29
+
30
+ }]);
@@ -0,0 +1,30 @@
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.2.0
8
+ */
9
+ "use strict";
10
+ /*
11
+ * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
12
+ * This devtool is neither made for production nor for readable output files.
13
+ * It uses "eval()" calls to create a separate source file in the browser devtools.
14
+ * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
15
+ * or disable the default devtool with "devtool: false".
16
+ * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
17
+ */
18
+ (this["webpackChunk_tsparticles_confetti"] = this["webpackChunk_tsparticles_confetti"] || []).push([["updaters_opacity_dist_browser_OpacityUpdater_js"],{
19
+
20
+ /***/ "../../updaters/opacity/dist/browser/OpacityUpdater.js":
21
+ /*!*************************************************************!*\
22
+ !*** ../../updaters/opacity/dist/browser/OpacityUpdater.js ***!
23
+ \*************************************************************/
24
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
25
+
26
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ OpacityUpdater: () => (/* binding */ OpacityUpdater)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"../../engine/dist/browser/index.js\");\n\nclass OpacityUpdater {\n constructor(container) {\n this.container = container;\n }\n async init(particle) {\n const opacityOptions = particle.options.opacity,\n pxRatio = 1;\n particle.opacity = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.initParticleNumericAnimationValue)(opacityOptions, pxRatio);\n const opacityAnimation = opacityOptions.animation;\n if (opacityAnimation.enable) {\n particle.opacity.velocity = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(opacityAnimation.speed) / _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.percentDenominator * this.container.retina.reduceFactor;\n if (!opacityAnimation.sync) {\n particle.opacity.velocity *= (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRandom)();\n }\n }\n await Promise.resolve();\n }\n isEnabled(particle) {\n const none = 0;\n return !particle.destroyed && !particle.spawning && !!particle.opacity && particle.opacity.enable && ((particle.opacity.maxLoops ?? none) <= none || (particle.opacity.maxLoops ?? none) > none && (particle.opacity.loops ?? none) < (particle.opacity.maxLoops ?? none));\n }\n reset(particle) {\n if (particle.opacity) {\n particle.opacity.time = 0;\n particle.opacity.loops = 0;\n }\n }\n async update(particle, delta) {\n if (!this.isEnabled(particle) || !particle.opacity) {\n return;\n }\n (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.updateAnimation)(particle, particle.opacity, true, particle.options.opacity.animation.destroy, delta);\n await Promise.resolve();\n }\n}\n\n//# sourceURL=webpack://@tsparticles/confetti/../../updaters/opacity/dist/browser/OpacityUpdater.js?");
27
+
28
+ /***/ })
29
+
30
+ }]);
@@ -0,0 +1,30 @@
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.2.0
8
+ */
9
+ "use strict";
10
+ /*
11
+ * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
12
+ * This devtool is neither made for production nor for readable output files.
13
+ * It uses "eval()" calls to create a separate source file in the browser devtools.
14
+ * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
15
+ * or disable the default devtool with "devtool: false".
16
+ * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
17
+ */
18
+ (this["webpackChunk_tsparticles_confetti"] = this["webpackChunk_tsparticles_confetti"] || []).push([["updaters_opacity_dist_browser_index_js"],{
19
+
20
+ /***/ "../../updaters/opacity/dist/browser/index.js":
21
+ /*!****************************************************!*\
22
+ !*** ../../updaters/opacity/dist/browser/index.js ***!
23
+ \****************************************************/
24
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
25
+
26
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadOpacityUpdater: () => (/* binding */ loadOpacityUpdater)\n/* harmony export */ });\nasync function loadOpacityUpdater(engine, refresh = true) {\n await engine.addParticleUpdater(\"opacity\", async container => {\n const {\n OpacityUpdater\n } = await __webpack_require__.e(/*! import() */ \"updaters_opacity_dist_browser_OpacityUpdater_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./OpacityUpdater.js */ \"../../updaters/opacity/dist/browser/OpacityUpdater.js\"));\n return new OpacityUpdater(container);\n }, refresh);\n}\n\n//# sourceURL=webpack://@tsparticles/confetti/../../updaters/opacity/dist/browser/index.js?");
27
+
28
+ /***/ })
29
+
30
+ }]);
@@ -0,0 +1,30 @@
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.2.0
8
+ */
9
+ "use strict";
10
+ /*
11
+ * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
12
+ * This devtool is neither made for production nor for readable output files.
13
+ * It uses "eval()" calls to create a separate source file in the browser devtools.
14
+ * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
15
+ * or disable the default devtool with "devtool: false".
16
+ * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
17
+ */
18
+ (this["webpackChunk_tsparticles_confetti"] = this["webpackChunk_tsparticles_confetti"] || []).push([["updaters_outModes_dist_browser_BounceOutMode_js"],{
19
+
20
+ /***/ "../../updaters/outModes/dist/browser/BounceOutMode.js":
21
+ /*!*************************************************************!*\
22
+ !*** ../../updaters/outModes/dist/browser/BounceOutMode.js ***!
23
+ \*************************************************************/
24
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
25
+
26
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ BounceOutMode: () => (/* binding */ BounceOutMode)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"../../engine/dist/browser/index.js\");\n\nclass BounceOutMode {\n constructor(container) {\n this.container = container;\n this.modes = [\"bounce\", \"split\"];\n }\n async update(particle, direction, delta, outMode) {\n if (!this.modes.includes(outMode)) {\n return;\n }\n const container = this.container;\n let handled = false;\n for (const [, plugin] of container.plugins) {\n if (plugin.particleBounce !== undefined) {\n handled = await plugin.particleBounce(particle, delta, direction);\n }\n if (handled) {\n break;\n }\n }\n if (handled) {\n return;\n }\n const pos = particle.getPosition(),\n offset = particle.offset,\n size = particle.getRadius(),\n bounds = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.calculateBounds)(pos, size),\n canvasSize = container.canvas.size,\n {\n bounceHorizontal,\n bounceVertical\n } = await __webpack_require__.e(/*! import() */ \"updaters_outModes_dist_browser_Utils_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./Utils.js */ \"../../updaters/outModes/dist/browser/Utils.js\"));\n bounceHorizontal({\n particle,\n outMode,\n direction,\n bounds,\n canvasSize,\n offset,\n size\n });\n bounceVertical({\n particle,\n outMode,\n direction,\n bounds,\n canvasSize,\n offset,\n size\n });\n }\n}\n\n//# sourceURL=webpack://@tsparticles/confetti/../../updaters/outModes/dist/browser/BounceOutMode.js?");
27
+
28
+ /***/ })
29
+
30
+ }]);