Skip to content

Add Harsh.Town design preview at /town/#4

Draft
97harsh wants to merge 3 commits into
nextjs-migrationfrom
feat/harsh-town
Draft

Add Harsh.Town design preview at /town/#4
97harsh wants to merge 3 commits into
nextjs-migrationfrom
feat/harsh-town

Conversation

@97harsh
Copy link
Copy Markdown
Owner

@97harsh 97harsh commented May 4, 2026

Summary

  • Adds a single self-contained town/index.html rendering the Harsh.Town design from the Claude Design handoff bundle — a soft pixel top-down portfolio prototype.
  • A tiny self-attention layer runs in-browser via TensorFlow.js (loaded from CDN) and drives autonomous chatter between ambient NPCs. Six project NPCs (UBC-OCEAN, MOTS, Codex, TFJS Webcam, Forecast-9, Ola Routing) are clickable and reveal a modal with body copy, tags, and a trait-embedding bar chart.
  • HUD shows TFJS / ATTN / utterance counters, plus a transcript drawer (☰ TRANSCRIPT) and ATTN heatmap toggle. WASD moves the player; E talks to the nearest project NPC. After 3 clicks without movement, a "psst… use WASD" hint surfaces.
  • Lives only at /town/ — the existing Jekyll site is untouched. Once we're happy we can promote it to / in a follow-up.

Implementation notes

  • Single file. React 18, ReactDOM, and Babel-standalone load from unpkg; TFJS loads dynamically from jsdelivr on first mount. No build step.
  • Front matter layout: null, permalink: /town/, sitemap: false so Jekyll skips the default layout/sidebar and the page is excluded from the sitemap during preview.
  • The inline <script type="text/babel"> block is wrapped in {% raw %}…{% endraw %} because the JSX uses {{ }} for inline style objects, which Liquid would otherwise eat.
  • Verified the file Liquid-parses cleanly locally (Ruby liquid gem). Couldn't run a full jekyll build locally — Gemfile.lock points at gems not installed in this env — but GitHub Pages will build it server-side once this PR lands.

Test plan

  • Visit https://97harsh.github.io/town/ after merge (or via a PR preview if configured) and confirm the page renders the pixel town with a tan background and HUD bar at the top.
  • Confirm "TFJS" stat flips from loading…READY and "ATTN" goes to ACTIVE within ~2s.
  • Move with WASD / arrow keys; bump into a project NPC (e.g. Dr. OCEAN) and verify the PRESS [E] prompt appears, then E opens the modal with title/body/tags/trait bars.
  • Click a project NPC star directly (no walk-up) → modal opens. Click 3 NPCs without moving → "psst, use WASD" hint pops.
  • Open ☰ TRANSCRIPT drawer; confirm chatter lines accumulate with timestamps and the COPY button copies to clipboard.
  • Toggle ◉ ATTN off and confirm the SVG attention lines + heatmap panel disappear.
  • Confirm the existing site (/, /blogs/, /projects/, etc.) is unaffected.

🤖 Generated with Claude Code

Self-contained pixel top-down portfolio prototype. A tiny self-attention
layer running in-browser via TensorFlow.js drives autonomous NPC chatter;
project NPCs are clickable and reveal modals with trait embeddings.

Lives at /town/ as a draft preview; the existing Jekyll site is untouched.
JSX is inlined and wrapped in {% raw %} so Liquid leaves it alone.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
97harsh-github-io Ready Ready Preview, Comment May 4, 2026 1:51am

@97harsh 97harsh changed the base branch from master to nextjs-migration May 4, 2026 01:22
Port the design from the standalone /town/index.html prototype into a real
Next.js page on the migration branch:

- nextjs-site/components/NpcTown.tsx — TS port of the React component
  (TFJS still lazy-loaded from CDN to keep it out of the main bundle).
- nextjs-site/pages/town.tsx — dynamic-imports NpcTown with ssr:false, since
  the component touches window/requestAnimationFrame on mount.
- nextjs-site/pages/_app.tsx — adds the standard NextPageWithLayout pattern
  so town can opt out of the global Layout (sidebar / container) and render
  full-viewport. Existing pages keep the default Layout via the fallback.

Removes the now-redundant Jekyll-side town/index.html — single source of
truth lives in the Next.js project. next build emits out/town.html (2.7 kB,
SSG static export), Vercel serves it at /town/.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant