Dashboard Temp Share Shortlinks Frames API

HTMLify

Miku
Views: 492 | 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
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<!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>