From 605ac71e2ffbf83652ce47bbf8ffc477df629e77 Mon Sep 17 00:00:00 2001 From: limepotato Date: Tue, 3 Sep 2024 16:03:57 -0600 Subject: [PATCH] better show/hide & move ntfy/lastfm to own templates --- astro/public/scripts/ntfy.js | 24 +++++++ .../components/main-page/silly-widgets.astro | 62 +++---------------- .../components/main-page/widgets/lastfm.astro | 18 ++++++ .../components/main-page/widgets/ntfy.astro | 48 ++++++++++++++ 4 files changed, 99 insertions(+), 53 deletions(-) create mode 100644 astro/src/components/main-page/widgets/lastfm.astro create mode 100644 astro/src/components/main-page/widgets/ntfy.astro diff --git a/astro/public/scripts/ntfy.js b/astro/public/scripts/ntfy.js index 3c6282c..34d33bd 100644 --- a/astro/public/scripts/ntfy.js +++ b/astro/public/scripts/ntfy.js @@ -4,10 +4,15 @@ const ntfyAttach = document.getElementById("ntfy-attach"); const ntfyClickAction = document.getElementById("ntfy-click"); const ntfyButton = document.getElementById("ntfy-button"); +const optionsCheck = document.getElementById("optionsCheckbox"); const titleCheck = document.getElementById("titleCheckbox"); const attachmentCheck = document.getElementById("attachmentCheckbox"); const clickCheck = document.getElementById("clickCheckbox"); +const titleBoxLabel = document.getElementById("titleBoxLabel"); +const attachmentBoxLabel = document.getElementById("attachBoxLabel"); +const clickBoxLabel = document.getElementById("clickBoxLabel"); + const msgPFX = "message: " @@ -86,6 +91,25 @@ async function ntfyClick() { } } +function toggleOptions() { + if (optionsCheck.checked) { + titleBoxLabel.style.display = "initial"; + attachmentBoxLabel.style.display = "initial"; + clickBoxLabel.style.display = "initial"; + titleCheck.style.display = "initial"; + attachmentCheck.style.display = "initial"; + clickCheck.style.display = "initial"; + } + if (!optionsCheck.checked) { + titleBoxLabel.style.display = "none"; + attachmentBoxLabel.style.display = "none"; + clickBoxLabel.style.display = "none"; + titleCheck.style.display = "none"; + attachmentCheck.style.display = "none"; + clickCheck.style.display = "none"; + } +} + function toggleTitle() { if (titleCheck.checked) { ntfyTitle.style.display = "initial" diff --git a/astro/src/components/main-page/silly-widgets.astro b/astro/src/components/main-page/silly-widgets.astro index 6390cd0..27396e1 100644 --- a/astro/src/components/main-page/silly-widgets.astro +++ b/astro/src/components/main-page/silly-widgets.astro @@ -1,54 +1,10 @@ +--- +import LastFM from "./widgets/lastfm.astro"; +import NTFY from "./widgets/ntfy.astro"; +--- +
-
-
- - -
-
- latest played song on last.fm -
-
-
-

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. -
- - DESTROYED ON SIGHT: slurs, flirting, lewd or sexual comments/jokes without previous explicit permission. - -
-
-
-
- - -
-
- - -
-
- - -
-
- - - - -
-
- -
-
s - if it doesnt seem to be working, or you have javascript disabled,
you can POST to https://ntfy.ouroboros.group/beep.
-
-
\ No newline at end of file + +
+ + diff --git a/astro/src/components/main-page/widgets/lastfm.astro b/astro/src/components/main-page/widgets/lastfm.astro new file mode 100644 index 0000000..32bdee8 --- /dev/null +++ b/astro/src/components/main-page/widgets/lastfm.astro @@ -0,0 +1,18 @@ +
+
+ - +
+
+ latest played song on last.fm +
+
diff --git a/astro/src/components/main-page/widgets/ntfy.astro b/astro/src/components/main-page/widgets/ntfy.astro new file mode 100644 index 0000000..ddda693 --- /dev/null +++ b/astro/src/components/main-page/widgets/ntfy.astro @@ -0,0 +1,48 @@ +
+ +

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. +
+ + DESTROYED ON SIGHT: slurs, flirting, lewd or sexual comments/jokes without previous explicit permission. + +
+
+ +
+ + + + +
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+ + if it doesnt seem to be working, or you have javascript disabled,
you can POST to https://ntfy.ouroboros.group/beep.
+
\ No newline at end of file