Interaction Lab

Features

  • A word drawn as halftone glass, one vessel per letter
  • Every vessel holds the same fill of water
  • Drag sideways to tilt; the word springs to the new angle
  • The water stays level, sloshes and shows its surface in blue
  • Tilt, surface angle and fill in the footer

API reference

<Level /> from components/aiforui/level.tsx

PropTypeDefaultDescription
fillnumber0.42Share of each letter filled with water, 0–1.
knumber40Spring stiffness toward the dragged tilt.
cnumber3.2Damping on the tilt.
wordstring"flow"The word. Each letter is a vessel. Changing it rebuilds the glass.

Keyboard interactions

TabFocuses the exhibit. Blue corner brackets show it has focus.
← → ↑ ↓Moves the blue probe 12px. It stands in for the pointer.
Shift + arrowsMoves the probe 48px.
Space (hold)Hold Space and press ← → to tilt the word.
EnterNo special action.
EscapeLets go and hides the probe.

Accessibility

  • The tile is a focusable role="group" with aria-roledescription "interactive demo" and a label that says what it shows and how to drive it.
  • The canvas and the SVG overlay are aria-hidden. A polite live region reads the live stats about 0.7s after keyboard input settles.
  • With prefers-reduced-motion, frames only run while the pointer is inside or for about 3 seconds after input, so the slosh only plays out while you interact.
  • The animation loop pauses while the tile is offscreen or the tab is hidden.
  • Focus is shown with corner brackets on :focus-visible only, so mouse clicks do not leave a ring.

Sound & haptics

Silent. It plays no sound and triggers no haptics.

Files

Written from scratch for sher.md and inspired by the Interaction Lab on aiforui.dev. It is an original build: it contains none of aiforui.dev's code, styles, assets or sounds, and its text is our own.