Open palm, swipe sideways: change slide. Pinch thumb and index, then move up or down: scroll. Nothing leaves your machine — the camera feed is processed in the browser.
Show five fingers and flick left or right. Fast, deliberate moves work best.
Touch thumb to index and move your hand vertically to pull the page along.
Prefer hands off the camera? ← → and ↑ ↓ still work.
MediaPipe's hand landmarker returns 21 3D points per hand. Everything here is derived from a handful of distances between them: whether a fingertip sits above its knuckle, how far the thumb is from the index tip, and how quickly the wrist travels horizontally.
Finger extension is a comparison of tip and middle-joint height. Pinch is the thumb-to-index distance normalized by palm size, so it holds up whether your hand is near the lens or far from it. Swipes need a wrist velocity above threshold plus an open palm, with a cooldown so one flick doesn't fire twice.
Coordinates arrive normalized to 0–1 and are mirrored on the x axis, because the preview is mirrored and moving right should mean right.
0.38 by default. Lower it if pinches trigger by accident, raise it if they never register.
1.15 screen-widths per second. Raise for deliberate flicks only, lower for gentler gestures.
2200 pixels per full-frame hand travel. This one is pure feel.
All three sit at the top of the script, above the detection loop.
Browsers only grant camera access on secure origins, so double-clicking the file will fail. From the folder containing it, run python3 -m http.server 8000 and visit localhost:8000.
Good light in front of you, not behind. One hand in frame. Keep it roughly upright — extension is measured vertically, so a sideways hand reads as a fist.