website: one header on every page, one contents drawer that starts closed

The docs page used to swap the site's links for its own three and unfold the
chapter rail on arrival, so half the navigation vanished the moment you opened
the documentation and a sidebar you never asked for was already there. Both are
gone. Every page — home, about, docs, API — now serves a byte-identical nav bar
and navigation sheet; which page you are on is marked with aria-current at
runtime, so nothing is ever added or dropped from the markup to say it.

The rail is now separate from the header and the same object everywhere: closed
in CSS at every width, opened by one Contents pill, closed by the ✕ in its own
sticky header, by Escape, or by a tap on the dimmed page. No preference is
remembered any more and the stale og_rail key is cleared on sight. One panel
controller in site.js drives both the sheet and the drawer, traps focus while
either is open and hands it back to the button that opened it. api.html no
longer carries a private copy of any of this.

Also: visibility is switched at one instant instead of being transitioned —
interpolating it left both panels hidden through their own opening animation,
so they popped in at the end and nothing inside could take focus until then.
Long inline code breaks instead of widening the page (docs ran 21px wide of a
320px screen), the header folds at one breakpoint rather than three, and every
control in the rail clears 44px.

246 headless assertions across four pages and five widths: nav and sheet
markup identical, drawer shut on first paint, no horizontal overflow, focus
returned, reduced motion honoured, no console errors.
This commit is contained in:
Duarte Santos committed 2026-08-31 14:32:32 +02:00
1 parent 572f50cd4f
commit 523cfc9df7
7 files changed
+1275 -409

No files matched your search

+50 -8
View File
@@ -6,15 +6,25 @@
<title>About — openGym</title>
<meta name="description" content="The story behind openGym: a gym tracker that started as a tiny personal app on a homelab server and grew into an open-source project.">
<meta name="theme-color" content="#000000">
<meta property="og:title" content="About openGym">
<meta property="og:description" content="How openGym came to be: a tracker built for one user, open-sourced under the AGPL, with every release documented.">
<meta property="og:image" content="https://opengym.duarte-santos.ch/img/banner.png">
<meta property="og:url" content="https://opengym.duarte-santos.ch/about.html">
<meta property="og:type" content="website">
<meta property="og:site_name" content="openGym">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="About openGym">
<meta name="twitter:image" content="https://opengym.duarte-santos.ch/img/banner.png">
<link rel="canonical" href="https://opengym.duarte-santos.ch/about.html">
<link rel="icon" type="image/png" sizes="512x512" href="icon-512.png">
<link rel="icon" type="image/png" sizes="180x180" href="icon-180.png">
<link rel="apple-touch-icon" href="icon-180.png">
<link rel="stylesheet" href="styles.css?v=10">
<link rel="stylesheet" href="styles.css?v=12">
<script>document.documentElement.className += ' js'</script>
<!-- Umami web analytics for opengym.duarte-santos.ch (self-hosted, cookieless). -->
<script defer src="https://stats.duarte-santos.ch/script.js" data-website-id="db36019e-50f4-453c-9c56-d0588aefe233"></script>
</head>
<body>
<body class="topnav">
<nav><div class="wrap nav-in">
<a class="brand" href="/">
@@ -22,19 +32,51 @@
openGym
</a>
<div class="nav-quick">
<a class="ql site" href="api.html">API</a>
<a class="ql site" href="/#features">Features</a>
<a class="ql site" href="/#screens">Screenshots</a>
<a class="ql site" href="/#demo">Demo</a>
<a class="ql site" href="/docs.html">Docs</a>
<a class="ql site" href="/api.html">API</a>
<a class="ql site" href="/about.html">About</a>
<a class="ql" href="https://gitlab.com/DuarteSantos8/opengym" rel="noopener">GitLab <span data-gh="stars"></span></a>
<a class="ql" href="https://discord.gg/e62jY6fwVb" rel="noopener">Discord</a>
<a class="cta" href="/#download">Download</a>
</div>
<button class="nav-toggle" aria-expanded="false" aria-controls="menu" aria-label="Menu">
<button class="nav-toggle" id="navtoggle" aria-expanded="false" aria-controls="sitemenu" aria-label="Menu">
<span></span><span></span>
</button>
</div></nav>
<!-- The topic rail: a fixed column beside the page on a wide screen, the hamburger
sheet everywhere else. One markup, two layouts — see .side in styles.css. -->
<aside class="side" id="menu" aria-label="Topics">
<!-- The navigation sheet: the header's links again, for the widths where the bar has
room only for the brand and the download. Byte-identical on every page, like the
bar above it — nothing is ever dropped because of which page you are on. -->
<div class="navsheet" id="sitemenu" role="navigation" aria-label="Site" aria-hidden="true">
<div class="nl-rows">
<a class="nl" href="/#features">Features</a>
<a class="nl" href="/#screens">Screenshots</a>
<a class="nl" href="/#demo">Demo</a>
<a class="nl" href="/docs.html">Docs</a>
<a class="nl" href="/api.html">API</a>
<a class="nl" href="/about.html">About</a>
<a class="nl" href="https://gitlab.com/DuarteSantos8/opengym" rel="noopener">GitLab <span data-gh="stars"></span></a>
<a class="nl" href="https://discord.gg/e62jY6fwVb" rel="noopener">Discord</a>
</div>
</div>
<!-- The one control that opens the contents, at every width. The drawer it opens is
closed in CSS, so it is shut on first paint whether or not the script runs. -->
<button class="toc-btn" id="tocbtn" aria-expanded="false" aria-controls="menu">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" aria-hidden="true"><path d="M4 6.5h16M4 12h16M4 17.5h10"/></svg>
Contents
</button>
<!-- The contents drawer: one list, one way in, one way out. Closed by default at
every width, and no preference is remembered — see .side in styles.css. -->
<aside class="side" id="menu" aria-label="Contents" aria-hidden="true">
<div class="side-top">
<p class="side-title">Contents</p>
<button class="rail-close" aria-label="Close contents"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M5 5l14 14M19 5L5 19"/></svg></button>
</div>
<p class="side-label">On this page</p>
<a class="side-link" href="#milestones-h"><b>Milestones</b><span>Every release, straight from GitLab</span></a>
<a class="side-link" href="#principles"><b>Principles</b><span>The rules that don't move</span></a>
@@ -121,6 +163,6 @@
</div>
</div></footer>
<script src="site.js?v=10" defer></script>
<script src="site.js?v=12" defer></script>
</body>
</html>