Skip to content
lunogramPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Lunogram website

The lunogram.com homepage: a scroll-driven letter on a dark ground, with the product's own message traffic drifting behind it, the journey that sent it, the list it came from, and a footer.

The page is served in English at / and Dutch at /nl/.

Running it

pnpm install
pnpm dev
Script What it does
pnpm dev Astro dev server on http://localhost:4321
pnpm build Static site into dist/
pnpm preview Serves the built dist/
pnpm check Type-checks the .astro and .ts files

Astro renders everything to static HTML. There is no client framework: the only JavaScript shipped is the choreography, the lane loop and the tooltips, about 4KB in one module.

Deploying

A push to main builds the site and publishes dist/ to GitHub Pages, which serves lunogram.com (.github/workflows/deploy.yml). Pages of the previous site redirect home; the list is RETIRED in astro.config.mjs.

Layout

src/
  data/        content and composition, no markup
  i18n/        the locale list and the path helpers
  lib/         pure helpers used at build time
  components/  the markup
  scripts/     the only code that runs in the browser
  styles/      global CSS, imported by the layout
File What it is
data/letter.ts The hero title and the letter.
data/messages.ts The twenty four sends in the field.
data/tokens.ts The tooltip behind each blue fragment.
data/lanes.ts Lane positions, speeds, and card geometry.
data/nav.ts Everything the menu says, and where its links go.
data/cta.ts The two call to action pills, and where they go.
data/journey.ts Everything the journey after the letter says.
data/lists.ts Everything the list after the journey says, and who is in it.
data/sections.ts The three labels in the index at the bottom.
data/site.ts The title and description per locale.
i18n/config.ts The locale list, and the helpers that move a path between locales.
lib/copy.ts The fragment syntax parser.
lib/jitter.ts Seeded pseudo-random, so builds are identical.
lib/avatar.ts Monogram and tone from a name.
scripts/field.ts Measures a lane set and clones it for the loop.
scripts/scroll.ts The scroll choreography.
scripts/tooltips.ts Hover and focus on the blue fragments.
scripts/menu.ts Opening, closing and measuring the menu.
scripts/reduced-motion.ts Toggles .reduced on <html>.

legacy/ holds the original single-page version this was refactored from. It is kept only for reference and can be deleted.

The idea

The page argues that a message should go out because something happened, not because it is Tuesday. So:

  • The hero title names the category and the trigger in one sentence.
  • The letter demonstrates first (it tells you which event caused it) and explains second (canvas, dynamic lists, channels).
  • The field behind it is the same thing at scale: real sends, to real people, from several different products.

Writing copy

Copy lives in src/data/, never in markup. Square brackets mark a personalised fragment, and a name in parentheses attaches the tooltip registered under that key in data/tokens.ts:

"You are reading this because you [opened the docs twice](event) this week."
"[41,882 rows], kept for the next fourteen days."

This is the only way to produce a blue fragment, which keeps the accent rule below true by construction.

Design tokens

All in :root in src/styles/tokens.css.

Token Value Role
--ground #0B0B0C The desk. Everything sits on this.
--surface #141418 Message card fill.
--paper #F1EDE5 The letter. The only lit object on the page.
--paper-ink #16161A Type on the letter.
--ink / --ink-soft / --ink-dim / --ink-faint Four steps of type on the ground, brightest to quietest.
--accent #2438D9 Reserved. See below.
--accent-lift #7080F6 The same blue, lifted for dark backgrounds.
--r-lg / --r-md / --r-sm 22 / 14 / 10px Radius scale.

The accent rule

Blue means exactly one thing: this fragment was personalised. It appears on the tokens in the letter, on the same fragments inside the drifting cards, and on the call to action. It is not used for logos, icons, avatars, status, or decoration. Keep it that way and the page explains itself without a caption.

Type

Face Role Where
Manrope The human voice Hero title, the letter, the letterhead, the signature
Instrument Sans The system voice Message cards, small labels, the CTA
System monospace The machine voice Webhook cards only

