Node 2.101 · CONCEPTCode Library08 MIN READ
Published: 6 Nov 2026

Choreographing Astro

Five patterns I'm happy with this week: vanilla motion, CSS slots, ghosts, and i18n

Abstract

A Concept inventory of patterns from this site: line reveals, grid slots, ghost rows, and locale switching, plus a quick note on page transitions and the GSAP scroll engine held back for its own pass.

Context

This note is the code companion to How This Site Was Built, which covers the stack from the outside. Here I open up specific parts of the codebase to see how they actually work.

So why Astro? I’ve moved through a few stacks over the years. Good old-fashioned hand-written HTML and CSS (2006), Jekyll (2017), Next.js (2020), and now Astro. It’s my current framework of choice because it ships plain HTML by default, adding JavaScript only when you ask for it. That fits a site where the hard parts are motion and layout, not data.

Alongside HTML, CSS, and Tailwind, I spend a lot of my time in timelines (After Effects, Premiere, slide decks) sequencing stories so the timing lands. This note analyses the codebase the same way I look at a timeline. What does a pattern do on screen? How does the underlying code cue it up?

Think of this as an inventory, not a manual. For each pattern, I’ve noted:

  • What the site does: the on-screen effect, in plain words.
  • My current understanding: my reading of it, often framed through an editing or motion analogy (some are still provisional).
  • Open questions: the threads that will turn into deeper dives.

Every excerpt comes straight from this site’s repo. Because I’m refactoring as I write, a few snippets might lag behind the live codebase until this note’s next revision.

This Concept cut covers five patterns I’m happy with this week, plus a quick note on page transitions. The scroll engine is held back for its own pass. More snippets will drop in via the Changelog while this note stays in Concept.

The Patterns

A. Line Splitter (splitLines)

index.astroastro
<h2>
  <span class="reveal-line" style="--i: 1">{t('home.role1')}</span>
  <span class="reveal-line" style="--i: 2">{t('home.role2')}</span>
</h2>
<p data-split-lines data-split-start="3">{t('home.description')}</p>
<div class="hero-block" style="--i: 8"><!-- CTAs --></div>
BaseLayout.astro <script>, steps onlyts
// 1. Wrap each word in a <span>.
// 2. Read each word's offsetTop. A new top = a new line.
// 3. Rebuild the paragraph as one .reveal-line per line, numbered from data-split-start.
// 4. When the last line finishes animating, put the original paragraph back.

What the site does: On the home hero, the text rises line by line: heading, paragraph, then buttons, all in one stagger.

My current understanding: It’s After Effects’ text animator with “based on: lines” and an offset. The heading lines are numbered by hand (--i: 1, 2), but a paragraph’s line breaks depend on the screen width, so the script finds where the browser broke the lines and wraps each one, continuing the count from 3. The CSS then staggers them using --i. When it’s finished, the paragraph goes back to normal HTML, so it reflows properly on resize.

Open questions:

  • Why does it wait for document.fonts.ready? A late font swap would move the line breaks.
  • animationend fires once per animation, and each line has two. How does the code wait for the last one?
  • With reduced motion switched on, the animation doesn’t run. Does that mean the paragraph never gets put back?
  • ’s SplitText is free now. When is it worth writing my own?

B. Drawing an SVG Line (pathLength="1")

about.astroastro
<svg class="thread-svg" viewBox="0 0 2800 620" preserveAspectRatio="xMidYMid meet" aria-hidden="true">
  <path d={THREAD_PATH} stroke="rgba(224,67,67,0.18)" stroke-width="2" fill="none" />
  <path
    id="thread-draw"
    d={THREAD_PATH}
    stroke="#E04343"
    stroke-width="2"
    fill="none"
    pathLength="1"
    stroke-dasharray="1"
    stroke-dashoffset="1"
  />
</svg>

What the site does: On the About page, a red thread draws itself across the timeline as I scroll through the pinned track. A faint copy of the full route sits underneath.

