xxxxxxxxxx
150
let w = 400;
let h = 400;
let angle1 = 0;
let angle2 = 0;
let angle3 = 0;
function setup() {
createCanvas(w, h);
background("#F2AABC");
}
function draw() {
// Background arch drawing
noFill();
stroke(108, 186, 201);
strokeWeight(100);
arc(0, 0, 500, 500, angle1 + PI, angle1);
angle1 += radians(1);
noStroke();
// Hair (behind the face)
fill("black");
ellipse((7 * w) / 8, h / 2 + 10, w / 3, h / 3);
ellipse((7 * w) / 8 - 30, h / 2 - 60, w / 3, h / 3);
ellipse(387, 150, w / 8, h / 8);
rect(w / 2, h / 2, w, h);
// Neck
fill("#F9E179");
triangle(w / 2, h / 4, w / 4, (3 * h) / 4, (3 * w) / 4, (3 * h) / 4);
fill("#D36332");
triangle(w / 2, h / 4, (3 * w) / 8, h / 2, (11 * w) / 16, (5 * h) / 8); // shadow on the neck
// Head
fill("#F9E179");
arc(w / 2, h / 4, w / 2, h / 2, 0, PI);
// Ear
arc(w / 2, h / 2 - 10, w / 8, h / 8, 0, PI);
// Lips
fill(232, 112, 133);
ellipse((3 * w) / 8, h / 4, w / 32, h / 32);
ellipse((3 * w) / 8 - w / 32 + 3, h / 4, w / 32, h / 32);
triangle(
(3 * w) / 8 - w / 32 + 3 - w / 64,
h / 4,
(3 * w) / 8 + w / 64,
h / 4,
(3 * w) / 8,
(5 * h) / 16
);
// Eyes - the other
fill("#D36332"); // glasses
quad(232, 117, 195, 137, 210, 194, 265, 170);
fill(242, 170, 188);
ellipse(216, 149, 20, 20);
fill("white");
translate(223, 150);
rotate(radians(-10));
ellipse(0, 0, 20, 50);
resetMatrix();
fill(106, 186, 201);
ellipse(222, 148, 15, 15);
fill("black");
ellipse(222, 148, 10, 10);
fill("white");
ellipse(222, 146, 3, 3);
fill("black");
translate(223, 150);
rotate(radians(-10));
arc(0, 0, 20, 50, (3 * PI) / 2, PI / 2); // eyelids
resetMatrix();
// Eyes - top
fill("white");
ellipse(216, 94, 20, 20);
fill(242, 170, 188);
ellipse(210, 101, 20, 20);
fill(106, 186, 201);
ellipse(215, 94, 15, 15);
fill("black");
ellipse(215, 94, 10, 10);
fill("white");
ellipse(217, 93, 3, 3);
// Hair (on top of the face)
fill("black");
beginShape();
vertex((5 * w) / 8, h / 4 - 10);
vertex((2 * w) / 3, (3 * h) / 8);
vertex((2 * w) / 3 + 10, (3 * h) / 8 + 10);
vertex((2 * w) / 3 - 5, (3 * h) / 8 + 15);
vertex(244, 190);
vertex(289, 277);
vertex(357, 277);
vertex(301, 97);
endShape(CLOSE);
// Nose and eyebrow arch
stroke("red");
strokeWeight(1);
line(180, 83, 180, 120);
line(180, 120, 230, 120);
noFill();
arc(230, 150, 50, 60, (3 * PI) / 2, PI / 2 - 0.5);
// Flower earring in rotation
translate(198, 230);
for (let i = 0; i < 10; i++) {
push();
fill(255, 0, 0); // Red petals
noStroke();
rotate(radians(360 / 10) * i + angle2);
ellipse(0, 15, 10, 30);
pop();
angle2 += 0.003;
}
// Text in Rotation
let radius = 150; // Radius at which text rotates
let textRotate = "Buka Buka Buka Buka Buka ";
let textArray = textRotate.split("");
let angleStep = (2 * PI) / textArray.length;
for (let i = 0; i < textArray.length; i++) {
let x = w / 2 + radius * cos(-angle3 + i * angleStep);
let y = h / 2 + radius * sin(-angle3 + i * angleStep);
textSize(50);
fill(232, 112, 133);
noStroke();
text(textArray[i], x, y);
}
angle3 += radians(1);
}