Concept:
The first cup of coffee, usually accompanied by music of Fairuz, in the morning, is a staple in every Lebanese household. I knew I wanted to do something that is connected to my culture and identity, so I looked up a picture of the signature morning setup and tried my best to mimic it.
A little bit of background, we call the coffee cup ‘finjan’ and the pot ‘rakwe’. The coffee itself is usually Turkish coffee.
Proud of This Part(s)!
I’m proud of two parts of my code, one is where I used loops to imitate the designs on the cup.
//loop for the oval design of the cup (for)
let ovals = 2;
for (let i = 0; i < ovals; i++) {
let x = 450 + i * 60;
let y = 300;
fill(" #3F51B5");
ellipse(x, y, 20, 70);
}
//loop for the flower (while)
let flowers = 3;
let i = 0;
while (i < flowers) {
let x = 430 + i * 50;
let y = 275;
stroke("#3F51B5");
strokeWeight(5);
line(x, y, x, y + 45);
noStroke();
fill("#F44336");
ellipse(x, y, 10, 20);
i++;
}
It was very fun to try and figure out the spacing, and using both for and while loops to get myself used to their separate structures, as I tend to be more prone to using for loops.
The other part of my code that I’m really proud of is the little animation when you press your mouse on the ‘rakwe’, it fills the ‘finjan’ and displays a welcome text.
//little animation for when you press the rakwe
//coffee cup seems to be full
//and a welcome text
if (
mouseIsPressed &&
mouseX > 65 &&
mouseX < 185 &&
mouseY > 120 &&
mouseY < 205
) {
fill("#50211C");
ellipse(480, 250, 80, 10);
textAlign(RIGHT);
textStyle(NORMAL);
textSize(50);
fill('black');
text("Ahla w Sahla", 420,100);
}
My Work:
Reflection:
It’s really fun taking concepts we implemented in class, but actually applying them to your own creative work. You also wind up learning new things on the way, for example, this was my first time using text in p5.js.
While I like the final result, I definitely see as we learn more, the more interactive and complex I can make it. I would like to make the ‘rakwe’ draggable, and have the user manually fill the cup with coffee. Also, maybe a possibility of under- or over-filling the cup and different display messages for each scenario.
