Yuhan personal site
Yuhan personal site

Yuhan personal site

Four hand-written pages — home, quotes, project ideas and about — with my own campus photos.

by CAI Yuhan

Personal site

Description

This is the site I built alongside the course, in four pages: Home, Quotes, Projects and Machine. Home opens with a photograph of the lake on campus and then says what is on the site. Quotes holds sixteen lines, each with who said it and where it comes from; the page picks one at random and shows it at the top, and a filter field hides the cards that do not match what you type. Projects lists six things I could build, who each one is for, and the order I would build it in. Machine has two toys: a box with a switch that turns itself off, and a reaction game that measures how fast you are and remembers your best time. The one menu is written once, in nav.html. Every page has an empty div with the id nav and loads nav.js, which fetches that fragment and inserts it, so adding a link means editing one file instead of four. The script works out the current page from the file name and marks it with aria-current. Opened straight from the filesystem the browser refuses the fetch, so the script carries the same links inside itself as a fallback. Everything is plain HTML, CSS and JavaScript: no framework, no build step, no library. The stylesheet has one column, one card style reused by every quote, and two accent colours. The machine is CSS transitions driven by a few lines of JavaScript; the game uses performance.now and keeps the best score in localStorage. What I learned building it: a page should read without its CSS, because that is what the browser gets first; one class reused is worth ten classes written once; and the smallest useful interaction (a filter, a switch) teaches more than a large feature built from a library. The site works on a phone — the menu wraps, the hero picture crops to a shorter band, and nothing scrolls sideways.

Desktop Homepage

Desktop Screenshot

Mobile Homepage

Mobile Screenshot

Open Graph Image

Open Graph Image

App Icon

App Icon

Favicon

Favicon