反射-CSDN直播反射映象https://live.csdn.net/v/460090
一.CSS部分
body {margin: 0;padding: 0;height: 100vh;overflow: hidden;display: flex;align-items: center;justify-content: center;background: black;
}
二.JS部分
//wccchallenge - reflection
//reflection for reflection - comments for your reflection
//click to mix
let n=9;
function setup(){c=min(windowWidth,windowHeight)*0.8;//what is our size in this universe - what space/dimension do you occupycreateCanvas(c,c);//what shall you paint on the canvas of this day?y=-c;//what are the variables within you and of you?background(255);//this background is the childhood of this canvas - what is the background on which you paint?noFill()//how can you be empty?
}
function draw(){translate(c/2,c/2);//we all have transformations. to move is to transform. What is your transformation?for(let j=1;j<n;j++){//what are the loops in which you find yourself?for(let i=0;i<n;i++){//do you have loops within loops?push();//when do you compartmentalize yourself? thoughts?rotate(i*TWO_PI/n);//with enough mirrors we can rotate about ourselves - who, what, where is your mirror?thoughts(abs(c*sin(frameCount/((j)*500))),c/5+j*50);//what do your thoughts look likepop()//what awakens you?}}
}function thoughts(t,r){v=map(t,0,c,0,355);//map your thoughtsstroke(v*abs(sin(t/300)),v*abs(sin(t/500)),v*abs(sin(t/100))); //color your breathy=-r*2+t//manipulate your variablescircle(0,y,r);//this is where thought becomes a stroke on the canvas
}function mousePressed(){n=int(random(3,42))//evolve and change
}