Hide the top bar on the home page

Visitors see the home page with no top bar at all. Signed in, the bar
sits behind a small tab at the top center that drops it down; Escape or
a click outside closes it. Every other page keeps the regular bar.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
cdnutterandClaude Opus 5.5 committed 2026-09-30 15:27:39 -07:00
1 parent f3185ba7bd
commit 0d4bbe8c8a
3 files changed
+61 -13

No files matched your search

+13
View File
@@ -189,3 +189,16 @@ document.addEventListener("click", (e) => {
if (!d.contains(e.target) || e.target.closest(".menu-pop a")) d.open = false;
}
});
// The home page's drop-down top bar closes on Escape or a click outside it.
document.addEventListener("click", (e) => {
const d = document.querySelector("details.topbar-drawer[open]");
if (d && !d.contains(e.target)) d.open = false;
});
document.addEventListener("keydown", (e) => {
const d = document.querySelector("details.topbar-drawer[open]");
if (e.key === "Escape" && d) {
d.open = false;
d.querySelector("summary").focus();
}
});