var $confetti = $('#confetti').length; if($confetti != ''){ window.ConfettiGenerator=function(e){var t={target:"confetti-holder",max:80,size:1,animate:!0,props:["circle","square","triangle","line"],colors:[[165,104,246],[230,61,135],[0,199,228],[253,214,126]],clock:25,interval:null,rotate:!1,width:window.innerWidth,height:window.innerHeight};e&&(e.target&&(t.target=e.target),e.max&&(t.max=e.max),e.size&&(t.size=e.size),void 0!==e.animate&&null!==e.animate&&(t.animate=e.animate),e.props&&(t.props=e.props),e.colors&&(t.colors=e.colors),e.clock&&(t.clock=e.clock),e.width&&(t.width=e.width),e.height&&(t.height=e.height),void 0!==e.rotate&&null!==e.rotate&&(t.rotate=e.rotate));var r=document.getElementById(t.target),a=r.getContext("2d"),i=[];function o(e,t){e||(e=1);var r=Math.random()*e;return t?Math.floor(r):r}var n=t.props.reduce(function(e,t){return e+(t.weight||1)},0);function s(){var e=t.props[function(){for(var e=Math.random()*n,r=0;r=0&&r.y>t.height||r.speed<0&&r.y<0)&&(i[e]=r,i[e].x=o(t.width,!0),i[e].y=r.speed>=0?-10:parseFloat(t.height))}}(),t.animate&&requestAnimationFrame(e)})},clear:function(){t.animate=!1,clearInterval(t.interval),requestAnimationFrame(function(){a.clearRect(0,0,r.width,r.height);var e=r.width;r.width=1,r.width=e})}}}; function confetti() { var confettiSettings = { target: 'confetti' }; var confetti = new ConfettiGenerator(confettiSettings); confetti.render(); }; $(document).ready(function() { confetti(); }); };