"use strict";(self.webpackChunkelement_web=self.webpackChunkelement_web||[]).push([[3636],{"./src/effects/fireworks/index.ts":(t,e,i)=>{i.d(e,{default:()=>r});var s=i("./node_modules/@babel/runtime/helpers/esm/defineProperty.js");function n(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i.push.apply(i,s)}return i}function o(t){for(var e=1;e{t&&(this.isRunning=!0,this.context=t.getContext("2d"),this.supportsAnimationFrame.call(window,this.updateWorld),e&&window.setTimeout(this.stop,e))}),(0,s.A)(this,"updateWorld",()=>{(this.isRunning||0!==this.particles.length)&&(this.update(),this.paint(),this.supportsAnimationFrame.call(window,this.updateWorld))}),(0,s.A)(this,"update",()=>{this.particles.length{if(this.context&&this.context.canvas){this.context.globalCompositeOperation="destination-out",this.context.fillStyle="rgba(0,0,0,0.5)",this.context.fillRect(0,0,this.context.canvas.width,this.context.canvas.height),this.context.globalCompositeOperation="lighter";for(let t=0;t{if(!this.context||!this.context.canvas)return;const t=this.context.canvas.width,e=this.context.canvas.height,i=Math.random()*(t-200)+100,s=Math.random()*(e-200)+100,n=50*Math.random()+100,o="rgb("+~~(200*Math.random()+55)+","+~~(200*Math.random()+55)+","+~~(200*Math.random()+55)+")";for(let t=0;te&&(t.vy=t.vy>0?e:-e),this.particles.push(t)}}),(0,s.A)(this,"stop",async()=>{this.isRunning=!1}),(0,s.A)(this,"drawParticle",t=>{this.context&&this.context.canvas&&(this.context.save(),this.context.beginPath(),this.context.translate(t.x+t.w/2,t.y+t.h/2),this.context.arc(0,0,t.w,0,2*Math.PI),this.context.fillStyle=t.color,this.context.globalAlpha=t.alpha,this.context.closePath(),this.context.fill(),this.context.restore())}),(0,s.A)(this,"move",t=>(t.x+=t.vx,t.vy+=this.options.gravity,t.y+=t.vy,t.alpha-=.01,!(t.x<=-t.w||t.x>=screen.width||t.y>=screen.height||t.alpha<=0))),this.options=o(o({},a),t)}}}}]); //# sourceMappingURL=3636.js.map