xxxxxxxxxx
83
/* interactive logo
Michal Shahaf
10/24/22
Instructions:
1. Touch John to change the colors
2. click on John to make him do something
*/
var height = 400;
var width = 400;
var img;
var h = height / 2;
var w = width / 2;
var The = "The";
var GOODLISTENER = "GOOD LISTENER";
var podcast = "podcast";
var counter = 0;
var interval = 60 * 2;
var memeText = "";
function preload() {
blink = loadImage("blink.png");
john = loadImage("john.png");
}
function setup() {
createCanvas(400, 400);
}
function draw() {
//background//
background("white");
fill(104, 168, 152);
noStroke();
rect(10, 10, 390, 390, 20);
//background color change//
if (mouseX < width / 4 && mouseY > height / 2 + 20) {
background(104, 168, 152);
fill("white");
noStroke();
rect(10, 10, 380, 380, 20);
}
//text and images//
image(john, 0, 200, 300, 200);
textSize(34);
textFont("Verdana");
fill(31, 71, 60);
text("the", w / 2 - 17 - 40, 85);
textSize(56);
fill("white");
text("GOOD", w - 110, 145);
text("LISTENER", w - 110, 205);
textSize(37);
fill(31, 71, 60);
text("podcast", w + 25, 250);
textSize(30);
fill(104, 168, 152);
//blinking John//
if (mouseIsPressed && mouseX < width / 4 && mouseY > height / 2 + 20) {
image(blink, 0, 200, 300, 200);
}
//GOOD LISTENER color text change//
if (mouseX < width / 4 && mouseY > height / 2 + 20) {
fill(104, 168, 152);
textSize(56);
text("GOOD", w - 110, 145);
text("LISTENER", w - 110, 205);
fill(218, 165, 32);
textSize(30);
}
//WITH JOHN HADDEN counter//
counter++;
if (counter === interval) {
memeText = "with John Hadden";
}
fill(0, 0, 128);
textSize(26);
text(memeText, w - 2 - 90, 325);
}