LoneForgeMotion
Library
Interface  /  Buttons

Toggle Switch

A big switch on a clean page flips on, lights three cards one by one, then flips back off.

Source kit 7 KB
Loop
8 s, seamless
Video
1080p, 30 fps, no sound
Built with
HTML canvas, one file
Made with
Claude Fable 5.2, medium 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 an on and off switch on a modern website layout.

A dark rounded window sits in the middle of the frame with a thin top bar: three small dots on the left and three pill links on the right. Below the bar, two centered placeholder bars stand in for a heading. Under them is one large toggle switch with a white knob. Early in the loop the knob slides to the right and stretches a little while it travels, the track fills with the first accent color and a soft glow blooms behind it. Along the bottom are three cards, each with a round icon, two placeholder bars and a small toggle of its own. After the big switch turns on, the cards light up one after another from left to right: their borders brighten, the icons glow in the second accent color and their small toggles flip. A little past the middle of the loop the big switch slides back, and the cards go dark again in the same order. Add a soft background glow and a few slow drifting dots.

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. Use rounded bars and dots wherever words or pictures would go. 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.

The source kit

Download

The 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.md1 KB
  • START-HERE.md1 KB
  • animation.js4 KB
  • core.js2 KB
  • index.html1 KB
  • render.py2 KB

Free to use and change for your own work. See the license.