Design.dev design.dev
AI · Component Template

AI Thinking Orb

One glass orb with weather inside it that shows what an AI agent is doing. Cool and slow while it waits, fast and violet while it works, amber when it needs you.

Live demo

Output of this prompt · Claude Fable 5.2 · WebGL

Watch a full run play out, approve the deploy, or pick any state below.

The Prompt 1,139 words

Build an agent status screen for a coding assistant called Marble: a dark room with one glass orb floating in it, and weather inside the glass that shows what the agent is doing. The fog folds slowly in cool blue while it waits, spins fast and violet while it works, breathes amber when it has stopped to ask permission, and settles green when the job is done. Under the orb, a headline says what is happening in plain words and a short log ticks off each step. It should feel like a lit object photographed in a studio, rendered live, and never like a loading spinner.

Match my project's existing stack, conventions, and design tokens. If there are none, output a single HTML file with inline CSS and JavaScript and zero dependencies.

LOOK
Page background #040406, text #f2f2f5, secondary text at 62% of that. System UI font; headline 26 to 50px (3.4vw), weight 650, letter-spacing -0.035em, centered. A fullscreen canvas sits behind everything. The orb's center is at 50% across and 32% down; its radius is min(width x 1.5, height) / 4.7, so it stays large on a phone. A fine film grain covers the page at 7% opacity. Four state colors, registered as one animatable custom property (--tone, 700ms transitions): Ready #8fb4ff, Thinking #a78bff, Asking #ffb44d, Done #5df0a8. The tone colors the spinner, the check marks and the primary button, so the interface changes color with the glass.

THE ORB (one fragment shader, raw WebGL, no library)
Draw one oversized triangle and do everything per pixel.
1. Glass ball: for a pixel at distance r < 1 from the center (in orb radii), the surface normal is (x, y, sqrt(1 - r^2)). Refract the view ray (0, 0, -1) through it with ratio 1/1.4. The chord through the ball has length 2 x dot(-ray, normal).
2. Fog: take 10 samples evenly along that chord. Rotate each sample about the vertical axis by phase x 0.7 + y x (0.6 + energy), so the fog twists and the twist tightens with energy. Density is three octaves of value noise (weights 0.55, 0.3, 0.15 at 1x, 2.1x, 4.3x), sampled at position x 2.1 and pushed by a second copy of the same noise x 1.6 (domain warping, which is what makes it fold instead of drift). Shape it with smoothstep(0.4, 0.78), fade it out toward the shell with smoothstep(1.02, 0.35, distance from center), and color it from the state's deep color to its bright color with smoothstep(0.45, 0.9).
3. Threads: at each sample read one more noise value n at 1.6x the frequency and add (1 - |2n - 1|)^10. This draws thin bright filaments where the field crosses its midline; they are what make it look alive. Scale them by 0.5 + energy x 2.2.
4. Roll off the sum with 1 - exp(-color x 1.3) so bright states glow instead of clipping.
5. The glass itself: an edge glow of (1 - z) raised to 2.1, 2.6 and 3.3 for red, green and blue (a slight color split at the rim); a soft rectangular window highlight about 0.16 x 0.09 radii, rotated 20 degrees, at (-0.4, 0.47); a faint round echo of it on the lower right.
6. Outside the ball: bloom of exp(-(r - 1) x 4.4) in the rim color, and a flat ellipse of the deep color 1.26 radii below center, as if it lit a table. Blend ball and background across 2 pixels at the edge so the silhouette is smooth. Add 1.8% of per-pixel noise to stop banding.
State colors as linear RGB, deep / bright / rim: Ready (0.16, 0.3, 0.95) / (0.8, 0.9, 1) / (0.5, 0.7, 1); Thinking (0.5, 0.18, 1) / (0.35, 0.85, 1) / (0.62, 0.5, 1); Asking (1, 0.4, 0.06) / (1, 0.88, 0.45) / (1, 0.7, 0.3); Done (0.05, 0.75, 0.45) / (0.8, 1, 0.82) / (0.4, 1, 0.7).

MOTION
Each state has a fog speed and an energy. Speed: 0.1, 0.75, 0.22, 0.08. Energy: Ready 0.14; Thinking 0.62 + 0.16 x sin(3.1t); Asking 0.5 + 0.5 x sin^2(2.4t), a slow patient pulse; Done 0.26. Ease the state blend toward its target at 3.2 per second and energy at 5 per second, and blend colors through the intermediate states. Keep the fog's clock in JavaScript (phase += dt x speed) and pass it in as a uniform: multiplying time by a changing speed makes the fog jump. On load the orb grows from 80% to full size and from black to full brightness at 1.7 per second, and the interface rises in after it, staggered by 70ms. While the agent is thinking, a band of light crosses the secondary line every 2.2s.

BEHAVIOR
The demo plays a believable run and loops: Ready for 2.4s; Thinking through four steps (read files, find the bug, write the fix, run the tests), each appearing with a spinner and resolving to a check mark with a spring pop and its real elapsed time; then Asking, with two buttons in the log, "Approve deploy" and "Hold for now". It waits six seconds for a click and then approves itself so the demo keeps moving. Approve leads to two more steps and Done; Hold returns to Ready with "Nothing was deployed." The log keeps the last four rows. A segmented control at the bottom shows any state on demand, holds it for seven seconds, then the run resumes. The pointer shifts the orb by 1.2% of the viewport, slides the highlight and pushes the fog, all eased at 4 per second. Pressing the glass makes it flare: add a kick of 1 that decays as exp(-2.2t), worth +0.7 energy and +1.6 speed.

ACCESSIBILITY
The headline is the status and lives in an aria-live="polite" region; the canvas is aria-hidden. The state control is a real radio group in a fieldset with a hidden legend. The buttons are real buttons with visible focus rings. With prefers-reduced-motion, render one still frame per state, play nothing automatically (open on the Asking state with its log filled in), and keep the control working. Without WebGL, show a radial gradient in the state color in the orb's place. Pause rendering when the tab is hidden, and lower the canvas resolution in steps before dropping frames.

NEVER
- Never use a spinner, dots or a progress bar as the main indicator; the orb is the indicator and the words say what it means.
- Never switch colors instantly; every state change blends over about half a second.
- Never let the fog loop visibly or scroll in one direction; it should fold.
- Never show a state without words. Color alone is not a status.
- Never take an irreversible step in the script without the Asking state first.
- No libraries, no images, no fonts from a network.
  1. CopyThe full prompt, one click.
  2. PasteInto Cursor, Claude Code, or any agent.
  3. CompareAgainst the live demo above.
AI Thinking Orb
Copied to clipboard