You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
274 B
17 lines
274 B
4 months ago
|
const box = document.getElementById('scroll')
|
||
|
let x, y
|
||
|
|
||
|
function init(){
|
||
|
x = 0
|
||
|
y = 0
|
||
|
AnimateSkybox()
|
||
|
}
|
||
|
|
||
|
function AnimateSkybox(){
|
||
|
x += 0.2
|
||
|
y = window.innerHeight / 2.2
|
||
|
box.style.backgroundPosition = x + "px " + y + "px"
|
||
|
requestAnimationFrame(AnimateSkybox)
|
||
|
}
|
||
|
|
||
|
init()
|