use requestAnimationFrame()