Use the modern requestAnimationFrame API