From b3881e698e2c1278a5c5bd5baece3939a504db8d Mon Sep 17 00:00:00 2001 From: James Conway <148910373+jamesconwaydev@users.noreply.github.com> Date: Sun, 29 Nov 2026 19:52:07 -0700 Subject: [PATCH] feat(site): the homepage hero said "hands you the tree" and showed none 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. --- apps/site/src/components/Grove.astro | 455 +++++++++++++++++++++++++++ apps/site/src/pages/index.astro | 38 ++- 2 files changed, 490 insertions(+), 3 deletions(-) create mode 100644 apps/site/src/components/Grove.astro diff --git a/apps/site/src/components/Grove.astro b/apps/site/src/components/Grove.astro new file mode 100644 index 0000000..bf68160 --- /dev/null +++ b/apps/site/src/components/Grove.astro @@ -0,0 +1,455 @@ +--- +// The hero graphic: fragments of HTML, CSS, JavaScript and XML drift in +// from the edges and snap into a parse tree that keeps growing, sheds an +// old branch now and then, and re-forms. Drawn on a canvas, paused when +// off-screen or hidden, and a finished, still tree when the visitor +// prefers reduced motion. +interface Props { + class?: string; +} +const { class: className } = Astro.props; +--- + +
+ + + + diff --git a/apps/site/src/pages/index.astro b/apps/site/src/pages/index.astro index c0bf604..df5901b 100644 --- a/apps/site/src/pages/index.astro +++ b/apps/site/src/pages/index.astro @@ -2,6 +2,7 @@ import Layout from '../layouts/Layout.astro'; import CodeBlock from '../components/CodeBlock.astro'; import hero from '../data/hero.json'; +import Grove from '../components/Grove.astro'; import { pages, softwareSourceCode, repo } from '../lib/site'; import { getVersions, getConformance, suite, baselineUrl, getCrateRows } from '../lib/data'; import { crateRoles, reachPhrase } from '../data/crates'; @@ -110,6 +111,8 @@ const installs = [Version {versions.crates}, Apache-2.0.
+What you wrote
@@ -354,7 +357,18 @@ const installs = [ display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(32px, 5vw, 72px); - align-items: start; + align-items: stretch; + } + + /* The tree grows beside the headline; its box is sized here, so nothing + shifts when the canvas starts drawing. */ + .hero-art { + min-height: 420px; + margin-block: -24px; + } + + .hero-grid > .parse { + grid-column: 1 / -1; } .hero-title { @@ -378,7 +392,7 @@ const installs = [ .parse { display: grid; - grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); + grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) minmax(0, 1fr); gap: 1px; margin: 0; border: 1px solid var(--pc-border-strong); @@ -394,7 +408,6 @@ const installs = [ } .parse-tree { - grid-row: span 2; background: #191b1f; } @@ -618,14 +631,33 @@ const installs = [ .install-grid { grid-template-columns: minmax(0, 1fr); } + + .hero-art { + min-height: 260px; + margin-block: -8px; + } + + .parse { + grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); + } + + .parse-tree { + grid-column: 2; + grid-row: 1 / span 2; + } } @media (max-width: 560px) { + .hero-art { + min-height: 220px; + } + .parse { grid-template-columns: minmax(0, 1fr); } .parse-tree { + grid-column: auto; grid-row: auto; }