HTMLify
knhrp
Views: 169 | Author: amar
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Countdown to Video</title> <style> body { display: flex; flex-direction: column; justify-content: center; align-items: center; height: 100vh; margin: 0; background: #000; color: #fff; font-family: Arial, sans-serif; } #countdown { font-size: 6rem; margin-bottom: 20px; } #video-container { display: none; width: 80%; max-width: 800px; box-shadow: 0 0 20px rgba(255,255,255,0.4); border-radius: 8px; overflow: hidden; } iframe { width: 100%; height: 450px; border: none; } button { margin-top: 10px; padding: 10px 20px; font-size: 1rem; border: none; border-radius: 4px; cursor: pointer; background: #1e90ff; color: #fff; } button:hover { background: #63b3ed; } </style> </head> <body> <div id="countdown">3</div> <button id="skip">Skip Countdown</button> <div id="video-container"> <iframe id="youtubeVideo" src="https://www.youtube.com/embed/sTaEwwHOzjc?autoplay=1" allow="autoplay; encrypted-media" allowfullscreen> </iframe> </div> <script> const countdownEl = document.getElementById('countdown'); const videoContainer = document.getElementById('video-container'); const skipButton = document.getElementById('skip'); let count = 3; let timer; function startCountdown() { timer = setInterval(() => { count--; if (count > 0) { countdownEl.textContent = count; } else { endCountdown(); } }, 1000); } function endCountdown() { clearInterval(timer); countdownEl.style.display = 'none'; skipButton.style.display = 'none'; videoContainer.style.display = 'block'; } skipButton.addEventListener('click', endCountdown); startCountdown(); </script> </body> </html> |