A calm, professional portfolio that opens in Calm mode every visit. One CHAOS button turns the whole page into a bright cartoon space adventure; Restore order (or Esc) brings it back. English and 日本語.
npm install
npm run dev # http://localhost:5173
npm run build # production build in dist/
npm run preview # serve dist/ at http://localhost:4173
- Calm page (
src/App.tsx,src/content.ts): hero, highlights, research interests, selected work, grant and placement, foundations, bench notes, path, learning, Japanese practice, contact (email, LinkedIn, GitHub, CV download and the Japanese row). - Eight interactive simulations (
src/sims/<name>/:core.tspure logic with Vitest tests,View.tsxrendering). They are lazy-loaded, pause when off-screen, are keyboard accessible, and carry the caption "Illustrative simulation, not measured data": PID twin (the "Auto-tune (demo)" button is a simple search optimiser, not the research RL tuner), 8-bit CPU, pipe leak inspection, swarm sandbox, quadruped gait lab, vehicle arena, G.A.I.T. signal lab (with "Not a medical device"), net-and-debris.
- Every fact, string and bilingual text:
src/content.ts. Status badges:statusLabel. - Rules: no invented numbers or claims; deck wording wins for status; hide details you cannot support. Items awaiting your answer are in
docs/open-questions.md. - Every Japanese string is a draft and needs a native Japanese reader before the site is shared.
- Habit numbers (Duolingo, LeetCode) carry an
asOfdate incontent.ts. Re-check them on publish day.
npm run lint && npm run typecheck && npm run test -- --run && npm run build
node tests/calm-check.mjs # Calm downloads no Chaos assets (needs npm run preview)
node tests/chaos-check.mjs # Moon collapse, Restore order, Esc, barrel roll
node tests/esc-collapse.mjs # regression: Esc during the Moon pile
node tests/browsers.mjs # Chromium, Firefox, WebKit smoke (needs npx playwright install firefox webkit)
node tests/mobile.mjs # iPhone-size Japanese view of the sims, overflow check
node tests/gravity.mjs # Moon: fall down, fall up, then the song (needs npm run preview)
node tests/chaos-gags2.mjs # omae, shattering text, dodging buttons, persistent comments
node tests/rick-filter.mjs # filter chips, swarm parts, shake and rick roll
node tests/flyby-crash.mjs # click a flyer: it crashes and explodes
node tests/robot-evict.mjs # pet robot gets angry, evicts you
node tests/section-notes.mjs # section comments arrive after a dwell
node tests/cena.mjs # jumpscare
node tests/enlarge.mjs # every simulation can be enlarged without cut-off
node tests/net-interact.mjs # net sim: drop, throw and pick up debris
npm run test:e2e # calm, chaos, esc, browsers, mobile against npm run preview
npm run test:chaos # the Chaos gag tests (add the preview URL as an argument)
node tests/shots.mjs # screenshots + console-error check (needs npm run dev)
CHECK_STRICT=1 npm run check:publish # private-term blocklist and draft markers
CHECK_STRICT=1 npm run check:jokes # fails until every caption is chosen or written
Last mobile Lighthouse on the local preview: Performance 93, Accessibility 100, Best Practices 100, SEO 100 (LCP 2.5 s, CLS 0, TBT 190 ms). Re-run before publishing.
Photos and recordings come from the portfolio deck. Put originals in src/assets/raw/ (gitignored) and run npm run media to create responsive WebP in public/media/img/. Videos are in public/media/vid/ (H.264, lazy). stepscribe.mp4 and rl-pid.mp4 are short project videos made with the brag tool (sources in the private project-videos/ folder); they use a bundled music bed, so check its licence terms before publishing or swap the track. See docs/credits.md.
- Answer
docs/open-questions.md; get a native review of the Japanese text. - Fill
docs/blocklist.txt(private terms, one per line, gitignored) and runCHECK_STRICT=1 npm run check:publish. - Strip EXIF from any new photos and check backgrounds for people or private screens.
- Push to GitHub, then Settings → Pages → Source: GitHub Actions. The workflow in
.github/workflows/deploy.ymlruns lint, typecheck, tests and the strict checks before building. For a project site the base path is set to/<repo>/automatically; for<user>.github.ioremove theVITE_BASEline.
Private working documents (build report, improvement audit, publish checklist, privacy sweep, open questions, blocklist, the build guide copy) live in docs/ on disk but are git-ignored, so they are never committed.
VITE_BASE=/<repo>/ npm run build makes a project-site build; / (the default) makes a user-site build. The workflow chooses automatically. To check a project-site build locally: build with VITE_BASE=/robotics-portfolio/, serve it with vite preview (same variable), then node tests/base-path.mjs http://localhost:4173/robotics-portfolio/.
Analytics is off until you give the build a Measurement ID. Nothing is hardcoded; with no ID, no Google code loads and the Content-Security-Policy stays fully self-hosted.
- Get the ID. In analytics.google.com: Admin, Create, Property. Then Data streams, Add stream, Web, enter the site address (https://idris-botics.github.io). The stream page shows a Measurement ID like
G-XXXXXXXXXX. - Locally. Copy
.env.exampleto.env.localand setVITE_GA_MEASUREMENT_ID=G-XXXXXXXXXX. Thennpm run build && npm run preview. (.env*files are git-ignored.) - On GitHub Pages. In the repository: Settings, Secrets and variables, Actions, Variables tab, New repository variable named
VITE_GA_MEASUREMENT_ID. The deploy workflow passes it to the build. A Measurement ID is public by design, so a variable (not a secret) is right. - Test. Open Analytics, Reports, Realtime, then visit the live site in another tab; you should appear within about 30 seconds. For event detail use Admin, DebugView (add
?debug_mode=1-style debugging with the Tag Assistant extension).
What it sends: page views (including project pages, as /#work/<slug>), section_view when a home section is first scrolled into view, and outbound_click for GitHub, LinkedIn, email, PDFs (papers and CV) and other external links (the email address itself is never sent). Visitors, sources, country/city, device, browser and engagement time come from GA4 itself. Google signals and ad personalisation are off, and visitors who send Do Not Track are not tracked.