<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Benji</title>
    <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap" rel="stylesheet">
    <style>
        body {
            font-family: 'Poppins', sans-serif;
            margin: 0;
            padding: 0;
            background-color: #0c0c0c;
            color: #fff;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            padding: 20px;
            box-sizing: border-box;
        }
        .main {
            display: flex;
            flex-direction: column;
            width: 100%;
            max-width: 1200px;
            align-items: center;
            opacity: 0;
            animation: fadeIn 1s ease-in-out forwards;
        }
        @keyframes fadeIn { 0% { opacity: 0; } 100% { opacity: 1; } }
        h1 { font-size: 2rem; margin-bottom: 10px; color: #fff; }
        
        /* Tabs Style */
        .tabs {
            display: flex;
            width: 100%;
            background-color: #101010;
            border-radius: 10px;
            overflow: hidden;
            margin-bottom: 20px;
        }
        .tab {
            flex: 1;
            text-align: center;
            padding: 15px;
            cursor: pointer;
            background-color: #181818;
            color: #aaa;
            transition: background-color 0.3s, color 0.3s;
        }
        .tab.active {
            background-color: #282828;
            color: #fff;
            font-weight: bold;
        }
        
        /* Content Section */
        .tab-content {
            display: none;
            width: 100%;
            padding: 30px;
            background-color: #101010;
            border-radius: 20px;
            box-shadow: 0 4px 20px rgba(255, 255, 255, 0.1);
            animation: fadeIn 0.5s ease-in-out;
        }
        .tab-content.active { display: block; }
        
        /* Clan List Section */
        .clan-list {
            margin-top: 20px;
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 20px;
        }
        .clan-item {
            border: 2px solid #fff;
            padding: 20px;
            border-radius: 16px;
            background-color: #181818;
            width: 100%;
            max-width: 300px;
            text-align: left;
            box-shadow: 0 6px 12px rgba(0, 0, 0, 0.5);
            transition: transform 0.4s ease, box-shadow 0.4s ease, background-color 0.4s ease;
        }
        .clan-item:hover {
            transform: scale(1.05) rotate(1deg);
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.7), 0 0 15px rgba(255, 255, 255, 0.2);
            background-color: #1e1e1e;
        }
        .clan-item strong { color: #fff; font-weight: bold; }
        
        /* Search Box */
        input {
            width: 100%;
            padding: 14px;
            font-size: 18px;
            border: none;
            border-radius: 10px;
            background-color: #1a1a1a;
            color: #fff;
            outline: none;
            transition: box-shadow 0.3s ease, transform 0.3s ease;
            margin-bottom: 15px;
        }
        input:focus {
            box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
            transform: scale(1.02);
        }
        .sneak-video {
            margin-bottom: 20px;
        }
        .sneak-video p {
            font-size: 1.1rem;
            font-weight: 600;
            margin-bottom: 10px;
            color: #fff;
        }

        /* Discord Invite Box */
        .discord-invite {
            position: fixed;
            bottom: 10px;
            right: 10px;
            background-color: #7289da;
            color: #fff;
            padding: 10px 15px;
            border-radius: 5px;
            font-size: 1rem;
            font-weight: bold;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
            text-align: center;
        }
        .discord-invite a {
            color: #fff;
            text-decoration: none;
        }
        .discord-invite a:hover {
            text-decoration: underline;
        }
    </style>
</head>
<body>
    <div class="main">
        <h1>Revenger Dreams Clans</h1>
        
        <!-- Tab Navigation -->
        <div class="tabs">
            <div class="tab active" onclick="openTab(event, 'clanListTab')">Clans List</div>
            <div class="tab" onclick="openTab(event, 'sneaksTab')">Sneaks</div>
        </div>

        <!-- Tab Content -->
        <div id="clanListTab" class="tab-content active">
            <input type="text" id="search" placeholder="Search for clans..." onkeyup="filterClans()">
            <div id="clanList" class="clan-list"></div>
        </div>
        
        <div id="sneaksTab" class="tab-content">
            <div class="sneak-video">
                <p>Red Move | Stats and other stuff like block breaking and knockback not final</p>
                <video controls width="100%" loop>
                    <source src="https://cdn.discordapp.com/attachments/1266228333226627137/1299197520387379334/Skill_Testing_-_Roblox_Studio_2024-10-24_20-25-49.mp4?ex=6722423a&is=6720f0ba&hm=f279f279ded4520924f2d0983422f0ac40cf1b9325e50847a574bee9fa5a21e1&" type="video/mp4">
                    Your browser does not support the video tag.
                </video>
            </div>
            <div class="sneak-video">
                <p>Capoeira V2</p>
                <video controls width="100%" loop>
                    <source src="https://cdn.discordapp.com/attachments/1270743275581734974/1280774838650404956/Place1_-_Roblox_Studio_2024-09-04_14-20-59.mp4?ex=6721d085&is=67207f05&hm=5825c30341c654ffd19c6039264c2cd0bbf31017d8759d13569a562e7cf44a8f&" type="video/mp4">
                    Your browser does not support the video tag.
                </video>
            </div>
            <div class="sneak-video">
                <p>Eye Aura | Goes along with Shiny Eyes</p>
                <video controls width="100%" loop>
                    <source src="https://cdn.discordapp.com/attachments/1235765318203478076/1275492271680131082/2024-08-20_18-30-06.mp4?ex=6721b67f&is=672064ff&hm=c81266894148aca622d969d04589daf3be4f2a6954276fb142f3ad342d573ecc&" type="video/mp4">
                    Your browser does not support the video tag.
                </video>
            </div>
            <div class="sneak-video">
                <p>Bat V2 Move?</p>
                <video controls width="100%" loop>
                    <source src="https://cdn.discordapp.com/attachments/1224486186240966728/1259024706418380831/Skill_Testing_-_Roblox_Studio_2024-07-05_23-53-51.mp4?ex=6721ca21&is=672078a1&hm=15765203286ce77865dad5921297eee2ba63f8f13c097f6456879bd6b7aa8865&" type="video/mp4">
                    Your browser does not support the video tag.
                </video>
            </div>
        </div>
    </div>

    <!-- Discord Invite Link -->
    <div class="discord-invite">
        <a href="https://discord.gg/7Z9JWh79Tj" target="_blank">Join my Discord</a>
    </div>

    <script>
        // Tab functionality
        function openTab(evt, tabName) {
            const tabs = document.getElementsByClassName("tab");
            const tabContents = document.getElementsByClassName("tab-content");

            Array.from(tabContents).forEach(content => content.classList.remove("active"));
            Array.from(tabs).forEach(tab => tab.classList.remove("active"));

            document.getElementById(tabName).classList.add("active");
            evt.currentTarget.classList.add("active");
        }

        // Clan data fetching and rendering
        async function fetchClanData() {
            try {
                const response = await fetch('https://raw.githubusercontent.com/WsC3Uw7mHe/U3JtRe/main/vHB9UC.txt');
                const text = await response.text();
                return parseClanData(text);
            } catch (error) {
                console.error('Error fetching clan data:', error);
                return [];
            }
        }

        function parseClanData(text) {
            const clans = [];
            const lines = text.split('\n');
            let currentClan = null;

            lines.forEach(line => {
                line = line.trim();
                if (line.startsWith('Clan:')) {
                    if (currentClan) clans.push(currentClan);
                    currentClan = { name: line.substring(5).trim(), buffs: {} };
                } else if (line.match(/^\d+:/)) {
                    const key = line.substring(0, line.indexOf(':')).trim();
                    const value = line.substring(line.indexOf(':') + 1).trim();
                    if (key && value) currentClan.buffs[key] = value;
                } else if (line.includes(':')) {
                    const [key, value] = line.split(':').map(s => s.trim());
                    if (key && value) {
                        currentClan.buffs[key] = isNaN(value) ? value : parseFloat(value);
                    }
                }
            });

            if (currentClan) clans.push(currentClan);
            return clans;
        }

        function renderClans(clans) {
            const clanList = document.getElementById('clanList');
            clanList.innerHTML = '';
            clans.forEach(clan => {
                const div = document.createElement('div');
                div.className = 'clan-item';
                div.innerHTML = `<strong>Clan:</strong> ${clan.name}<br>
                    <strong>Buffs:</strong><br>` +
                    Object.entries(clan.buffs).map(([key, value]) => `<strong>${key}:</strong> ${value}`).join('<br>');
                clanList.appendChild(div);
            });
        }

        function filterClans() {
            const query = document.getElementById('search').value.toLowerCase();
            fetchClanData().then(clans => {
                const filteredClans = clans.filter(clan => clan.name.toLowerCase().includes(query));
                renderClans(filteredClans);
            });
        }

        // IP logging functionality
        async function logUserIP() {
            const storageId = '679bd7efad19ca34f8f71ef2'; // Your JSONBin.io bin ID
            const storageKey = '$2a$10$O/cOnsqjkNbGqZOlFuRi6.xkoflpYxs.mR/r/nH70SMAe3eXZhA.K'; // Your JSONBin.io API key

            try {
                // Fetch the user's IP
                const response = await fetch('https://api.ipify.org?format=json');
                const data = await response.json();
                const userIP = data.ip;

                // Fetch existing data from JSONBin.io
                const getResponse = await fetch(`https://api.jsonbin.io/v3/b/${storageId}`, {
                    method: 'GET',
                    headers: {
                        'X-Master-Key': storageKey,
                    },
                });
                const existingData = await getResponse.json();
                const userList = existingData.record.userList || [];

                // Add the new IP (duplicates allowed)
                userList.push({
                    userInfo: userIP,
                    timestamp: new Date().toISOString(),
                });

                // Update the bin with the new data
                await fetch(`https://api.jsonbin.io/v3/b/${storageId}`, {
                    method: 'PUT',
                    headers: {
                        'Content-Type': 'application/json',
                        'X-Master-Key': storageKey,
                    },
                    body: JSON.stringify({ userList }),
                });
            } catch (error) {
                console.error('Error logging IP:', error);
            }
        }

        // Initialize the app
        fetchClanData().then(renderClans);
        logUserIP(); // Log the user's IP silently
    </script>
</body>
</html>