particle.style.top = Math.random() * window.innerHeight + 'px'; document.body.appendChild(particle); setTimeout(() => { if (document.body.contains(particle)) { document.body.removeChild(particle); } }, 3000); }, i * 80); } } function createLalalaEffect() { const lalalaEmojis = ['🎡', '🎢', '🌈', 'πŸ’«', '✨', '⭐', '🌟']; for (let i = 0; i < 15; i++) { setTimeout(() => { const particle = document.createElement('div'); particle.className = 'lalala-particle'; particle.textContent = lalalaEmojis[Math.floor(Math.random() * lalalaEmojis.length)]; particle.style.left = Math.random() * window.innerWidth + 'px'; particle.style.top = Math.random() * window.innerHeight + 'px'; document.body.appendChild(particle); setTimeout(() => { if (document.body.contains(particle)) { document.body.removeChild(particle); } }, 2800); }, i * 120); } } function createKingEffect() { const kingEmojis = ['πŸ‘‘', 'πŸ’Ž', 'πŸ”±', '⚑', 'πŸ†', '✨', 'πŸ’«', '🌟']; for (let i = 0; i < 18; i++) { setTimeout(() => { const particle = document.createElement('div'); particle.className = 'king-particle'; particle.textContent = kingEmojis[Math.floor(Math.random() * kingEmojis.length)]; particle.style.left = Math.random() * window.innerWidth + 'px'; particle.style.top = Math.random() * window.innerHeight + 'px'; particle.style.color = `hsl(${Math.random() * 60 + 320}, 90%, 70%)`; // Red-gold colors document.body.appendChild(particle); setTimeout(() => { if (document.body.contains(particle)) { document.body.removeChild(particle); } }, 3200); }, i * 90); } } function createBirthdayEffect() { const birthdayEmojis = ['πŸŽ‚', 'πŸ•―οΈ', 'πŸŽ‰', '🎊', '🎈', '🎁', 'πŸ₯³', '🎭']; for (let i = 0; i < 16; i++) { setTimeout(() => { const particle = document.createElement('div'); particle.className = 'birthday-particle'; particle.textContent = birthdayEmojis[Math.floor(Math.random() * birthdayEmojis.length)]; particle.style.left = Math.random() * window.innerWidth + 'px'; particle.style.top = Math.random() * window.innerHeight + 'px'; particle.style.color = `hsl(${Math.random() * 360}, 85%, 65%)`; document.body.appendChild(particle); setTimeout(() => { if (document.body.contains(particle)) { document.body.removeChild(particle); } }, 3500); }, i * 110); } } function createWindEffect() { const windEmojis = ['πŸ’¨', 'πŸŒͺ️', 'πŸƒ', '🌿', '🌬️', '☁️', '🌀️', 'πŸ’š']; for (let i = 0; i < 12; i++) { setTimeout(() => { const particle = document.createElement('div'); particle.className = 'wind-particle'; particle.textContent = windEmojis[Math.floor(Math.random() * windEmojis.length)]; particle.style.left = Math.random() * window.innerWidth + 'px'; particle.style.top = Math.random() * window.innerHeight + 'px'; document.body.appendChild(particle); setTimeout(() => { if (document.body.contains(particle)) { document.body.removeChild(particle); } }, 2500); }, i * 150); } } function createGumEffect() { const gumEmojis = ['🍬', '🍭', 'πŸ’—', 'πŸ’–', 'πŸ’•', '🌸', '🎈', '🧚']; for (let i = 0; i < 10; i++) { setTimeout(() => { const particle = document.createElement('div'); particle.className = 'gum-particle'; particle.textContent = gumEmojis[Math.floor(Math.random() * gumEmojis.length)]; particle.style.left = Math.random() * window.innerWidth + 'px'; particle.style.top = Math.random() * window.innerHeight + 'px'; particle.style.color = `hsl(${Math.random() * 60 + 300}, 85%, 70%)`; // Pink colors document.body.appendChild(particle); setTimeout(() => { if (document.body.contains(particle)) { document.body.removeChild(particle); } }, 2200); }, i * 180); } } function createCelebrationParticles() { const celebrations = ['πŸŽ‰', '🎊', '🍰', 'πŸ‘‘', 'πŸŽ‚', '🌈', 'πŸ’«', 'πŸ†', '✨', '🌟', '🎈', 'πŸ₯³']; for (let i = 0; i < 60; i++) { setTimeout(() => { const particle = document.createElement('div'); particle.className = 'particle'; particle.textContent = celebrations[Math.floor(Math.random() * celebrations.length)]; particle.style.left = Math.random() * window.innerWidth + 'px'; particle.style.top = Math.random() * window.innerHeight + 'px'; particle.style.color = `hsl(${Math.random() * 360}, 90%, 70%)`; document.body.appendChild(particle); setTimeout(() => { if (document.body.contains(particle)) { document.body.removeChild(particle); } }, 4000); }, i * 60); } } function showComboEffect() { const comboDisplay = document.getElementById('comboDisplay'); const messages = [ `${gameState.combo} COMBO! CAKE!`, `${gameState.combo} COMBO! SWEET!`, `${gameState.combo} COMBO! LALALA!`, `${gameState.combo} COMBO! KING!`, `${gameState.combo} COMBO! BIRTHDAY!` ]; comboDisplay.textContent = messages[Math.floor(Math.random() * messages.length)]; comboDisplay.classList.add('show'); setTimeout(() => { comboDisplay.classList.remove('show'); }, 2000); } function showAchievement(text) { const toast = document.getElementById('achievementToast'); const textElement = document.getElementById('achievementText'); textElement.textContent = text; toast.classList.add('show'); setTimeout(() => { toast.classList.remove('show'); }, 5000); } // Initialize on load document.addEventListener('DOMContentLoaded', initGame); // Console Easter Egg console.log('%c🍰 Cake Typing Master πŸ‘‘', 'font-size: 24px; font-weight: bold; color: #FFB6C1;'); console.log('%cIt\'s a piece of cake! μ™• ν•˜κ³  먹어버렀! 🌈', 'font-size: 14px; color: #DC143C;');