xxxxxxxxxx
90
let oppos = [
"backward - forward",
"bad - good",
"beautiful - ugly",
"before - after",
"begin - end",
"below - above",
"bent - straight",
"best - worst",
"big - little",
"bitter - sweet",
"black - white",
"blame - praise",
"bless - curse",
"bold - meek",
"borrow - lend",
"bottom - top",
"bound - free",
"boundless - limited",
"boy - girl",
"brave - cowardly",
"bright - dim",
"broad - narrow",
"build - destroy",
];
let cnv;
let myfont
function preload() {
myFont = loadFont('C64_Pro_Mono-STYLE.ttf');
}
function setup() {
cvn = createCanvas(800, 800);
let cx =(windowWidth-cvn.width)/2
let cy = (windowHeight-cvn.height)/2
cvn.position(cx,cy)
textAlign(CENTER,CENTER);
textSize(90);
frameRate(1);
//textFont('Times New Roman')
//textFont('Courier New');
//textStyle(BOLD)
//textFont('Helvetica');
textFont(myFont)
noStroke()
}
function draw() {
background(127);
let words = oppos[frameCount % oppos.length].split(" ");
fill(0);
rect(0, 0, 800, 400);
fill(255);
text(words[0], width / 2, height / 5);
fill(255);
rect(0, 400, 800, 800);
fill(0);
text(words[2], width / 2, height - height / 5);
//stroke(127)
let sz=15
for(let x =0; x<800;x+=sz){
let y
let ud = floor(random(2))
if(ud==1){
y = height/2-sz/2;
fill(255)
}else{
y= height/2
fill(0)
}
rect(x,y,sz,sz/2)
}
// noStroke()
}
function keyPressed() {
// this will download the first 25 seconds of the animation!
if (key === 'g') {
saveGif('bw2.gif', 23);
}
if (key === 's') {
saveCanvas('bw2', 'jpg');
}
}