<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title> For My Loveπ</title> <style> body { font-family: Tahoma, sans-serif; text-align: center; background-image: url('keje/1.jpeg'); background-size: cover; /* Ensures the image covers the entire screen */ background-position: center center; /* Centers the image horizontally and vertically */ background-repeat: no-repeat; /* Prevents the image from repeating */ margin: 0; padding: 0; height: 100vh; /* Ensures the body takes up the full height of the viewport */ } .popup { display: none; position: fixed; width: 90%; /* Adjust width for smaller screens */ max-width: 300px; height: auto; background: #C0C0C0; color: black; padding: 10px; border: 2px solid black; box-shadow: 5px 5px black; font-size: 14px; text-align: center; } .popup-header { position: relative; /* Ensures the close button positions correctly */ background: navy; /* Keeps the navy background */ color: white; padding: 8px; text-align: center; font-weight: bold; } .close-btn { position: absolute; top: 50%; right: 10px; transform: translateY(-50%); font-size: 16px; font-weight: bold; cursor: pointer; color: white; background: transparent; /* Transparent background to blend with navy */ border: none; outline: none; } .close-btn:hover { color: red; /* Change color on hover for better UX */ } .popup-content { padding: 10px; } .popup img { width: 60%; /* Make images scale properly */ max-width: 100px; height: auto; margin-bottom: 10px; } .popup button { background: linear-gradient(to bottom, #e0e0e0, #b0b0b0); border: 1px solid #666; padding: 10px 16px; margin: 5px; cursor: pointer; font-size: 14px; font-weight: bold; border-radius: 5px; box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2); transition: all 0.2s ease-in-out; touch-action: manipulation; /* Improves mobile touch responsiveness */ } .popup button:hover { background: linear-gradient(to bottom, #cfcfcf, #a0a0a0); box-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3); } .popup button:active, .popup button:focus { background: #999; box-shadow: inset 2px 2px 4px rgba(0, 0, 0, 0.3); transform: scale(0.98); /* Slightly shrink button on tap */ } .popup:nth-child(1) { top: 10%; left: 5%; } .popup:nth-child(2) { top: 10%; right: 5%; } .popup:nth-child(3) { bottom: 10%; left: 5%; } .popup:nth-child(4) { bottom: 10%; right: 5%; } .popup:nth-child(5) { top: 50%; left: 50%; transform: translate(-50%, -50%); background: #C0C0C0; } #finalPopup { display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 90%; max-width: 400px; background: #C0C0C0; color: black; padding: 20px; border: 2px solid black; box-shadow: 5px 5px black; text-align: center; } /* Mobile View: Adjust popups for smaller screens */ @media screen and (max-width: 600px) { .popup { width: 90%; max-width: 280px; font-size: 12px; padding: 8px; } .popup img { width: 50%; max-width: 80px; } .popup button { padding: 6px 10px; font-size: 12px; color: black; } #finalPopup { width: 90%; max-width: 350px; padding: 15px; } .popup:nth-child(1) { top: 5%; left: 50%; transform: translateX(-50%); } .popup:nth-child(2) { top: 20%; left: 50%; transform: translateX(-50%); } .popup:nth-child(3) { bottom: 20%; left: 50%; transform: translateX(-50%); } .popup:nth-child(4) { bottom: 5%; left: 50%; transform: translateX(-50%); } .popup:nth-child(5) { top: 5%; left: 50%; transform: translateX(-50%); } /* .popup:nth-child(5) { top: 50%; left: 50%; transform: translate(-50%, -50%); background: #C0C0C0; width: 90%; max-width: 350px; } */ } @keyframes zoomIn { from { transform: scale(0.5); opacity: 0; } to { transform: scale(1); opacity: 1; } } </style> <script> function closePopup(element) { element.parentElement.parentElement.style.display = 'none'; } </script> </head> <body> <h1 style="color: white;"></h1> <div class="popup"> <div class="popup-header"> System Alert <!-- <span class="close-btn" onclick="closePopup(this)">β</span> --> </div> <div class="popup-content"> <img src="keje/2.jpeg" alt="Alert"> <p>Kalau awak hebat cuba tangkap saya π</p> <button onclick="showNext(1)">Tak Mahu</button> <button onclick="showNext(1)">Tangkap</button> </div> </div> <div class="popup"> <div class="popup-header">System Alert</div> <div class="popup-content"> <img src="keje/3.jpeg" alt="Warning"> <p>Uwekk tk kira mahu ke tak, tangkap saya jugook πππ</p> <button onclick="showNext(2)">Give Up</button> <button onclick="showNext(2)">Cuba Lagi</button> </div> </div> <div class="popup"> <div class="popup-header">System Alert</div> <div class="popup-content"> <img src="keje/9.jpeg" alt="Caution" > <p>Takkn dah giveup π, tak dapat nyenyenye π€‘</p> <!-- <button onclick="showNext(3)">Tak Nak</button> --> <button onclick="showNext(3)">Usaha Tangga Kejayaanπ€</button> </div> </div> <div class="popup"> <div class="popup-header">System Alert</div> <div class="popup-content"> <img src="keje/6.jpeg" alt="Happy Birthday"> <p>Ma lob mmg amat cemerlang!ππ</p> <button onclick="showNext(4)">Mestilah π«£</button> </div> </div> <div class="popup" id="finalPopup"> <div class="popup-header">Final Alert</div> <div class="popup-content"> <img src="keje/8.png" alt="Notice" style="width: 150px; height: auto; max-width: 100%;"> <p>π«Άπ₯°π</p> <button onclick="playSong()">Hadiah π</button> <!-- <button onclick="playSong()">Click Me</button> --> </div> </div> <audio id="birthdaySong" src="Besday.mp3"></audio> <script src="https://cdn.jsdelivr.net/npm/canvas-confetti@1.3.2/dist/confetti.browser.min.js"></script> <script> let currentPopup = 0; document.querySelectorAll('.popup')[0].style.display = 'block'; function showNext(index) { document.querySelectorAll('.popup')[index - 1].style.display = 'none'; if (index < 5) { document.querySelectorAll('.popup')[index].style.display = 'block'; } } function playSong() { let audio = document.getElementById('birthdaySong'); let finalPopup = document.getElementById('finalPopup'); // Start playing the song audio.play().then(() => { console.log("Audio started playing"); }).catch(error => { console.log("Audio play blocked:", error); }); // Show the final popup with transparency finalPopup.style.display = 'block'; finalPopup.style.background = "rgba(192, 192, 192, 0.8)"; finalPopup.style.backdropFilter = "blur(5px)"; finalPopup.style.animation = "fadeIn 1s ease-in-out"; // Smooth appearance // Set the content inside the popup finalPopup.innerHTML = ` <div class="popup-header" style="background: rgba(0, 0, 128, 0.8); color: white;">π Happy Birthday Sayangku! π <span class="close-btn" onclick="closePopup(this)">β</span> </div> <div class="popup-content"> <img src="keje/10.png" alt="Birthday Celebration" style="width: 200px; height: auto; max-width: 100%;"> <p style="color: black;">Happy Birthday, sayang! Hari ini bukan sekadar hari lahir awak, tapi juga hari yang mengingatkan betapa berharganya awak dalam hidup saya. Every smile you give, every laugh you share, semuanya adalah cahaya yang menerangi dunia saya. Jangan penat nak layan perangai saya, sebab no matter what, my love for you will never fade. Saya sayang awak lebih dari apa yang kata-kata mampu ungkapkan, lebih dari apa yang masa boleh hitung. I love you in the deepest, purest way beyond words, beyond time. Semoga setiap impian awak menjadi kenyataan, and I'll always be by your side to love and cherish you, today and forever. πβ¨</p> </div> `; // Fireworks & Confetti Effect launchFireworks(); } function launchFireworks() { // Create multiple bursts of confetti let duration = 3 * 1000; // 3 seconds let animationEnd = Date.now() + duration; let interval = setInterval(() => { if (Date.now() > animationEnd) { return clearInterval(interval); } // Fire confetti in different directions confetti({ particleCount: 50, spread: 70, origin: { x: Math.random(), y: Math.random() * 0.6 } }); }, 300); } document.addEventListener("DOMContentLoaded", function() { let buttons = document.querySelectorAll(".popup button"); buttons.forEach(button => { button.addEventListener("touchstart", function() { this.style.background = "linear-gradient(to bottom, #cfcfcf, #a0a0a0)"; this.style.boxShadow = "3px 3px 6px rgba(0, 0, 0, 0.3)"; }); button.addEventListener("touchend", function() { this.style.background = "linear-gradient(to bottom, #e0e0e0, #b0b0b0)"; this.style.boxShadow = "2px 2px 5px rgba(0, 0, 0, 0.2)"; }); }); }); </script> </body> </html>