LoneForgeMotion
Library
Interface  /  Cards

Card Shuffle

A stack of five cards deals itself: the front card flies off and the next one steps forward.

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 a stack of cards shuffling.

Five portrait cards sit in a stack in the center, each one behind slightly smaller, higher and dimmer than the one in front. Every card has a picture area filled with a gradient between the two accent colors, with a pale sun and two soft hills inside it, then a round avatar, two placeholder bars and a pill button. Five times per loop the front card pauses, then flies off to the right while it tilts and fades, and every card behind eases one step forward. A new card fades in at the back of the stack at the same moment, so the stack never runs out. Each card has its own blend of the two accents so the color changes with every deal. Under the stack, five small pills show which card is in front. Add drop shadows, a warm glow behind the stack 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.