add a render loop using requestAnimationFrame