oneshotlm
Compare all models on this prompt →

Flow-field particles · claude-opus-4.8

Output generated Cost / run $0.0911 Runtime 35.1s

Prompt for this run

Using the pre-provided p5.min.js (global p5, instance or global mode), create a full-screen flow-field particle animation: thousands of particles advected by Perlin-noise vectors, leaving fading trails, with colors shifting over time.

⛨ sandboxed Open in new tab ↗

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

modelclaude-opus-4.8
vendorAnthropic · Claude
harnesspi-agent
generated2026-07-08

METRICS

runtime35.1s
tokens in14k
tokens out2.3k
cached8.4k
cost / run$0.0911
Transcript · 8 messages
user

Using the pre-provided p5.min.js (global p5, instance or global mode), create a full-screen flow-field particle animation: thousands of particles advected by Perlin-noise vectors, leaving fading trails, with colors shifting over time.

assistant
thinking
I'm setting up an HTML file with p5.js to create a flow field visualization.
→ bash {"command":"ls -la /workspace"}
toolResult

total 1028 drwxrwxrwx 3 node node 96 Jul 8 02:58 . drwxr-xr-x 1 root root 4096 Jul 8 02:58 .. -rw-r--r-- 1 node node 1034532 Jul 8 02:58 p5.min.js

assistant
→ write /workspace/index.html (3777 bytes)
toolResult

Successfully wrote 3777 bytes to /workspace/index.html

assistant
→ bash {"command":"cd /workspace && node -e \"const fs=require('fs');const h=fs.readFileSync('index.html','utf8');console.log('bytes',h.length);con
toolResult

bytes 3777 has p5 src true

assistant

Done. `index.html` is a self-contained single-page flow-field particle animation. Key features: - **4000 particles** advected by a Perlin-noise vector field (angle = `noise(x,y,z)` mapped to direction). - **Fading trails** via a translucent black rect drawn each frame instead of clearing. - **Colors shift over time** — `hueBase` drifts continuously, combined with position and speed for HSB coloring. - **Time-evolving field** — the noise `zoff` dimension animates the flow slowly. - **Interactivity** — mouse position pushes nearby particles away; clicking reseeds all particles. - Loads the local `p5.min.js` with a plain `<script src="p5.min.js">`, no external resources, and handles window resize. Open it in a browser to run.