T/T
Back to work

Personal project · 2026

RŌNIN

By his own count, he won more than sixty duels.

Stack
React, Vite, plain CSS
In numbers
9 chapters, 5 profiles, 8 passages in Japanese
Tests
31 unit tests and a browser suite; the site only deploys when all pass
The opening of the site, showing Musashi's painting blended into the paper texture.
The opening. The painting sits in the paper instead of on top of it.

What it is

RŌNIN is a one-page site about Miyamoto Musashi, the swordsman who wrote The Book of Five Rings. It tells his life as a single story across nine chapters, quotes him in the original Japanese, and displays the ink paintings he left behind. It also includes short profiles of five people from his life, a section placing him in the wars of his time, and a journal where you can write notes for any of the five scrolls.

I built it with React and Vite using plain JavaScript and CSS. It runs as static files on GitHub Pages. There is no server and no user accounts, so the journal is saved directly in the browser.

The problem

The first version was a field guide to six different samurai. It worked technically, but it read like an encyclopedia. The more I researched, the more I realized I only cared about Musashi. He fought his first duel at thirteen and spent his final years painting birds with just a few ink strokes. That contrast was the real story, and a field guide had no room for it.

The second problem appeared after the content was finished. The site was correct and well built, but it felt cold. His actual paintings are ink on paper with strokes that bleed and heavy blots of black. My site was just flat colors, thin lines, and boxes, with some text at 12 pixels. It looked like a modern web app that just happened to be about him.

The decisions

One man, one story

I cut the other five samurai and rebuilt the site entirely around Musashi. His life runs as nine chapters on a single page, with a timeline beside it that tracks your reading progress. The people around him were moved to short profile pages instead of sharing the main stage.

Historical sources disagreed on his birth year, his exact number of duels, and what really happened at his famous duel on Ganryūjima island. Instead of hedging every sentence, each chapter links to its sources, and disagreements are grouped into a single note.

Letting him speak

Eight short passages appear in the original Japanese, with translations written specifically for the site. Every painting and print has a caption listing the maker, the date, and a link to its rights record. When an image is a print made two centuries after the event it shows, the caption explicitly says so.

The story ends with a portrait held by the Shimada Museum of Arts. Most places online call it a self-portrait, which is what I assumed. But the museum describes it as painted after his death by someone who seems to have known him, so I updated the caption to match. It is also why that portrait is not blended into the page texture like his ink paintings. Only work by his own hand gets that treatment.

Following the reader

The timeline highlights the chapter you are currently reading. My first attempt used an IntersectionObserver, but it would sometimes miss the final position after a user clicked a timeline link, leaving the highlight on the wrong chapter. I replaced it with a scroll listener that runs at most once per frame. The active chapter is simply the last one whose top has passed a line 35 percent of the way down the screen. It is a basic rule, but it is always right.

When the page transitions to a dark woodblock print for the Ganryūjima section, the timeline goes dark with it. On a computer screen, it only turns dark exactly where it passes over the ink, so the timeline never hangs over the paper as a solid dark block.

The brush chapter showing a timeline of years on the left and three ink paintings aligned along their base on the right.
The brush chapter. Three of his ink paintings, blended into the page and aligned at the base.

Making it feel painted

I did not want a full redesign because the layout already worked. The warmth had to come from the surface. I added a faint grain over the whole page to mimic paper. His ink paintings are blended into that paper using a multiply blend mode, so the pale background of each scan takes on the page color instead of sitting on top as a grey rectangle. The dividers between chapters became brush strokes. The smallest text was bumped from 12 to 13 pixels, and navigation moved to 14 pixels.

I tried scattering generated ink blots across the page, but they just looked like grey dirt on the screen, so I removed them. The torn edge around the Ganryūjima section is the only place the ink actually bleeds.

Keeping the pages consistent

The profile pages were built after the main page, and over time the design drifted. They ended up with numbered source lists that repeated what was already in the sections, red chronology years when the main timeline used ink, shaded fact strips that appeared nowhere else, and dark buttons at the bottom when the rest of the site used plain links.

I went through the profiles and aligned them with the main page piece by piece. Sources now only appear once under the section that uses them. I even wrote a test that fails if a source is defined in the data but not actually shown on the page. The fact strips were moved into the introductions, and every exit link was changed to match the plain links used at the top of the page. Each fix was small on its own, but together they made the profiles feel like part of the same book instead of an afterthought.

A brush face for 119 characters

I wanted his Japanese quotes in a brush typeface called Yuji Syuku. Japanese fonts are massive. This one is about 8 MB split into 124 files. Loaded normally, the browser would still fetch 36 of those files, totaling about 1 MB, just to draw a few lines of text. I subsetted the font down to the exact 119 characters the site uses, bringing the file size down to 46 KB.

The catch is that if I ever add a new quote with a character outside that subset, the browser will quietly fall back to a default font. To prevent this, I wrote a script that rebuilds the font directly from the site data, and a test fails if any Japanese character on the site is missing from the font file.

test('the brush font subset covers every Japanese character the site sets in it', async () => {
  const subset = await readFile(
    new URL('../public/fonts/yuji-syuku-subset.txt', import.meta.url),
    'utf8',
  );
  const japanese = [
    ...Object.values(musashiQuotes).map((quote) => quote.japanese),
    ...rings.map((ring) => ring.kanji),
    ...people.map((person) => person.kanji),
    ...glossary.map((entry) => entry.kanji),
  ].join('');
  const missing = [...new Set(japanese)].filter((character) => !subset.includes(character));
  assert.deepEqual(missing, [], 'Run scripts/build-brush-font.py after adding Japanese text');
});
From tests/content.test.js. It runs with the rest of the suite before every deploy, so a missing character stops the site from being published.
The crossing to Ganryūjima section, where the paper tears into a dark woodblock print and the timeline turns dark only below the torn edge.
The crossing to Ganryūjima. The timeline darkens only where it passes over the ink.

What I would do differently

I would treat the visual tone as part of the initial problem instead of something to fix at the end. The site was technically finished before I admitted it felt cold, and by then every visual change had to fit around a layout I did not want to touch.

I would check text sizes on a phone from the start. Text at 12 pixels looked fine on my desktop monitor but was too small everywhere else.

I would review the secondary pages against the main one every time the main page changes. The profile pages were not wrong when I built them. They just stopped matching the main page over time, and nobody notices that drift until they go looking for it.

I would also check what a historical source actually says before trusting the label it is known by. Nearly every copy of the Shimada portrait online calls it a self-portrait, but the museum that owns it does not.

More work on the home page, or the stack behind each project on the CV.