Interaction Lab

Features

  • A 60 × 24 page of noise with nine sentences hidden in it
  • A lamp at the bottom edge swings toward the pointer
  • Inside the beam the real text shows; the beam's edge flickers blue
  • Hold to narrow the beam from 24° to 11° and reach from 340 to 560px
  • Aim, lit characters and share of the page read so far

API reference

<Torch /> from components/aiforui/torch.tsx

PropTypeDefaultDescription
anglenumber24Cone half-angle in degrees at rest. Pressing narrows it to 46%.
reachnumber340Reach in px at rest. Pressing extends it by 65%.

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)Focuses the beam: narrower and longer while held.
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 lamp does not sweep and the noise does not churn on its own.
  • The hidden sentences are original copy and are readable in text.ts.
  • 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.