Vücut Çorabı

document.addEventListener("DOMContentLoaded", function() { /* ------------------------------- Yaprak / Kar / Çiçek Efekti ------------------------------- */ function createLeaf(symbol, duration) { const leaf = document.createElement("div"); leaf.innerText = symbol; leaf.style.position = "fixed"; leaf.style.left = Math.random() * window.innerWidth + "px"; leaf.style.top = "-30px"; leaf.style.fontSize = (20 + Math.random() * 10) + "px"; leaf.style.opacity = 0.8; leaf.style.animation = `falling ${duration}s linear forwards`; document.body.appendChild(leaf); setTimeout(() => { leaf.remove(); }, duration * 1000); } const month = new Date().getMonth(); // 0=Ocak, 11=Aralık let symbol = "🌸"; let interval = 2000; let duration = 6; let audioSrc = ""; if(month >= 2 && month <= 4){ // İlkbahar symbol = "🌸"; interval = 2000; duration = 6; audioSrc = "https://www.fesliyanstudios.com/play-mp3/387"; // Kuş cıvıltısı } else if(month >= 5 && month <= 7){ // Yaz symbol = "🌿"; interval = 2500; duration = 7; audioSrc = "https://www.fesliyanstudios.com/play-mp3/653"; // Dalga sesi } else if(month >= 8 && month <= 10){ // Sonbahar symbol = "🍂"; interval = 1000; duration = 5; audioSrc = "https://www.fesliyanstudios.com/play-mp3/3877"; // Yaprak hışırtısı } else { // Kış symbol = "❄️"; interval = 3000; duration = 8; audioSrc = "https://www.fesliyanstudios.com/play-mp3/3878"; // Ateş çıtırtısı } setInterval(() => createLeaf(symbol, duration), interval); const style = document.createElement("style"); style.innerHTML = ` @keyframes falling { 0% { transform: translateY(0) rotate(0deg); opacity: 1; } 100% { transform: translateY(${window.innerHeight}px) rotate(360deg); opacity: 0; } } `; document.head.appendChild(style); /* ------------------------------- Mevsime Göre Ses Efekti ------------------------------- */ if(audioSrc){ const audio = document.createElement("audio"); audio.src = audioSrc; audio.loop = true; audio.volume = 0.1; // Kısık ses document.body.appendChild(audio); // Tarayıcı kısıtlaması: kullanıcı etkileşiminden sonra başlat document.body.addEventListener("click", () => { audio.play(); }, { once: true }); } });