Skip to content

feat(site): the homepage hero said "hands you the tree" and showed none growing - #5

Merged
jamesconwaydev merged 1 commit into
mainfrom
hero-animation
Nov 30, 2026
Merged

jamesconwaydev merged 1 commit into
mainfrom
hero-animation

Conversation

@jamesconwaydev

Copy link
Copy Markdown
Contributor

Problem

The homepage says Parsec hands you the tree, and the hero showed a static parse example beside the headline and nothing alive. netweir.com and conn3x.org each open on a moving graphic that shows what the project does. parsec.tools didn't.

Change

  • apps/site/src/components/Grove.astro: fragments of HTML, CSS, JavaScript and XML (<div, @media, =>, xmlns, </p> and so on) drift in from the edges and snap into a parse tree that keeps growing.
    • A marigold pulse runs down each branch as its node lands.
    • Every so often an old branch lets go, its fragments drift back out, and the tree re-forms around the gap.
    • A label shows only where it fits before the next node on its row, so labels never overlap.
  • Light theme: it follows the colour scheme, using the darker accent the site already uses for text on light.
  • Reduced motion: prefers-reduced-motion: reduce gets one finished tree that doesn't move.
  • Cost: it pauses when it's off screen or the tab is hidden, and draws at the device's pixel ratio. Glows are a sprite drawn once, not shadowBlur. It's a bundled script of 2.9 KB gzipped, so the CSP needs no new hash. The canvas is aria-hidden and its box is sized in CSS, so nothing shifts when it starts.
  • Phones: below 400 px it grows a smaller, slower tree.
  • index.astro: the tree takes the hero's right column. The real parse example moves under the headline as a full-width row, with what you wrote, what Parsec built and what it noticed side by side. It keeps the two-column layout up to 900 px and stacks on phones.

Tests

  • pnpm build and astro check are clean, with 0 errors and 0 warnings.
  • Lighthouse on the home page: 100 / 100 / 100 / 100 on both mobile and desktop.
  • check-headers.mjs: the home page passes, and every inline script, style and style attribute is hashed.
  • Header check failures elsewhere: the check fails on other pages, none of which this PR touches.
    • Each of them reports a 404 resource with analytics consent granted.
    • /changelog/ also reports attachShadow.
    • The home page, the only page with this change, isn't on the list.
  • Manual checks: looked at in dark, light, reduced motion, 375 px and 768 px.

The preview from the deploy workflow comes with this PR's run, at https://hero-animation.parsec-site.pages.dev.

…ne growing

Fragments of HTML, CSS, JavaScript and XML now drift in from the edges
beside the headline and snap into a parse tree that keeps growing. A
pulse runs down each branch as its node lands, and every so often an
old branch lets go and the tree re-forms around the gap.

It's a canvas in apps/site/src/components/Grove.astro, loaded as a
bundled script, so the CSP needs no new hash. It pauses when it's off
screen or the tab is hidden, and draws at the device's pixel ratio.
With reduced motion it's one finished tree that doesn't move. Below
400 px it grows a smaller, slower tree.

The real parse example moves under the headline as a full-width row,
with what you wrote, what Parsec built and what it noticed side by
side.

@foothillsdigital foothillsdigital left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving b3881e6.

  • Build: pnpm --filter site build builds 19 pages, and astro check shows 0 errors and 0 warnings.
  • CSP: the Grove script ships as an external module (/_astro/Grove.astro_astro_type_script_index_0_lang.*.js, 6.3 KB before gzip) and isn't inline, so _headers needs no new hash, as you say.
  • It can't run away or leak:
    • Live nodes are capped by maxNodes(), and prune() drops an old branch when it's reached.
    • Finished tokens are filtered out every frame.
    • The loop stops via IntersectionObserver off-screen and on visibilitychange when the tab is hidden.
    • start() refuses to run while hidden, off-screen, already running, or under reduced motion.
  • Reduced motion: it grows one finished tree and never starts the loop. Its change listener switches either way live. The light-scheme listener re-reads the colours.
  • No layout shift: the canvas is aria-hidden, and its box is sized in CSS, so nothing moves when it starts.

What I couldn't check here: scripts/check-headers.mjs needs a Playwright browser, and it fails before checking anything on my machine, identically on main. So the header and Lighthouse numbers are yours. I also didn't watch it animate.

@jamesconwaydev
jamesconwaydev merged commit bc2a8ee into main Nov 30, 2026
1 check passed
@jamesconwaydev
jamesconwaydev deleted the hero-animation branch November 30, 2026 02:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants