<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Social Media Links</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #000000;
            color: #FFFFFF;
            margin: 0;
            padding: 0;
        }
        a {
            color: #00CED1; /* Dark Turquoise */
            text-decoration: none;
        }
        a:hover {
            color: #FFD700; /* Gold */
        }
        .top-right {
            position: absolute;
            top: 20px;
            right: 20px;
            font-size: 2em;
        }
        .cookie-banner {
            position: absolute;
            bottom: 0;
            width: 100%;
            background-color: rgba(0, 0, 0, 0.8);
            color: #fff;
            padding: 10px;
            text-align: center;
            font-size: 1.2vw;
        }
        .cookie-banner a {
            color: #00CED1;
            text-decoration: underline;
        }
        .button {
            background-color: #d1ff00;
            color: #000;
            padding: 10px 20px;
            text-decoration: none;
            border-radius: 5px;
            margin-left: 10px;
        }
        .modal {
            display: none;
            position: fixed;
            z-index: 1;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            overflow: auto;
            background-color: rgba(0, 0, 0, 0.5);
            justify-content: center;
            align-items: center;
        }
        .modal-content {
            background-color: #000;
            padding: 20px;
            border: 1px solid #444;
            width: 80%;
            max-width: 600px;
            color: #fff;
            text-align: center;
        }
        .close {
            color: #AAA;
            float: right;
            font-size: 28px;
            font-weight: bold;
        }
        .close:hover,
        .close:focus {
            color: #fff;
            text-decoration: none;
            cursor: pointer;
        }
        .video-list {
            text-align: left;
        }
    </style>
</head>
<body>
    <script>
    (function() {
        var devtools = /./;
        devtools.toString = function() {
            this.opened = true;
            showWarning();
        };

        function showWarning() {
            document.body.innerHTML = "<h1 style='color: red; text-align: center;'>Please do not open DevTools!</h1>";
        }

        console.log('%c ', devtools);
        
        setInterval(function() {
            if (devtools.opened) {
                devtools.opened = false; // reset the flag
            }
        }, 1000);

        window.addEventListener('blur', function() {
            setTimeout(function() {
                if (devtools.opened) {
                    showWarning();
                }
            }, 200);
        });
    })();
</script>
    <a href="https://sneakonbrowsers.github.io" class="top-right">X</a>
    <h1>Social Media</h1>
    <div>
        <a href="https://reddit.com/r/sneakon">Reddit</a><br>
        <a href="https://discord.gg/vGWcC4hYxC">Discord</a><br>
        <a href="#" onclick="showVideoModal();">YouTube</a>
    </div>
    <div class="cookie-banner">
        <p>We use cookies to improve your experience. By using our site, you agree to our use of cookies. 
            <a href="#">Learn more</a>.
            <a href="#" class="button" onclick="acceptCookies();">Accept</a>
        </p>
    </div>

    <!-- Video Modal -->
    <div id="video-modal" class="modal">
        <div class="modal-content">
            <span class="close" onclick="closeVideoModal();">&times;</span>
            <p>Videos from Sneakon YouTube Channel:</p>
            <div id="video-list" class="video-list"></div>
        </div>
    </div>

    <script>
        function showVideoModal() {
            fetchVideos();
            var modal = document.getElementById('video-modal');
            modal.style.display = "flex";
        }

        function closeVideoModal() {
            var modal = document.getElementById('video-modal');
            modal.style.display = "none";
        }

        function fetchVideos() {
            var apiKey = 'AIzaSyBPE7244usOc7NzYN9Cr9QEGl05qLTgqbc';
            var channelId = 'UCDX9rOVFOyU7C6478vXwevg'; // Replace this with the actual channel ID for @SneakonBrowsers
            var url = `https://www.googleapis.com/youtube/v3/search?key=${apiKey}&channelId=${channelId}&part=snippet&type=video&order=date&maxResults=10`;

            fetch(url)
                .then(response => response.json())
                .then(data => {
                    var videoList = document.getElementById('video-list');
                    videoList.innerHTML = '';
                    data.items.forEach(item => {
                        var videoItem = document.createElement('div');
                        videoItem.innerHTML = `<p>${item.snippet.title}</p><a href="https://www.youtube.com/watch?v=${item.id.videoId}" target="_blank">Watch on YouTube</a>`;
                        videoList.appendChild(videoItem);
                    });
                })
                .catch(error => {
                    console.error('Fetching YouTube videos failed:', error);
                });
        }

        function acceptCookies() {
            var cookieBanner = document.querySelector('.cookie-banner');
            cookieBanner.style.display = 'none';
        }
        </script>
</body>
</html>