diff --git a/astro/public/scripts/ntfy.js b/astro/public/scripts/ntfy.js
index 948a1fc..b6c1edb 100644
--- a/astro/public/scripts/ntfy.js
+++ b/astro/public/scripts/ntfy.js
@@ -1,5 +1,11 @@
-const ntfyInput = document.getElementById("ntfy-input");
-const ntfyButton = document.getElementById("ntfy-send");
+const ntfyMessage = document.getElementById("ntfy-message");
+const ntfyTitle = document.getElementById("ntfy-title");
+const ntfyTags = document.getElementById("ntfy-tags");
+const ntfyAttach = document.getElementById("ntfy-attach");
+const ntfyClickAction = document.getElementById("ntfy-click");
+const ntfyButton = document.getElementById("ntfy-button");
+
+const msgPFX = "message: "
// Random placeholder
@@ -7,56 +13,64 @@ function getPlaceholder() {
placeholderSelector = Math.floor(Math.random() * 8) + 1;
switch (placeholderSelector) {
case 1:
- ntfyInput.placeholder = "hi nelle! (。>﹏<。)";
+ ntfyMessage.placeholder = `${msgPFX}hi nelle! (。>﹏<。)`;
break;
case 2:
- ntfyInput.placeholder = "(╹◡╹)凸";
+ ntfyMessage.placeholder = `${msgPFX}(╹◡╹)凸`;
break;
case 3:
- ntfyInput.placeholder = "Confession of sin: I dont like SciAdv";
+ ntfyMessage.placeholder = `${msgPFX}Confession of sin: I dont like SciAdv`;
break;
case 4:
- ntfyInput.placeholder = "Knock Knock...";
+ ntfyMessage.placeholder = `${msgPFX}Knock Knock...`;
break;
case 5:
- ntfyInput.placeholder = "El. Psy. Kongroo.";
+ ntfyMessage.placeholder = `${msgPFX}El. Psy. Kongroo.`;
break;
case 6:
- ntfyInput.placeholder = "the organization is after you.";
+ ntfyMessage.placeholder = `${msgPFX}the organization is after you.`;
break;
case 7:
- ntfyInput.placeholder =
- "you wouldnt happen to know where an IBN5100 is, would you?";
+ ntfyMessage.placeholder =
+ `${msgPFX}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?";
+ ntfyMessage.placeholder =
+ `${msgPFX}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?";
+ ntfyMessage.placeholder = `${msgPFX}time travel?`;
break;
default:
- ntfyInput.placeholder = "type some words and hit send";
+ ntfyMessage.placeholder = `${msgPFX}type some words and hit send`;
}
}
// send function
-function send(message) {
+function send(message, title, tags, attachment, click) {
const r = new XMLHttpRequest();
r.open("POST", "https://ntfy.ouroboros.group/beep", true);
r.setRequestHeader("Content-Type", "text/plain");
+ r.setRequestHeader("Title", title);
+ r.setRequestHeader("Tags", tags);
+ r.setRequestHeader("Attach", attachment);
+ r.setRequestHeader("Click", click);
r.send(message);
}
// send notification
function sendNotification() {
- send(ntfyInput.value);
- ntfyInput.value = "";
+ send(ntfyTitle.value, ntfyMessage.value, ntfyTags.value, ntfyAttach.value, ntfyClickAction.value);
+ ntfyTitle.value = "";
+ ntfyTags.value = "";
+ ntfyAttach.value = "";
+ ntfyClickAction.value = "";
+ ntfyMessage.value = "";
}
// on send button click
async function ntfyClick() {
- if (!ntfyInput.value.replace(/\s/g, "").length) {
+ if (!ntfyMessage.value.replace(/\s/g, "").length) {
ntfyButton.innerHTML = "ಠ﹏ಠ";
setTimeout(() => {
ntfyButton.innerHTML = "Send";
diff --git a/astro/src/components/main-page/silly-widgets.astro b/astro/src/components/main-page/silly-widgets.astro
index ffc0315..ba7637e 100644
--- a/astro/src/components/main-page/silly-widgets.astro
+++ b/astro/src/components/main-page/silly-widgets.astro
@@ -20,15 +20,21 @@
-