Both faces are self-hosted variable fonts, installed from Fontsource and served from the build. Nothing is fetched from Google.

Everything human is sentence case. Uppercase with wide tracking is reserved for system labels. The hero and the salutation share a face, weight range and tracking on purpose, so the page reads as one person writing.

The scroll choreography

scripts/scroll.ts computes a single progress value p from 0 to 1 across the .scroller (320svh), then drives everything from it. The letter's own phases are ranges of p collected in one PHASE object; what follows the letter is a scene, a range plus a render function, listed in scripts/main.ts.

Phase or scene Range What happens
Title exit 0 → .12 Rises and fades. Starts on the first wheel tick, ease-out.
Sheet rise 0 → .38 Moves from 62% of the viewport to vertically centred. Shadow deepens with --lift.
Line focus .02 + i*.05, each over .12 Each paragraph resolves from 4.6px of blur, top to bottom.
Journey .42 → .95 scripts/journey-centered.ts: the sheet morphs into the email card and the journey draws itself around it.

Each scene gets its own eased 0..1 and they render in order. A page with no scenes falls back to PHASE.handoff, .84 → 1, which blurs and fades the whole stage.

The ranges are packed on purpose: one scene starts where the last one finishes, so no stretch of the scroll shows a still frame. At 900px tall that is 1980px of travel, with the last ~180px left for the journey's light to play out. Widening a range means taking the room from a neighbour.

The letter is whole from the first frame, only out of focus. Nothing is hidden waiting for a scroll listener, so the page has a complete still frame.

The list

The stage lets go after the journey. The list is an ordinary section below it (components/Lists.astro, styles/lists.css, scripts/lists.ts), because by then the reader is reading and a pinned handover reads as a trick. The motion lives inside the section instead, in the same node language as the journey: the list card has an out-port, and two outlet nodes hang off it — Journey and Broadcast.

Something real travels the edges, and the direction is the point. When someone joins, their face leaves their row, rides the edge out to the Journey node and sits there beside the report (Team welcome · started for Marco). When a broadcast goes out, a small paper message comes back down the edge from the Broadcast node into the list, every mark pulses top to bottom as it lands, and the node's report counts up to the number delivered. Both ride an offset-path set from the routed edge, with a short dash trailing behind on the edge itself. The dash's gap is longer than its run so only one is ever on the path; with a shorter gap the next one entered at the start as the first one left.

While the section is on screen this plays on a 12.4s loop, timed rather than scrubbed: someone joins and a journey starts for them; a broadcast goes out; someone leaves; the two of them quietly swap back. The tally follows every change and each one is announced to a live region. It stops the moment the section leaves the viewport or the tab is hidden, and resets to its settled state. Reduced motion shows that settled state with both reports visible.

Everything that moves is opacity, transform, offset-distance, or a dash offset. The edges are routed at layout time from the real port positions — sideways on wide screens, down and across on narrow ones — so the nodes can be moved in CSS alone, and the runners follow.

The index

components/Progress.astro pins three dots to the bottom of the window. The one you are in grows into a pill with its name in it and fills as you scroll through it; hovering or tabbing to any other one opens it the same way, so you can read where a jump goes before taking it, and clicking scrolls there. The dot and the pill are the same element — the item animates its width, the dot animates its height, both on --e-morph — so nothing is swapped out mid-morph.

The letter and the journey are cut from the stage's p, through onProgress, and become current the moment their scene starts moving. The list is below the stage, so it is found by layout: it is current once its top has crossed 55% of the window, and fills as it scrolls through. The index stays hidden over the hero, where the title is the only thing on the page, and fades up once the reader commits to scrolling. Labels live in data/sections.ts. With reduced motion the stage is an ordinary document, so every section is found by layout.

prefers-reduced-motion unpins the stage, drops the lane animation, and shows everything resolved. The .reduced class is toggled on <html>.

The message field

