@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.
- package/1308.min.js +2 -0
- package/1308.min.js.LICENSE.txt +1 -0
- package/1472.min.js +2 -0
- package/1472.min.js.LICENSE.txt +1 -0
- package/1513.min.js +2 -0
- package/1513.min.js.LICENSE.txt +1 -0
- package/1705.min.js +2 -0
- package/1705.min.js.LICENSE.txt +1 -0
- package/1810.min.js +2 -0
- package/1810.min.js.LICENSE.txt +1 -0
- package/196.min.js +2 -0
- package/196.min.js.LICENSE.txt +1 -0
- package/2124.min.js +2 -0
- package/2124.min.js.LICENSE.txt +1 -0
- package/2173.min.js +2 -0
- package/2173.min.js.LICENSE.txt +1 -0
- package/2580.min.js +2 -0
- package/2580.min.js.LICENSE.txt +1 -0
- package/2720.min.js +2 -0
- package/2720.min.js.LICENSE.txt +1 -0
- package/2765.min.js +2 -0
- package/2765.min.js.LICENSE.txt +1 -0
- package/3141.min.js +2 -0
- package/3141.min.js.LICENSE.txt +1 -0
- package/3261.min.js +2 -0
- package/3261.min.js.LICENSE.txt +1 -0
- package/3473.min.js +2 -0
- package/3473.min.js.LICENSE.txt +1 -0
- package/3610.min.js +2 -0
- package/3610.min.js.LICENSE.txt +1 -0
- package/3629.min.js +2 -0
- package/3629.min.js.LICENSE.txt +1 -0
- package/3648.min.js +2 -0
- package/3648.min.js.LICENSE.txt +1 -0
- package/3733.min.js +2 -0
- package/3733.min.js.LICENSE.txt +1 -0
- package/3862.min.js +2 -0
- package/3862.min.js.LICENSE.txt +1 -0
- package/3869.min.js +2 -0
- package/3869.min.js.LICENSE.txt +1 -0
- package/409.min.js +2 -0
- package/409.min.js.LICENSE.txt +1 -0
- package/4245.min.js +2 -0
- package/4245.min.js.LICENSE.txt +1 -0
- package/4328.min.js +2 -0
- package/4328.min.js.LICENSE.txt +1 -0
- package/4396.min.js +2 -0
- package/4396.min.js.LICENSE.txt +1 -0
- package/4547.min.js +2 -0
- package/4547.min.js.LICENSE.txt +1 -0
- package/4595.min.js +2 -0
- package/4595.min.js.LICENSE.txt +1 -0
- package/4794.min.js +2 -0
- package/4794.min.js.LICENSE.txt +1 -0
- package/482.min.js +2 -0
- package/482.min.js.LICENSE.txt +1 -0
- package/4866.min.js +2 -0
- package/4866.min.js.LICENSE.txt +1 -0
- package/4973.min.js +2 -0
- package/4973.min.js.LICENSE.txt +1 -0
- package/4994.min.js +2 -0
- package/4994.min.js.LICENSE.txt +1 -0
- package/5092.min.js +2 -0
- package/5092.min.js.LICENSE.txt +1 -0
- package/5120.min.js +2 -0
- package/5120.min.js.LICENSE.txt +1 -0
- package/5245.min.js +2 -0
- package/5245.min.js.LICENSE.txt +1 -0
- package/5308.min.js +2 -0
- package/5308.min.js.LICENSE.txt +1 -0
- package/5329.min.js +2 -0
- package/5329.min.js.LICENSE.txt +1 -0
- package/5437.min.js +2 -0
- package/5437.min.js.LICENSE.txt +1 -0
- package/5444.min.js +2 -0
- package/5444.min.js.LICENSE.txt +1 -0
- package/5534.min.js +2 -0
- package/5534.min.js.LICENSE.txt +1 -0
- package/560.min.js +2 -0
- package/560.min.js.LICENSE.txt +1 -0
- package/5647.min.js +2 -0
- package/5647.min.js.LICENSE.txt +1 -0
- package/571.min.js +2 -0
- package/571.min.js.LICENSE.txt +1 -0
- package/5742.min.js +2 -0
- package/5742.min.js.LICENSE.txt +1 -0
- package/6004.min.js +2 -0
- package/6004.min.js.LICENSE.txt +1 -0
- package/6132.min.js +2 -0
- package/6132.min.js.LICENSE.txt +1 -0
- package/6551.min.js +2 -0
- package/6551.min.js.LICENSE.txt +1 -0
- package/6772.min.js +2 -0
- package/6772.min.js.LICENSE.txt +1 -0
- package/7031.min.js +2 -0
- package/7031.min.js.LICENSE.txt +1 -0
- package/7049.min.js +2 -0
- package/7049.min.js.LICENSE.txt +1 -0
- package/7108.min.js +2 -0
- package/7108.min.js.LICENSE.txt +1 -0
- package/7331.min.js +2 -0
- package/7331.min.js.LICENSE.txt +1 -0
- package/7517.min.js +2 -0
- package/7517.min.js.LICENSE.txt +1 -0
- package/7687.min.js +2 -0
- package/7687.min.js.LICENSE.txt +1 -0
- package/7725.min.js +2 -0
- package/7725.min.js.LICENSE.txt +1 -0
- package/7757.min.js +2 -0
- package/7757.min.js.LICENSE.txt +1 -0
- package/7835.min.js +2 -0
- package/7835.min.js.LICENSE.txt +1 -0
- package/7859.min.js +2 -0
- package/7859.min.js.LICENSE.txt +1 -0
- package/7886.min.js +2 -0
- package/7886.min.js.LICENSE.txt +1 -0
- package/7890.min.js +2 -0
- package/7890.min.js.LICENSE.txt +1 -0
- package/8060.min.js +2 -0
- package/8060.min.js.LICENSE.txt +1 -0
- package/9062.min.js +2 -0
- package/9062.min.js.LICENSE.txt +1 -0
- package/9126.min.js +2 -0
- package/9126.min.js.LICENSE.txt +1 -0
- package/9331.min.js +2 -0
- package/9331.min.js.LICENSE.txt +1 -0
- package/9376.min.js +2 -0
- package/9376.min.js.LICENSE.txt +1 -0
- package/95.min.js +2 -0
- package/95.min.js.LICENSE.txt +1 -0
- package/9530.min.js +2 -0
- package/9530.min.js.LICENSE.txt +1 -0
- package/9532.min.js +2 -0
- package/9532.min.js.LICENSE.txt +1 -0
- package/9836.min.js +2 -0
- package/9836.min.js.LICENSE.txt +1 -0
- package/9921.min.js +2 -0
- package/9921.min.js.LICENSE.txt +1 -0
- package/basic_dist_browser_index_js.js +30 -0
- package/browser/ConfettiOptions.js +7 -7
- package/browser/confetti.js +18 -31
- package/cjs/ConfettiOptions.js +6 -6
- package/cjs/confetti.js +55 -45
- package/engine_dist_browser_Core_Container_js.js +90 -0
- package/engine_dist_browser_Core_Particle_js.js +30 -0
- package/esm/ConfettiOptions.js +7 -7
- package/esm/confetti.js +18 -31
- package/move_base_dist_browser_BaseMover_js.js +30 -0
- package/move_base_dist_browser_Utils_js.js +30 -0
- package/move_base_dist_browser_index_js.js +30 -0
- package/package.json +17 -17
- package/plugins_emitters_dist_browser_EmitterInstance_js.js +30 -0
- package/plugins_emitters_dist_browser_EmittersPlugin_js.js +90 -0
- package/plugins_emitters_dist_browser_Emitters_js.js +30 -0
- package/plugins_emitters_dist_browser_ShapeManager_js.js +30 -0
- package/plugins_emitters_dist_browser_index_js.js +100 -0
- package/plugins_motion_dist_browser_MotionInstance_js.js +30 -0
- package/plugins_motion_dist_browser_MotionPlugin_js.js +50 -0
- package/plugins_motion_dist_browser_index_js.js +30 -0
- package/report.html +3 -3
- package/shapes_cards_dist_browser_ClubDrawer_js.js +30 -0
- package/shapes_cards_dist_browser_DiamondDrawer_js.js +30 -0
- package/shapes_cards_dist_browser_HeartDrawer_js.js +30 -0
- package/shapes_cards_dist_browser_SpadeDrawer_js.js +30 -0
- package/shapes_cards_dist_browser_Utils_js.js +30 -0
- package/shapes_cards_dist_browser_index_js.js +30 -0
- package/shapes_circle_dist_browser_CircleDrawer_js.js +30 -0
- package/shapes_circle_dist_browser_Utils_js.js +30 -0
- package/shapes_circle_dist_browser_index_js.js +30 -0
- package/shapes_emoji_dist_browser_EmojiDrawer_js.js +30 -0
- package/shapes_emoji_dist_browser_Utils_js.js +30 -0
- package/shapes_emoji_dist_browser_index_js.js +40 -0
- package/shapes_heart_dist_browser_HeartDrawer_js.js +30 -0
- package/shapes_heart_dist_browser_Utils_js.js +30 -0
- package/shapes_heart_dist_browser_index_js.js +30 -0
- package/shapes_image_dist_browser_GifUtils_Utils_js.js +50 -0
- package/shapes_image_dist_browser_ImageDrawer_js.js +30 -0
- package/shapes_image_dist_browser_ImagePreloader_js.js +40 -0
- package/shapes_image_dist_browser_index_js.js +40 -0
- package/shapes_polygon_dist_browser_PolygonDrawer_js.js +40 -0
- package/shapes_polygon_dist_browser_TriangleDrawer_js.js +40 -0
- package/shapes_polygon_dist_browser_Utils_js.js +30 -0
- package/shapes_polygon_dist_browser_index_js.js +30 -0
- package/shapes_square_dist_browser_SquareDrawer_js.js +30 -0
- package/shapes_square_dist_browser_Utils_js.js +30 -0
- package/shapes_square_dist_browser_index_js.js +30 -0
- package/shapes_star_dist_browser_StarDrawer_js.js +30 -0
- package/shapes_star_dist_browser_Utils_js.js +30 -0
- package/shapes_star_dist_browser_index_js.js +30 -0
- package/tsparticles.confetti.bundle.js +2141 -9731
- package/tsparticles.confetti.bundle.min.js +1 -1
- package/tsparticles.confetti.bundle.min.js.LICENSE.txt +1 -1
- package/tsparticles.confetti.js +171 -516
- package/tsparticles.confetti.min.js +1 -1
- package/tsparticles.confetti.min.js.LICENSE.txt +1 -1
- package/types/confetti.d.ts +5 -0
- package/umd/ConfettiOptions.js +6 -6
- package/umd/confetti.js +57 -46
- package/updaters_color_dist_browser_ColorUpdater_js.js +30 -0
- package/updaters_color_dist_browser_index_js.js +30 -0
- package/updaters_life_dist_browser_LifeUpdater_js.js +60 -0
- package/updaters_life_dist_browser_Utils_js.js +30 -0
- package/updaters_life_dist_browser_index_js.js +30 -0
- package/updaters_opacity_dist_browser_OpacityUpdater_js.js +30 -0
- package/updaters_opacity_dist_browser_index_js.js +30 -0
- package/updaters_outModes_dist_browser_BounceOutMode_js.js +30 -0
- package/updaters_outModes_dist_browser_DestroyOutMode_js.js +30 -0
- package/updaters_outModes_dist_browser_NoneOutMode_js.js +30 -0
- package/updaters_outModes_dist_browser_OutOfCanvasUpdater_js.js +30 -0
- package/updaters_outModes_dist_browser_OutOutMode_js.js +30 -0
- package/updaters_outModes_dist_browser_Utils_js.js +30 -0
- package/updaters_outModes_dist_browser_index_js.js +30 -0
- package/updaters_roll_dist_browser_RollUpdater_js.js +50 -0
- package/updaters_roll_dist_browser_Utils_js.js +30 -0
- package/updaters_roll_dist_browser_index_js.js +30 -0
- package/updaters_rotate_dist_browser_RotateUpdater_js.js +50 -0
- package/updaters_rotate_dist_browser_index_js.js +30 -0
- package/updaters_size_dist_browser_SizeUpdater_js.js +30 -0
- package/updaters_size_dist_browser_index_js.js +30 -0
- package/updaters_tilt_dist_browser_TiltUpdater_js.js +50 -0
- package/updaters_tilt_dist_browser_index_js.js +30 -0
- package/updaters_wobble_dist_browser_Utils_js.js +30 -0
- package/updaters_wobble_dist_browser_WobbleUpdater_js.js +50 -0
- package/updaters_wobble_dist_browser_index_js.js +30 -0
package/7108.min.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see 7108.min.js.LICENSE.txt */
|
|
2
|
+
(this.webpackChunk_tsparticles_confetti=this.webpackChunk_tsparticles_confetti||[]).push([[7108],{7108:(t,a,e)=>{async function n(t,a=!0){await t.addParticleUpdater("outModes",(async t=>{const{OutOfCanvasUpdater:a}=await e.e(5329).then(e.bind(e,5329));return new a(t)}),a)}e.d(a,{loadOutModesUpdater:()=>n})}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! tsParticles Confetti v3.2.0 by Matteo Bruni */
|
package/7331.min.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see 7331.min.js.LICENSE.txt */
|
|
2
|
+
(this.webpackChunk_tsparticles_confetti=this.webpackChunk_tsparticles_confetti||[]).push([[7331],{7331:(t,c,s)=>{s.d(c,{drawSquare:()=>a});const e=Math.sqrt(2),n=2;function a(t){const{context:c,radius:s}=t,a=s/e,i=a*n;c.rect(-a,-a,i,i)}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! tsParticles Confetti v3.2.0 by Matteo Bruni */
|
package/7517.min.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see 7517.min.js.LICENSE.txt */
|
|
2
|
+
(this.webpackChunk_tsparticles_confetti=this.webpackChunk_tsparticles_confetti||[]).push([[7517],{2878:(t,e,a)=>{a.d(e,{y:()=>r});var n=a(3624);class r{async draw(t){const{particle:e,radius:n}=t,r=this.getCenter(e,n),s=this.getSidesData(e,n),{drawPolygon:i}=await a.e(1513).then(a.bind(a,1513));i(t,r,s)}getSidesCount(t){const e=t.shapeData;return Math.round((0,n.Gu)(e?.sides??5))}}},7517:(t,e,a)=>{a.d(e,{TriangleDrawer:()=>r});var n=a(2878);class r extends n.y{getCenter(t,e){return{x:-e,y:e/1.66}}getSidesCount(){return 3}getSidesData(t,e){return{count:{denominator:2,numerator:3},length:2*e}}}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! tsParticles Confetti v3.2.0 by Matteo Bruni */
|
package/7687.min.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see 7687.min.js.LICENSE.txt */
|
|
2
|
+
(this.webpackChunk_tsparticles_confetti=this.webpackChunk_tsparticles_confetti||[]).push([[7687],{7687:(a,t,s)=>{s.d(t,{DiamondDrawer:()=>i});class i{async draw(a){const{drawPath:t,paths:i}=await s.e(482).then(s.bind(s,482));t(a,i.diamond)}}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! tsParticles Confetti v3.2.0 by Matteo Bruni */
|
package/7725.min.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see 7725.min.js.LICENSE.txt */
|
|
2
|
+
(this.webpackChunk_tsparticles_confetti=this.webpackChunk_tsparticles_confetti||[]).push([[7725],{7725:(e,i,s)=>{s.d(i,{SizeUpdater:()=>a});var t=s(3624);class a{async init(e){const i=e.container,s=e.options.size.animation;s.enable&&(e.size.velocity=(e.retina.sizeAnimationSpeed??i.retina.sizeAnimationSpeed)/t.tZ*i.retina.reduceFactor,s.sync||(e.size.velocity*=(0,t.sZ)())),await Promise.resolve()}isEnabled(e){return!e.destroyed&&!e.spawning&&e.size.enable&&((e.size.maxLoops??0)<=0||(e.size.maxLoops??0)>0&&(e.size.loops??0)<(e.size.maxLoops??0))}reset(e){e.size.loops=0}async update(e,i){this.isEnabled(e)&&((0,t.Cr)(e,e.size,!0,e.options.size.animation.destroy,i),await Promise.resolve())}}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! tsParticles Confetti v3.2.0 by Matteo Bruni */
|
package/7757.min.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see 7757.min.js.LICENSE.txt */
|
|
2
|
+
(this.webpackChunk_tsparticles_confetti=this.webpackChunk_tsparticles_confetti||[]).push([[7757],{7757:(t,i,o)=>{o.d(i,{bounceHorizontal:()=>s,bounceVertical:()=>r});var e=o(3624);const n=0,c=0;function s(t){if("bounce"!==t.outMode&&"split"!==t.outMode||"left"!==t.direction&&"right"!==t.direction)return;t.bounds.right<c&&"left"===t.direction?t.particle.position.x=t.size+t.offset.x:t.bounds.left>t.canvasSize.width&&"right"===t.direction&&(t.particle.position.x=t.canvasSize.width-t.size-t.offset.x);const i=t.particle.velocity.x;let o=!1;if("right"===t.direction&&t.bounds.right>=t.canvasSize.width&&i>n||"left"===t.direction&&t.bounds.left<=c&&i<n){const i=(0,e.Gu)(t.particle.options.bounce.horizontal.value);t.particle.velocity.x*=-i,o=!0}if(!o)return;const s=t.offset.x+t.size;t.bounds.right>=t.canvasSize.width&&"right"===t.direction?t.particle.position.x=t.canvasSize.width-s:t.bounds.left<=c&&"left"===t.direction&&(t.particle.position.x=s),"split"===t.outMode&&t.particle.destroy()}function r(t){if("bounce"!==t.outMode&&"split"!==t.outMode||"bottom"!==t.direction&&"top"!==t.direction)return;t.bounds.bottom<c&&"top"===t.direction?t.particle.position.y=t.size+t.offset.y:t.bounds.top>t.canvasSize.height&&"bottom"===t.direction&&(t.particle.position.y=t.canvasSize.height-t.size-t.offset.y);const i=t.particle.velocity.y;let o=!1;if("bottom"===t.direction&&t.bounds.bottom>=t.canvasSize.height&&i>n||"top"===t.direction&&t.bounds.top<=c&&i<n){const i=(0,e.Gu)(t.particle.options.bounce.vertical.value);t.particle.velocity.y*=-i,o=!0}if(!o)return;const s=t.offset.y+t.size;t.bounds.bottom>=t.canvasSize.height&&"bottom"===t.direction?t.particle.position.y=t.canvasSize.height-s:t.bounds.top<=c&&"top"===t.direction&&(t.particle.position.y=s),"split"===t.outMode&&t.particle.destroy()}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! tsParticles Confetti v3.2.0 by Matteo Bruni */
|
package/7835.min.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see 7835.min.js.LICENSE.txt */
|
|
2
|
+
(this.webpackChunk_tsparticles_confetti=this.webpackChunk_tsparticles_confetti||[]).push([[7835],{7835:(e,t,a)=>{async function n(e,t=!0){await e.addMover("base",(async()=>{const{BaseMover:e}=await a.e(5647).then(a.bind(a,5647));return new e}),t)}a.d(t,{loadBaseMover:()=>n})}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! tsParticles Confetti v3.2.0 by Matteo Bruni */
|
package/7859.min.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see 7859.min.js.LICENSE.txt */
|
|
2
|
+
(this.webpackChunk_tsparticles_confetti=this.webpackChunk_tsparticles_confetti||[]).push([[7859],{7859:(t,e,i)=>{i.d(e,{BounceOutMode:()=>s});var o=i(3624);class s{constructor(t){this.container=t,this.modes=["bounce","split"]}async update(t,e,s,n){if(!this.modes.includes(n))return;const c=this.container;let a=!1;for(const[,i]of c.plugins)if(void 0!==i.particleBounce&&(a=await i.particleBounce(t,s,e)),a)break;if(a)return;const r=t.getPosition(),u=t.offset,d=t.getRadius(),f=(0,o.M_)(r,d),l=c.canvas.size,{bounceHorizontal:p,bounceVertical:h}=await i.e(7757).then(i.bind(i,7757));p({particle:t,outMode:n,direction:e,bounds:f,canvasSize:l,offset:u,size:d}),h({particle:t,outMode:n,direction:e,bounds:f,canvasSize:l,offset:u,size:d})}}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! tsParticles Confetti v3.2.0 by Matteo Bruni */
|
package/7886.min.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see 7886.min.js.LICENSE.txt */
|
|
2
|
+
(this.webpackChunk_tsparticles_confetti=this.webpackChunk_tsparticles_confetti||[]).push([[7886],{7886:(t,i,e)=>{e.d(i,{NoneOutMode:()=>s});var o=e(3624);class s{constructor(t){this.container=t,this.modes=["none"]}async update(t,i,e,s){if(!this.modes.includes(s))return;if((t.options.move.distance.horizontal&&("left"===i||"right"===i))??(t.options.move.distance.vertical&&("top"===i||"bottom"===i)))return;const n=t.options.move.gravity,c=this.container,r=c.canvas.size,a=t.getRadius();if(n.enable){const e=t.position;(!n.inverse&&e.y>r.height+a&&"bottom"===i||n.inverse&&e.y<-a&&"top"===i)&&c.particles.remove(t)}else{if(t.velocity.y>0&&t.position.y<=r.height+a||t.velocity.y<0&&t.position.y>=-a||t.velocity.x>0&&t.position.x<=r.width+a||t.velocity.x<0&&t.position.x>=-a)return;(0,o.Ac)(t.position,c.canvas.size,o.OW.origin,a,i)||c.particles.remove(t)}await Promise.resolve()}}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! tsParticles Confetti v3.2.0 by Matteo Bruni */
|
package/7890.min.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see 7890.min.js.LICENSE.txt */
|
|
2
|
+
(this.webpackChunk_tsparticles_confetti=this.webpackChunk_tsparticles_confetti||[]).push([[7890],{7890:(a,n,t)=>{async function e(a,n=!0){await async function(a,n=!0){const{PolygonDrawer:e}=await t.e(6772).then(t.bind(t,6772));await a.addShape("polygon",new e,n)}(a,n),await async function(a,n=!0){const{TriangleDrawer:e}=await t.e(7517).then(t.bind(t,7517));await a.addShape("triangle",new e,n)}(a,n)}t.d(n,{loadPolygonShape:()=>e})}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! tsParticles Confetti v3.2.0 by Matteo Bruni */
|
package/8060.min.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see 8060.min.js.LICENSE.txt */
|
|
2
|
+
(this.webpackChunk_tsparticles_confetti=this.webpackChunk_tsparticles_confetti||[]).push([[8060],{8060:(a,e,t)=>{async function d(a,e=!0){const{SpadeDrawer:d}=await t.e(9836).then(t.bind(t,9836)),{HeartDrawer:n}=await t.e(4396).then(t.bind(t,4396)),{DiamondDrawer:i}=await t.e(7687).then(t.bind(t,7687)),{ClubDrawer:w}=await t.e(95).then(t.bind(t,95));await a.addShape(["spade","spades"],new d,e),await a.addShape(["heart","hearts"],new n,e),await a.addShape(["diamond","diamonds"],new i,e),await a.addShape(["club","clubs"],new w,e)}t.d(e,{loadCardsShape:()=>d})}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! tsParticles Confetti v3.2.0 by Matteo Bruni */
|
package/9062.min.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see 9062.min.js.LICENSE.txt */
|
|
2
|
+
(this.webpackChunk_tsparticles_confetti=this.webpackChunk_tsparticles_confetti||[]).push([[9062],{9062:(e,t,i)=>{i.d(t,{EmojiDrawer:()=>s});var a=i(3624),o=i(4593);const n='"Twemoji Mozilla", Apple Color Emoji, "Segoe UI Emoji", "Noto Color Emoji", "EmojiOne Color"';class s{constructor(){this._emojiShapeDict=new Map}destroy(){for(const[e,t]of this._emojiShapeDict)t instanceof ImageBitmap&&(t?.close(),this._emojiShapeDict.delete(e))}async draw(e){const{drawEmoji:t}=await i.e(5437).then(i.bind(i,5437));t(e)}async init(e){const t=e.actualOptions;if(!o.h.find((e=>(0,a.dB)(e,t.particles.shape.type))))return;const i=[(0,a.mx)(n)],s=o.h.map((e=>t.particles.shape.options[e])).find((e=>!!e));s&&(0,a.KH)(s,(e=>{e.font&&i.push((0,a.mx)(e.font))})),await Promise.all(i)}particleDestroy(e){delete e.emojiData}async particleInit(e,t){const i=t.shapeData;if(!i?.value)return;const o=(0,a.wA)(i.value,t.randomIndexData),s=i.font??n;if(!o)return;const c=`${o}_${s}`,r=this._emojiShapeDict.get(c);if(r)return void(t.emojiData=r);const l=2*(0,a.KI)(t.size.value);let p;const m=(0,a.KI)(t.size.value);if("undefined"!=typeof OffscreenCanvas){const e=new OffscreenCanvas(l,l),t=e.getContext("2d");if(!t)return;t.font=`400 ${2*m}px ${s}`,t.textBaseline="middle",t.textAlign="center",t.fillText(o,m,m),p=e.transferToImageBitmap()}else{const e=document.createElement("canvas");e.width=l,e.height=l;const t=e.getContext("2d");if(!t)return;t.font=`400 ${2*m}px ${s}`,t.textBaseline="middle",t.textAlign="center",t.fillText(o,m,m),p=e}this._emojiShapeDict.set(c,p),t.emojiData=p,await Promise.resolve()}}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! tsParticles Confetti v3.2.0 by Matteo Bruni */
|
package/9126.min.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see 9126.min.js.LICENSE.txt */
|
|
2
|
+
(this.webpackChunk_tsparticles_confetti=this.webpackChunk_tsparticles_confetti||[]).push([[9126],{9126:(t,e,i)=>{i.d(e,{LifeUpdater:()=>c});var n=i(3624);class s extends n.SW{constructor(){super(),this.sync=!1}load(t){t&&(super.load(t),void 0!==t.sync&&(this.sync=t.sync))}}class a extends n.SW{constructor(){super(),this.sync=!1}load(t){t&&(super.load(t),void 0!==t.sync&&(this.sync=t.sync))}}class o{constructor(){this.count=0,this.delay=new s,this.duration=new a}load(t){t&&(void 0!==t.count&&(this.count=t.count),this.delay.load(t.delay),this.duration.load(t.duration))}}class c{constructor(t){this.container=t}async init(t){const e=this.container,i=t.options.life;i&&(t.life={delay:e.retina.reduceFactor?(0,n.Gu)(i.delay.value)*(i.delay.sync?1:(0,n.sZ)())/e.retina.reduceFactor*n.X5:0,delayTime:0,duration:e.retina.reduceFactor?(0,n.Gu)(i.duration.value)*(i.duration.sync?1:(0,n.sZ)())/e.retina.reduceFactor*n.X5:0,time:0,count:i.count},t.life.duration<=0&&(t.life.duration=-1),t.life.count<=0&&(t.life.count=-1),t.life&&(t.spawning=t.life.delay>0),await Promise.resolve())}isEnabled(t){return!t.destroyed}loadOptions(t,...e){t.life||(t.life=new o);for(const i of e)t.life.load(i?.life)}async update(t,e){if(!this.isEnabled(t)||!t.life)return;const{updateLife:n}=await i.e(2580).then(i.bind(i,2580));n(t,e,this.container.canvas.size)}}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! tsParticles Confetti v3.2.0 by Matteo Bruni */
|
package/9331.min.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see 9331.min.js.LICENSE.txt */
|
|
2
|
+
(this.webpackChunk_tsparticles_confetti=this.webpackChunk_tsparticles_confetti||[]).push([[9331],{9331:(e,l,n)=>{n.d(l,{initParticle:()=>r,updateRoll:()=>i});var a=n(3624);const t=2*Math.PI,o=360;function r(e){const l=e.options.roll;if(l?.enable)if(e.roll={enable:l.enable,horizontal:"horizontal"===l.mode||"both"===l.mode,vertical:"vertical"===l.mode||"both"===l.mode,angle:(0,a.sZ)()*t,speed:(0,a.Gu)(l.speed)/o},l.backColor)e.backColor=(0,a.lN)(l.backColor);else if(l.darken.enable&&l.enlighten.enable){const n=(0,a.sZ)()>=a.vq?"darken":"enlighten";e.roll.alter={type:n,value:(0,a.Gu)("darken"===n?l.darken.value:l.enlighten.value)}}else l.darken.enable?e.roll.alter={type:"darken",value:(0,a.Gu)(l.darken.value)}:l.enlighten.enable&&(e.roll.alter={type:"enlighten",value:(0,a.Gu)(l.enlighten.value)});else e.roll={enable:!1,horizontal:!1,vertical:!1,angle:0,speed:0}}function i(e,l){const n=e.options.roll,a=e.roll;if(!a||!n?.enable)return;const o=a.speed*l.factor,r=t;a.angle+=o,a.angle>r&&(a.angle-=r)}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! tsParticles Confetti v3.2.0 by Matteo Bruni */
|
package/9376.min.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see 9376.min.js.LICENSE.txt */
|
|
2
|
+
(this.webpackChunk_tsparticles_confetti=this.webpackChunk_tsparticles_confetti||[]).push([[9376],{9376:(t,a,e)=>{async function n(t,a=!0){await t.addParticleUpdater("rotate",(async t=>{const{RotateUpdater:a}=await e.e(4994).then(e.bind(e,4994));return new a(t)}),a)}e.d(a,{loadRotateUpdater:()=>n})}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! tsParticles Confetti v3.2.0 by Matteo Bruni */
|
package/95.min.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see 95.min.js.LICENSE.txt */
|
|
2
|
+
(this.webpackChunk_tsparticles_confetti=this.webpackChunk_tsparticles_confetti||[]).push([[95],{95:(t,a,s)=>{s.d(a,{ClubDrawer:()=>c});class c{async draw(t){const{drawPath:a,paths:c}=await s.e(482).then(s.bind(s,482));a(t,c.club)}}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! tsParticles Confetti v3.2.0 by Matteo Bruni */
|
package/9530.min.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see 9530.min.js.LICENSE.txt */
|
|
2
|
+
(this.webpackChunk_tsparticles_confetti=this.webpackChunk_tsparticles_confetti||[]).push([[9530],{9530:(a,e,t)=>{async function n(a,e=!0){const{SquareDrawer:n}=await t.e(1810).then(t.bind(t,1810));await a.addShape(["edge","square"],new n,e)}t.d(e,{loadSquareShape:()=>n})}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! tsParticles Confetti v3.2.0 by Matteo Bruni */
|
package/9532.min.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see 9532.min.js.LICENSE.txt */
|
|
2
|
+
(this.webpackChunk_tsparticles_confetti=this.webpackChunk_tsparticles_confetti||[]).push([[9532],{9532:(t,a,e)=>{async function n(t,a=!0){const{StarDrawer:n}=await e.e(2765).then(e.bind(e,2765));await t.addShape("star",new n,a)}e.d(a,{loadStarShape:()=>n})}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! tsParticles Confetti v3.2.0 by Matteo Bruni */
|
package/9836.min.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see 9836.min.js.LICENSE.txt */
|
|
2
|
+
(this.webpackChunk_tsparticles_confetti=this.webpackChunk_tsparticles_confetti||[]).push([[9836],{9836:(a,t,s)=>{s.d(t,{SpadeDrawer:()=>e});class e{async draw(a){const{drawPath:t,paths:e}=await s.e(482).then(s.bind(s,482));t(a,e.spade)}}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! tsParticles Confetti v3.2.0 by Matteo Bruni */
|
package/9921.min.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see 9921.min.js.LICENSE.txt */
|
|
2
|
+
(this.webpackChunk_tsparticles_confetti=this.webpackChunk_tsparticles_confetti||[]).push([[9921],{9921:(t,e,a)=>{async function i(t,e=!0){await t.addParticleUpdater("life",(async t=>{const{LifeUpdater:e}=await a.e(9126).then(a.bind(a,9126));return new e(t)}),e)}a.d(e,{loadLifeUpdater:()=>i})}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! tsParticles Confetti v3.2.0 by Matteo Bruni */
|
|
@@ -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([["basic_dist_browser_index_js"],{
|
|
19
|
+
|
|
20
|
+
/***/ "../basic/dist/browser/index.js":
|
|
21
|
+
/*!**************************************!*\
|
|
22
|
+
!*** ../basic/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 */ loadBasic: () => (/* binding */ loadBasic)\n/* harmony export */ });\nasync function loadBasic(engine, refresh = true) {\n const {\n loadBaseMover\n } = await __webpack_require__.e(/*! import() */ \"move_base_dist_browser_index_js\").then(__webpack_require__.bind(__webpack_require__, /*! @tsparticles/move-base */ \"../../move/base/dist/browser/index.js\")),\n {\n loadCircleShape\n } = await __webpack_require__.e(/*! import() */ \"shapes_circle_dist_browser_index_js\").then(__webpack_require__.bind(__webpack_require__, /*! @tsparticles/shape-circle */ \"../../shapes/circle/dist/browser/index.js\")),\n {\n loadColorUpdater\n } = await __webpack_require__.e(/*! import() */ \"updaters_color_dist_browser_index_js\").then(__webpack_require__.bind(__webpack_require__, /*! @tsparticles/updater-color */ \"../../updaters/color/dist/browser/index.js\")),\n {\n loadOpacityUpdater\n } = await __webpack_require__.e(/*! import() */ \"updaters_opacity_dist_browser_index_js\").then(__webpack_require__.bind(__webpack_require__, /*! @tsparticles/updater-opacity */ \"../../updaters/opacity/dist/browser/index.js\")),\n {\n loadOutModesUpdater\n } = await __webpack_require__.e(/*! import() */ \"updaters_outModes_dist_browser_index_js\").then(__webpack_require__.bind(__webpack_require__, /*! @tsparticles/updater-out-modes */ \"../../updaters/outModes/dist/browser/index.js\")),\n {\n loadSizeUpdater\n } = await __webpack_require__.e(/*! import() */ \"updaters_size_dist_browser_index_js\").then(__webpack_require__.bind(__webpack_require__, /*! @tsparticles/updater-size */ \"../../updaters/size/dist/browser/index.js\"));\n await loadBaseMover(engine, false);\n await loadCircleShape(engine, false);\n await loadColorUpdater(engine, false);\n await loadOpacityUpdater(engine, false);\n await loadOutModesUpdater(engine, false);\n await loadSizeUpdater(engine, false);\n await engine.refresh(refresh);\n}\n\n//# sourceURL=webpack://@tsparticles/confetti/../basic/dist/browser/index.js?");
|
|
27
|
+
|
|
28
|
+
/***/ })
|
|
29
|
+
|
|
30
|
+
}]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { deepExtend, isArray, } from "@tsparticles/engine";
|
|
1
|
+
import { deepExtend, isArray, percentDenominator, } from "@tsparticles/engine";
|
|
2
2
|
export class ConfettiOptions {
|
|
3
3
|
constructor() {
|
|
4
4
|
this.angle = 90;
|
|
@@ -23,13 +23,13 @@ export class ConfettiOptions {
|
|
|
23
23
|
}
|
|
24
24
|
get origin() {
|
|
25
25
|
return {
|
|
26
|
-
x: this.position.x /
|
|
27
|
-
y: this.position.y /
|
|
26
|
+
x: this.position.x / percentDenominator,
|
|
27
|
+
y: this.position.y / percentDenominator,
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
set origin(value) {
|
|
31
|
-
this.position.x = value.x *
|
|
32
|
-
this.position.y = value.y *
|
|
31
|
+
this.position.x = value.x * percentDenominator;
|
|
32
|
+
this.position.y = value.y * percentDenominator;
|
|
33
33
|
}
|
|
34
34
|
get particleCount() {
|
|
35
35
|
return this.count;
|
|
@@ -72,8 +72,8 @@ export class ConfettiOptions {
|
|
|
72
72
|
const origin = data.origin;
|
|
73
73
|
if (origin && !data.position) {
|
|
74
74
|
data.position = {
|
|
75
|
-
x: origin.x !== undefined ? origin.x *
|
|
76
|
-
y: origin.y !== undefined ? origin.y *
|
|
75
|
+
x: origin.x !== undefined ? origin.x * percentDenominator : undefined,
|
|
76
|
+
y: origin.y !== undefined ? origin.y * percentDenominator : undefined,
|
|
77
77
|
};
|
|
78
78
|
}
|
|
79
79
|
const position = data.position;
|
package/browser/confetti.js
CHANGED
|
@@ -1,20 +1,6 @@
|
|
|
1
|
-
import { isSsr, isString, tsParticles, } from "@tsparticles/engine";
|
|
1
|
+
import { isSsr, isString, millisecondsToSeconds, tsParticles, } from "@tsparticles/engine";
|
|
2
2
|
import { ConfettiOptions } from "./ConfettiOptions.js";
|
|
3
|
-
|
|
4
|
-
import { loadCardsShape } from "@tsparticles/shape-cards";
|
|
5
|
-
import { loadEmittersPlugin } from "@tsparticles/plugin-emitters";
|
|
6
|
-
import { loadEmojiShape } from "@tsparticles/shape-emoji";
|
|
7
|
-
import { loadHeartShape } from "@tsparticles/shape-heart";
|
|
8
|
-
import { loadImageShape } from "@tsparticles/shape-image";
|
|
9
|
-
import { loadLifeUpdater } from "@tsparticles/updater-life";
|
|
10
|
-
import { loadMotionPlugin } from "@tsparticles/plugin-motion";
|
|
11
|
-
import { loadPolygonShape } from "@tsparticles/shape-polygon";
|
|
12
|
-
import { loadRollUpdater } from "@tsparticles/updater-roll";
|
|
13
|
-
import { loadRotateUpdater } from "@tsparticles/updater-rotate";
|
|
14
|
-
import { loadSquareShape } from "@tsparticles/shape-square";
|
|
15
|
-
import { loadStarShape } from "@tsparticles/shape-star";
|
|
16
|
-
import { loadTiltUpdater } from "@tsparticles/updater-tilt";
|
|
17
|
-
import { loadWobbleUpdater } from "@tsparticles/updater-wobble";
|
|
3
|
+
const defaultGravity = 9.81, sizeFactor = 5, speedFactor = 3, decayOffset = 1, disableRotate = 0, disableTilt = 0;
|
|
18
4
|
let initialized = false;
|
|
19
5
|
let initializing = false;
|
|
20
6
|
const ids = new Map();
|
|
@@ -24,16 +10,17 @@ async function initPlugins(engine) {
|
|
|
24
10
|
}
|
|
25
11
|
if (initializing) {
|
|
26
12
|
return new Promise((resolve) => {
|
|
27
|
-
const interval = setInterval(() => {
|
|
13
|
+
const timeout = 100, interval = setInterval(() => {
|
|
28
14
|
if (!initialized) {
|
|
29
15
|
return;
|
|
30
16
|
}
|
|
31
17
|
clearInterval(interval);
|
|
32
18
|
resolve();
|
|
33
|
-
},
|
|
19
|
+
}, timeout);
|
|
34
20
|
});
|
|
35
21
|
}
|
|
36
22
|
initializing = true;
|
|
23
|
+
const { loadEmittersPlugin } = await import("@tsparticles/plugin-emitters"), { loadMotionPlugin } = await import("@tsparticles/plugin-motion"), { loadCardsShape } = await import("@tsparticles/shape-cards"), { loadHeartShape } = await import("@tsparticles/shape-heart"), { loadImageShape } = await import("@tsparticles/shape-image"), { loadPolygonShape } = await import("@tsparticles/shape-polygon"), { loadSquareShape } = await import("@tsparticles/shape-square"), { loadStarShape } = await import("@tsparticles/shape-star"), { loadEmojiShape } = await import("@tsparticles/shape-emoji"), { loadRotateUpdater } = await import("@tsparticles/updater-rotate"), { loadLifeUpdater } = await import("@tsparticles/updater-life"), { loadRollUpdater } = await import("@tsparticles/updater-roll"), { loadTiltUpdater } = await import("@tsparticles/updater-tilt"), { loadWobbleUpdater } = await import("@tsparticles/updater-wobble"), { loadBasic } = await import("@tsparticles/basic");
|
|
37
24
|
await loadEmittersPlugin(engine, false);
|
|
38
25
|
await loadMotionPlugin(engine, false);
|
|
39
26
|
await loadCardsShape(engine, false);
|
|
@@ -56,13 +43,13 @@ async function setConfetti(params) {
|
|
|
56
43
|
const actualOptions = new ConfettiOptions();
|
|
57
44
|
actualOptions.load(params.options);
|
|
58
45
|
let container;
|
|
59
|
-
const fpsLimit = 120, opacitySpeed = (actualOptions.ticks *
|
|
46
|
+
const fpsLimit = 120, fpsLimitFactor = 3.6, opacitySpeed = (actualOptions.ticks * millisecondsToSeconds) / (fpsLimitFactor * millisecondsToSeconds * fpsLimit);
|
|
60
47
|
if (ids.has(params.id)) {
|
|
61
48
|
container = ids.get(params.id);
|
|
62
49
|
if (container && !container.destroyed) {
|
|
63
50
|
const alias = container;
|
|
64
51
|
if (alias.addEmitter) {
|
|
65
|
-
alias.addEmitter({
|
|
52
|
+
await alias.addEmitter({
|
|
66
53
|
startCount: actualOptions.count,
|
|
67
54
|
position: actualOptions.position,
|
|
68
55
|
size: {
|
|
@@ -99,7 +86,7 @@ async function setConfetti(params) {
|
|
|
99
86
|
},
|
|
100
87
|
},
|
|
101
88
|
size: {
|
|
102
|
-
value:
|
|
89
|
+
value: sizeFactor * actualOptions.scalar,
|
|
103
90
|
},
|
|
104
91
|
move: {
|
|
105
92
|
angle: {
|
|
@@ -111,10 +98,10 @@ async function setConfetti(params) {
|
|
|
111
98
|
max: actualOptions.drift,
|
|
112
99
|
},
|
|
113
100
|
gravity: {
|
|
114
|
-
acceleration: actualOptions.gravity *
|
|
101
|
+
acceleration: actualOptions.gravity * defaultGravity,
|
|
115
102
|
},
|
|
116
|
-
speed: actualOptions.startVelocity *
|
|
117
|
-
decay:
|
|
103
|
+
speed: actualOptions.startVelocity * speedFactor,
|
|
104
|
+
decay: decayOffset - actualOptions.decay,
|
|
118
105
|
direction: -actualOptions.angle,
|
|
119
106
|
},
|
|
120
107
|
},
|
|
@@ -151,7 +138,7 @@ async function setConfetti(params) {
|
|
|
151
138
|
},
|
|
152
139
|
},
|
|
153
140
|
size: {
|
|
154
|
-
value:
|
|
141
|
+
value: sizeFactor * actualOptions.scalar,
|
|
155
142
|
},
|
|
156
143
|
links: {
|
|
157
144
|
enable: false,
|
|
@@ -171,10 +158,10 @@ async function setConfetti(params) {
|
|
|
171
158
|
enable: true,
|
|
172
159
|
gravity: {
|
|
173
160
|
enable: true,
|
|
174
|
-
acceleration: actualOptions.gravity *
|
|
161
|
+
acceleration: actualOptions.gravity * defaultGravity,
|
|
175
162
|
},
|
|
176
|
-
speed: actualOptions.startVelocity *
|
|
177
|
-
decay:
|
|
163
|
+
speed: actualOptions.startVelocity * speedFactor,
|
|
164
|
+
decay: decayOffset - actualOptions.decay,
|
|
178
165
|
direction: -actualOptions.angle,
|
|
179
166
|
random: true,
|
|
180
167
|
straight: false,
|
|
@@ -185,7 +172,7 @@ async function setConfetti(params) {
|
|
|
185
172
|
},
|
|
186
173
|
rotate: {
|
|
187
174
|
value: actualOptions.flat
|
|
188
|
-
?
|
|
175
|
+
? disableRotate
|
|
189
176
|
: {
|
|
190
177
|
min: 0,
|
|
191
178
|
max: 360,
|
|
@@ -200,7 +187,7 @@ async function setConfetti(params) {
|
|
|
200
187
|
direction: "random",
|
|
201
188
|
enable: !actualOptions.flat,
|
|
202
189
|
value: actualOptions.flat
|
|
203
|
-
?
|
|
190
|
+
? disableTilt
|
|
204
191
|
: {
|
|
205
192
|
min: 0,
|
|
206
193
|
max: 360,
|
|
@@ -278,7 +265,7 @@ confetti.create = async (canvas, options) => {
|
|
|
278
265
|
return confetti;
|
|
279
266
|
}
|
|
280
267
|
await initPlugins(tsParticles);
|
|
281
|
-
const id = canvas.getAttribute("id")
|
|
268
|
+
const id = canvas.getAttribute("id") ?? "confetti";
|
|
282
269
|
canvas.setAttribute("id", id);
|
|
283
270
|
return async (idOrOptions, confettiOptions) => {
|
|
284
271
|
let subOptions;
|
package/cjs/ConfettiOptions.js
CHANGED
|
@@ -26,13 +26,13 @@ class ConfettiOptions {
|
|
|
26
26
|
}
|
|
27
27
|
get origin() {
|
|
28
28
|
return {
|
|
29
|
-
x: this.position.x /
|
|
30
|
-
y: this.position.y /
|
|
29
|
+
x: this.position.x / engine_1.percentDenominator,
|
|
30
|
+
y: this.position.y / engine_1.percentDenominator,
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
33
|
set origin(value) {
|
|
34
|
-
this.position.x = value.x *
|
|
35
|
-
this.position.y = value.y *
|
|
34
|
+
this.position.x = value.x * engine_1.percentDenominator;
|
|
35
|
+
this.position.y = value.y * engine_1.percentDenominator;
|
|
36
36
|
}
|
|
37
37
|
get particleCount() {
|
|
38
38
|
return this.count;
|
|
@@ -75,8 +75,8 @@ class ConfettiOptions {
|
|
|
75
75
|
const origin = data.origin;
|
|
76
76
|
if (origin && !data.position) {
|
|
77
77
|
data.position = {
|
|
78
|
-
x: origin.x !== undefined ? origin.x *
|
|
79
|
-
y: origin.y !== undefined ? origin.y *
|
|
78
|
+
x: origin.x !== undefined ? origin.x * engine_1.percentDenominator : undefined,
|
|
79
|
+
y: origin.y !== undefined ? origin.y * engine_1.percentDenominator : undefined,
|
|
80
80
|
};
|
|
81
81
|
}
|
|
82
82
|
const position = data.position;
|
package/cjs/confetti.js
CHANGED
|
@@ -1,23 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
26
|
exports.confetti = void 0;
|
|
4
27
|
const engine_1 = require("@tsparticles/engine");
|
|
5
28
|
const ConfettiOptions_js_1 = require("./ConfettiOptions.js");
|
|
6
|
-
const
|
|
7
|
-
const shape_cards_1 = require("@tsparticles/shape-cards");
|
|
8
|
-
const plugin_emitters_1 = require("@tsparticles/plugin-emitters");
|
|
9
|
-
const shape_emoji_1 = require("@tsparticles/shape-emoji");
|
|
10
|
-
const shape_heart_1 = require("@tsparticles/shape-heart");
|
|
11
|
-
const shape_image_1 = require("@tsparticles/shape-image");
|
|
12
|
-
const updater_life_1 = require("@tsparticles/updater-life");
|
|
13
|
-
const plugin_motion_1 = require("@tsparticles/plugin-motion");
|
|
14
|
-
const shape_polygon_1 = require("@tsparticles/shape-polygon");
|
|
15
|
-
const updater_roll_1 = require("@tsparticles/updater-roll");
|
|
16
|
-
const updater_rotate_1 = require("@tsparticles/updater-rotate");
|
|
17
|
-
const shape_square_1 = require("@tsparticles/shape-square");
|
|
18
|
-
const shape_star_1 = require("@tsparticles/shape-star");
|
|
19
|
-
const updater_tilt_1 = require("@tsparticles/updater-tilt");
|
|
20
|
-
const updater_wobble_1 = require("@tsparticles/updater-wobble");
|
|
29
|
+
const defaultGravity = 9.81, sizeFactor = 5, speedFactor = 3, decayOffset = 1, disableRotate = 0, disableTilt = 0;
|
|
21
30
|
let initialized = false;
|
|
22
31
|
let initializing = false;
|
|
23
32
|
const ids = new Map();
|
|
@@ -27,31 +36,32 @@ async function initPlugins(engine) {
|
|
|
27
36
|
}
|
|
28
37
|
if (initializing) {
|
|
29
38
|
return new Promise((resolve) => {
|
|
30
|
-
const interval = setInterval(() => {
|
|
39
|
+
const timeout = 100, interval = setInterval(() => {
|
|
31
40
|
if (!initialized) {
|
|
32
41
|
return;
|
|
33
42
|
}
|
|
34
43
|
clearInterval(interval);
|
|
35
44
|
resolve();
|
|
36
|
-
},
|
|
45
|
+
}, timeout);
|
|
37
46
|
});
|
|
38
47
|
}
|
|
39
48
|
initializing = true;
|
|
40
|
-
await (
|
|
41
|
-
await (
|
|
42
|
-
await (
|
|
43
|
-
await (
|
|
44
|
-
await (
|
|
45
|
-
await (
|
|
46
|
-
await (
|
|
47
|
-
await (
|
|
48
|
-
await (
|
|
49
|
-
await (
|
|
50
|
-
await (
|
|
51
|
-
await (
|
|
52
|
-
await (
|
|
53
|
-
await (
|
|
54
|
-
await (
|
|
49
|
+
const { loadEmittersPlugin } = await Promise.resolve().then(() => __importStar(require("@tsparticles/plugin-emitters"))), { loadMotionPlugin } = await Promise.resolve().then(() => __importStar(require("@tsparticles/plugin-motion"))), { loadCardsShape } = await Promise.resolve().then(() => __importStar(require("@tsparticles/shape-cards"))), { loadHeartShape } = await Promise.resolve().then(() => __importStar(require("@tsparticles/shape-heart"))), { loadImageShape } = await Promise.resolve().then(() => __importStar(require("@tsparticles/shape-image"))), { loadPolygonShape } = await Promise.resolve().then(() => __importStar(require("@tsparticles/shape-polygon"))), { loadSquareShape } = await Promise.resolve().then(() => __importStar(require("@tsparticles/shape-square"))), { loadStarShape } = await Promise.resolve().then(() => __importStar(require("@tsparticles/shape-star"))), { loadEmojiShape } = await Promise.resolve().then(() => __importStar(require("@tsparticles/shape-emoji"))), { loadRotateUpdater } = await Promise.resolve().then(() => __importStar(require("@tsparticles/updater-rotate"))), { loadLifeUpdater } = await Promise.resolve().then(() => __importStar(require("@tsparticles/updater-life"))), { loadRollUpdater } = await Promise.resolve().then(() => __importStar(require("@tsparticles/updater-roll"))), { loadTiltUpdater } = await Promise.resolve().then(() => __importStar(require("@tsparticles/updater-tilt"))), { loadWobbleUpdater } = await Promise.resolve().then(() => __importStar(require("@tsparticles/updater-wobble"))), { loadBasic } = await Promise.resolve().then(() => __importStar(require("@tsparticles/basic")));
|
|
50
|
+
await loadEmittersPlugin(engine, false);
|
|
51
|
+
await loadMotionPlugin(engine, false);
|
|
52
|
+
await loadCardsShape(engine, false);
|
|
53
|
+
await loadHeartShape(engine, false);
|
|
54
|
+
await loadImageShape(engine, false);
|
|
55
|
+
await loadPolygonShape(engine, false);
|
|
56
|
+
await loadSquareShape(engine, false);
|
|
57
|
+
await loadStarShape(engine, false);
|
|
58
|
+
await loadEmojiShape(engine, false);
|
|
59
|
+
await loadRotateUpdater(engine, false);
|
|
60
|
+
await loadLifeUpdater(engine, false);
|
|
61
|
+
await loadRollUpdater(engine, false);
|
|
62
|
+
await loadTiltUpdater(engine, false);
|
|
63
|
+
await loadWobbleUpdater(engine, false);
|
|
64
|
+
await loadBasic(engine);
|
|
55
65
|
initializing = false;
|
|
56
66
|
initialized = true;
|
|
57
67
|
}
|
|
@@ -59,13 +69,13 @@ async function setConfetti(params) {
|
|
|
59
69
|
const actualOptions = new ConfettiOptions_js_1.ConfettiOptions();
|
|
60
70
|
actualOptions.load(params.options);
|
|
61
71
|
let container;
|
|
62
|
-
const fpsLimit = 120, opacitySpeed = (actualOptions.ticks *
|
|
72
|
+
const fpsLimit = 120, fpsLimitFactor = 3.6, opacitySpeed = (actualOptions.ticks * engine_1.millisecondsToSeconds) / (fpsLimitFactor * engine_1.millisecondsToSeconds * fpsLimit);
|
|
63
73
|
if (ids.has(params.id)) {
|
|
64
74
|
container = ids.get(params.id);
|
|
65
75
|
if (container && !container.destroyed) {
|
|
66
76
|
const alias = container;
|
|
67
77
|
if (alias.addEmitter) {
|
|
68
|
-
alias.addEmitter({
|
|
78
|
+
await alias.addEmitter({
|
|
69
79
|
startCount: actualOptions.count,
|
|
70
80
|
position: actualOptions.position,
|
|
71
81
|
size: {
|
|
@@ -102,7 +112,7 @@ async function setConfetti(params) {
|
|
|
102
112
|
},
|
|
103
113
|
},
|
|
104
114
|
size: {
|
|
105
|
-
value:
|
|
115
|
+
value: sizeFactor * actualOptions.scalar,
|
|
106
116
|
},
|
|
107
117
|
move: {
|
|
108
118
|
angle: {
|
|
@@ -114,10 +124,10 @@ async function setConfetti(params) {
|
|
|
114
124
|
max: actualOptions.drift,
|
|
115
125
|
},
|
|
116
126
|
gravity: {
|
|
117
|
-
acceleration: actualOptions.gravity *
|
|
127
|
+
acceleration: actualOptions.gravity * defaultGravity,
|
|
118
128
|
},
|
|
119
|
-
speed: actualOptions.startVelocity *
|
|
120
|
-
decay:
|
|
129
|
+
speed: actualOptions.startVelocity * speedFactor,
|
|
130
|
+
decay: decayOffset - actualOptions.decay,
|
|
121
131
|
direction: -actualOptions.angle,
|
|
122
132
|
},
|
|
123
133
|
},
|
|
@@ -154,7 +164,7 @@ async function setConfetti(params) {
|
|
|
154
164
|
},
|
|
155
165
|
},
|
|
156
166
|
size: {
|
|
157
|
-
value:
|
|
167
|
+
value: sizeFactor * actualOptions.scalar,
|
|
158
168
|
},
|
|
159
169
|
links: {
|
|
160
170
|
enable: false,
|
|
@@ -174,10 +184,10 @@ async function setConfetti(params) {
|
|
|
174
184
|
enable: true,
|
|
175
185
|
gravity: {
|
|
176
186
|
enable: true,
|
|
177
|
-
acceleration: actualOptions.gravity *
|
|
187
|
+
acceleration: actualOptions.gravity * defaultGravity,
|
|
178
188
|
},
|
|
179
|
-
speed: actualOptions.startVelocity *
|
|
180
|
-
decay:
|
|
189
|
+
speed: actualOptions.startVelocity * speedFactor,
|
|
190
|
+
decay: decayOffset - actualOptions.decay,
|
|
181
191
|
direction: -actualOptions.angle,
|
|
182
192
|
random: true,
|
|
183
193
|
straight: false,
|
|
@@ -188,7 +198,7 @@ async function setConfetti(params) {
|
|
|
188
198
|
},
|
|
189
199
|
rotate: {
|
|
190
200
|
value: actualOptions.flat
|
|
191
|
-
?
|
|
201
|
+
? disableRotate
|
|
192
202
|
: {
|
|
193
203
|
min: 0,
|
|
194
204
|
max: 360,
|
|
@@ -203,7 +213,7 @@ async function setConfetti(params) {
|
|
|
203
213
|
direction: "random",
|
|
204
214
|
enable: !actualOptions.flat,
|
|
205
215
|
value: actualOptions.flat
|
|
206
|
-
?
|
|
216
|
+
? disableTilt
|
|
207
217
|
: {
|
|
208
218
|
min: 0,
|
|
209
219
|
max: 360,
|
|
@@ -282,7 +292,7 @@ confetti.create = async (canvas, options) => {
|
|
|
282
292
|
return confetti;
|
|
283
293
|
}
|
|
284
294
|
await initPlugins(engine_1.tsParticles);
|
|
285
|
-
const id = canvas.getAttribute("id")
|
|
295
|
+
const id = canvas.getAttribute("id") ?? "confetti";
|
|
286
296
|
canvas.setAttribute("id", id);
|
|
287
297
|
return async (idOrOptions, confettiOptions) => {
|
|
288
298
|
let subOptions;
|