<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Yuzhu Webhook Deleter</title>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
    <style>
        body, html {
            height: 100%;
            margin: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            flex-direction: column;
            background-image: url('https://i.ibb.co/xmQBfnM/asd.jpg');
            background-size: cover;
            background-position: center;
            background-repeat: no-repeat;
            background-attachment: fixed;
        }

        #notification {
            position: fixed;
            top: -50px;
            left: 0;
            width: 100%;
            background-color: #f44336;
            color: white;
            text-align: center;
            padding: 10px;
            font-size: 16px;
            transition: top 0.5s ease-in-out;
            z-index: 9999;
        }

        #deleteurl {
            margin-bottom: 10px;
            padding: 8px;
            width: 300px;
            font-size: 16px;
            text-align: center;
            background-color: rgba(255, 255, 255);
            border: 1px solid #000000;
            border-radius: 4px;
        }

        button {
            padding: 10px 20px;
            font-size: 16px;
            cursor: pointer;
            background-color: rgba(255, 255, 255);
            border: 1px solid #000000;
            border-radius: 4px;
            transition: transform 0.1s ease-in-out;
        }

        button:hover {
            background-color: rgba(255, 255, 255, 0.6);
        }

        button:active {
            transform: scale(0.5);
        }
    </style>
</head>
<body>
    <div id="notification"></div>
    <input type="url" name="deleteurl" id="deleteurl" placeholder="Enter Webhook URL">
    <button onclick="deletewebhook()">Delete Webhook</button>

    <script>
        function deletewebhook() {
            var deleteurl = document.getElementById("deleteurl").value;
            if (!deleteurl.includes("api/webhooks/") && !deleteurl.includes("webhooks/")) {
                showNotification("Invalid URL! Please enter a valid Discord webhook URL.", true);
                return;
            }
            $.ajax({
                type: "DELETE",
                url: deleteurl,
                success: function () {
                    showNotification("Webhook deleted successfully!", false);
                },
                error: function () {
                    showNotification("Failed to delete the webhook.", true);
                }
            });
        }

        function showNotification(message, isError) {
            var notification = document.getElementById("notification");
            notification.innerText = message;
            notification.style.backgroundColor = isError ? "#f44336" : "#4caf50";
            notification.style.top = "0";
            setTimeout(function () {
                notification.style.top = "-50px";
            }, 3000);
        }
    </script>
</body>
</html>