(window.webpackJsonp=window.webpackJsonp||[]).push([[3],{1383:function(t,e,i){"use strict";i.r(e),i.d(e,"DefaultOptions",(function(){return c})),i.d(e,"default",(function(){return h}));var s=i(1),n=i.n(s),o=i(28);function r(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 a(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?r(Object(i),!0).forEach((function(e){n()(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):r(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}const c={maxCount:120,gravity:3.2,maxDrift:5,maxRot:5};class h{constructor(t){n()(this,"options",void 0),n()(this,"context",null),n()(this,"particles",[]),n()(this,"lastAnimationTime",0),n()(this,"colours",["rgba(194,210,224,1)","rgba(235,214,219,1)","rgba(255,211,45,1)","rgba(255,190,174,1)","rgba(255,173,226,1)","rgba(242,114,171,1)","rgba(228,55,116,1)","rgba(255,86,130,1)","rgba(244,36,57,1)","rgba(247,126,157,1)","rgba(243,142,140,1)","rgba(252,116,183,1)"]),n()(this,"isRunning",!1),n()(this,"start",(async(t,e=3e3)=>{if(!t)return;this.context=t.getContext("2d"),this.particles=[];const i=this.options.maxCount;for(;this.particles.length<i;)this.particles.push(this.resetParticle({},t.width,t.height));this.isRunning=!0,requestAnimationFrame(this.renderLoop),e&&window.setTimeout(this.stop,e)})),n()(this,"stop",(async()=>{this.isRunning=!1})),n()(this,"resetParticle",((t,e,i)=>(t.color=this.colours[Math.random()*this.colours.length|0],t.x=Math.random()*e,t.y=Math.random()*i+i,t.xCol=t.x,t.scale=.07*Math.random()+.04,t.maximumDrift=Math.random()*this.options.maxDrift+3.5,t.maximumRot=Math.random()*this.options.maxRot+3.5,t.gravity=this.options.gravity+4.8*Math.random(),t))),n()(this,"renderLoop",(()=>{if(this.context&&this.context.canvas)if(0===this.particles.length)this.context.clearRect(0,0,this.context.canvas.width,this.context.canvas.height);else{(Date.now()-this.lastAnimationTime>=15||!this.lastAnimationTime)&&(this.context.clearRect(0,0,this.context.canvas.width,this.context.canvas.height),this.lastAnimationTime=Date.now(),this.animateAndRenderHearts()),requestAnimationFrame(this.renderLoop)}})),this.options=a(a({},c),t)}animateAndRenderHearts(){if(this.context&&this.context.canvas)for(const t of Object(o.b)(this.particles)){t.y-=t.gravity;const e=75*t.maximumDrift,i=2*Math.PI;t.x=6*t.maximumDrift*Math.sin(i/e*.7*t.y),t.x+=t.xCol;const s=1/t.scale,n=t.x*s,o=t.y*s;if(this.context.save(),this.context.scale(t.scale,t.scale),this.context.beginPath(),this.context.translate(248+n,215+o),this.context.rotate(.1*t.maximumRot*Math.sin(i/e*t.y*.8)),this.context.translate(-248-n,-215-o),this.context.moveTo(140+n,20+o),this.context.bezierCurveTo(73+n,20+o,20+n,74+o,20+n,140+o),this.context.bezierCurveTo(20+n,275+o,156+n,310+o,248+n,443+o),this.context.bezierCurveTo(336+n,311+o,477+n,270+o,477+n,140+o),this.context.bezierCurveTo(477+n,74+o,423+n,20+o,357+n,20+o),this.context.bezierCurveTo(309+n,20+o,267+n,48+o,248+n,89+o),this.context.bezierCurveTo(229+n,48+o,188+n,20+o,140+n,20+o),this.context.closePath(),this.context.fillStyle=t.color,this.context.fill(),this.context.restore(),t.y<-100){const e=this.particles.indexOf(t);this.particles.splice(e,1)}}}}}}]);
//# sourceMappingURL=3.js.map