Library
Interface / Phone
Glass Unlock
A padlock knob glides across a frosted glass pill, fills it with color, pops the lock open with a ripple, then slides back.
- Loop
- 8 s, seamless
- Video
- 1080p, 30 fps, no sound
- Built with
- HTML canvas, one file
- Made with
- Claude Sonnet 5.5, max effort
The prompt
The prompt this loop was built from. Paste it into your agent to make your own version from the idea.
Make a seamless 8 second motion loop of a slide to unlock control on a modern phone. A wide frosted glass pill sits in the middle of a soft light ground, with two large blurred color glows drifting slowly behind it. At the left end of the pill is a round white knob with a small padlock drawn in the first accent color. To the right of the knob, four chevrons shimmer one after another from left to right about six times per loop, hinting at the swipe. After a short pause a soft touch halo appears under the knob and it glides across the pill with an eased drag, leaving a gradient from the first accent to the second behind it, and the chevrons fade as it passes them. When the knob reaches the right end it pulses once, the padlock shackle swings open, a ripple ring leaves the knob and an outline ring spreads out from the whole pill. Hold the unlocked state for a moment, then the lock closes and the knob glides back to the left while the fill drains, ready to repeat. The pill and knob are drawn a little larger when the frame is wide. Write it as one JavaScript file that draws on an HTML canvas with the 2D context. One function draws any moment: render(ctx, W, H, ph, colors), where ph is the loop phase from 0 to 1. Write every motion in whole turns of ph so the last frame flows into the first and the loop has no seam. No text, no logos, no images, no libraries. Scale every size from the shorter side of the canvas so it works wide, vertical and square. Take three colors as inputs: a background and two accents. Take the neutral colors for glass, shadows and lines from the background so it also works on a dark or a light background.
The source kit
DownloadThe same code that is drawing the loop on this page. Unzip it, point your agent at START-HERE.md, and it can rebuild the loop and change it.
- LICENSE.txt1 KB
- PROMPT.md2 KB
- START-HERE.md1 KB
- animation.js7 KB
- core.js2 KB
- index.html1 KB
- render.py2 KB
Free to use and change for your own work. See the license.