<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Enhanced Auth & Bypass</title>
    <base target="_top">
    <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap" rel="stylesheet">
    <style>
        body {
            font-family: 'Poppins', Arial, sans-serif;
            margin: 0;
            padding: 0;
            overflow: hidden;
            height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            color: #fff;
            background: radial-gradient(circle, #141e30, #243b55);
        }

        /* Animated particle background */
        canvas {
            position: absolute;
            top: 0;
            left: 0;
            z-index: -1;
        }

        #auth-banner, #main-content {
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 40px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 20px;
            box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(15px);
            transition: all 0.4s ease;
            width: 100%;
            max-width: 500px;
        }

        h1 {
            font-size: 28px;
            margin-bottom: 20px;
            color: #fff;
            text-align: center;
        }

        input[type="text"], input[type="url"] {
            width: 100%;
            padding: 15px;
            margin: 10px 0;
            border: 1px solid rgba(255, 255, 255, 0.3);
            border-radius: 12px;
            font-size: 16px;
            color: #fff;
            background: rgba(255, 255, 255, 0.1);
            transition: all 0.3s ease;
        }

        input[type="text"]::placeholder, input[type="url"]::placeholder {
            color: rgba(255, 255, 255, 0.7);
        }

        input[type="text"]:focus, input[type="url"]:focus {
            border-color: #4adeff;
            box-shadow: 0 0 15px rgba(74, 222, 255, 0.5);
            outline: none;
        }

        button {
            background: linear-gradient(135deg, #4adeff, #16c784);
            color: white;
            padding: 12px 20px;
            border: none;
            border-radius: 15px;
            cursor: pointer;
            font-size: 16px;
            margin-top: 20px;
            transition: background 0.4s ease, transform 0.3s ease;
            font-weight: 600;
        }

        button:hover {
            background: linear-gradient(135deg, #16c784, #4adeff);
            transform: scale(1.05);
            box-shadow: 0 5px 15px rgba(74, 222, 255, 0.5);
        }

        .error {
            color: #ff6b6b;
            margin-top: 10px;
            font-size: 14px;
            text-align: center;
        }

        a {
            color: #4adeff;
            font-size: 14px;
            text-decoration: none;
            margin-top: 20px;
        }

        a:hover {
            text-decoration: underline;
        }

        .button-container {
            display: flex;
            gap: 10px;
            justify-content: center;
            width: 100%;
            margin-top: 20px;
        }

        .button-container button {
            flex: 1;
        }

        #main-content {
            display: none;
        }

        #auth-banner.shown {
            animation: fadeIn 0.6s ease;
        }

        #main-content.shown {
            animation: fadeIn 0.6s ease;
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        window.onbeforeunload = function() {
   return 'Are you sure that you want to leave this page?';
};

        @media (max-width: 768px) {
            body {
                padding: 20px;
            }

            #auth-banner, #main-content {
                padding: 30px;
            }

            h1 {
                font-size: 24px;
            }

            button {
                padding: 10px 15px;
                font-size: 14px;
            }
        }
    </style>
