Refactor scrolling animation to use requestAnimationFrame() instead of setInterval()