Browser observation guide / Example @@ -31,5 +32,8 @@ browser.
diff --git a/website/README.md b/website/README.md index b7f8bc668..abbce8908 100644 --- a/website/README.md +++ b/website/README.md @@ -64,6 +64,11 @@ respecting reduced-motion preferences. Both the prompt and animation work without JavaScript. The homepage and agent setup section share a copyable installation prompt; setup still presents its plan for approval. +Reading pages share a small `↑ Top` link at the bottom right. It appears after +scrolling and returns to the page header, with smooth scrolling when reduced +motion is disabled. Keyboard activation returns focus to the first navigation +link. Without JavaScript, the link stays visible and uses its `#top` anchor. + DX-Ball figures and findings refer to the linked 7 October 2026 checkpoint, commit `a55dca27ec0a07018c1b2c95ae2be027f7d8c3c4`. Update those links and figures together when moving to another checkpoint. Case-study source excerpts come diff --git a/website/evidence/guide-examples.md b/website/evidence/guide-examples.md index 70cdc859c..476c0fbd0 100644 --- a/website/evidence/guide-examples.md +++ b/website/evidence/guide-examples.md @@ -71,6 +71,10 @@ Full local outputs and the browser verification harness are under ## Example source digests +These digests identify the files used for the recorded analyses. The browser +page later gained the site's shared `↑ Top` navigation; its `export.js` and +`notes.json` retain the versions below. + | File | SHA-256 | | -------------------------------------- | ------------------------------------------------------------------ | | `examples/notes-electron/csv.js` | `6875aeecc1d3e6c1ff5b888a199c26b377d812d5b10e5fb4025e192a206b0018` | diff --git a/website/public/assets/main.js b/website/public/assets/main.js index 40a1d9808..1cdb38e0e 100644 --- a/website/public/assets/main.js +++ b/website/public/assets/main.js @@ -60,3 +60,27 @@ function initializeStepComparisons() { } initializeStepComparisons(); + +function initializeBackToTop() { + const link = document.querySelector(".back-to-top"); + if (link === null) return; + + const updateVisibility = () => { + link.hidden = window.scrollY < 400; + }; + window.addEventListener("scroll", updateVisibility, { passive: true }); + updateVisibility(); + + link.addEventListener("click", (event) => { + event.preventDefault(); + const reduceMotion = window.matchMedia( + "(prefers-reduced-motion: reduce)", + ).matches; + window.scrollTo({ top: 0, behavior: reduceMotion ? "auto" : "smooth" }); + document + .querySelector(".brand, .breadcrumb a") + ?.focus({ preventScroll: true }); + }); +} + +initializeBackToTop(); diff --git a/website/public/assets/styles.css b/website/public/assets/styles.css index d184cb31e..d1f36e0ee 100644 --- a/website/public/assets/styles.css +++ b/website/public/assets/styles.css @@ -99,6 +99,31 @@ section[id] { .skip-link:focus { top: 0.75rem; } +.back-to-top { + position: fixed; + right: calc(1.5rem + env(safe-area-inset-right, 0px)); + bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px)); + z-index: 5; + display: inline-flex; + align-items: center; + gap: 0.4rem; + min-height: 44px; + padding: 0.5rem 0.85rem; + border: 1px solid var(--line); + border-radius: 6px; + background: var(--page); + color: var(--muted); + font-size: 0.875rem; + font-weight: 600; + text-decoration: none; +} +.back-to-top[hidden] { + display: none; +} +.back-to-top:hover { + background: var(--soft); + color: var(--ink); +} .site-header { border-bottom: 1px solid var(--line); } @@ -1023,6 +1048,10 @@ pre code { } @media (max-width: 640px) { + .back-to-top { + right: calc(1rem + env(safe-area-inset-right, 0px)); + bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); + } .container { width: calc(100% - 2.5rem); } diff --git a/website/public/examples/notes-web/index.html b/website/public/examples/notes-web/index.html index 00d2c80b8..7f420d16d 100644 --- a/website/public/examples/notes-web/index.html +++ b/website/public/examples/notes-web/index.html @@ -7,8 +7,9 @@ + -
+