Googly eyes, without the glue. Drag them around or shake them. On a phone, tilt it. Or turn on the camera and wear a pair yourself: the face detection runs in your browser, and the picture never leaves your device.
How it’s built
A rewrite of an old CodePen that ran on Matter.js and PoseNet. Now it’s a few lines of physics on Canvas 2D, and face detection only loads when you switch the camera on.
- A ball in a circle. Each pupil feels the eye’s movement in reverse, bounces off the rim and rolls along it with a little friction.
- It goes to sleep. After 45 still steps the loop stops, until you drag or tilt again.
- Your phone’s own gravity.
devicemotion, turned to the screen’s orientation and smoothed. On iOS a button asks for permission first. - Faces on your device. MediaPipe’s face detector comes from a CDN only when the camera goes on. The model comes from Google and runs on the CPU, because the GPU route quietly fails on some Android phones.