|
| 1 | +<!DOCTYPE html> |
| 2 | +<html lang="en"> |
| 3 | +<head> |
| 4 | + <meta charset="UTF-8"> |
| 5 | + <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 6 | + <title>SML Archive</title> |
| 7 | + <link rel="stylesheet" href="styles.css"> <!-- Link to the external CSS file --> |
| 8 | + <style> |
| 9 | + .video-container { |
| 10 | + display: none; |
| 11 | + position: relative; |
| 12 | + padding-bottom: 56.25%; /* 16:9 aspect ratio (height divided by width) */ |
| 13 | + height: 0; |
| 14 | + overflow: hidden; |
| 15 | + } |
| 16 | + |
| 17 | + .video-container iframe { |
| 18 | + position: absolute; |
| 19 | + top: 0; |
| 20 | + left: 0; |
| 21 | + width: 100%; |
| 22 | + height: 100%; |
| 23 | + } |
| 24 | + |
| 25 | + section { |
| 26 | + text-align: center; |
| 27 | + } |
| 28 | + </style> |
| 29 | +</head> |
| 30 | +<body> |
| 31 | + <header> |
| 32 | + <img src="SML_new_logo.webp" alt="Channel Icon"> |
| 33 | + <h1>SML Archive</h1> |
| 34 | + </header> |
| 35 | + |
| 36 | + <nav> |
| 37 | + <!-- Navigation links --> |
| 38 | + <ul> |
| 39 | + <li><a href="#">Home</a></li> |
| 40 | + <li><a href="#">Videos</a></li> |
| 41 | + <li><a href="#">About</a></li> |
| 42 | + </ul> |
| 43 | + </nav> |
| 44 | + |
| 45 | + <main> |
| 46 | + <!-- Content of the channel page --> |
| 47 | + <section> |
| 48 | + <h2>Videos</h2> |
| 49 | + <!-- Embedded video with auto scaling --> |
| 50 | + <div class="video-container"> |
| 51 | + <iframe id="video-iframe" frameborder="0" allowfullscreen></iframe> |
| 52 | + </div> |
| 53 | + <p id="video-title" data-src="https://www.youtube.com/embed/6w8QkUBx0qc">SML Movie: Chef Pee Pee Quits Part 2</p> |
| 54 | + </section> |
| 55 | + </main> |
| 56 | + |
| 57 | + <footer> |
| 58 | + <p>© 2023 SML Archive. All rights reserved.</p> |
| 59 | + </footer> |
| 60 | + |
| 61 | + <script> |
| 62 | + window.addEventListener('DOMContentLoaded', function() { |
| 63 | + var videoContainer = document.querySelector('.video-container'); |
| 64 | + var videoIframe = document.getElementById('video-iframe'); |
| 65 | + var videoTitle = document.getElementById('video-title'); |
| 66 | + |
| 67 | + videoTitle.addEventListener('click', function() { |
| 68 | + if (!videoContainer.style.display || videoContainer.style.display === 'none') { |
| 69 | + var dataSrc = videoTitle.getAttribute('data-src'); |
| 70 | + videoIframe.setAttribute('src', dataSrc); |
| 71 | + videoContainer.style.display = 'block'; |
| 72 | + } |
| 73 | + }); |
| 74 | + }); |
| 75 | + </script> |
| 76 | +</body> |
| 77 | +</html> |
0 commit comments