r/tailwindcss • u/poojadeliverwebsite • 19h ago
A headline where each letter swells from hairline to black as your cursor passes
Built this hero for DeliverWebsite UI. Each letter measures its own centre once (on mount, after fonts load, on resize), then a motion value turns the pointer distance into pressure: max(0, 1 - d / 240), squared so it peaks right under the cursor. That drives font-weight 200 → 900 and opacity, so it needs a variable font (Inter works).
Two things that tripped me up: words have to be inline-block + whitespace-nowrap so they never break mid-word, and the space has to sit between the word spans, because a browser drops a trailing space inside an inline-block.
On phones there's no cursor, so a virtual pointer drifts in a slow figure of eight and rolls a wave through the line instead.
Would you use something like this on a real landing page, or is it too much?