Vertical lanes on a uniform 16.5% grid, two of which pass behind the sheet.

LANES = [ { x, dur, delay, mid?, inner?, wide? } ]   // lane position and speed

Five lanes at normal widths. The 44.5% slot is left out because that is where the sheet sits, and 94% would fall off the edge; both come back above 1800px, where five lanes leave visible gaps.

The field is full bleed. It used to sit inside a 1600px column, which on a wide screen ended the lanes on a hard vertical edge with bare ground beside it. The four edges are faded by painting ground over them in .vignette, not by a mask: a mask on the field takes its moving children off the compositor, and every frame then repaints well over a hundred cards and their blurred shadows.

Every card is rendered at build time. Each lane is a seamless marquee: scripts/field.ts measures the rendered set, tops it up on very tall viewports, then clones it once and animates translateY(-1 * setH) on a linear infinite loop. Durations are 97 to 141 seconds and deliberately coprime-ish so lanes never sync up.

Which message goes in which slot is dealt by composeLanes, card by card rather than lane by lane. It refuses a message whose face is already in that lane or in either lane beside it, so no lane repeats a face and no two neighbouring lanes carry the same one. The field has more avatar slots than there are senders, so a face does appear more than once somewhere; what this rules out is catching it. See the arithmetic under Avatars.

Card geometry is jittered from a fixed seed (jitter(i, seed)), not Math.random, so the composition is identical on every build and can be tuned. Widths per channel are in data/lanes.ts:

WIDTH = { email:[204,34], sms:[178,30], push:[196,30], inapp:[188,28], hook:[200,26] }
// [minimum width, random range] per channel

Width varies, horizontal offset is only ±8px. That was tuned: more sideways jitter made the field read as noise, and cards started colliding across lanes. If you widen the cards, widen the lane spacing in LANES to match or they will overlap.

Responsive: below 1180px the inner lane is hidden, below 900px the mid lanes go too, leaving the two outermost.

Card data

{ ch:"email", t:"08:02", who:"Dmitri Sokolov", s:"Subject", b:"Body with a [token]" }
{ ch:"sms",   t:"09:41", who:"Tomas Brandt",   b:"..." }
{ ch:"push",  t:"11:16", app:"Northwind",      s:"Title", b:"..." }
{ ch:"inapp", t:"12:04", b:"..." }
{ ch:"hook",  t:"240ms", s:"invoice.paid",     b:"delivered to ledger-sync" }

Message is a discriminated union on ch, so the compiler knows an email has a sender and a webhook does not. Each channel renders a different shape, taken from the platform's own preview components (console/src/components/preview/), one component per channel in components/cards/:

  • EmailCard — EmailFrame: avatar, name, time, subject, snippet
  • SmsCard — PhoneFrame: no card, just an incoming bubble with a flattened bottom-left corner
  • PushCard — PushFrame: app tile, app name, time, title, body. Rounder and lighter than the email card
  • InAppCard — a toast with an icon and a dismiss
  • WebhookCard — a status dot, the event in monospace, latency instead of a clock

Avatars

Senders carry a photograph, listed in data/avatars.ts and stored in src/assets/avatars. Astro resizes each to 66px and serves webp, so the 1254px originals never reach the browser: fourteen faces cost about 15KB in total. Only files directly in avatars/ are bundled, so the unused ones parked in avatars/spare cost nothing while they wait.

The pairings of name to face are arbitrary and meant to be set by hand. The names were sorted and matched against the files in the same order, so that nothing about a person is inferred from their name. Point any line at any file.

A sender with no entry falls back to a monogram, tone picked by hashing the name across five near-neutral fills.

The portraits are shot on saturated backgrounds, and they are the one warm thing on the page. Most of that colour is drained out through --ava-treatment in styles/tokens.css: at full strength the blue backgrounds read as personalised fragments, and the rest pull focus off the sheet. Raise the saturation there to bring more back.

