· 5 min read

The small details: clicks, vibration, avatars and a wordmark

A click that never fires on a scroll, vibration with cooldowns, avatars that match on every screen, and a footer wordmark that animates without React.

Shivank Pandey

Nobody notices good polish. They notice when a click sound fires while they scroll a menu, when a phone buzzes three times for one action, or when their avatar is a photo on one screen and a cartoon on another. This post is about four small features and the rules that keep each from becoming annoying.

A click should sound like a click, not a scroll

Typestrix plays a soft click when you press a button. Browsers refuse to start audio before the user interacts with the page, so the sound file is downloaded as plain bytes on load, and the audio engine is only created inside the first real press. After that, each click is two tiny audio nodes reusing one decoded sample. If the browser blocks audio, the button still works; the sound just does not play.

There is no onClick={playSound} on individual buttons. One listener on the document recognises anything interactive (buttons, links, tabs, switches, menu items) and decides whether the gesture was really a press:

Pick a step, or use the arrows, to walk through the diagram.

Step through it. Mouse plays on press; touch waits to see what the gesture was.

The listener runs in the capture phase, before component libraries get a chance to cancel the event, which on mobile can otherwise swallow the click entirely.

Vibration with manners

On phones that support it, Typestrix vibrates for a handful of moments: a restart, a mode change, the race countdown, a finished test, a warning. Every vibration passes four gates: the browser supports vibration, the device has a touch screen, the user has not switched it off, and the same event has not fired too recently.

MomentPatternCooldown
Mode or setting change18 ms50 ms
Race countdown tick25 ms200 ms
Test restart40 ms120 ms
Test or race complete30 ms, pause 60, 40 ms200 ms
Focus lost during a test40 ms, pause 100, 40 ms300 ms

Pulses stay at 12 ms or more because shorter ones are hard to feel on many Android motors. The cooldown is per event, so a restart followed by a success both vibrate, but two restarts in quick succession produce one buzz. iPhone Safari does not support the Vibration API, so haptics are simply skipped there.

Both switches live in the settings menu and persist across visits. An early version stored the haptics preference under its own key; when settings moved into one store, a small migration copied an "off" choice across and deleted the old key, so nobody who had turned vibration off found it back on.

The same face on every screen

An avatar preference travels further than it looks: the profile, the leaderboard, chat and the race roster all show it. If one of those paths drops the preference, the same person appears as a photo in one place and a generated character in another. So every surface uses the same component and the same rule:

Pick a step, or use the arrows, to walk through the diagram.

Step through it. The same three steps run on every screen that shows a person.
thumbs avatar for K7QM2XRP
/api/avatar?seed=K7QM2XRP&style=thumbs&size=96

Every image above is a live request to the app's own avatar endpoint, which generates the SVG on the server from a style, a seed and a size. Because the same inputs always produce the same image, the response is cached for a year: once your browser has your avatar, it never asks again. The trade-off is that changing the artwork for an existing URL needs a new URL; the cache will not forget on its own.

The preference itself is carried everywhere a name is: in the leaderboard entry, and inside the signed token that identifies you to the race server. That is what keeps the face consistent across surfaces built at different times.

A wordmark that animates without React

The large "Typestrix" at the bottom of the landing page writes itself, holds, erases and repeats. Hover it and an accent spotlight follows your pointer.

Pick a step, or use the arrows, to walk through the diagram.

Step through one cycle. Hovering freezes the outline fully drawn so the spotlight has something to reveal.

The letters are not text. A small script turns the font's glyphs into SVG paths once, so the outline and the fill layers share exactly the same geometry at any size. The whole loop is CSS, paused while the wordmark is off screen. The spotlight is the only part that needs JavaScript: pointer positions are converted into the SVG's own coordinates and written straight to the gradient, at most once per frame. React renders the structure once and never re-renders for a mouse move.

What ties these together

Each of these features could have been one line of code: play a sound on click, vibrate on restart, show the photo, animate the logo. The extra work in each case is restraint: waiting for a real tap, rate limiting vibration, falling back without retry loops, and keeping per-frame work out of React. That restraint is what makes them feel finished instead of noisy.

Keep reading