xxxxxxxxxx
// please look at references for the inspirations
// reference: https://openprocessing.org/sketch/1050677
// reference for the fade effect: https://editor.p5js.org/remarkability/sketches/rtM08miUD
let particles = [] ;
var analyzer;
var fade; //for the fade effect
var fadeAmount = 1
function setup() {
createCanvas(windowWidth, windowHeight);
fade=0;
for(var i=0;i<width;i+=20){
for(var o=0;o<height;o+=5){
particles.push({
x:i,y:o,clr:color(mouseX*0.1,mouseY*0.4+frameCount,250,250)
})
}
}
}
function draw() {
background(100,70,40,0.07);
//noStroke();
for(var i=0;i<particles.length;i++){
let p =particles[i];
fill(mouseX*0.5,mouseY*0.5+frameCount, fade)
if (fade<0) fadeAmount=1;
if (fade>255) fadeAmount=-10;
fade += fadeAmount;
ellipse(p.x+30 ,p.y+30 ,1);
p.x+=(noise(p.x/200,p.y/200,3000)-0.6)*3;
p.y+=(noise(p.x/200,p.y/200,30000)-0.5)*3;
}
}