# Homepage Implementation Plan > **For Claude:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task. **Goal:** Build a cinematic, scroll-driven project homepage for Understand Anything using Astro, deployed to GitHub Pages via `gh-pages` branch. **Architecture:** Astro SSG project in `homepage/` on main. Self-hosted fonts (DM Serif Display, Inter, JetBrains Mono) with robust fallbacks. Pure CSS animations triggered by `IntersectionObserver`. GitHub Actions workflow builds and deploys to `gh-pages` on push. **Tech Stack:** Astro 5, CSS custom properties, vanilla JS, GitHub Actions **Design doc:** `docs/plans/2026-03-15-homepage-design.md` --- ### Task 1: Scaffold Astro Project **Files:** - Create: `homepage/package.json` - Create: `homepage/astro.config.mjs` - Create: `homepage/tsconfig.json` - Create: `homepage/src/pages/index.astro` (placeholder) - Create: `homepage/src/layouts/Layout.astro` (placeholder) - Create: `homepage/public/.gitkeep` **Step 1: Initialize Astro project** ```bash cd /Users/yuxianglin/Desktop/opensource/Understand-Anything mkdir -p homepage cd homepage pnpm create astro@latest . -- --template minimal --no-install --no-git --typescript strict ``` If the interactive prompt blocks, create files manually instead. **Step 2: Configure Astro for GitHub Pages** Edit `homepage/astro.config.mjs`: ```js import { defineConfig } from 'astro/config'; export default defineConfig({ site: 'https://lum1104.github.io', base: '/Understand-Anything', }); ``` **Step 3: Verify the project builds** ```bash cd /Users/yuxianglin/Desktop/opensource/Understand-Anything/homepage pnpm install pnpm build ``` Expected: Build succeeds, `dist/` directory created. **Step 4: Commit** ```bash git add homepage/ git commit -m "feat(homepage): scaffold Astro project with GitHub Pages config" ``` --- ### Task 2: Self-Host Fonts & Base CSS **Files:** - Create: `homepage/public/fonts/DMSerifDisplay-Regular.woff2` - Create: `homepage/public/fonts/Inter-Regular.woff2` - Create: `homepage/public/fonts/Inter-SemiBold.woff2` - Create: `homepage/public/fonts/JetBrainsMono-Regular.woff2` - Create: `homepage/src/styles/global.css` **Step 1: Download font files** Download the WOFF2 files from Google Fonts API (or fontsource). Place them in `homepage/public/fonts/`. Required files: - DM Serif Display Regular (woff2) - Inter Regular + SemiBold (woff2) - JetBrains Mono Regular (woff2) Use curl to download from fontsource CDN or Google Fonts CSS API. Example: ```bash mkdir -p homepage/public/fonts # Download from fontsource (reliable CDN) curl -L "https://cdn.jsdelivr.net/fontsource/fonts/dm-serif-display@latest/latin-400-normal.woff2" -o homepage/public/fonts/DMSerifDisplay-Regular.woff2 curl -L "https://cdn.jsdelivr.net/fontsource/fonts/inter@latest/latin-400-normal.woff2" -o homepage/public/fonts/Inter-Regular.woff2 curl -L "https://cdn.jsdelivr.net/fontsource/fonts/inter@latest/latin-600-normal.woff2" -o homepage/public/fonts/Inter-SemiBold.woff2 curl -L "https://cdn.jsdelivr.net/fontsource/fonts/jetbrains-mono@latest/latin-400-normal.woff2" -o homepage/public/fonts/JetBrainsMono-Regular.woff2 ``` If download fails, try alternative URLs or use `npx fontsource` to install locally. **Step 2: Create global CSS with design tokens and font-face declarations** Create `homepage/src/styles/global.css`: ```css /* Font declarations — self-hosted, no external CDN dependency */ @font-face { font-family: 'DM Serif Display'; src: url('/Understand-Anything/fonts/DMSerifDisplay-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; } @font-face { font-family: 'Inter'; src: url('/Understand-Anything/fonts/Inter-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; } @font-face { font-family: 'Inter'; src: url('/Understand-Anything/fonts/Inter-SemiBold.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; } @font-face { font-family: 'JetBrains Mono'; src: url('/Understand-Anything/fonts/JetBrainsMono-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; } /* Design tokens */ :root { --bg: #0a0a0a; --surface: #141414; --border: #1a1a1a; --accent: #d4a574; --accent-glow: rgba(212, 165, 116, 0.15); --text: #e8e2d8; --text-muted: #8a8578; --font-heading: 'DM Serif Display', Georgia, 'Times New Roman', serif; --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; --font-code: 'JetBrains Mono', 'SF Mono', 'Cascadia Code', 'Fira Code', monospace; } /* Reset & base */ *, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; } html { scroll-behavior: smooth; } body { font-family: var(--font-body); background-color: var(--bg); color: var(--text); line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden; } /* Noise texture overlay */ body::before { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 9999; opacity: 0.03; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E"); } /* Scroll-reveal animation */ @keyframes fadeSlideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } } .reveal { opacity: 0; } .reveal.visible { animation: fadeSlideUp 0.8s ease-out forwards; } /* Stagger delays for feature cards */ .reveal-delay-1 { animation-delay: 0.1s; } .reveal-delay-2 { animation-delay: 0.25s; } .reveal-delay-3 { animation-delay: 0.4s; } a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; } ``` **Step 3: Import global CSS in Layout** Update `homepage/src/layouts/Layout.astro`: ```astro --- interface Props { title: string; } const { title } = Astro.props; --- {title} ``` **Step 4: Build and verify fonts load** ```bash cd /Users/yuxianglin/Desktop/opensource/Understand-Anything/homepage pnpm build ``` Expected: Build succeeds. Check `dist/fonts/` contains the woff2 files. **Step 5: Commit** ```bash git add homepage/public/fonts/ homepage/src/styles/global.css homepage/src/layouts/Layout.astro git commit -m "feat(homepage): add self-hosted fonts and design token CSS" ``` --- ### Task 3: Nav Bar Component **Files:** - Create: `homepage/src/components/Nav.astro` **Step 1: Create the nav component** Create `homepage/src/components/Nav.astro`: ```astro --- const githubUrl = 'https://github.com/Lum1104/Understand-Anything'; --- ``` **Step 2: Add Nav to index.astro (temporary test)** Update `homepage/src/pages/index.astro`: ```astro --- import Layout from '../layouts/Layout.astro'; import Nav from '../components/Nav.astro'; ---