HTMLify

Miku
Views: 48 | Author: amar
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Language Preference</title>
    <style>
        /* Fullscreen Miku GIF as Background */
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            margin: 0;
            height: 100vh;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            color: white;
            background: url('https://media1.tenor.com/m/tdcTLzCqIEMAAAAC/miku-hatsune-miku.gif') no-repeat center center fixed;
            background-size: cover;
        }

        h1 {
            margin-bottom: 20px;
            align-items: center;
            font-size: 2.5em;
            text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
        }

        button {
            padding: 12px 25px;
            font-size: 1.2em;
            cursor: pointer;
            border: none;
            border-radius: 10px;
            background-color: #00a2ff;
            color: white;
            transition: all 0.3s ease;
        }

        button:hover {
            background-color: #00d0ff;
            transform: scale(1.12);
        }

        /* Modal Styles */
        .modal {
            display: none; 
            position: fixed; 
            z-index: 1; 
            left: 0;
            top: 0;
            width: 100%; 
            height: 100%; 
            background-color: rgba(0, 0, 0, 0.8); /* Dark overlay */
        }

        .modal-content {
            background-color: #f1faff;
            margin: 10% auto;
            padding: 20px;
            border-radius: 15px;
            width: 80%;
            max-width: 900px;
            border: 1px solid #00a2ff;
        }

        span {
            color: #00a2ff;
            font-size: 1.5em;
            float: right;
            cursor: pointer;
        }

        span:hover {
            color: #ff7ebd;
        }

        iframe {
            width: 100%;
            height: 400px;
            border-radius: 10px;
        }

        footer {
            background-color: rgba(0, 0, 0, 0.473);
            width: 100%;
            text-align: center;
            padding: 10px 0;
            position: absolute;
            bottom: 0;
            font-size: 1em;
            color: #00ffdd;
        }
    </style>
</head>
<body>   <div> 

    <h1>Which one would be easier for you, English or Japanese?</h1>


    </div>
    <table>
        <tr>
            <td><button onclick="playVideo('english')">English</button></td>
            <td><button onclick="playVideo('japanese')">Japanese</button></td>
        </tr>
    </table>

    <div id="videoModal" class="modal">
        <div class="modal-content">
            <span onclick="closeModal()">&times;</span>
            <div id="videoContainer"></div>
        </div>
    </div>

    <footer>
        Code by amar with ChatGPT
    </footer>

 
    <script>
        function playVideo(language) {
            const videoContainer = document.getElementById('videoContainer');
            videoContainer.innerHTML = ''; // Clear previous video
            
            let videoUrl;
            if (language === 'english') {
                videoUrl = 'https://www.youtube.com/embed/tohDycgc-H8?start=25&autoplay=1'; // English video starts at 25 seconds
            } else if (language === 'japanese') {
                videoUrl = 'https://www.youtube.com/embed/5qkTpJAhywg?start=26&autoplay=1'; // Japanese video starts at 26 seconds
            }

            // Create an iframe for the video
            const iframe = document.createElement('iframe');
            iframe.src = videoUrl;
            iframe.frameBorder = '0';
            iframe.allow = 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture';
            iframe.allowFullscreen = true;

            videoContainer.appendChild(iframe); // Add the iframe to the container
            
            // Show the modal
            document.getElementById('videoModal').style.display = "block";
        }

        function closeModal() {
            document.getElementById('videoModal').style.display = "none"; // Hide the modal
            document.getElementById('videoContainer').innerHTML = ''; // Clear the video when closing
        }

        // Close the modal when clicking outside of it
        window.onclick = function(event) {
            const modal = document.getElementById('videoModal');
            if (event.target === modal) {
                closeModal();
            }
        }
    </script>

</body>
</html>

Comments