Skip to content

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

ethantran.ca

Personal site — Vite + React + Tailwind + three.js.

npm install
npm run dev      # http://localhost:3000
npm run build    # production build in /dist
npm run images   # rebuild web copies after adding/changing photos or project images

The site is one centered column made of two zones. The shell never changes: the hero (name — which links back to index — with now-playing on its line, then headshot + bio + links) and the ➢ pages nav. Routes swap only what sits below it — index (about, on repeat, the closed-loop terrain), projects, work (experience), gallery, resume. Project details open in a modal, not a separate route.

All content lives in /data as plain TypeScript — you never touch a component to add a project, a job, an about line, or a photo. The sections below are the recipes.

Add a project

  1. Drop an image in /public (e.g. /public/myproject.jpg). It renders at its natural aspect ratio as the card image, and again inside the modal. Skip it and the card becomes a caption-only entry.
  2. Add an entry to data/projects.ts:
{
  slug: 'my-project',            // unique id
  title: 'My Project',
  year: '2026',
  category: 'Embedded/Firmware', // shown in the modal; or an array: ['Hardware', 'Hackathons']
  kind: 'hardware',              // which filter shows it: 'software' | 'hardware' | 'both' (default)
  summary: 'One-liner shown under the card title and in the modal.',
  tags: ['Firmware', 'PCB'],     // chips in the modal
  links: { github: 'https://github.com/...' },  // also: demo, website — buttons in the modal
  content: {                     // the modal story
    problem: '...',
    solution: '...',
    build: '...',
    learned: '...',
    buildImage: '/myproject.jpg',           // ← the image from step 1
    // finishedImage: '/myproject-done.jpg',  // optional second photo
    // video: '<iframe ...></iframe>',        // optional YouTube embed, shown above the photos
  },
}
  1. Run npm run images so the card gets its small web copy and blurred preview (see Images).

All projects render on the projects page in this file's order, flowing left/right into two columns. Valid categories are defined in types.ts (Category).

Add experience

Add an entry to data/experience.ts:

{
  id: '5',
  role: 'Firmware Intern',        // shown as the small italic subtitle
  company: 'Company',             // shown big
  period: 'May 2026 – Aug 2026',
  domain: 'company.com',          // logo = the site's favicon (zero setup)
  // logo: '/logos/company.png',  // or a local file if the favicon is ugly
  link: 'https://company.com',    // adds a ↗ link on the company name
  bullets: ['Shown when the row is hovered (tapped on mobile).'],
}

No domain/logo → a monogram chip is generated from the company name.

Add an about line

Add an entry to data/about.ts. Each line is a list of parts, rendered in order:

{
  parts: [
    'Currently building a ',
    { emoji: '🤖' },                          // emoji icon
    ' robot with ',
    { domain: 'nvidia.com', name: 'NVIDIA' }, // favicon icon + "NVIDIA" label, kept on one line
    ' Jetson.',
    // { text: 'gallery', to: '/photography' } // internal link
  ],
  // sub: ['↳-style indented sub-line, same part types'],
}

Add photos

Drop files in /public/photography/<Album>/, register each in data/photography.ts with id, url, location, year (id must be unique — it's the React list key), then run npm run images. Browsers can't show .HEIC, so convert those to JPG first. Albums are grouped by location — year, newest year first; the priority list in pages/Photography.tsx decides which places lead within a year.

To tag people, run npm run dev, open a photo, and press tag people (top left). Tagging someone is three clicks: click the photo and pick who it is (or paste a new person's site); the label then follows the mouse, so click to set it down; then its arrow, snug against the label, travels round the label's edge toward the mouse, so click to set that too. Esc drops a tag mid-placement. Click a tag that's already there to place it again the same way; × removes it. Placed labels show exactly where you put them, arrow on the edge you picked (stored as side and at, how far along it); older tags placed with only an arrow tip get the snug arrow on the edge facing it, and tags never placed still hang off their point and are nudged apart automatically. Each change saves straight to data/photo-tags.json — commit that file to publish. The editor (components/TagEditor.tsx) exists only on the dev server: it isn't in the production bundle, and the dev server accepts saves only from this machine. On the site, tagged photos get a person badge on their tile, and tapping the photo in the lightbox shows the tags (components/PhotoTags.tsx).

Place each tag just under the person's chin. Where labels would collide (a group shot on a phone), the lightbox rearranges them by itself: a label moves above the person's head with its arrow pointing down, or slides a little further out on a stem, whichever reaches less. To clear the face it uses each tag's face (rough face height, % of the photo's height); tags saved without one borrow the typical face size of the other tags in that photo.

Add a friend

The bottom of the index is a wall of 88x31 web buttons (components/Friends.tsx), mine first. Save the friend's button into /public/buttons/ (a copy can't break when they redesign) and add one line to data/friends.ts:

