Skills

P5js

Create generative visual art and interactive sketches using p5.js, rendered as...

Install

npx skills add taracodlabs/aiden --skill p5js -g -a claude-code -y
Repository
taracodlabs/aiden868
Category
Engineering
Updated
16d ago
License
Apache-2.0
Context cost
Lightabout 1,044 tokens
Runs scripts
No, instructions only

What it does

Create generative visual art and interactive sketches using p5.js, rendered as self-contained HTML files

p5.js Generative Art and Creative Coding

Create generative visual art, animations, and interactive sketches using p5.js. Output is a self-contained HTML file that opens in any browser, no build step required.

When to Use

  • User wants generative or procedural visual art
  • User wants an interactive animation or visualization
  • User wants to visualize data in a creative, non-standard way
  • User wants a screensaver-style animation
  • User wants to experiment with creative coding

How to Use

1. Basic p5.js HTML template

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>p5.js Sketch</title>
  <style>body { margin: 0; background: #0d1117; overflow: hidden; }</style>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.0/p5.min.js"></script>
</head>
<body>
<script>
// Your p5.js sketch code goes here

function setup() {
  createCanvas(windowWidth, windowHeight);
  background(13, 17, 23);
}

function draw() {
  // Called every frame (~60fps)
}
</script>
</body>
</html>

2. Flowing particles sketch

let particles = [];

function setup() {
  createCanvas(windowWidth, windowHeight);
  colorMode(HSB, 360, 100, 100, 100);
  background(220, 30, 10);
  for (let i = 0; i < 300; i++) {
    particles.push({ x: random(width), y: random(height), hue: random(180, 280) });
  }
}

function draw() {
  fill(220, 30, 10, 8);
  noStroke();
  rect(0, 0, width, height);

  for (let p of particles) {
    let angle = noise(p.x * 0.003, p.y * 0.003) * TWO_PI * 4;
    p.x += cos(angle) * 2;
    p.y += sin(angle) * 2;
    if (p.x < 0 || p.x > width || p.y < 0 || p.y > height) {
      p.x = random(width); p.y = random(height);
    }
    stroke(p.hue, 70, 90, 60);
    strokeWeight(1.5);
    point(p.x, p.y);
  }
}

3. Recursive fractal tree

function setup() {
  createCanvas(800, 600);
  background(13, 17, 23);
  stroke(100, 200, 120, 180);
  translate(width / 2, height);
  branch(120);
}
Read the whole SKILL.md on GitHub

More in Engineering