s=50;o=[];_=Math;q=_.floor;w=_.random;e=_.cos;x=a.width;y=a.height;l=_.min;g=_.PI;for(i=s;i--;){b=r(30)+15;o.push({X:r(x-b-b)+b,Y:r(y/2),S:b,L:w()*2+1,C:w()*4-2,U:2,V:[255,r(255),r(255)]})}function r(i){return q(w()*i)}function t(a,b,c,d){return _.abs(q(e((a*99+r(d*99||0))/b)*c))}function $(A){c.fillStyle='rgba('+A.join(',')+')'}function m(i){for(j=s;j--;){p=o[j];if(p.D)c.putImageData(p.D,p.X,p.Y)}$([t(i,59,200,22),t(i,8,255),t(-i,99,255),.02]);c.beginPath();c.arc(x/2+r(99)-50,y/2+r(9),9+i/9%x,0,g*r(3));c.fill();$([255,0,0,.05]);for(j=s;j--;){if(w()<.1)c.fillRect(0,y/2+w()*9*j,x,w()*3);c.globalCompositeOperation='source-'+(j?'atop':'over')}for(j=s;j--;){p=o[j];if(p.X>x-p.S||p.X<4)p.C=-p.C;if(p.Y>y/2-p.S)p.U=-3;p.X+=p.C*p.L;p.Y+=p.U*p.L;p.U+=.05;p.D=c.getImageData(p.X,p.Y,p.S+2,p.S+2)}for(j=s;j--;){p=o[j];$(p.V.concat(l(i/5000-.5-j/30,.4)));c.beginPath();c.arc(p.X+p.S/2,p.Y+p.S/2,p.S/2,0,g*2);c.fill()}c.font=x/9+'px Arial';if(w()<.005)c.fillText('#js1k 2016',w()*x/4+x/10,y-w()*y/3);requestAnimationFrame(m)}m()
s=50;o=[];_=Math;q=_.floor;w=_.random;e=_.cos;x=a.width;y=a.height;l=_.min;g=_.PI;
for(i=s;i--;) {
b=r(30)+15;
o.push({X:r(x-b-b)+b,Y:r(y/2),S:b,L:w()*2+1,C:w()*4-2,U:2,V:[255,r(255),r(255)]})
}
function r(i){return q(w()*i)}
function t(a,b,c,d){return _.abs(q(e((a*99+r(d*99||0))/b)*c))}
function $(A){c.fillStyle='rgba('+A.join(',')+')'}
function m(i) {
for(j=s;j--;){p=o[j];
if(p.D)c.putImageData(p.D,p.X,p.Y)
}
$([t(i,59,200,22),t(i,8,255),t(-i,99,255),.02]);
c.beginPath();
c.arc(x/2+r(99)-50,y/2+r(9),9+i/9%x,0,g*r(3));
c.fill();
$([255,0,0,.05]);
for(j=s;j--;) {
if (w()<.1)c.fillRect(0, y/2+w()*9*j, x, w()*3);
c.globalCompositeOperation='source-'+(j?'atop':'over')
}
for(j=s;j--;){p=o[j];
if(p.X>x-p.S||p.X<4)p.C=-p.C;
if(p.Y>y/2-p.S)p.U=-3;
p.X+=p.C*p.L;
p.Y+=p.U*p.L;
p.U+=.05;
p.D=c.getImageData(p.X,p.Y,p.S+2,p.S+2)
}
for(j=s;j--;){p=o[j];
$(p.V.concat(l(i/5000-.5-j/30,.4)));
c.beginPath();
c.arc(p.X+p.S/2,p.Y+p.S/2,p.S/2,0,g*2);
c.fill()
}
c.font=x/9+'px Arial';
//$([5,5,0,.2]);
if (w()<.005)c.fillText('#js1k 2016', w()*x/4+x/10, y-w()*y/3);
requestAnimationFrame(m)
}
m()