oneshotlm
Compare all models on this prompt →

Mandelbrot explorer · gemini-3-flash-preview

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.

⛨ sandboxed Open in new tab ↗
transcript · 4 messages
user

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.

assistant
thinking
**Developing Web App**

I'm currently focused on building a single-page web app to visualize the Mandelbrot set. The core components for full-screen rendering, smooth color gradients, and interactive panning/zooming are taking shape. My aim is to integrate all HTML, CSS, and JavaScript into one neat file.

**Refining Implementation Strategy**

I'm prioritizing a main-thread JavaScript rendering approach for now, aiming for optimized loops before considering Web Workers to maintain the single-file requirement. My focus is on achieving smooth panning and zooming with responsive color gradients as the core logic solidifies within the canvas element.

**Implementing WebGL Renderer**

I've decided to pivot towards a WebGL implementation for better performance and smoother full-screen rendering. This involves creating vertex and fragment shaders for the Mandelbrot calculation, using uniforms to handle zoom and pan interactions efficiently. The core logic for these shaders is starting to take shape.

write index.html (8379 bytes)
toolResult

Successfully wrote 8379 bytes to index.html

assistant
thinking
**Rendering Mandelbrot Set**

My initial Mandelbrot set rendering is complete, utilizing WebGL for efficient visualization. I've successfully integrated smooth coloring via the renormalization formula, along with intuitive pan and zoom controls. Automatic iteration scaling dynamically adjusts with zoom, ensuring optimal detail.

**Refining Visualization Logic**

I've confirmed the full-screen canvas responsiveness and the click-and-drag panning. Mouse-wheel zooming also appears to be correctly implemented with a focus on mouse-centered adjustments. I've ensured all code resides in a single `index.html` file, with no external dependencies, and the smooth color gradient is indeed handled by the fragment shader. The iteration limit of 1000 within the fragment shader, controlled by `u_max_iterations`, should suffice for typical zooms.

The Mandelbrot set explorer has been created as a self-contained `index.html` file. It uses WebGL for high-performance, real-time rendering, featuring smooth color gradients, intuitive click-and-drag panning, and mouse-centered zooming. ### Key Features: - **High Performance:** Leverages the GPU via WebGL to calculate millions of iterations per second. - **Smooth Coloring:** Uses a renormalization algorithm to eliminate "bands" of color, providing a liquid-smooth gradient. - **Interactive Controls:** - **Drag:** Click and hold to move around the complex plane. - **Zoom:** Use the mouse wheel to zoom in or out at the cursor's position. - **Dynamic Detail:** Automatically increases the iteration count as you zoom deeper to maintain sharp fractal boundaries. - **No Dependencies:** Pure HTML5, CSS3, and JavaScript/GLSL with no external libraries or network calls. ```html <!-- index.html is now present in the current directory --> ``` Usage: Simply open `index.html` in any modern web browser.

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

modelgemini-3-flash-preview
vendorGoogle
harnesspi-agent
generated2026-07-22

EVALUATION

4/5 working

Mandelbrot renders with smooth blue gradient; drag pans and wheel zooms correctly, click/keys have no effect as expected.

Vision grade · anthropic/claude-sonnet-5

MEASUREMENTS

Raw readings from the capture, not a verdict — the grade above is the only judgement. Percentages are how much of the screen changed; the measure under-reports sparse motion on a dark background.

idle motion0.0%
on click0.0%
on drag34.2%
on wheel6.0%
on enter + space0.0%
on arrow keys0.0%
on w/a/s/d0.0%
frame spread18.9 / 255
console errors0
js errors none

METRICS

runtime26.1s
tokens in5.7k
tokens out4.0k
cached0
cost / run$0.0148