xxxxxxxxxx
82
function setup() {
createCanvas(400, 400);
rectMode(CENTER);
}
function draw() {
background('white');
drawCircle1();
drawCircle2();
drawTriangle();
drawSquare();
drawLines();
}
function drawCircle1(){
noStroke();
fill('#C1CFC0BB');
let x = width/2;
let y = height/5*3;
let minCircleSize = 200;
circle(x, y, minCircleSize + mouseY/3);
}
function drawCircle2(){
noStroke();
fill('#6B7AA1BB')
let minCircleSize = 30;
circle(mouseX, mouseY, mouseY/3 + minCircleSize)
}
function drawTriangle(){
noStroke();
fill('#E7E0C9BB')
let x1 = width*0.5;
let y1 = height*0.25;
let x2 = width*0.30;
let y2 = height*0.5;
let x3 = width*0.6;
let y3 = height*0.55;
triangle(x1+mouseX/10, y1+mouseY/10,
x2-mouseX/10, y2-mouseY/10,
x3-mouseY/10, y3-mouseX/10);
}
function drawSquare(){
noStroke();
fill('#11324DBB')
let x = width/7*5;
let y = height/7*5
let minSquareSize = 50
rect(x,y, minSquareSize + mouseX/5);
}
function drawLines(){
stroke('#000000CC');
strokeWeight(2);
line(30+mouseX/20,30+mouseY/30,
width*0.6-mouseX/10, height*0.5-mouseX/10)
strokeWeight(2);
line(30-mouseX/10,30-mouseY/15,
width*0.2+mouseY/5, height*0.8+mouseX/10)
strokeWeight(1);
line(0+mouseY/5,height*0.3-mouseY/10,
width*0.6+mouseX/20, height*0.3+mouseY/20)
strokeWeight(3);
line(0+mouseX,height*0.6,width*0.6+mouseX, height*0.6)
strokeWeight(1);
line(width*0.5,0-mouseY,width*0.9, height*0.9-mouseY)
}