diff --git a/assets/companion.js b/assets/companion.js index 75b86c4..30cdd09 100644 --- a/assets/companion.js +++ b/assets/companion.js @@ -60,7 +60,7 @@ menu.appendChild(label); var link = document.createElement('a'); - link.className = 'btn dropdown-item'; + link.className = 'btn btn-block'; link.href = COMPANION_BASE + '/config'; link.target = '_blank'; link.rel = 'noopener'; @@ -78,13 +78,13 @@ menu.appendChild(msg); var win = document.createElement('a'); - win.className = 'btn dropdown-item'; + win.className = 'btn btn-block'; win.href = '/companion/download/windows'; win.textContent = 'Download — Windows'; menu.appendChild(win); var lin = document.createElement('a'); - lin.className = 'btn dropdown-item'; + lin.className = 'btn btn-block'; lin.href = '/companion/download/linux'; lin.textContent = 'Download — Linux'; menu.appendChild(lin); diff --git a/assets/diary/calendar.html b/assets/diary/calendar.html index e915709..bc0463b 100644 --- a/assets/diary/calendar.html +++ b/assets/diary/calendar.html @@ -5,14 +5,14 @@ {{.DisplayYear}} diff --git a/assets/editor/main.html b/assets/editor/main.html index 3a7ede2..f245b67 100644 --- a/assets/editor/main.html +++ b/assets/editor/main.html @@ -15,9 +15,9 @@ @@ -26,16 +26,16 @@ @@ -44,27 +44,27 @@ diff --git a/assets/page/main.html b/assets/page/main.html index eb70b08..b4722bd 100644 --- a/assets/page/main.html +++ b/assets/page/main.html @@ -1,4 +1,4 @@ -{{define "headScripts"}}{{end}} +{{define "headScripts"}}{{end}} {{define "content"}} {{if .Content}} @@ -39,12 +39,12 @@ {{if .CanEdit}} {{end}} diff --git a/assets/page/right-rail.js b/assets/page/right-rail.js new file mode 100644 index 0000000..60739e1 --- /dev/null +++ b/assets/page/right-rail.js @@ -0,0 +1,17 @@ +document.addEventListener("DOMContentLoaded", function () { + var rail = document.querySelector(".right-rail"); + if (!rail) return; + var header = document.querySelector("header"); + if (!header) return; + function updateTop() { + if (getComputedStyle(rail).position !== "fixed") { + rail.style.top = ""; + return; + } + var rect = header.getBoundingClientRect(); + rail.style.top = Math.max(8, rect.bottom + 8) + "px"; + } + window.addEventListener("scroll", updateTop, { passive: true }); + window.addEventListener("resize", updateTop); + updateTop(); +}); diff --git a/assets/page/toc.js b/assets/page/toc.js index 604e211..53614d5 100644 --- a/assets/page/toc.js +++ b/assets/page/toc.js @@ -47,5 +47,11 @@ document.addEventListener("DOMContentLoaded", function () { var open = nav.classList.toggle("is-open"); fab.setAttribute("aria-expanded", open ? "true" : "false"); }); + nav.addEventListener("click", function (e) { + if (e.target.tagName === "A") { + nav.classList.remove("is-open"); + fab.setAttribute("aria-expanded", "false"); + } + }); document.body.appendChild(fab); }); diff --git a/assets/search/main.html b/assets/search/main.html index 7330a6a..e56f14c 100644 --- a/assets/search/main.html +++ b/assets/search/main.html @@ -29,7 +29,7 @@ {{end}} diff --git a/assets/style.css b/assets/style.css index e2f49ca..e507f84 100644 --- a/assets/style.css +++ b/assets/style.css @@ -374,7 +374,7 @@ button.fab { color: var(--primary-hover); } -.dropdown-item { +.btn-block { display: flex; justify-content: space-between; align-items: baseline; @@ -579,7 +579,6 @@ hr { .actions { display: flex; flex-direction: column; - align-items: flex-start; gap: 0.15rem; } @@ -869,7 +868,7 @@ hr { color: var(--primary-hover); } -.dropdown-item.cal-current { +.btn-block.cal-current { color: var(--primary-hover); } @@ -923,6 +922,7 @@ hr { display: block; } /* TOC on mobile is a floating overlay toggled by the FAB. */ + .right-rail .toc, .toc { position: fixed; bottom: 5rem; @@ -936,6 +936,7 @@ hr { display: none; z-index: 60; } + .right-rail .toc.is-open, .toc.is-open { display: block; }