</head>
<body>
    <canvas id="particleCanvas"></canvas>

    <div id="auth-banner" class="shown">
        <h1>🔒 Enter Your Auth Key</h1>
        <input type="text" id="authKey" placeholder="Enter your key...">
        <button onclick="validateKey()">Login</button>
        <p class="error" id="error-message"></p>
    </div>

    <div id="main-content">
        <h1>🌐 Website Bypasser</h1>
        <p>Enter the URL of the website to bypass:</p>
        <input type="url" id="myURL" placeholder="https://example.com" 
               onkeydown="if (event.keyCode == 13) document.getElementById('analyze').click()">
        <div class="button-container">
            <button id="analyze" onclick="download()">Analyze</button>
            <button id="analyze1" onclick="download1()">Advanced Analyze</button>
        </div>
        <p id="abc"></p>
        <p id="abc1"></p>
    </div>

    <script>
        // Particle effect background
        const canvas = document.getElementById('particleCanvas');
        const ctx = canvas.getContext('2d');
        const particlesArray = [];
        const colors = ['#4adeff', '#16c784', '#f39c12', '#e74c3c'];

        canvas.width = window.innerWidth;
        canvas.height = window.innerHeight;

        window.addEventListener('resize', () => {
            canvas.width = window.innerWidth;
            canvas.height = window.innerHeight;
        });

        class Particle {
            constructor(x, y, dx, dy, radius, color) {
                this.x = x;
                this.y = y;
                this.dx = dx;
                this.dy = dy;
                this.radius = radius;
                this.color = color;
            }

            draw() {
                ctx.beginPath();
                ctx.arc(this.x, this.y, this.radius, 0, Math.PI * 2, false);
                ctx.fillStyle = this.color;
                ctx.fill();
                ctx.closePath();
            }

            update() {
                if (this.x + this.radius > canvas.width || this.x - this.radius < 0) {
                    this.dx = -this.dx;
                }
                if (this.y + this.radius > canvas.height || this.y - this.radius < 0) {
                    this.dy = -this.dy;
                }

                this.x += this.dx;
                this.y += this.dy;

                this.draw();
            }
        }

        function initParticles() {
            particlesArray.length = 0;
            const numberOfParticles = Math.min(window.innerWidth / 10, 100);

            for (let i = 0; i < numberOfParticles; i++) {
                const radius = Math.random() * 3 + 1;
                const x = Math.random() * (canvas.width - radius * 2) + radius;
                const y = Math.random() * (canvas.height - radius * 2) + radius;
                const dx = (Math.random() - 0.5) * 2;
                const dy = (Math.random() - 0.5) * 2;
                const color = colors[Math.floor(Math.random() * colors.length)];
                particlesArray.push(new Particle(x, y, dx, dy, radius, color));
            }
        }

        function animateParticles() {
            requestAnimationFrame(animateParticles);
            ctx.clearRect(0, 0, canvas.width, canvas.height);

            particlesArray.forEach((particle) => particle.update());
        }

        initParticles();
        animateParticles();

        // Auth key validation
        const validKeys = ["Dias9872", "Otherppl"];
        function validateKey() {
            const enteredKey = document.getElementById('authKey').value.trim();
            const errorMessage = document.getElementById('error-message');

            if (validKeys.includes(enteredKey)) {
                document.getElementById('auth-banner').style.display = 'none';
                document.getElementById('main-content').style.display = 'flex';
            } else {
                errorMessage.textContent = "⛔ Wrong key. Please try again.";
            }
        }

        // Clear specific element message
        function clearMessage(id) {
            document.getElementById(id).textContent = "";
        }

        // Reset state after success
        function resetState() {
            clearMessage("abc");
            clearMessage("abc1");
        }

        // Main download function
        function download() {
            function onSuccess(download) {
                const a = document.createElement('a');
                const data = download[2] === 1 
                    ? new Uint8Array(download[0]) 
                    : download[0];
                const blob = new Blob([data], { type: download[1] });
                a.href = window.URL.createObjectURL(blob);
                a.download = `file.${download[1].split("/")[1].split(";")[0]}`;
                a.click();
                resetState();
            }

            function onFailure() {
                document.getElementById('abc').textContent = "⚠️ URL Error";
            }

            updateMessage("abc", "⏳ Bypassing...");
            clearMessage("abc1");

            if (typeof google !== 'undefined' && google.script && google.script.run) {
                google.script.run.withFailureHandler(onFailure)
                    .withSuccessHandler(onSuccess)
                    .fun1(document.getElementById('myURL').value);
            } else {
                console.error("google.script.run is not defined.");
            }
        }

        // Advanced analyze function
        function download1() {
            function onSuccess(download) {
                const a = document.createElement('a');
                const data = download[2] === 1 
                    ? new Uint8Array(download[0]) 
                    : download[0];
                const blob = new Blob([data], { type: download[1] });
                a.href = window.URL.createObjectURL(blob);
                a.download = `file.${download[1].split("/")[1].split(";")[0]}`;
                a.click();
                resetState();
            }

            function onFailure() {
                document.getElementById('abc1').textContent = "⚠️ Error";
            }

            updateMessage("abc1", "⏳ Advanced Analyzing...");
            clearMessage("abc");

            if (typeof google !== 'undefined' && google.script && google.script.run) {
                google.script.run.withFailureHandler(onFailure)
                    .withSuccessHandler(onSuccess)
                    .fun2(document.getElementById('myURL').value);
            } else {
                console.error("google.script.run is not defined.");
            }
        }

        // Update specific element message
        function updateMessage(id, message) {
            document.getElementById(id).textContent = message;
        }

        // Clear specific element message
        function clearMessage(id) {
            document.getElementById(id).textContent = "";
        }

    </script>
</body>
</html>
