oneshotlm
Compare all models on this prompt →

Flow-field particles · grok-4.20

Output generated Cost / run $0.0139 Runtime 24.3s

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

modelgrok-4.20
vendorxAI · Grok
harnesspi-agent
generated2026-08-01

METRICS

runtime24.3s
tokens in6.8k
tokens out3.8k
cached4.0k
cost / run$0.0139
Transcript · 6 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 task is to create a full-screen flow-field particle animation using p5.js. It must be a single self-contained index.html file with CSS in <style>, JS in <script>, and include the p5.min.js via <sc...
→ bash {"command":"ls -la"}
toolResult

total 1012 drwxr-sr-x. 2 node node 23 Aug 1 20:23 . drwxrwsrwx. 3 root node 16 Aug 1 20:23 .. -rw-r--r--. 1 node node 1034532 Aug 1 20:23 p5.min.js

assistant
thinking
The task is to create a full-screen flow-field particle animation using p5.min.js. It needs thousands of particles advected by Perlin-noise vectors, leaving fading trails, with colors shifting over ti...The task is to create a full-screen flow-field particle animation using p5.min.js. It needs thousands of particles advected by Perlin-noise vectors, leaving fading trails, with colors shifting over time. All in one self-contained index.html file with CSS in <style>, JS in <script>, and include <script src="p5.min.js"></script>.

I need to write the complete index.html file.

First, sketch the code.

Use global mode since p5.min.js global.

HTML:

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="utf-8">

<title>Flow Field Particles</title>

<style style>

body { margin: 0; overflow: hidden; background: black; }

canvas { display: block; }

</style>

<script src="p5.min.js"></script>

</head>

<body>

<script>

// code here

let particles = [];

let flowField;

let cols, rows;

let res = 20;

let zoff = 0;

function setup() {

  createCanvas(windowWidth, windowHeight);

  colorMode(HSB, 360, 100, 100);

  cols = floor(width / res);

  rows = floor(height / res);

  flowField = new Array(cols * rows);

 for (let i = 0; i < 5000; i++) {

    particles.
→ write index.html (7492 bytes)
toolResult

Successfully wrote 7492 bytes to index.html

assistant
thinking
The task is complete. The single self-contained index.html file has been created with p5.min.js loaded, full-screen canvas, thousands of particles (6500), Perlin noise flow field updated every frame w...

The file **index.html** has been created. Open it in a browser to view the full-screen flow-field particle animation (thousands of particles following evolving 3D Perlin noise vectors, with smooth fading trails and time-shifting HSB colors). Press **R** to reset or drag/touch to perturb the flow.