{ name: 'Jane Doe', url: 'https://jane.dev', button: '/buttons/jane.png' },
// no button yet? leave `button` out and a text tile in the site's style stands in

To link back, a friend pastes this anywhere on their site — plain HTML, no script, works on any stack (pixelated keeps the pixel art sharp on retina screens):

<a href="https://www.ethantran.ca"><img src="https://www.ethantran.ca/button.gif" width="88" height="31" alt="Ethan Tran" style="image-rendering: pixelated"></a>

Or, on a React / Next.js site:

<a href="https://www.ethantran.ca"><img src="https://www.ethantran.ca/button.gif" width={88} height={31} alt="Ethan Tran" style={{ imageRendering: 'pixelated' }} /></a>

My button is animated pixel art drawn in code: edit scripts/button.mjs and run npm run button to redraw public/button.gif (and public/button.png, its first frame, kept for anyone who linked the still before the GIF existed). Keep both paths, since other sites point straight at them.

The night flock is made the same way: scripts/geese-night.mjs takes the painting (scripts/art/geese-night.jpg, white geese on black), mirrors it so the flock flies right to left, eases its brightest whites, and feathers its edges out along a ragged line. It prints the painting's black, which is dark mode's --paper. Run npm run night to rewrite public/geese-night.webp.

The tab icon is a portrait of a goose's head in profile on pink (scripts/art/favicon.jpg), cropped to the whole head, beak tip included, so its black head and white cheek read at 16px: npm run favicon (scripts/favicon.mjs) writes public/favicon.png with rounded corners, and a square public/apple-touch-icon.png for iOS, which rounds icons itself.

Images

