<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Discord Webhooks Spammer</title>
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');
        body {
            font-family: 'Roboto', sans-serif;
            background-color: #1c1c1c;
            color: #ffffff;
            margin: 0;
            padding: 0;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
        }
        .container {
            background-color: #2e2e2e;
            border-radius: 15px;
            padding: 30px;
            max-width: 450px;
            width: 90%;
            box-shadow: 0 0 20px rgba(0, 0, 0, 0.7);
            margin-bottom: 20px;
        }
        h1 {
            color: #ffffff;
            text-align: center;
            margin-bottom: 20px;
            font-weight: 700;
        }
        label {
            color: #ffffff;
            display: block;
            margin-bottom: 8px;
            font-weight: 700;
        }
        input, textarea, select {
            width: 100%;
            padding: 12px;
            margin-bottom: 15px;
            border: none;
            border-radius: 8px;
            background-color: #444;
            color: #fff;
            font-size: 14px;
            box-sizing: border-box;
        }
        input::placeholder, textarea::placeholder {
            color: #888;
        }
        textarea {
            resize: none;
        }
        button {
            width: 100%;
            padding: 12px;
            border: none;
            border-radius: 8px;
            background-color: #32cd32;
            color: #fff;
            font-size: 16px;
            font-weight: 700;
            cursor: pointer;
            transition: background-color 0.3s, transform 0.3s;
        }
        button.stop {
            background-color: #ff4d4d;
        }
        button:hover {
            transform: scale(1.05);
        }
        .log {
            margin-top: 20px;
            font-size: 12px;
            max-height: 150px;
            overflow-y: auto;
            border: 1px solid #444;
            padding: 10px;
            border-radius: 8px;
            background-color: #1c1c1c;
            box-sizing: border-box;
        }
        .log-entry {
            padding: 8px;
            border-radius: 8px;
            margin-bottom: 8px;
            font-weight: 700;
        }
        .log-entry.success {
            background-color: #28a828;
            color: #fff;
        }
        .log-entry.error {
            background-color: #ff4d4d;
            color: #fff;
        }
        .hidden {
            display: none;
        }
        footer {
            display: flex;
            align-items: center;
            color: #888;
            font-size: 14px;
        }
        footer a {
            margin-right: 10px;
        }
        footer img {
            width: 24px;
            height: 24px;
        }
        @media (max-width: 600px) {
            .container {
                padding: 20px;
            }
            h1 {
                font-size: 20px;
                margin-bottom: 15px;
            }
            button {
                font-size: 14px;
                padding: 10px;
            }
            footer span {
                font-size: 12px;
            }
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>Discord Webhooks Spammer</h1>
        <form id="webhookForm">
            <label for="webhookUrl">Webhook URL:</label>
            <input type="url" id="webhookUrl" name="webhookUrl" placeholder="Enter your webhook URL" pattern="https://discord.com/api/webhooks/.+" required>
            <label for="username">Username:</label>
            <input type="text" id="username" name="username" placeholder="Enter your username" required>
            <label for="messageType">Message Type:</label>
            <select id="messageType" name="messageType" required>
                <option value="message">Regular Message</option>
                <option value="embed">Embed</option>
            </select>
            <div id="titleContainer" class="hidden">
                <label for="title">Title:</label>
                <input type="text" id="title" name="title" placeholder="Enter embed title">
            </div>
            <label for="message">Message:</label>
            <textarea id="message" name="message" rows="4" placeholder="Enter your message" required></textarea>
            <div id="mediaUrlContainer" class="hidden">
                <label for="mediaUrl">Send Image(optional):</label>
                <input type="url" id="mediaUrl" name="mediaUrl" placeholder="Enter image/video URL">
            </div>
            <button type="submit" id="sendButton">SEND</button>
        </form>
        <div class="log" id="log"></div>
    </div>
    <footer>
        <a href="https://discord.gg/9qndH24C64" target="_blank">
            <img src="https://img.icons8.com/ios-filled/50/888888/discord-logo.png" alt="Discord Logo">
        </a>
        <span>SHA Community</span>
    </footer>
    <script>
        let intervalId;

        document.getElementById('messageType').addEventListener('change', function() {
            const isEmbed = this.value === 'embed';
            document.getElementById('titleContainer').classList.toggle('hidden', !isEmbed);
            document.getElementById('mediaUrlContainer').classList.toggle('hidden', !isEmbed);
        });

        function addLogEntry(status, text) {
            const log = document.getElementById('log');
            const entry = document.createElement('div');
            entry.classList.add('log-entry', status);
            const now = new Date();
            entry.textContent = `[${now.toLocaleTimeString()}] ${text}`;
            log.appendChild(entry);
            log.scrollTop = log.scrollHeight;
            while (log.childElementCount > 50) {
                log.removeChild(log.firstChild);
            }
        }

        function sendWebhook(payload, webhookUrl, message) {
            fetch(webhookUrl, {
                method: 'POST',
                headers: { 'Content-Type': 'application/json' },
                body: JSON.stringify(payload)
            }).then(response => {
                if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`);
                addLogEntry('success', `Sent: ${message}`);
            }).catch(error => addLogEntry('error', `Failed: ${error.message}`));
        }

        document.getElementById('webhookForm').addEventListener('submit', function(event) {
            event.preventDefault();
            const sendButton = document.getElementById('sendButton');
            const isSending = sendButton.textContent === "SEND";
            sendButton.textContent = isSending ? "STOP" : "SEND";
            sendButton.classList.toggle('stop', isSending);

            if (!isSending) {
                clearInterval(intervalId);
                document.getElementById('webhookForm').reset();
                document.getElementById('log').innerHTML = '';
                document.getElementById('messageType').value = "message";
                document.getElementById('mediaUrlContainer').classList.add('hidden');
                document.getElementById('titleContainer').classList.add('hidden');
                return;
            }

            const webhookUrl = document.getElementById('webhookUrl').value;
            const username = document.getElementById('username').value;
            const messageType = document.getElementById('messageType').value;
            const title = document.getElementById('title').value;
            const message = document.getElementById('message').value;
            const mediaUrl = document.getElementById('mediaUrl').value;

            const payload = { username, content: `${message}\n\n@everyone\n@here` };
            if (messageType === 'embed') {
                payload.embeds = [{ title: title, description: message, color: 0x00FF00 }];
                payload.content = `\n\n@everyone\n@here`;
                if (mediaUrl) {
                    payload.embeds[0].image = { url: mediaUrl };
                }
            }

            sendWebhook(payload, webhookUrl, message);
            intervalId = setInterval(() => sendWebhook(payload, webhookUrl, message), 1000);
        });
    </script>
</body>
</html>