diff options
author | Case Duckworth | 2022-08-19 20:25:57 -0500 |
---|---|---|
committer | Case Duckworth | 2022-08-19 20:25:57 -0500 |
commit | a7e339768797f1f809b041bb5af903b58bc82830 (patch) | |
tree | 8b247f1643c288f1121422b5e300d80066e6dcd2 | |
parent | Ignore index.html (diff) | |
download | fwendplanet-a7e339768797f1f809b041bb5af903b58bc82830.tar.gz fwendplanet-a7e339768797f1f809b041bb5af903b58bc82830.zip |
-rw-r--r-- | Makefile | 2 | ||||
-rwxr-xr-x | fwendplanet_html.awk | 3 | ||||
-rw-r--r-- | script.js | 11 | ||||
-rw-r--r-- | style.css | 4 |
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 | |||
3 | OUTD = /var/www/acdw.casa/fwends/ | 3 | OUTD = /var/www/acdw.casa/fwends/ |
4 | RC = sfeedrc | 4 | RC = sfeedrc |
5 | FEEDS = feeds | 5 | FEEDS = feeds |
6 | FILES = index.html style.css p*.html | 6 | FILES = *.html *.css *.js |
7 | AGGREGATOR = ./fwendplanet.sh | 7 | AGGREGATOR = ./fwendplanet.sh |
8 | PAGEN = 60 # 2 months | 8 | PAGEN = 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 | |||
3 | const 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 | ||
36 | details:hover { | ||
37 | cursor: pointer; | ||
38 | } | ||
39 | |||
36 | .info { | 40 | .info { |
37 | position: relative; | 41 | position: relative; |
38 | } | 42 | } |