var c=document.getElementById("canv"),$=c.getContext("2d"),w=c.width=window.innerWidth/1.2,h=c.height=window.innerHeight/1.5;function txt(){var a="helicity".split("").join("\u2004");$.font="3.5em Jura",$.fillStyle="hsl(0,0%,0%)",$.fillText(a,(c.width-$.measureText(a).width)*.5,.5*c.height)}function Part(a,b,d){this.x=a,this.y=b,this.z=d}for(var mid={x:w/2,y:h/2},cam={rotX:0,rotY:0,rotZ:0,zoom:1.99,focus:350},pts=[],i=0;i<2e3;++i)pts.push(new Part(Math.random()*w-w/2,Math.random()*h-h/2,Math.random()*w-200));var spA=0,dtr=1/180*Math.PI;function draw(r){$.clearRect(0,0,c.width,c.height),$.globalCompositeOperation="source-over";var a=$.createLinearGradient(c.width,c.height,1,c.width,c.height);a.addColorStop(0,"hsla(0,0%,0%,1)"),a.addColorStop(.6,"hsl(0,0%,0%)"),a.addColorStop(1,"hsla(0,0%,0%,0)"),$.fillStyle=a,$.fillRect(0,0,c.width,c.height);var j=Math.sin(++spA*dtr);cam.rotY+=.5*j,cam.rotZ-=.5*j;for(var n=cam.rotX*dtr,o=cam.rotY*dtr,p=cam.rotZ*dtr,d=0;d<pts.length;++d){var e=pts[d],k=rot(e.x,e.y,p),l=rot(k.b,e.z,n),m=rot(l.b,k.a,o),b=cam.focus/(cam.focus+m.a)*cam.zoom,f=m.b*b+mid.x,g=l.a*b+mid.y,q=4*b;$.globalCompositeOperation="lighter",f< -50||f>c.width||g< -50||g>c.height||($.fillStyle="hsla(0,0%,100%)",$.beginPath(),$.arc(f,g,b,q,2*Math.PI,!0),$.fill(),$.closePath())}window.requestAnimationFrame(draw),txt()}function rot(b,d,a){return{a:Math.cos(a)*b-Math.sin(a)*d,b:Math.sin(a)*b+Math.cos(a)*d}}draw(),window.addEventListener("resize",function(){c.width=w=window.innerWidth/1.2,c.height=h=window.innerHeight/1.5},!1)