From f5cc3a2144c57fa944f6e8aef92638c5ddc90136 Mon Sep 17 00:00:00 2001 From: andwati Date: Mon, 31 Aug 2026 08:12:35 +0300 Subject: [PATCH] Add the Three.js constellation centerpiece and redesign the homepage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Data model: nodes are real content entries (writings, portfolio, bookshelf), edges are shared-tag connections — the same relationship "related posts" already uses, drawn instead of listed. No decorative or fake data. - src/lib/constellation-data.ts: builds the node/edge graph from the actual collections at build time. - src/lib/constellation-scene.ts: vanilla Three.js scene (no framework) — fibonacci-sphere layout, auto-rotation, pointer raycasting with a title tooltip, click-through to the entry's page. Honors prefers-reduced-motion (skips rotation and the spring-eased entrance, which reuses src/lib/spring.ts) and checks WebGL support, falling back to a plain count for browsers/settings that lack it. - src/components/Constellation.astro: wires it up, serializing the graph as inline JSON for the client script to consume. - Homepage rebuilt around it: hero constellation above a 3-column dashboard (latest writings/portfolio/bookshelf), using a new `wide` layout variant on Base.astro (dashboard needs more than the 42rem article width). Also: removes "life and beliefs" from all site copy (site.config.ts, the llms.txt generator + its output) per request — description is now "Computer science and mathematics." Verified in-browser: real WebGL scene renders with correctly positioned/colored nodes and edges, hover shows the right title via raycasting, layout holds at the new wide container width. --- TODO.md | 22 +- apps/site/public/llms.txt | 2 +- apps/site/src/components/Constellation.astro | 70 +++++++ apps/site/src/layouts/Base.astro | 6 +- apps/site/src/lib/constellation-data.ts | 58 ++++++ apps/site/src/lib/constellation-scene.ts | 200 +++++++++++++++++++ apps/site/src/pages/index.astro | 102 ++++++++-- apps/site/src/site.config.ts | 4 +- apps/site/src/styles/global.css | 4 + scripts/generate-llms.astro-site.mjs | 2 +- 10 files changed, 440 insertions(+), 30 deletions(-) create mode 100644 apps/site/src/components/Constellation.astro create mode 100644 apps/site/src/lib/constellation-data.ts create mode 100644 apps/site/src/lib/constellation-scene.ts diff --git a/TODO.md b/TODO.md index 490f7d3..3f297a0 100644 --- a/TODO.md +++ b/TODO.md @@ -69,18 +69,26 @@ approved plan for full rationale on each decision referenced below. header/nav with active-link state, theme toggle, footer with social links. Verified light + dark in-browser across home, a writing detail page (TOC/headings), bookshelf, and 404 -- [ ] Homepage redesign around the Three.js centerpiece as hero — next up +- [x] Homepage redesign around the Three.js centerpiece as hero — the + constellation sits above a 3-column dashboard (latest writings, + portfolio, bookshelf), verified rendering and hover/click working + in-browser - [x] New 404 page concept (terminal easter egg retired) — "Page Fault", now fully styled with the rest of the design system ## Three.js centerpiece -- [ ] Decide the constellation/node-graph data model (what nodes/edges - represent — writings ↔ portfolio ↔ beliefs connections) -- [ ] Build as an isolated Astro island -- [ ] Static image/CSS fallback for `prefers-reduced-motion` and low-end - devices -- [ ] Perf budget check on a low-end/mobile profile +- [x] Constellation data model: nodes are real content entries (writings, + portfolio, bookshelf), edges are shared-tag connections — the same + relationship "related posts" already uses, drawn instead of listed. + No decorative/fake data. `src/lib/constellation-data.ts` +- [x] Built as an isolated component (`Constellation.astro` + a plain + client ` diff --git a/apps/site/src/layouts/Base.astro b/apps/site/src/layouts/Base.astro index 3ce2f34..e3bfb90 100644 --- a/apps/site/src/layouts/Base.astro +++ b/apps/site/src/layouts/Base.astro @@ -8,8 +8,10 @@ import { siteConfig } from "../site.config"; interface Props { title: string; description?: string; + /** Widens .container for dashboard-style layouts (currently just the homepage). */ + wide?: boolean; } -const { title, description } = Astro.props; +const { title, description, wide = false } = Astro.props; const metaDescription = description ?? siteConfig.description; const currentPath = Astro.url.pathname; --- @@ -109,7 +111,7 @@ const currentPath = Astro.url.pathname; -
+
{siteConfig.author.toUpperCase()}