On duplicates. The field has 40 avatar slots across seven lanes and there are fourteen senders, so each face is used about three times over. Up to around 1440px nothing repeats on screen, because the dealer keeps the copies out of the same and neighbouring lanes. A wider screen shows 25 avatars at once, more than there are senders, and a face does turn up two or three times; that is accepted, not a bug. Closing it would mean roughly 25 senders with a face each. Six unused faces sit in avatars/spare if you ever want to start.

The menu

One pill that grows into a panel. Nothing is swapped out and nothing crossfades: the shell animates its own width, the drawer animates its own height, and the pill sits on top of both the whole time, so the open reads as the same object opening rather than a dialog arriving.

Three things make that work, and all three are easy to break:

  • The drawer is laid out at the open width from the first frame and centred inside an overflow:hidden box. The text is therefore already wrapped the way it will end up, and never reflows while the shell is still narrow.
  • The shell needs min-width:0. It is a flex item, so its automatic minimum size would otherwise floor it at the drawer's min-content width and the pill could never be narrower than its longest link.
  • The closed width is measured off the button, not the shell. A folded drawer still contributes its full width to max-content, so measuring the shell measures the open panel. scripts/menu.ts takes the button's width plus the frame around it, and pins it as --w.

Only width, height, transform and opacity are animated, so the field moving behind it never has to repaint. --e-morph is the easing for anything that changes size; --ease is for everything else.

The language switcher is the one control that does not animate its own state: picking a language is a page load. The thumb slides on hover and focus instead, as a preview of where you are about to land.

Locales

i18n/config.ts holds the locale list; everything else keys off it. Content lives where it always did, one record per locale:

export const LETTER: Record<Locale, Letter> = { en: {...}, nl: {...} };

Adding a locale means adding it to LOCALES, adding its key to each record in data/, and adding a page that renders <Page locale="xx" />. The switcher, the hreflang alternates and the canonical URL all follow from there.

Two rules worth keeping:

  • The fragment keys have to match across locales. [...](rule) in the English letter and in the Dutch one both look up rule in data/tokens.ts.
  • data/messages.ts holds the same sends in the same order in every locale. The lane composition is indexed off that list, so a locale that reorders it moves every card in the field.

Tooltips

Hovering or focusing a blue fragment in the letter opens a card explaining what produced it. The data lives in data/tokens.ts:

event: { l:"Trigger", e:"docs.viewed · 2 or more in 7 days",
         n:"The journey starts the moment the second event lands. No batch, no cron." }

l is the label, e the expression, n the note, and wrap says whether the fragment is long enough to break across lines. Keep these true to what the platform actually does. They are the only place on the page where the mechanism is stated precisely, and they are what makes the accent colour legible.

Tokens carry tabindex="0" so the tooltips are reachable by keyboard.

Before this ships

  • The names and companies are invented. Dmitri Sokolov, Northwind, Orbit and the rest are placeholders. Swap them for real customers only with permission, otherwise keep them clearly fictional.
  • The links are real. The docs (docs.lunogram.com) and the source (github.com/lunogram/platform) live once in data/site.ts and are read by the menu and the footer. The two call to action destinations, the cal.com introduction call and the sign-up page on accounts.lunogram.com (which sends new accounts on to console.lunogram.com), live in data/cta.ts. #top is real; #after has no section on the main page any more, so scripts/journey-centered.ts retargets it at the end of the journey.
  • The letterhead is set type, not a logo. When you settle on a wordmark, LETTER.letterhead in data/letter.ts is the only place it needs to change; the footer reads it too. The favicons in public/ are the existing brand icon. public/og.jpg is a 1200×630 capture of the hero; retake it when the hero changes.
  • The page ends on the footer. The letter hands off to the journey; the stage then lets go and the list section scrolls up under it, then the footer. The counts, the five people and the outlet reports in data/lists.ts are invented like the rest.
  • prefers-reduced-motion is handled; test it. Also check keyboard focus through the tokens and the call to action.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages