xxxxxxxxxx
396
function setup() {
createCanvas(400,400);
}
function draw() {
background(249,242,236);
// gold chain
push();
noFill();
strokeWeight(2);
stroke(199,165,74);
arc(200,25,420,200,TWO_PI,PI);
pop();
push();
fill(230, 210, 193);
translate(5,5)
rect(198,120,4,30,15);
pop();
// Flipping the pendant
push();
let s = map(mouseX,0, width, -1,1);
if(mouseX > width) {
s=1}
translate(width/2 - s*width/2,0);
scale(s,1)
// pendant shadow
fill(230, 210, 193);
push();
translate(6,6)
noStroke();
ellipse(200,220,150,150)
pop();
// pendant
fill(199,165,74);
stroke(173, 139, 47);
ellipse(200,220,150,150);
// pendant details
fill(207, 176, 91);
ellipse(200,220,140,140);
//outer
push();
stroke(145, 118, 44);
strokeCap(ROUND);
strokeWeight(3);
angleMode(DEGREES);
arc(200,220,140,140,80,280);
pop();
//outer highlight
push();
stroke(235, 201, 110);
strokeWeight(2);
noFill();
angleMode(DEGREES);
arc(200,220,145,145,90,270);
pop();
if(mouseX < width/2) {
// parthenon entablature shadow
push()
translate(3,3)
fill(145, 118, 44);
noStroke();
triangle(200,160,160,180,240,180);
rect(165,180,70,15);
ellipse(200,158,4,4);
pop();
// parthenon entablature
fill(235, 201, 110);
triangle(200,160,160,180,240,180);
line(175,176,225,176);
rect(165,180,70,15);
ellipse(200,158,4,4);
push();
noFill();
rect(168,184,65,7);
pop();
push();
stroke(145, 118, 44);
strokeWeight(2);
line(165,181,235,181);
pop()
// parthenon columns shadow
push()
translate(3,3)
fill(145, 118, 44);
noStroke();
quad(166,195,165,255,174,255,173,195);
quad(186,195,185,255,194,255,193,195);
quad(206,195,205,255,214,255,213,195);
quad(226,195,225,255,234,255,233,195);
// volute 1
circle(166,197,5);
circle(173,197,5);
// volute 2
circle(185,197,5);
circle(193,197,5);
// volute 3
circle(206,197,5);
circle(213,197,5);
// volute 3
circle(226,197,5);
circle(233,197,5);
pop();
// parthenon columns
quad(166,195,165,255,174,255,173,195);
quad(186,195,185,255,194,255,193,195);
quad(206,195,205,255,214,255,213,195);
quad(226,195,225,255,234,255,233,195);
// volute 1
circle(166,197,5);
circle(173,197,5);
// volute 2
circle(185,197,5);
circle(193,197,5);
// volute 3
circle(206,197,5);
circle(213,197,5);
// volute 3
circle(226,197,5);
circle(233,197,5);
// parthenon stylobate shadow
push()
translate(3,3)
fill(145, 118, 44);
noStroke();
rect(158,255,85,5);
rect(155,260,90,5);
pop();
// parthenon stylobate
rect(158,255,85,5);
rect(155,260,90,5);
// Highlights
push();
stroke(245, 235, 208);
strokeWeight(1.5);
line(169,205,169,250);
line(189,205,189,250);
line(209,205,209,250);
line(229,205,229,250);
line(160,257,200,257);
line(160,263,205,263);
line(200,165,181,175);
line(172,188,203,188);
pop();
}
else{
// woman profile
// head shadow
push();
translate(3,3);
noStroke();
fill(145, 118, 44);
rect(170,170,65,80,20,30,10,10);//face
triangle(205,240,205,255,225,250)//chin
quad(170,220,165,270,209,275,205,240);//neck
triangle(235,202,247,227,235,229);//nose
pop();
// head
push();
noStroke();
fill(235, 201, 110);
rect(170,170,65,80,20,30,10,10);//face
triangle(205,240,205,255,225,250)//chin
quad(170,220,165,270,209,275,205,240);//neck
triangle(235,202,247,227,235,229);//nose
pop();
// lips shadow
push()
translate(3,3)
fill(145, 118, 44);
noStroke();
arc(235,235,6,4,270,90);
arc(235,239,6,4,270,90);
triangle(235,235,227,237,235,239);
pop();
// lips
fill(235, 201, 110);
arc(235,235,6,4,270,90);
arc(235,239,6,4,270,90);
triangle(235,235,227,237,235,239);
// hair shadow
push();
translate(3,3);
fill(145, 118, 44);
noStroke();
rect(170,167,62,20,30,30,5,0);
ellipse(180,200,50,65)
pop();
// hair
noStroke();
rect(170,167,62,20,30,30,5,0);
ellipse(180,200,50,65);
// bun shadow
push();
translate(90,-30);
rotate(17);
translate(3,3)
fill(145, 118, 44);
noStroke();
ellipse(155,230,45,25)
pop();
// bun
push();
translate(90,-30);
rotate(17);
noStroke();
ellipse(155,230,45,25)
pop();
// eye shadow
push();
translate(2,2)
fill(145, 118, 44);
arc(216,205,22,14,315,45);
pop();
// eye
push()
fill(235, 201, 110);
stroke(145, 118, 44);
strokeWeight(1);
arc(216,205,22,14,315,45,PIE);
pop()
// pupil
noFill();
stroke(145, 118, 44);
ellipse(225,206,4,4);
// highlights
stroke(245, 235, 208);
strokeWeight(1.5);
arc(185,200,50,55,130,240);
line(185,172,222,172);
line(205,183,224,183);
push();
translate(93,-30);
rotate(17);
arc(155,230,45,25,130,240);
pop();
}
pop();
// gold hoop
fill(199,165,74);
rect(198,120,4,30,15);
// shirt shadow
fill(230, 210, 193);
noStroke();
triangle(0,150,210,400,100,400);
triangle(400,150,200,400,300,400);
// shirt base
fill(182, 224, 211);
triangle(0,150,0,400,180,400);
triangle(400,150,400,400,220,400);
// collar shadow
push();
noStroke();
fill(143, 204, 199)
quad(0,150,0,300,130,400,180,400);
quad(400,150,220,400,270,400,400,300);
pop();
// shirt pattern
//blue
push();
strokeWeight(10);
stroke(205, 226, 250);
blendMode(MULTIPLY);
// left
line(20,200,20,400);
line(80,300,80,400);
line(140,350,140,400);
// right
line(380,200,380,400);
line(320,300,320,400);
line(260,350,260,400);
pop();
//violet
push();
translate(30,0);
strokeWeight(10);
stroke(226, 205, 250);
blendMode(MULTIPLY);
// left
line(20,300,20,400);
line(80,360,80,400);
line(140,395,140,400);
// right
line(380,200,380,400);
line(320,300,320,400);
line(260,350,260,400);
pop();
// collar
fill(242, 187, 191);
noStroke();
quad(0,150,0,280,140,400,180,400);
quad(400,150,220,400,260,400,400,280);
// left buttonhole
push();
angleMode(DEGREES);
translate(300,10);
rotate(45);
fill(143, 204, 199)
ellipse(130,370,50,10);
pop();
// right buttonhole
push();
angleMode(DEGREES);
translate(-180,290);
rotate(-45);
fill(143, 204, 199);
ellipse(270,370,50,10);
pop();
// button
fill(191, 126, 146);
quad(279,343,290,350,258,380,254,368);
// collar shadow
push();
fill(252, 227, 229);
noStroke();
blendMode(MULTIPLY);
quad(0,140,0,220,161,400,180,400);
quad(400,140,220,400,240,400,400,220);
pop();
push();
strokeWeight(5);
stroke(196, 135, 140);
line(0,150,180,400);
line(400,150,220,400);
pop();
//ellipse(0,-20,70,70);
//ellipse(400,-20,70,70);
// Have you seen this?
textSize(26);
textFont('Baskerville');
text("Have you seen this?", mouseX, mouseY);
//text("(" + mouseX + ", " + mouseY + ")", mouseX, mouseY);
}