You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 359059f
Browse filesBrowse the repository at this point in the historyBrowse files
Rebuilds "/" with the scrollcraft engine under the Live surface grammar:
five acts over 11.0vh, the ranking scrubbing through real snapshot
history as the signature move, and the 3D constellation promoted to the
peak's lock target. Nav becomes app chrome across all routes.
Adds GET /api/v1/tools/history/bulk, which the landing depends on. The
backend must be live before the frontend build that calls it.
Verified with the skill's harness at desktop, 390x844 and reduced
motion: no dead scroll, every cue peaks, all contrast clears 4.5:1.
Zero generated assets, zero API credits spent.
Copy file name to clipboardExpand all lines: CLAUDE.md
+5-4Lines changed: 5 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -87,15 +87,16 @@ The GitHub half of the score always worked; the **developer-conversation half**
87
87
To grow the signal further: add more subreddits/RSS feeds, fetch HN story text (not just titles), or widen keywords in `catalog.py`.
88
88
89
89
### Frontend
90
-
-**App Router** (`frontend/src/app/`). Key routes: `/` (landing — repositioned so **roadmaps are the hero**, momentum is the proof; leads with the `FiveMinutePlan` goal→roadmap chooser), `/explore`, `/trends`, `/compare`, `/tools/[slug]` (renders `LearningResources`), `/roadmap/[technology]` (interactive path — per-step "Watch on YouTube" + per-tool "Best course" videos, progress check-off), `/roadmaps`, `/watchlist`, plus the growth surfaces: `/plan/[slug]` (public shareable career-plan landing, per-goal OG preview), `/learn/[slug]` (SSR SEO guide "How to Learn X in 2026" with Course/FAQ JSON-LD), and `/api/og` (dynamic Open Graph card via `next/og`). `ShareButton` (native share + copy) drives the acquisition loop; goal→roadmap mapping lives in `src/data/goals.ts`. `sitemap.ts` lists all learn/roadmap/plan/tool pages. Set `NEXT_PUBLIC_SITE_URL` in production so OG/canonical/sitemap URLs are absolute.
90
+
-**App Router** (`frontend/src/app/`). Key routes: `/` (landing — **rebuilt with the `scrollcraft` engine under the "Live surface" grammar**; see the section below), `/explore`, `/trends`, `/compare`, `/tools/[slug]` (renders `LearningResources`), `/roadmap/[technology]` (interactive path — per-step "Watch on YouTube" + per-tool "Best course" videos, progress check-off), `/roadmaps`, `/watchlist`, plus the growth surfaces: `/plan/[slug]` (public shareable career-plan landing, per-goal OG preview), `/learn/[slug]` (SSR SEO guide "How to Learn X in 2026" with Course/FAQ JSON-LD), and `/api/og` (dynamic Open Graph card via `next/og`). `ShareButton` (native share + copy) drives the acquisition loop; goal→roadmap mapping lives in `src/data/goals.ts`. `sitemap.ts` lists all learn/roadmap/plan/tool pages. Set `NEXT_PUBLIC_SITE_URL` in production so OG/canonical/sitemap URLs are absolute.
91
91
-**`frontend/src/data/trends.ts` is the only place the frontend talks to the backend.** Every page imports typed `fetchX()` helpers from here (`fetchTools`, `fetchOverview`, `fetchToolDetail`, `fetchLearningPath`, `fetchCompareTools`, etc.). Fetches use Next.js ISR (`revalidate`). **Do not hardcode tool/score/roadmap data in components — it must come through this layer.**
92
92
-**Same-origin API proxy (do not undo).** The browser calls its OWN origin `/api/v1/*`; `frontend/next.config.ts` rewrites that to `BACKEND_ORIGIN` server-side. So there is **no CORS** and only the page's own port must be reachable (this fixed the class of bug where a hardcoded `http://<LAN-IP>:8000` was unreachable from the same machine/phone). `API_BASE` in `trends.ts` = `window.location.origin` on the client, `process.env.BACKEND_ORIGIN || "http://localhost:8000"` on the server (SSR/ISR). **`NEXT_PUBLIC_API_URL` was removed — do not reintroduce it.** Gotchas: `BACKEND_ORIGIN` is read at BUILD time by `rewrites()`, so it must be set before the build (docker-compose passes `http://backend:8000` as a build arg; Vercel sets the public backend URL); the rewrite is scoped to `/api/v1/*` so the app's own `/api/og` route is NOT proxied. Absolute site URL (OG/canonical/sitemap/JSON-LD) has a single source of truth: `frontend/src/lib/site.ts` (`SITE_URL` ← `NEXT_PUBLIC_SITE_URL`).
93
-
-**Mobile:** the landing renders a dedicated `MobileHome` tree below 768px, chosen by a JS breakpoint in `page.tsx` (NOT a CSS hidden/block split) so the heavy R3F 3D constellation never mounts on phones. Entrance animations there (and in `FiveMinutePlan`) are fail-safe: content only starts hidden once a visible tab is confirmed (`canAnimate` gate), else it paints visible — never stranded by an animation that doesn't fire. The `Navbar` is transparent (no bg box) with a scroll-progress bar; `template.tsx`'s page transition is opacity-only (a transform there breaks the fixed navbar's stick).
93
+
-**Mobile:** the landing renders the **same five acts** at every width — what must be avoided on a phone is the WebGL context, not the design, so `ActRadarLock` takes a `webgl` prop and swaps its ground for a CSS lattice below 768px. R3F still never mounts there. `MobileHome` is now reached ONLY when there is no live data to build the acts from. Entrance animations there (and in `FiveMinutePlan`) are fail-safe: content only starts hidden once a visible tab is confirmed (`canAnimate` gate), else it paints visible — never stranded by an animation that doesn't fire. The `Navbar` is **app chrome** (tab strip + a live status line from `/overview`), transparent with a scroll-progress bar — Live surface forbids a wordmark-plus-CTA bar, and mono is kept for data/labels but not as a "technical" costume; `template.tsx`'s page transition is opacity-only (a transform there breaks the fixed navbar's stick).
94
94
-**Auth:** Clerk, wired via `<ClerkProvider>` in `frontend/src/app/layout.tsx`. Keep it.
95
95
- **Design system ("Dala" — the void + one electric accent, DARK-FIRST, adopted 2026-08-25, replacing the short-lived Mercury and the older wine "Neon Noir"):** dark is the DEFAULT — the pre-paint script in `layout.tsx` adds `.dark` to `<html>` unless the visitor explicitly chose light, and `Navbar.tsx` is the only writer of that class. Dark values live in `html.dark`, light values in `:root`. **Dark: pure `#000000` canvas — never dark grey** — Bone White `#ffffff` text, Ash Gray `#9a9a9a` secondary, Silver Mist `#bdbdbd` tertiary. ONE accent, Electric Iris `--accent-1: #8052ff`, **for filled actions only, never a large surface**; Saffron Spark `--accent-2: #ffb829` is a separate *highlight/emphasis* role, **not a gradient partner**; Deep Verdant `#15846e` appears only in the logo/particles. **Data colours stay separate and constant — score-green `#12B76A`, amber `#B54708`, red `#F04438` — momentum meaning only.** **The defining rule: there is NO card surface.** `--c-surface` equals the canvas, and `.tech-panel`/`.glass-panel` have no fill, no border and no shadow — elements float on the void with whitespace alone, at 24px radius. **The one deliberate deviation:** `DashboardShell.tsx` adds a `route-data` class on `/explore|/trends|/compare|/tools|/roadmap(s)|/watchlist`, and a single CSS rule gives panels there a 1px hairline (still no fill, no shadow) — 31 rows of scores on pure black are unreadable otherwise. Tune it in that one rule. **Typography — hierarchy comes from SCALE and TRACKING, never weight:** headings are **weight 400 (never bold)**, body is **weight 200**, nav/labels 600 uppercase at 0.025em, and display sizes 42px+ carry `-0.04em` tracking. Dala is a **single-typeface** system: **Inter** (the spec's own named substitute for PPNeueMontreal) for everything — `--font-display` is Inter, not Space Grotesk. JetBrains Mono is retained ONLY for tabular figures (scores/stats) and carries `tabular-nums`. **Note:** the `@theme` font tokens were historically beaten by Tailwind's defaults, so the app silently rendered in system-ui for a long time; explicit `body`/`.font-display`/`.font-mono` rules at the END of `globals.css` now bind the next/font faces — do not remove them. **No gradients on UI components** (logo/particles only): `.gradient-text` and `.text-shimmer` are flat Saffron, `.btn-primary` is a flat Iris pill, `.glow-line`/`.neon-rule` are hairlines, `.aurora-mesh` and the `.ambient-orb` washes are off. The ambient layer is `.ambient-particles` — three radial-gradient dot layers, `position: fixed` so it parallaxes with **no scroll listener at all**. **No scroll-driven colour:** every section is pure black, and per the spec the navbar has **no fill and no backdrop-blur at any scroll position**. Do NOT reintroduce the retired palettes (Mercury onyx/cobalt, wine `#7C2D4A`/magenta, violet `#A78BFA`/pink, electric blue, indigo `#4338CA`, or the teal/graphite/clay themes). **Theming mechanism:** `:root`/`html.dark` remap Tailwind's whole `--color-indigo-400/500/600/700` scale to Iris, so every existing `*-indigo-*` utility (~350) follows automatically. Use `indigo-*` or `var(--accent-1)` — never a hardcoded hex. Colours a token swap cannot reach must be hand-edited: `3d/LiveConstellation.tsx`, `3d/TechSphere.tsx` (Three.js can't read CSS vars), `ChartContainer.tsx`, and `api/og/route.tsx` (server-rendered, no CSS). Utility classes: `tech-panel`(+`-interactive`), `terminal-window`/`terminal-bar`, `hud-grid`, `glass-panel`, `btn-primary`, `ticker-rail` (edge-masked marquee), `split-reveal`, `sr-loader`, `confetti-piece`, `slide-up`/`fade-in`/`glow-hover`, `ambient-particles`. **Animation fail-safe rule (learned 4×):** never let a JS-clock animation be the ONLY thing revealing content — framer-motion pauses on a backgrounded tab and never writes the final value. Prefer CSS, and make the resting state the readable one; `.slide-up` is transform-only for exactly this reason. **Values are MEASURED from the live reference (`dala.craftedbygc.com`), not inferred:** primary button `22.5px` radius / `14.4px 15.96px` padding / 12px-600-uppercase at `0.3px`; the Saffron `.eyebrow` is 12px-600-uppercase at `0.6px`; display type 112px at `-0.04em`; section rhythm **48px** (`.section-rhythm`, hero `144px`). Motion uses that site's own curves: `--ease-wipe` `cubic-bezier(0.76,0,0.24,1)` (the 1s text wipe), `--ease-clip` `(0.215,0.61,0.355,1)`, `--ease-hover` `(0.25,1,0.5,1)`, `--ease-colour` `(0.5,1,0.89,1)`. Type steps: `.t-display` / `.t-section-lg` / `.t-cta` / `.t-statement` / `.t-narrative` (all weight 400, `-0.04em` above 42px) with `.measure` for the ~26rem body column. **The ambient layer is outlined TRIANGLES** (`.ambient-particles`, SVG data-URIs) — note the tile size must EQUAL `background-size`, or the triangles upscale (a 60px tile at 210px scaled them 3.5x into wallpaper). **Turbopack gotcha:** `globals.css` edits don't serve until `.next` is deleted + the dev server restarted — this bites EVERY time, and a stale cache also silently breaks the landing page's client data fetching, which looks like an unrelated bug.
96
96
-**Logo (`Navbar.tsx`)** — built on the reference's construction: an abstract letterform from **flat geometric primitives on a grid** (a large quarter-circle sweep, a solid square, a smaller quarter-circle), each gradient-filled, **no strokes and NO container badge** — the mark floats on the void. Ours makes the primitives mean something: quarter-circles are radar sweeps, the square is the stack. The **wordmark stays monochrome white at weight 400** — the mark carries all the colour, otherwise the two compete. Gradients are allowed here precisely because the spec exempts the logo and particle art.
97
-
-**`ScrollExpand` (`ui/ScrollExpand.tsx`)** — a scroll-driven zoom/expand. `fit="media"` frames a 16:9 stage that opens 62%→100% while the media counter-zooms (`mediaZoom`); `fit="content"` wraps existing markup and applies only the scale. Currently on the **narrative passage** (1.14) and the **5-minute-plan** (1.10, mounted INSIDE that `<section>` so the `#five-minute-plan` anchor the navbar links to survives). Keep the count low — past three or four, a page-wide zoom stops reading as a beat. It writes a `--expand` CSS var from ONE passive rAF-throttled listener, never per-frame React state.
98
-
-**The 3D constellation is a contained hero FIGURE, not a background.** It was once promoted to a fixed full-viewport layer to copy the reference's brain; that failed because theirs is thousands of 1–2px triangles (a texture you look *through*) while ours is ~40 labelled data spheres (an information graphic you *read*). At viewport scale it became giant blobs and floating chips over the headline. Scroll-morphing between formations still exists in the component but is **gated to the `background` variant** — a contained figure that deforms as you scroll past reads as a glitch.
97
+
- **The landing is a `scrollcraft` build (adopted 2026-08-27).** The engine is vendored **byte-identical** at `public/scrollcraft/scrollcraft.js` (+ `src/lib/scrollcraft/scrollcraft.css`, imported at the top of `globals.css`) and **must never be edited** — bespoke behaviour goes in the page, driven off `--sc-p` and our own `data-sc-*`. Themed by remapping `--sc-*` onto Dala tokens at the end of `globals.css`, never by touching the engine's stylesheet. Five acts in `components/landing/` (instrument `pin` 1.6 → time-axis `pan` 2.4 → radar-lock `pin` **3.4, the peak** → sources `flow` → commit `pin` 2.3), 11.0vh total. **Signature move:** scroll is the time axis — the wheel scrubs the real `ToolSnapshot` series (`/tools/history/bulk`) and the ranking reorders; only POSITION tweens, every number shown is snapped to a real reading. Gotchas, each cost a debugging round: the engine is an **IIFE, not a module** (static import breaks SSR, dynamic import won't typecheck — load it as a script); `mount()` **collects acts once** and `layout()` never rescans, so `ScrollcraftRoot` must not mount until the data has rendered its acts; there is **no `destroy()`**, so the wrapper keeps one instance per root and empties `acts/worlds/clips` on unmount; and **Lenis is disabled on `/`** because two systems interpolating `scrollY` disagree about where the page is. Verify with `node <skill>/scripts/shoot.mjs --url http://localhost:3000` (needs `playwright-core` in `frontend/`) — it catches cue windows that never peak and contrast over media. Brief + fingerprint registry live in `scrollcraft/`.
98
+
-**`ScrollExpand` (`ui/ScrollExpand.tsx`)** — a scroll-driven zoom/expand. `fit="media"` frames a 16:9 stage that opens 62%→100% while the media counter-zooms (`mediaZoom`); `fit="content"` wraps existing markup and applies only the scale. **No longer mounted on the landing** (its scale gesture fights pinned acts); still available for other routes. Keep the count low — past three or four, a page-wide zoom stops reading as a beat. It writes a `--expand` CSS var from ONE passive rAF-throttled listener, never per-frame React state.
99
+
-**The 3D constellation is now the PEAK's lock target** (act 3 of the landing), composited under a reticle driven from `--sc-p`. It is not rewritten and not a background. It was once promoted to a fixed full-viewport layer to copy the reference's brain; that failed because theirs is thousands of 1–2px triangles (a texture you look *through*) while ours is ~40 labelled data spheres (an information graphic you *read*). At viewport scale it became giant blobs and floating chips over the headline. Scroll-morphing between formations still exists in the component but is **gated to the `background` variant** — a contained figure that deforms as you scroll past reads as a glitch.
99
100
-**Number formatting:** always pass a locale — bare `.toLocaleString()` uses the BROWSER's locale, so 2772018 rendered as `27,72,018` on an en-IN machine and would differ per visitor. Use `.toLocaleString('en-US')`.
0 commit comments