Mandelbrot explorer · glm-5.2
Output generated Cost / run $0.0148 Runtime 91.1s
Prompt for this run
Render the Mandelbrot set with a smooth color gradient on a full-screen canvas, with click-and-drag to pan and mouse-wheel to zoom.
TAKE IT TO CODE
A single self-contained HTML file — copy it and open in any browser, or reuse the prompt with your own pi-agent run.
RUN
METRICS
Transcript · 4 messages
Render the Mandelbrot set with a smooth color gradient on a full-screen canvas, with click-and-drag to pan and mouse-wheel to zoom.
thinking
Let me create a single-page Mandelbrot set renderer with pan and zoom.
/workspace/index.html (11024 bytes)Successfully wrote 11024 bytes to /workspace/index.html
Done. `index.html` is a fully self-contained Mandelbrot explorer. **Features:** - **Full-screen canvas** rendered at device-pixel-resolution (capped at 2x for performance), tiled in 64×64 chunks so renders stay responsive and can be cancelled mid-frame. - **Smooth color gradient** using the continuous (normalized) escape-time formula `i + 1 − log₂(log|z|)` mapped onto a cyclic cosine palette of 2048 precomputed colors — no visible banding, seamless wrap. - **Click-and-drag to pan** (mouse + touch), with grab/grabbing cursors. - **Mouse-wheel zoom** anchored to the cursor position so the spot under the pointer stays fixed (also pinch-zoom on touch). - **Adaptive iteration depth** that scales with zoom level (100→2000), plus cardioid/period-2-bulb early-out for speed. - **HUD** showing live zoom factor, center coordinates, and current iteration count, plus a **Reset** button. - Stale renders are cancelled via a token, so rapid panning/zooming doesn't queue up work. Open `index.html` in any browser — it runs entirely offline with no external resources.