95 lines, 7 of them comments ยท 904 tokens, written in 26 seconds for $0.0003


 1  function setup() {
 2    createCanvas(800, 600);
 3    noStroke();
 4    frameRate(30);
 5  }
 6  
 7  function draw() {
 8    // Semi-transparent background for trailing effect
 9    background(0, 10);
10    
11    // Generate interactive elements
12    drawShapes();
13    drawLines();
14    drawParticles();
15  }
16  
17  function drawShapes() {
18    // Pulsing central circle
19    let pulse = sin(frameCount * 0.05) * 30;
20    fill(
21      map(mouseX, 0, width, 100, 255),
22      map(mouseY, 0, height, 100, 255),
23      150,
24      150
25    );
26    ellipse(width/2, height/2, 150 + pulse, 150 + pulse);
27    
28    // Rotating triangles
29    push();
30    translate(width/2, height/2);
31    rotate(frameCount * 0.02);
32    for(let i = 0; i < 8; i++) {
33      rotate(PI/4);
34      fill(255, 100, 100, 100);
35      triangle(
36        0, -100,
37        50, 0,
38        -50, 0
39      );
40    }
41    pop();
42  }
43  
44  function drawLines() {
45    // Dynamic connecting lines
46    strokeWeight(2);
47    for(let i = 0; i < 10; i++) {
48      let x1 = width/2 + sin(frameCount * 0.01 + i) * 200;
49      let y1 = height/2 + cos(frameCount * 0.01 + i) * 200;
50      let x2 = mouseX + sin(frameCount * 0.02 + i) * 50;
51      let y2 = mouseY + cos(frameCount * 0.02 + i) * 50;
52      
53      stroke(
54        255,
55        map(i, 0, 10, 100, 255),
56        map(i, 0, 10, 50, 200),
57        100
58      );
59      line(x1, y1, x2, y2);
60    }
61    noStroke();
62  }
63  
64  function drawParticles() {
65    // Floating particles
66    for(let i = 0; i < 20; i++) {
67      let angle = frameCount * 0.02 + i * 0.5;
68      let radius = 100 + sin(frameCount * 0.03 + i) * 50;
69      let x = width/2 + cos(angle) * radius;
70      let y = height/2 + sin(angle) * radius;
71      
72      let size = 5 + sin(frameCount * 0.05 + i) * 3;
73      
74      fill(
75        150 + sin(frameCount * 0.02 + i) * 105,
76        200 + cos(frameCount * 0.03 + i) * 55,
77        255,
78        150
79      );
80      ellipse(x, y, size, size);
81    }
82  }
83  
84  function mousePressed() {
85    // Add explosion effect on click
86    for(let i = 0; i < 50; i++) {
87      let angle = random(TWO_PI);
88      let speed = random(1, 5);
89      let x = mouseX + cos(angle) * random(10, 50);
90      let y = mouseY + sin(angle) * random(10, 50);
91      
92      fill(random(255), random(255), random(255), 200);
93      ellipse(x, y, 10, 10);
94    }
95  }