My current understanding: This is Trim Paths. pathLength="1" makes the browser treat the line as one unit long, whatever its real length. The dash is one unit long too, and the offset slides it along. 1 means not started, 0 means fully drawn. The faint copy underneath is an underlay sheet showing the route before it’s inked. The value that drives the offset over scroll comes from the scroll stage; that wiring is held back for its own pass.

Open questions:

  • The reduced-motion CSS sets stroke-dashoffset: 0 and overrides the attribute the script writes. Does CSS always win over SVG attributes?
  • The HTML captions line up with the SVG dots. Is that only because the track’s aspect ratio matches the viewBox?

C. Grid Slot (0fr → 1fr)

[slug].astro <style>css
.node-slot {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition:
    grid-template-rows 440ms var(--ease-sheet),
    opacity 300ms var(--ease-sheet);
}
.node-slot-inner {
  min-height: 0;
  overflow: hidden;
  visibility: hidden;
  transition: visibility 0s linear 300ms;
}
.note-card[data-node-state="active"] .node-slot {
  grid-template-rows: 1fr;
  opacity: 1;
}
.note-card[data-node-state="active"] .node-slot-inner {
  visibility: visible;
  transition-delay: 0s;
}

What the site does: When a note becomes active, its card in the side panel expands to reveal the detail underneath.

My current understanding: You can’t animate to height: auto, but you can animate a grid row from 0fr (nothing) to 1fr (its natural size). The script only changes one attribute, data-node-state, and the CSS does all the motion. The visibility delay keeps the content visible until the fade finishes, then hides it.

Open questions:

  • Does visibility: hidden stop keyboard users from tabbing into the collapsed content? Is that the reason it’s there?
  • Why does the inner element need min-height: 0?
  • The “feeds into” control in the slot is a <span role="button"> inside the card’s link. Why is that nesting a problem, and what’s the better structure?

D. Polymorphic Tag (Ghost Notes)

journal/index.astroastro
---
const ghost = entry.data.launchState === 'ghost';
const Tag = ghost ? 'div' : 'a';
---
<Tag
  href={ghost ? undefined : `/${locale}/journal/${slug}`}
  class:list={['journal-row grid …', ghost ? 'journal-ghost' : 'group']}
  data-status={entry.data.status}
  data-tags={(entry.data.tags ?? []).join('|')}
>
  {ghost && (
    <p class="…">
      <svg aria-hidden="true"><!-- padlock --></svg>
      {statusLabel} · {formatJournalDate(entry.data.date, locale)}
    </p>
  )}
  <!-- shared: node number, title, subtitle, meta, abstract, tags -->
</Tag>

What the site does: In the journal index, live notes are clickable rows. Ghost notes (planned but not written) look similar, but show a padlock, their status, and their date. They don’t respond to hover or clicks.

My current understanding: One template, two possible HTML tags. If the note’s frontmatter says launchState: "ghost", the row is built as a <div>. Otherwise, it’s an <a> link. Only live rows get the group class, so hover styles skip ghosts automatically. That part is Tailwind. The data-* attributes also feed the filter tabs.

Open questions:

  • Why undefined for the href, rather than an empty string?
  • Does a <div> row get skipped by keyboards and screen readers in a way a dead link wouldn’t?

E. Language Switcher (pointLocale)

[slug].astroastro
---
const enPath = `/en/journal/${entry.data.translationSlug}`;
const frPath = `/fr/journal/${entry.data.translationSlug}`;
---
<div id="journal-stage" data-locale-en={enPath} data-locale-fr={frPath}>
[slug].astro <script>ts
const en = root.dataset.localeEn;
const fr = root.dataset.localeFr;
if (en) document.querySelector('[data-locale-target="en"]')?.setAttribute('href', en);
if (fr) document.querySelector('[data-locale-target="fr"]')?.setAttribute('href', fr);

What the site does: On a journal note, switching to French takes me to the French version of the same note, not back to the start of the journal.

