p5.js script made with Claude3.7
It’s a flocking simulation where triangular boids follow classic separation, alignment, and cohesion rules while being attracted to touch input. The entire swarm shares a unified neon color palette that transitions between pink and cyan.
Key features include:
- Mobile-first responsive design with performance optimizations
- Triangles that correctly face their direction of movement using velocity.heading()
- A unified swarm color that transitions between neon pink and cyan
- Click/touch interaction that changes colors and attracts the swarm
- A title with animated text-shadow that cycles between pink and cyan
- Subtle glow effects on the triangles
- A pulsing size effect that intensifies near the attraction point
The code should be a complete, standalone HTML file with embedded CSS and JavaScript that works on both mobile and desktop browsers.