No.43 · Buttons
Draw Link
A text link whose underline follows your hand: it draws in from the side you arrive on and leaves out the far side, like a stroke passing under the words.
The prompt
Written for the variant you picked above: In a sentence
Build a text link with an underline that travels. The underline is a pseudo-element under the text (height max(1px, 0.07em), accent colour) scaled on X from 0. On mouseenter, detect which half of the link the pointer entered from and set data-from; the underline grows from that side (transform-origin left or right) over 520ms on cubic-bezier(0.65,0,0.35,1). On mouseleave, detect the exit side and shrink the line toward it — so a pointer passing through left-to-right draws the stroke in from the left and wipes it out to the right, like a pen passing under the word. A small ↗ arrow nudges up-right and brightens. Focus shows the full underline and a soft ring. On touch the underline rests at 40% opacity so links are recognisable. Selected variant — In a sentence: In a sentence: three links inside a large Instrument Serif sentence (clamp 1.9–3rem, muted #a7a1ab text) — "Currently building Vitrine, writing about interface motion, and studying at GUtech." — each with its ↗ arrow.
Notes
- Interaction
- Hover from either side: the underline enters from that side and exits through the side you leave.
- Motion
- 520ms ease-in-out scaleX with a direction-dependent origin; arrow nudge 520ms expo-out.
- Accessibility
- A real link; focus-visible shows the underline and a ring. Reduced motion makes it instant.
- Responsive
- Scales with its font size (em-based line and arrow).
- On touch
- Underline rests visible at reduced opacity.