axi0motion

Swell

Letters under the pointer swell wide, bold and tall while the far ones draw in, so the line keeps its width; at rest a slow wave runs through them.

  • enhancer
  • pointer
  • hover
  • weight
  • width
  • headline
  • variable
  • since 0.2

Background Studio: tune it below, then copy the code

Your system asks for reduced motion: the demo shows its final state and nothing moves.

Live demo

Swell example

PRESSURE

Controls

2.4 em
1.3
1.18
300

Code

It follows the controls above: change an option and the code changes with it.

<script src="https://search.axi0.io/axi0/motion/motion.js" defer></script>

<p class="m-demo-max m-demo-light" data-motion="swell">PRESSURE</p>

The wrappers: Swell.tsx (React, TypeScript) and Swell.vue (Vue). Both render the same attributes as the HTML; the loader does the rest.

Options

AttributeDefaultWhat it does
data-motion-reach2.4Reach around the pointer, in letter heights
data-motion-width1.3How much wider the near letters get (the far ones give the room back)
data-motion-rise1.18Height under the pointer
data-motion-bold300Extra weight under the pointer
data-motion-color#f6a04dColor under the pointer
data-motion-idletrueA slow wave when the pointer rests

Accessibility

The text stays one readable string: the letters sit in an aria-hidden copy and the element carries the full text (aria-label on headings, links and buttons, a visually hidden copy elsewhere). Only transforms, weight and color change inside fixed letter boxes, so no layout shifts. Under reduced motion the letters stay at rest. Only transform, opacity and paint change, so nothing around it moves. Frames run through the shared loop, which stops off screen, in hidden tabs and under reduced motion; reduced motion shows the final state with no movement.

Size

swell.js is 1.6 KB gzip, with text-kit.js 3.2 KB it needs. A page loads the loader (2.9 KB) and core.js (1.4 KB) once, whatever it uses.