xxxxxxxxxx
52
let img;
let m;
let fS= 32;
function setup() {
myFont = loadFont('Lato-Black.ttf');
img=loadImage('https://freeolabini.org/media-kit/fob_16-9.png');
createCanvas(windowWidth, windowHeight);
if(windowWidth >= 800){
fS=42;
}
else {
fS= 32;
}
textSize(fS);
textFont(myFont,fS );
textAlign(CENTER, BOTTOM);
button = createButton('Descargar');
button.position(width - button.width ,height - button.height);
button.mousePressed(saveP);
}
function draw() {
background(img, 0, 0);
push();
text( 'How much longer?', width/2, fS );
pop();
push();
noStroke();
translate(0,fS)
fill(255,0,0);
rect(0,0,width,fS);
stroke(255);
fill(255);
text( 'Day ' + daysPast(), width/2,fS);
pop();
}
function daysPast() {
annyversary = new Date(2023, 0, 31);
current_date = new Date();
return Math.ceil((Math.abs(current_date - annyversary)) / (1000 * 60 * 60 * 24));
}
function saveP() {
save('FreeOlaBini.png');
}