summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2022-08-19 20:25:57 -0500
committerCase Duckworth2022-08-19 20:25:57 -0500
commita7e339768797f1f809b041bb5af903b58bc82830 (patch)
tree8b247f1643c288f1121422b5e300d80066e6dcd2
parentIgnore index.html (diff)
downloadfwendplanet-main.tar.gz
fwendplanet-main.zip
Add script.js and a toggle button HEAD main
-rw-r--r--Makefile2
-rwxr-xr-xfwendplanet_html.awk3
-rw-r--r--script.js11
-rw-r--r--style.css4
4 files changed, 19 insertions, 1 deletions
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
3OUTD = /var/www/acdw.casa/fwends/ 3OUTD = /var/www/acdw.casa/fwends/
4RC = sfeedrc 4RC = sfeedrc
5FEEDS = feeds 5FEEDS = feeds
6FILES = index.html style.css p*.html 6FILES = *.html *.css *.js
7AGGREGATOR = ./fwendplanet.sh 7AGGREGATOR = ./fwendplanet.sh
8PAGEN = 60 # 2 months 8PAGEN = 60 # 2 months
9 9
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 {
18 print "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">" 18 print "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">"
19 print "<title>" TITLE "</title>" 19 print "<title>" TITLE "</title>"
20 print "<link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">" 20 print "<link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">"
21 print "<script src=\"script.js\">"
22 print "</script>"
21 print "</head>" 23 print "</head>"
22 print "<body>" 24 print "<body>"
23 print "<div id=\"main\">" 25 print "<div id=\"main\">"
@@ -29,6 +31,7 @@ BEGIN {
29 } 31 }
30 print "</h1>" 32 print "</h1>"
31 print "<div class=\"nav\">" 33 print "<div class=\"nav\">"
34 print "<a href=\"#\" onclick=\"toggleDetails()\">details</a>"
32 if (PREV) { 35 if (PREV) {
33 print "<a href=\"" PREV "\">prev</a>" 36 print "<a href=\"" PREV "\">prev</a>"
34 } 37 }
diff --git a/script.js b/script.js new file mode 100644 index 0000000..01458c9 --- /dev/null +++ b/script.js
@@ -0,0 +1,11 @@
1// Toggle all <details> on the page (thanks elioat!)
2
3const toggleDetails = () => {
4 document.body.querySelectorAll("details").forEach((e) => {
5 if (!e.classList.contains("info")) {
6 e.hasAttribute("open")
7 ? e.removeAttribute("open")
8 : e.setAttribute("open", true);
9 }
10 });
11};
diff --git a/style.css b/style.css index d9c02e2..e5b16e9 100644 --- a/style.css +++ b/style.css
@@ -33,6 +33,10 @@ details[open] {
33 min-height: 4.2em; 33 min-height: 4.2em;
34} 34}
35 35
36details:hover {
37 cursor: pointer;
38}
39
36.info { 40.info {
37 position: relative; 41 position: relative;
38} 42}