My current understanding: The note writes both language URLs onto the page as data- attributes. A small script reads them and updates the header’s language links. The page and the header never import each other. They share two attributes, like two departments agreeing on a file-naming convention. Both languages use the same slug, which is also how the transition planner recognises a language switch.

Open questions:

  • What happens if a note doesn’t exist in French yet? Does the link lead to a 404?
  • If both languages share a slug, could the header build the link itself without a script?

F. Page Cuts (edit decision, kept light)

BaseLayout.astro <script>ts
const localeSwap = from.page === to.page && from.slug === to.slug && from.lang !== to.lang;
const noteToNote = from.page === 'journal' && to.page === 'journal'
  && Boolean(from.slug) && Boolean(to.slug)
  && from.lang === to.lang;

const mode = reduce || localeSwap ? 'fade' : noteToNote ? 'article' : 'wipe';
global.csscss
html[data-vt="wipe"]::view-transition-new(site) {
  animation: vt-angled-wipe 720ms var(--ease-in-out) both;
}

@keyframes vt-angled-wipe {
  0%   { clip-path: polygon(0% -40%, 100% 0%, 100% 0%, 0% -40%); }
  100% { clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%); }
}

What the site does: Three kinds of cut. Room-to-room (Home, About, CV, Journal) gets an angled wipe. Note-to-note keeps the side panel and fades the essay. Language switch, or reduced motion, gets a plain fade.

My current understanding: Before each navigation, the script labels the cut (wipe, article, or fade) on <html>. The CSS reads that label. That part is an edit decision list. The wipe itself is a clip-path. The planner plumbing (stamping both documents, the loader, the click epoch) is queued with the ClientRouter deep dive.

G. Scroll Stage (choreography owned, engine deferred)

On Home, About, and CV, desktop scroll feels weighted. Sections pin. Colour and pillars move on a timeline. Mobile and prefers-reduced-motion fall back to a plain stack.

I designed those beats: what pins, when colour snaps, how the Bienvenue bridge lands, where reduced motion cuts the show. That is choreography, the same skill I use in Premiere and After Effects.

The engine under it (, ScrollTrigger, , the shared ticker, matchMedia teardown) is a separate layer, and I’ve cut it from this inventory. The site ships, and that engine gets its own pass. It’s the first Next Step below.

Early Hunches

Three ideas show up in the patterns above. Not principles yet:

  1. JavaScript writes the state, CSS does the motion. data-node-state, data-vt, locale data- attributes. The script is the edit decision list; the stylesheet is the transition library.
  2. The frontmatter decides, the template follows. launchState picks <div> or <a>. translationSlug points the language switch.
  3. Choreography and the engine are separate layers of authorship. I set the beat sheet. Now the ticker is the next layer to learn.

These aren’t standard details yet. They work on this site. They stay scoped to this project until the open questions close.

Next Steps

Still Concept (01)

  1. / / ScrollTrigger ownership pass: live in the scroll-stage code and bring the ticker, matchMedia, and cleanup into the owned layer.
  2. ClientRouter lifecycle deep dive: AbortController, transition:persist, what survives a cut. Queued.
  3. Later snippet additions: grow this inventory via Changelog without leaving Concept.

Towards Schematic (02), later

  1. Fold answered patterns into reusable standard details once the open questions close.

Key Terms

Plain-language working definitions:

  • pathLength: An SVG attribute that sets a line’s length to whatever number you choose. The basis of Trim Paths in the browser.
  • fr unit: A share of the space in a grid. 0fr → 1fr animates to the content’s natural size.
  • Polymorphic tag: One template that can output different HTML elements.
  • translationSlug: Shared slug across locales so the language switch stays on the same note.
  • Edit decision list: Labelling each cut with its transition type before it plays (wipe / article / fade).

Changelog

  • 06 Nov 2026 - First inventory (v1.0): five patterns, a short note on page cuts, and the scroll engine held for its own pass. Still Concept.