const box = document.getElementById('scroll') let x, y, z function init(){ x = 0 y = 0 z = 0 AnimateSkybox() } function AnimateSkybox(){ x += 0.2 y = window.innerHeight / 2.2 z += 0.2 box.style.backgroundPosition = x + "px " + y + "px" requestAnimationFrame(AnimateSkybox) } init()