xxxxxxxxxx
78
let doggos;
let imgs = [];
let button;
let words = [
"according to the ASPCA pit bulls represent the highest number of dogs taken in by shelters, but have only the third highest adoption rates",
"pit bulls consistently score excellent on temperament tests and make great service, therapy and police dogs as well as family pets",
"during the 20th century pit bulls were America’s most popular family dog and were known for being good with small children",
"pit bulls were presented as the national mascot on WWI recruitment propaganda, they were America’s dog!",
"pit bull jaws do not have lockjaw and their bites are consistent with other breeds of that size",
"dogs labeled as pit bull will stay in shelters three times longer than dogs designated as their actual breed",
"pit bull is not a breed but a set of phenotypes found in the american pit bull terrier, american staffordshire terrier, staffordshire bull terrier and the american bully",
"the aggressive label given to pit bulls was earned though mistreatment from humans and they should not be blamed for their abusers wrondoings",
"pit bulls deserve to be wrapped in sweaters and loved",
];
function gotData(data) {
console.log(data);
doggos = data;
img = loadImage(data.message);
}
function preload() {
resetSketch();
}
function setup() {
createCanvas(600, 600);
background(85, 67, 58);
imageMode(CENTER);
textAlign(CENTER);
textFont("monospace", 20);
fill(205, 178, 152);
button = createButton("pittie please");
button.position(100, 550);
button.size(400, 50);
button.mousePressed(resetSketch);
}
function draw() {
if (img) {
image(img, 300, 360, 390, 390);
push();
stroke(205, 178, 152);
strokeWeight(5);
line(102.5, 550, 102.5, 165);
line(497.5, 550, 497.5, 165);
line(102.5, 164, 497.5, 164);
pop();
push();
textFont("monospace", 50);
text("♥", 560, 250);
text("♥", 560, 350);
text("♥", 560, 450);
text("♥", 560, 550);
text("♥", 40, 250);
text("♥", 40, 350);
text("♥", 40, 450);
text("♥", 40, 550);
pop();
}
}
function resetSketch() {
loadJSON('https://dog.ceo/api/breed/bullterrier/images/random', gotData);
background(85, 67, 58);
let word = random(words);
text(word, 20, 30, 570, 400);
}