From 487b026a06f52b2baea608220818ac6651e55746 Mon Sep 17 00:00:00 2001 From: pancakes Date: Tue, 3 Dec 2024 20:56:27 +1000 Subject: [PATCH] Improve ntfy --- src/routes/+page.svelte | 5 +++-- src/routes/style.css | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 615efe4..e3122d9 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -5,13 +5,13 @@ const pages = getPages(); - function sendNtfyMessage() { + async function sendNtfyMessage() { const message = document.getElementById("ntfy-message").value; if (message.length < 15) return alert( `Message must be 15 to 128 characters. Current length is ${message.length}`, ); - fetch("https://ntfy.meow.company/pancakes", { + var resp = await fetch("https://ntfy.meow.company/pancakes", { method: "POST", body: message, headers: { @@ -20,6 +20,7 @@ Tags: "black_cat", }, }); + if (resp.ok) alert(`Sent: ${message}`); } function updateNtfyCharCount(_) { diff --git a/src/routes/style.css b/src/routes/style.css index 8a74f65..e3a9e04 100644 --- a/src/routes/style.css +++ b/src/routes/style.css @@ -406,6 +406,7 @@ input[type="submit"] { border-radius: var(--radius); font-weight: bold; text-transform: uppercase; + cursor: pointer; } input[type="text"] {