I have a scroll animation for the clouds but the animation should be reversed. How its working now is that it dissapears when its all the way scrolled up but it needs to be the other way around. www.wytsepunter.com (also its very laggy on phone any tips for making that smoother?)
Here is the code:
let bg = document.getElementById('bg');
let moon = document.getElementById('moon');
let rock = document.getElementById('rock');
let clouds = document.getElementById('clouds');
let text = document.getElementById('text');
window.addEventListener('scroll', function (){
var value = window.scrollY;
bg.style.top = value + 0.5 + 'px';
moon.style.left = value * 0.5 + 'px';
clouds.style.top = value * 0.5 + 'px';
clouds.style.opacity = value * 0.5 + '%';
text.style.top = value * 1 + 'px';