Test bed for the proposed Web Haptics API — a semantic, cross-platform
interface for tactile feedback through
navigator.playHaptics(effect, intensity).
Imperative API (JavaScript)
Each button calls navigator.playHaptics(effect, intensity)
with one of the six predefined effects. Requires sticky user activation —
a click satisfies that. If the last input device isn't haptics-capable,
nothing plays (and, by design, the API returns undefined either way).
navigator.playHaptics("align", 0.8);
Imperative patterns
Each example calls the same play(effect, intensity)
helper on a meaningful UI transition rather than on every movement.
Focusing the field gives a subtle cue that it is ready.
Drag the file. Entering a different folder triggers one Hint.
Pull down until the circular indicator fills and crosses the limit.
Try to move past either end with a wheel, keyboard, or pointer drag.
Drag the title bar until the window touches an edge. Edge feedback fires on contact, before release.
Each valid previous or next step triggers Tick.
Every on or off transition triggers a crisp Tick.
Drag through the discrete stops. Each newly selected detent triggers Tick.
Drag the shape around the canvas. Align feedback fires as a center snap guide appears.
Completing the save triggers Success.
A failed submission announces the problem and triggers Error.