diff --git a/public/scripts/ntfy.js b/public/scripts/ntfy.js index 3d747d4..4cf4a6f 100644 --- a/public/scripts/ntfy.js +++ b/public/scripts/ntfy.js @@ -11,40 +11,4 @@ function send(message) { if (ntfyInput.value.length <= 0) return send(ntfyInput.value) ntfyInput.value = "" - } - ntfyInput.addEventListener("keyup", e => e.keyCode == 13 && send()) - // send praise - let praiseSentence = document.getElementById("pp-sentence"), - praiseA = document.getElementById("pp-a"), - praiseAdj = document.getElementById("pp-adj"), - praiseNoun = document.getElementById("pp-noun"), - praiseAfter = document.getElementById("pp-after") - resetPraise() - praiseAdj.addEventListener("change", updatePraiseA) - praiseSentence.addEventListener("change", () => { - if (praiseSentence.selectedOptions[0].hasAttribute("data-suffix")) praiseAfter.innerText = praiseSentence.selectedOptions[0].attributes["data-suffix"].value - else praiseAfter.innerText = "" - updatePraiseA() - }) - function sendPraise() { - if (praiseAdj.value == "0" || praiseNoun.value == "0") return - text = praiseSentence.selectedOptions[0].innerText - if (text) text += " " + praiseA.innerText + " " - text += praiseAdj.selectedOptions[0].innerText + " " + praiseNoun.selectedOptions[0].innerText - if (praiseAfter.innerText) text += praiseSentence.selectedOptions[0].attributes["data-suffix"].value - send(text) - resetPraise() - } - // praise helpers - function resetPraise() { - praiseSentence.value = "0" - praiseA.innerText = "" - praiseAdj.value = "0" - praiseNoun.value = "0" - praiseAfter.innerText = "" - } - function updatePraiseA() { - if (praiseSentence.value == "0") praiseA.innerText = "" - else if (praiseAdj.selectedOptions[0].hasAttribute("data-mod")) praiseA.innerText = "an" - else praiseA.innerText = "a" } \ No newline at end of file diff --git a/src/pages/index.astro b/src/pages/index.astro index b5771df..521ac79 100755 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -69,71 +69,6 @@ import Layout from "../layouts/Layout.astro";

send me a notification! type words and press send

send -