// Parallax mouse movement document.addEventListener("mousemove", function(e) { let x = (e.clientX / window.innerWidth - 0.5) * 30; document.getElementById("dune1").style.transform = "translateX(calc(-25% + " + x + "px))"; document.getElementById("dune2").style.transform = "translateX(calc(-25% + " + x*1.5 + "px))"; });
// Create stars let starsContainer = document.getElementById("stars"); for (let i = 0; i < 150; i++) { let star = document.createElement("div"); star.classList.add("star"); star.style.top = Math.random() * 100 + "%"; star.style.left = Math.random() * 100 + "%"; starsContainer.appendChild(star); } // Create floating dust for (let i = 0; i < 40; i++) { let dust = document.createElement("div"); dust.classList.add("dust"); dust.style.left = Math.random() * 100 + "%"; dust.style.bottom = Math.random() * 100 + "px"; dust.style.animationDuration = (5 + Math.random() * 10) + "s"; document.body.appendChild(dust); } let nightMode = false; function toggleDayNight() { let sky = document.getElementById("sky"); let sun = document.getElementById("sun"); let stars = document.querySelectorAll(".star"); nightMode = !nightMode; if (nightMode) { sky.classList.add("night"); sun.classList.add("moon"); stars.forEach(star => star.classList.add("visible")); } else { sky.classList.remove("night"); sun.classList.remove("moon"); stars.forEach(star => star.classList.remove("visible")); } }
