use window.animationFrame