oneshotlm
Compare all models on this prompt →

Flow-field particles · glm-4.7

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 ↗
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
The user wants me to create a flow-field particle animation using p5.js. Let me plan this out:

1. Create a single HTML file with:
   - p5.min.js loaded from local file
   - Full-screen canvas
   - Perlin noise flow field
   - Thousands of particles
   - Fading trails (using semi-transparent background)
   - Colors shifting over time

Key features to implement:
- Use p5.js global mode
- Create a flow field using noise() for vector directions
- Particles that follow the flow field
- Trail effect by drawing semi-transparent rectangle over the canvas
- Color cycling over time using HSB mode
- Handle window resize

Let me write this:

I'll create a full-screen flow-field particle animation with p5.js. Let me build this in a single HTML file.

write index.html (4105 bytes)
toolResult

Successfully wrote 4105 bytes to index.html

assistant
thinking
I've created a complete flow-field particle animation in index.html. Let me verify it was created correctly.
bash {"command":"ls -la index.html"}
toolResult

-rw-r--r-- 1 node node 4105 Jul 22 16:59 index.html

assistant
thinking
Great! The file was created successfully. Let me also verify that p5.min.js exists in the current directory as mentioned in the requirements.
bash {"command":"ls -la p5.min.js"}
toolResult

-rw-r--r-- 1 node node 1034532 Jul 22 16:58 p5.min.js

assistant
thinking
Perfect! Both files are in place. The index.html file I created includes:

1. Full-screen canvas that responds to window resizing
2. 4000 particles that follow Perlin noise-based flow field vectors
3. Fading trail effect using semi-transparent background rectangles
4. HSB color mode with colors shifting over time based on:
   - A global colorOffset that increases each frame
   - Particle position (x and y coordinates)
   - Individual particle color speed variation
5. Particles wrap around screen edges
6. No external dependencies - loads p5.min.js from the local file

The animation creates beautiful flowing trails that fade over time, with colors that cycle through the spectrum continuously.

Created `index.html` with a full-screen flow-field particle animation featuring: - **4000 particles** advected by Perlin-noise vectors - **Flow field** calculated on a 20px grid using p5's `noise()` function - **Fading trails** achieved by drawing semi-transparent black rectangles each frame - **Dynamic colors** shifting over time using HSB mode - hue cycles based on global offset + particle position - **Screen wrapping** - particles seamlessly flow from one edge to another - **Responsive** - handles window resize events The animation loads the local `p5.min.js` file and runs entirely offline with no external dependencies. Open `index.html` in a browser to see the mesmerizing flow field effect!

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

modelglm-4.7
vendorZ.ai · GLM
harnesspi-agent
generated2026-07-22

EVALUATION

4/5 working

Colorful flow-field particle trails animate continuously with shifting hues; input doesn't visibly alter behavior, but self-animation is strong.

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 motion34.8%
on click24.5%
on drag21.2%
on wheel18.4%
on enter + space23.5%
on arrow keys28.6%
on w/a/s/d29.7%
frame spread29.8 / 255
console errors0
js errors none

METRICS

runtime77.1s
tokens in183
tokens out1.7k
cached10k
cost / run$0.0038