port animations from setTimeout to requestAnimationFrame