dots=[] TAU = Math.PI * 2;
angle = 0; speed = 0.01;
for(o = 0; o < 120; o++){
d = document.createElement("div");
d.id = "bn"+o;
d.style.position = "absolute";
d.innerHTML = "•";
document.body.appendChild(d);
dots.push(d);
}
function anim(){
angle+=speed;
cosA = Math.cos(angle);
sinA = Math.sin(angle);
for(o = 0; o < 120; o++){
t = (o/120)*TAU;
x = 6*16*Math.pow(Math.sin(t), 3);
y = -6*(13*Math.cos(t)-5*Math.cos(2*t)-2*Math.cos(3*t)-Math.cos(4*t));
xr = x*cosA - y*sinA;
yr = x*sinA + y*cosA;
dots[o].style.left = (xr+window.innerWidth/2)+"px";
dots[o].style.top = (yr+window.innerHeight/2)+"px";
}
requestAnimationFrame(anim)
}anim();