Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ semibold; body text is 17px. Reading columns use a 72ch measure.
## Layout

The homepage has long chapters in a left reading column, a fixed canvas on the
right, and a chapter index in the left gutter on wide screens. On narrow
screens, the canvas moves above each chapter. Interior pages open with a
right. On narrow screens, the canvas moves above each chapter. Interior pages open with a
visible title and lede (`.page-intro`) under a still band of sky at the top
right; documentation pages keep their three-column layout. Navigation, buttons,
tables, callouts, and footer links remain visually quiet.
Expand Down
4 changes: 0 additions & 4 deletions public/mdbase-murmuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -1072,10 +1072,6 @@
chapters.forEach((chapter, chapterIndex) => {
chapter.classList.toggle("is-active", chapterIndex === index);
});
document.querySelectorAll(".chapter-index a").forEach((link, linkIndex) => {
if (linkIndex === index) link.setAttribute("aria-current", "step");
else link.removeAttribute("aria-current");
});
buildScene(scene, true);
}

Expand Down
2 changes: 1 addition & 1 deletion scripts/home-animation.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function harness(width, height, reducedMotion = true) {
querySelector: selector => selector === '#diagram' ? canvas : {
getBoundingClientRect: () => ({ bottom: width <= 350 ? 137 : 107 }),
},
querySelectorAll: selector => selector.includes('chapter-index') ? [] : chapters,
querySelectorAll: () => chapters,
documentElement: { style: { setProperty() {} }, addEventListener() {}, scrollHeight: height * 8 },
fonts: { ready: { then() {} } },
addEventListener() {},
Expand Down
13 changes: 1 addition & 12 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,7 @@ import AppShot from "../components/AppShot.astro";
>
<div id="material" aria-hidden="true"><canvas id="atmosphere"></canvas><div id="grain"></div></div>
<canvas id="diagram" aria-hidden="true"></canvas>
<nav class="chapter-index" aria-label="Sections">
<a href="#intro">Home</a>
<a href="#files">Files</a>
<a href="#apps">Apps</a>
<a href="#sync">Sync</a>
<a href="#anywhere">Anywhere</a>
<a href="#permission">Permissions</a>
<a href="#sharing">Sharing</a>
<a href="#start">Get started</a>
<button class="chapter-index__motion" type="button" data-motion-control>Pause motion</button>
</nav>
<button class="motion-control" type="button" data-motion-control>Pause motion</button>
<main id="main" tabindex="-1" data-pagefind-body>
<section id="intro" class="chapter is-active" data-scene="intro" aria-label="Introduction"><div class="chapter__inner">
<h1 class="home-title">Structured data in ordinary Markdown files</h1>
Expand All @@ -28,7 +18,6 @@ import AppShot from "../components/AppShot.astro";
<p class="home-status">mdbase is in beta. Keep independent backups of important collections.</p>
<figure class="app-shot home-film">
<div class="app-shot__window"><video controls playsinline preload="none" poster="/videos/mdbase-in-two-minutes.jpg" width="1920" height="1080" aria-label="What mdbase does, a silent film"><source src="/videos/mdbase-in-two-minutes.mp4" type="video/mp4" /></video></div>
<figcaption>What mdbase does, in two minutes. No sound.</figcaption>
</figure>
</div></section>

Expand Down
62 changes: 6 additions & 56 deletions src/styles/home.css
Original file line number Diff line number Diff line change
Expand Up @@ -362,81 +362,31 @@
color: var(--syntax-link);
}

/* Chapter index in the left gutter on wide screens; elsewhere only the motion control shows. */
.chapter-index {
/* The motion control sits in the bottom-right corner at every width. */
.motion-control {
position: fixed;
z-index: 3;
right: 12px;
bottom: 12px;
padding: 4px 10px;
font: 12px/1.3 var(--sans);
background: color-mix(in srgb, var(--color-canvas) 90%, transparent);
}

.chapter-index a {
display: none;
}

@media (width>=1400px) {
.chapter-index {
display: flex;
flex-direction: column;
gap: 9px;
position: fixed;
z-index: 3;
right: auto;
bottom: auto;
left: 16px;
top: 50%;
padding: 0;
background: none;
transform: translateY(-50%);
font: 12px/1.3 var(--sans);
}
.chapter-index a {
display: block;
color: var(--color-text-muted);
text-decoration: none;
padding-left: 10px;
border-left: 2px solid transparent;
}
.chapter-index a:hover {
color: var(--color-text);
}
.chapter-index a[aria-current] {
color: var(--color-text);
border-left-color: var(--color-accent);
}
}

.chapter-index__motion {
padding: 0;
border: 0;
background: none;
background: color-mix(in srgb, var(--color-canvas) 90%, transparent);
color: var(--color-text-muted);
font: inherit;
text-align: left;
font: 12px/1.3 var(--sans);
text-decoration: underline;
text-underline-offset: 3px;
cursor: pointer;
}

.chapter-index__motion:hover {
.motion-control:hover {
color: var(--color-text);
}

.chapter-index__motion:focus-visible {
.motion-control:focus-visible {
outline: 2px solid var(--color-accent);
outline-offset: 3px;
}

@media (width>=1400px) {
.chapter-index__motion {
margin-top: 10px;
padding-left: 12px;
}
}

/* The fixed header's backing fades into the sky, so it never ends in a hard edge. */
.home-body > .site-header {
background: transparent;
Expand Down
Loading