From a7e339768797f1f809b041bb5af903b58bc82830 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Fri, 19 Aug 2022 20:25:57 -0500 Subject: Add script.js and a toggle button --- Makefile | 2 +- fwendplanet_html.awk | 3 +++ script.js | 11 +++++++++++ style.css | 4 ++++ 4 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 script.js diff --git a/Makefile b/Makefile index ba2e202..390d931 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ REPO = https://tildegit.org/casa/pages/raw/branch/main/opml/mug.of.opml OUTD = /var/www/acdw.casa/fwends/ RC = sfeedrc FEEDS = feeds -FILES = index.html style.css p*.html +FILES = *.html *.css *.js AGGREGATOR = ./fwendplanet.sh PAGEN = 60 # 2 months diff --git a/fwendplanet_html.awk b/fwendplanet_html.awk index 654a939..bb1d86f 100755 --- a/fwendplanet_html.awk +++ b/fwendplanet_html.awk @@ -18,6 +18,8 @@ BEGIN { print "" print "" TITLE "" print "" + print "" print "" print "" print "
" @@ -29,6 +31,7 @@ BEGIN { } print "" print "
" + print "details" if (PREV) { print "prev" } diff --git a/script.js b/script.js new file mode 100644 index 0000000..01458c9 --- /dev/null +++ b/script.js @@ -0,0 +1,11 @@ +// Toggle all
on the page (thanks elioat!) + +const toggleDetails = () => { + document.body.querySelectorAll("details").forEach((e) => { + if (!e.classList.contains("info")) { + e.hasAttribute("open") + ? e.removeAttribute("open") + : e.setAttribute("open", true); + } + }); +}; diff --git a/style.css b/style.css index d9c02e2..e5b16e9 100644 --- a/style.css +++ b/style.css @@ -33,6 +33,10 @@ details[open] { min-height: 4.2em; } +details:hover { + cursor: pointer; +} + .info { position: relative; } -- cgit 1.4.1-21-gabe81