From 09d43804b7375f6ca3ed41be0fb16932b83a80f4 Mon Sep 17 00:00:00 2001 From: limepotato Date: Sun, 1 Sep 2024 21:27:52 -0600 Subject: [PATCH] random ntfyInput placeholders --- astro/public/scripts/ntfy.js | 40 ++++++++++++++++++- .../components/main-page/silly-widgets.astro | 4 +- astro/src/layouts/Layout.astro | 2 +- 3 files changed, 42 insertions(+), 4 deletions(-) diff --git a/astro/public/scripts/ntfy.js b/astro/public/scripts/ntfy.js index 18d2b3c..1e90af5 100644 --- a/astro/public/scripts/ntfy.js +++ b/astro/public/scripts/ntfy.js @@ -1,7 +1,44 @@ const ntfyInput = document.getElementById("ntfy-input"); const ntfyButton = document.getElementById("ntfy-send"); -// both +// Random placeholder + +function getPlaceholder() { + placeholderSelector = (Math.floor(Math.random()*8) +1); + switch(placeholderSelector) { + case 1: + ntfyInput.placeholder='hi nelle! (。>﹏<。)'; + break; + case 2: + ntfyInput.placeholder='(╹◡╹)凸'; + break; + case 3: + ntfyInput.placeholder='Confession of sin: I dont like SciAdv'; + break; + case 4: + ntfyInput.placeholder='Knock Knock...'; + break; + case 5: + ntfyInput.placeholder='El. Psy. Kongroo.'; + break; + case 6: + ntfyInput.placeholder='the organization is after you.'; + break; + case 7: + ntfyInput.placeholder='you wouldnt happen to know where an IBN5100 is, would you?'; + break; + case 8: + ntfyInput.placeholder='if you had to choose, between: bacon, unlimited bacon, but no games. or. games. unlimited games, but no games. which would you pick?'; + break; + case 9: + ntfyInput.placeholder='time travel?'; + break; + default: + ntfyInput.placeholder='type some words and hit send'; + } +} + +// send function function send(message) { const r = new XMLHttpRequest(); r.open("POST", "https://ntfy.ouroboros.group/beep", true); @@ -15,6 +52,7 @@ function sendNotification() { ntfyInput.value = ""; } +// on send button click async function ntfyClick() { if (!ntfyInput.value.replace(/\s/g, "").length) { ntfyButton.innerHTML = "ಠ﹏ಠ"; diff --git a/astro/src/components/main-page/silly-widgets.astro b/astro/src/components/main-page/silly-widgets.astro index c1573d2..544a4d9 100644 --- a/astro/src/components/main-page/silly-widgets.astro +++ b/astro/src/components/main-page/silly-widgets.astro @@ -10,7 +10,7 @@ > -
+

send me a notification! type words and press send

music recs, questions, jokes, confessions of your sins, etc, welcome, I respond to all or most as vagueposts on the fediverse. @@ -22,7 +22,7 @@

- +