with(Math){r=random;f=floor;pi=PI;at=atan2}w=window;a=[];function rn(b){return f(r()*b)}function rc(){return"rgb("+rn(255)+","+rn(255)+","+rn(255)+")"}
w.onload=function(){c=document.getElementById("c");c.width=cw=600;c.height=ch=300;o=c.getContext("2d");g=o.createLinearGradient(0,0,cw,70);g.addColorStop(0,rc());g.addColorStop(0.5,rc());o.fillStyle=g;o.font="220px Impact";o.fillText("#JS1K",50,200);for(x=0;x<cw;x+=5)for(y=0;y<ch;y+=5){d=o.getImageData(x,y,1,1).data;color="rgb("+d[0]+","+d[1]+","+d[2]+")";d[2]!=0&&a.push({x:x,y:y,c:color})}w.onmousemove=function(b){x=b.clientX;y=b.clientY};setInterval(function(){c.width=cw;for(i=0;i<a.length;i++){o.save();
o.translate(a[i].x,a[i].y);o.rotate(at(x-a[i].x,-(y-a[i].y))*(180/pi)/50);o.fillStyle=a[i].c;o.beginPath();o.moveTo(20,20);o.lineTo(25,20);o.lineTo(20,25);o.fill();o.restore()}},10)};
d2l0aChNYXRoKXtyPXJhbmRvbTtmPWZsb29yO3BpPVBJO2F0PWF0YW4yfXc9d2luZG93O2E9W107ZnVuY3Rpb24gcm4oYil7cmV0dXJuIGYocigpKmIpfWZ1bmN0aW9uIHJjKCl7cmV0dXJuInJnYigiK3JuKDI1NSkrIiwiK3JuKDI1NSkrIiwiK3JuKDI1NSkrIikifQ0Kdy5vbmxvYWQ9ZnVuY3Rpb24oKXtjPWRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJjIik7Yy53aWR0aD1jdz02MDA7Yy5oZWlnaHQ9Y2g9MzAwO289Yy5nZXRDb250ZXh0KCIyZCIpO2c9by5jcmVhdGVMaW5lYXJHcmFkaWVudCgwLDAsY3csNzApO2cuYWRkQ29sb3JTdG9wKDAscmMoKSk7Zy5hZGRDb2xvclN0b3AoMC41LHJjKCkpO28uZmlsbFN0eWxlPWc7by5mb250PSIyMjBweCBJbXBhY3QiO28uZmlsbFRleHQoIiNKUzFLIiw1MCwyMDApO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