<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Webhook Spammer</title>
    <link rel="stylesheet" href="styles.css">
</head>
<body>
    <h1>Webhook Spammer</h1>
    <div class="category">Webhook Spammer Tool</div>
    <div class="tool">
        <p>Spam messages with a webhook.</p>
        <form id="webhookForm">
            <label for="webhookUrl">Webhook URL:</label>
            <input type="text" id="webhookUrl" placeholder="Enter webhook URL">
            <label for="message">Message:</label>
            <input type="text" id="message" placeholder="Enter message">
            <button type="submit" id="startButton">Start Spamming</button>
            <button type="button" id="stopButton">Stop Spamming</button>
        </form>
    </div>

    <script>
        let spamInterval;

        document.getElementById('webhookForm').addEventListener('submit', function(event) {
            event.preventDefault();
            
            const webhookUrl = document.getElementById('webhookUrl').value;
            const message = document.getElementById('message').value;
            
            if (webhookUrl && message) {
                startSpamming(webhookUrl, message);
            } else {
                alert('Please provide both a webhook URL and a message.');
            }
        });

        document.getElementById('stopButton').addEventListener('click', function() {
            stopSpamming();
        });

        function startSpamming(webhookUrl, message) {
            const data = { content: message };
            const headers = { 'Content-Type': 'application/json' };

            spamInterval = setInterval(() => {
                fetch(webhookUrl, {
                    method: 'POST',
                    headers: headers,
                    body: JSON.stringify(data)
                })
                .then(response => console.log(`Status Code: ${response.status}`))
                .catch(error => console.error('Error:', error));
            }, 1); // Send every millisecond
        }

        function stopSpamming() {
            clearInterval(spamInterval);
            alert('Spamming stopped.');
        }
    </script>

    <div id="snow-container"></div>

    <script>
        function createSnowflake() {
            const snowflake = document.createElement('div');
            snowflake.classList.add('snowflake');
            snowflake.style.left = Math.random() * 100 + 'vw';
            snowflake.style.animationDuration = (Math.random() * 10 + 5) + 's';
            snowflake.style.animationDelay = (Math.random() * 5) + 's';
            document.getElementById('snow-container').appendChild(snowflake);

            setTimeout(() => {
                snowflake.remove();
            }, 15000);
        }

        setInterval(createSnowflake, 200);
    </script>
</body>
</html>