The originals (public/photography/, and each project's buildImage/finishedImage) are never served as-is — some are 5 MB. npm run images (scripts/web-images.mjs) writes WebP copies to public/web/ — sm (640px) for the grid and cards, lg (2000px) for the lightbox and modal — and each image's size plus a tiny blurred preview to data/image-meta.json. Commit all of it. components/WebImage.tsx uses that to size every image box before anything loads, paint the blur at once, and sharpen in the real image. It only rebuilds what changed; until you run it, a new image falls back to its original file.

Spotify (now playing + on repeat)

Both come straight from Spotify's Web API through two Vercel functions, so the credentials never reach the browser:

  • Now playing (hero, components/SpotifyStatus.tsx) — api/now-playing.ts returns what's playing on any device (green pulse), paused (grey dot), or otherwise the last track played. Spotify can't push changes the way Lanyard did, so each open page asks every 4 s, straight away when the tab comes back into view, and again just as the song playing should end, so track changes land on time. The CDN keeps each answer for 2 s (never staler), so Spotify sees at most one request per 2 s, and a warm function reuses its access token instead of fetching one every time.
  • On repeat (index, components/OnRepeat.tsx) — my five most-played tracks over the past ~4 weeks, from api/top-tracks.ts, cached for an hour, so the shelf updates by itself.

Until Spotify is configured, both simply don't show.

One-time setup (re-run step 2 whenever the scopes in scripts/spotify-auth.mjs change):

  1. In the Spotify developer dashboard, create an app (Web API) and add the redirect URI http://127.0.0.1:8888/callback.
  2. Put the app's SPOTIFY_CLIENT_ID and SPOTIFY_CLIENT_SECRET in .env.local, then run node --env-file=.env.local scripts/spotify-auth.mjs (same in PowerShell, cmd or bash). Open the link it prints, approve, and add the SPOTIFY_REFRESH_TOKEN it prints to .env.local — npm run dev then serves /api/* from your own handlers, like Vercel does. (Without those secrets, the dev server proxies /api/* to the live site, so both still show your real data.)
  3. Add the same three variables to the Vercel project's environment variables and redeploy.

Where things render

Section Data Component
Shell layout (zones, routes) + footer — App.tsx
Hero — name, now playing, headshot, bio, links inline, /api/now-playing components/Hero.tsx, components/SpotifyStatus.tsx, api/now-playing.ts
Pages nav (➢ index / projects / work / gallery / resume) — components/PagesNav.tsx
Back-to-top pill (appears past 260px) — components/ScrollTop.tsx
index → Closed-loop terrain + caption — components/ClosedLoopControlTerrain.tsx (canvas), pages/Home.tsx (sizing + caption)
Section headers ("x —") — components/QuietHeader.tsx
index → About data/about.ts pages/Home.tsx, components/About.tsx
index → About's "gallery" link, which peeks at a carousel of gallery photos on hover data/photography.ts components/GalleryPeek.tsx
index → On repeat (Spotify top 5) /api/top-tracks components/OnRepeat.tsx, api/top-tracks.ts
index → Friends (88x31 button wall) data/friends.ts components/Friends.tsx
projects → cards + filters data/projects.ts pages/Projects.tsx, components/WorkCards.tsx
Project detail modal data/projects.ts components/ProjectModal.tsx
work → experience (hover to expand) data/experience.ts pages/Work.tsx, components/ExperienceTimeline.tsx
gallery → photos + lightbox data/photography.ts pages/Photography.tsx, components/WebImage.tsx
resume → embedded PDF public/Ethan_Tran_Resume.pdf pages/Resume.tsx

Animations live in index.css. On first load, boot.ts holds every .reveal invisible until the webfonts are in (at most 1.2 s), so text never visibly swaps fonts; then the hero, nav, page, and footer stagger in from one clean start, and the geese bloom and the terrain fade in after. Route changes replay only the page's own .reveal. With reduced motion on, every fade stays (so loading still reads as calm) and only the movement goes: no lifts, zooms, blur, or photo fly-in.

Theme: minimal watercolor, sampled from a painting of geese in flight. Warm paper (paper) with a cool payne's-grey ink-* scale, Newsreader for all text (an editorial serif whose optical sizes keep small text sturdy and the name fine), and a single goose-beak orange accent (beak) — the ✦ about markers, active filter/nav page, focus rings, and the terrain's goal marker all wear it.

There's a day and a night. The tokens are CSS variables in index.css (light on :root, dark on .dark), which tailwind.config.js wraps, so every paper/ink/beak class flips on its own; reach for dark: only for things that aren't tokens. Night is the night flock's own black (#161616) with neutral greys, the ink scale turned over (text is the old paper colour), and an antique gold accent in place of the beak orange. The project modal and photo lightbox are always near-black, so they keep the light tokens. Every visit opens by day, whatever the system prefers; the toggle in the header's top-right corner, beside what's playing (ThemeToggle), switches to night for the rest of that visit, and nothing is saved (theme.ts). Switching dissolves the whole page through a view transition.

Behind the page, back to front (App.tsx):

  • GeeseSky — the flock (public/geese.webp, feathered so no edge shows). It blooms in on first load, then only floats softly (a few px of rise and sway, a faint lean from the cursor). It sits behind the header and scrolls away a little slower than the page, so it never stays behind body text. By night the same spot holds a second painting, white geese on black (public/geese-night.webp), mirrored to fly right to left and fading into the dark page, which is its own black.
  • WatercolorTrail — the cursor is a damp brush: faint strokes with a darker drying rim that fade to nothing in ~3–4 s (mouse/pen only, off under reduced motion). Multiply by day; at night it blends with screen, so the pigment lightens the dark page instead.
  • .paper-grain — a fixed cold-press texture over both (screen-blended at night). .brush-rule is the painted divider used in the hero and footer.

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages