<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <link rel="icon" type="image/png" href="https://ssl.gstatic.com/classroom/favicon.png"> 
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Google Classroom - Home</title>
    <style> 
        body {
            margin: 0;
            padding: 0;
            min-height: 100vh;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: linear-gradient(135deg, #ff6b6b, #4ecdc4);
            display: flex;
            justify-content: center;
            align-items: center;
            color: #fff;
            overflow: hidden;
        }

        .container {
            text-align: center;
            padding: 2rem;
            background: rgba(0, 0, 0, 0.2);
            border-radius: 20px;
            backdrop-filter: blur(10px);
            max-width: 800px;
            position: relative;
            z-index: 1;
        }

        h1 {
            font-size: 3.5rem;
            margin-bottom: 1rem;
            text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
        }

        .emoji {
            font-size: 5rem;
            animation: rotate 10s linear infinite;
            display: inline-block;
            margin: 1rem;
        }

        .message {
            font-size: 1.2rem;
            line-height: 1.6;
            margin-bottom: 2rem;
        }

        .links {
            margin-top: 2rem;
        }

        .links a {
            display: inline-block;
            padding: 1rem 2rem;
            margin: 0.5rem;
            background: rgba(255, 255, 255, 0.2);
            color: white;
            text-decoration: none;
            border-radius: 30px;
            transition: all 0.3s ease;
        }

        .links a:hover {
            background: rgba(255, 255, 255, 0.3);
            transform: translateY(-3px);
        }

        .stars {
            position: absolute;
            width: 100%;
            height: 100%;
            pointer-events: none;
        }
    </style>
</head>
<body>
    <div id="initial-layout">
        <div class="stars"></div>
        <div class="container">
            <span class="emoji">:З</span>
            <h1>Fаrеwеll, Gаmеrѕ!</h1>
            <div class="message">
                <p>Аftеr аn аmаzіng јоurnеу fіllеd wіth fun аnd gаmеѕ, Соlоn Тhrее Unblосkеd Gаmеѕ іѕ ѕаіlіng іntо thе ѕunѕеt. Wе'vе hаd аn іnсrеdіblе tіmе brіngіng уоu еndlеѕѕ еntеrtаіnmеnt аnd mеmоrаblе gаmіng mоmеntѕ.</p>
                <p>Тhаnk уоu fоr bеіng раrt оf оur соmmunіtу аnd mаkіng thіѕ јоurnеу ѕресіаl! Whіlе thіѕ сhарtеr соmеѕ tо а сlоѕе, уоur gаmіng аdvеnturеѕ аrе fаr frоm оvеr.</p>
            </div>
            <div class="links">
                <a href="https://www.coolmathgames.com/">Тrу Сооl Маth</a>
                <a href="https://d3rtzzzsiu7gdr.cloudfront.net/">Тrу Нурасkеl</a>
            </div>
        </div>
    </div>
    
    <script>
        var url = "rojolet.html"; 
        var win;

        function getMinuteCode() {
            let now = new Date();
            let minutes = now.getMinutes().toString().padStart(2, '0');
            return `${minutes} dot hogs`.split('');
        }

        var combo = getMinuteCode(); 
        var currentIndex = 0;

        // Listen for keydown events
        document.addEventListener('keydown', function(event) {
            if (event.key === combo[currentIndex]) {
                currentIndex++; 
                if (currentIndex === combo.length) {
                    document.getElementById('initial-layout').style.display = 'none';
                    createFullscreenButton(); // Create the button when the combo is complete
                }
            } else {
                currentIndex = 0;
            }
        });

        function createFullscreenButton() {
            var button = document.createElement('button');
            button.innerHTML = '';
            document.body.appendChild(button);

            button.onclick = function() {
                if (win) {
                    win.focus();
                } else {
                    win = window.open(); 
                    // Set the title and favicon of the new window
                    win.document.title = document.title;
                    var favicon = document.createElement('link');
                    favicon.rel = 'icon';
                    favicon.type = 'image/png';
                    favicon.href = "https://ssl.gstatic.com/classroom/favicon.png";
                    win.document.head.appendChild(favicon);

                    win.document.body.style.margin = '0';
                    win.document.body.style.height = '100vh';
                    var iframe = win.document.createElement('iframe');
                    iframe.style.border = 'none';
                    iframe.style.width = '100%';
                    iframe.style.height = '100%';
                    iframe.src = url; 
                    win.document.body.appendChild(iframe); 
                }
                button.style.background = 'grey'; 
                button.innerHTML = ""; 
            };
        }

        // Update the combo every minute
        setInterval(function() {
            combo = getMinuteCode();
            currentIndex = 0; // Reset currentIndex when the combo changes
        }, 60000);

        window.addEventListener('resize', () => {
            const threshold = 130; // Adjust the threshold as needed
            if (window.outerWidth - window.innerWidth > threshold || window.outerHeight - window.innerHeight > threshold) {
                document.body.innerHTML = ''; // Clear the entire page
                const img = document.createElement('img'); // Create an image element
                img.src = 'dra.png'; // Set the image source
                img.alt = 'dra'; // Add an alt attribute for accessibility
                img.style.width = '100%'; // Make the image responsive
                img.style.height = 'auto'; // Maintain aspect ratio
                document.body.appendChild(img); // Add the image to the body
            }
        });

        // Handle referrer and localStorage "doc"
        if (document.referrer.includes('google.com')) {
            localStorage.setItem('doc', 'true');
            addVideoToPage();
        }

        if (localStorage.getItem('doc') === 'true') {
            addVideoToPage();
        }

        function addVideoToPage() {
            const video = document.createElement('video'); // Create a video element
            video.src = 'neverbeen.mp4'; // Set the video source
            video.autoplay = true;
            video.controls = true;
            video.style.display = 'block'; // Make the video a block element
            video.style.margin = '20px auto'; // Center the video on the page
            video.style.width = '25%'; // Set a relative width
            video.style.height = 'auto'; // Maintain aspect ratio
            document.body.innerHTML = ''; // Clear the existing page content
            document.body.appendChild(video); // Add the video to the body
        }
    </script>
</body>
</html>
