Skip to content

Instantly share code, notes, and snippets.

@kusano
Created March 8, 2015 19:17
Show Gist options
  • Save kusano/7554ea7503dec3c53057 to your computer and use it in GitHub Desktop.
Save kusano/7554ea7503dec3c53057 to your computer and use it in GitHub Desktop.
!function(){
var R = 480;
document.querySelectorAll(".schedule_member_base_grn")[1].style.position="relative";
var p=document.querySelectorAll(".user-grn");
var n=p.length;
for (var i=0;i<n;i++) {
p[i].r = R*Math.sqrt(Math.random());
p[i].th = 2*Math.PI*Math.random();
p[i].style.position="absolute";
}
function render(){
var t=performance.now()/10000;
for (var i=0;i<n;i++) {
var th = 2*Math.PI*(i/n+t)+p[i].th;
p[i].style.top = p[i].r*Math.sin(th)+"px";
p[i].style.left = R-p[i].r*Math.cos(th)+"px";
}
requestAnimationFrame(render);
}
requestAnimationFrame(render);
}()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment