xxxxxxxxxx
75
let pixelFont;
let content = "404 NOT FOUND 404 NOT FOUND 404 NOT FOUND";
var yStart = 0;
var aStart = 0;
let words = [
"This page has been deleted",
"This content has been deleted",
"This page does not exist.",
"This content does not exist..",
];
var i = 0;
function preload() {
pixelFont = loadFont("assets/pixel7.ttf");
}
function setup() {
createCanvas(windowWidth, 800, WEBGL);
frameRate(20);
// translate(0,0,mouseX)
camera(0, 500, 500);
}
function draw() {
//orbitControl();
if (mouseIsPressed === true) {
background("red");
} else {
background("skyblue");
}
for (let x = -width / 2 - 600; x < width; x += 1010) {
for (let y = yStart - height / 2 - 500; y < height; y += 80) {
textFont(pixelFont);
textAlign(LEFT, TOP);
textSize(20);
if (mouseIsPressed === true) {
for (let a = aStart - width / 2; a < width; a += 700) {
for (let b = -height / 2 - 500; b < height; b += 100) {
textSize(20);
fill(random(200), random(80, 90));
textAlign(CENTER, CENTER);
text(words[i], a, b);
}
// aStart=aStart+0.05;
}
// i++;
if (i > words.length - 1) {
i = 0;
}
} else {
fill("white");
stroke("black");
strokeWeight(105);
text(content, x, y);
}
}
}
yStart = yStart - 3;
}
function mousePressed() {
i++;
if (i > words.length - 1) {
i = 0;
}
}