xxxxxxxxxx
368
let back; // background
let border; let scream; let button; // type
let clapclap; // clap
let can; let we; let please; let just; let go; let home; let now; // words
let colours; let s; let b; // colours
let count = 0; // click
let nail1; let nail2; let nail3; let side; let side2; let side3; let side4; // random bolts
let words; let displaytext; let lastChar; let temptext; // border words
let tp; let lft; let rgt; let btm; // border
let hme; let cncl; // buttons
function preload() {
back = loadImage('back-04.png');
border = loadFont('Italiana-Regular.ttf');
scream = loadFont('Jaan.ttf');
button = loadFont('Button.ttf');
clapclap = loadImage('Asset 5.png');
}
function setup() {
createCanvas(1000, 1000);
colorMode(HSB, 360, 100, 100, 100);
textAlign(CENTER, CENTER);
angleMode(DEGREES)
frameRate(3)
image(back, 0, 0, 1000, 1000);
colours = [50, 0, 290, 260, 240]
s = 70;
b = 100;
nail1 = new bolts(139, 139)
nail2 = new bolts(860, 139)
nail3 = new bolts(860, 860)
side = new disco(55, 55)
side2 = new disco(width - 55, 55)
side3 = new disco(55, height - 55)
side4 = new disco(width - 55, height - 55)
words = str("THANKS NO THANKS 2020 ");
displaytext = words;
tp = new thanks(500, 65, 0);
lft = new thanks(500, 935, 180);
rgt = new thanks(935, 500, 90);
btm = new thanks(65, 502, 270);
hme = new butt(125, 777)
cncl = new butt(235, 777)
}
function draw() {
nail1.show()
nail2.show()
nail3.show()
side.be()
side2.be()
side3.be()
side4.be()
tp.dis()
lft.dis()
rgt.dis()
btm.dis()
hme.oneBut()
cncl.twoBut()
}
class butt {
constructor(bxx, byy) {
this.x = bxx;
this.y = byy;
}
oneBut() {
noStroke()
fill(348, 12, 14)
rect(this.x, this.y, 102, 102)
textSize(14)
textFont(button);
fill(colours[0], s, b)
text("fine i guess", this.x + 48.5, this.y + 86) //125, 777
beginShape()
vertex(this.x + 28, this.y + 75)
vertex(this.x + 28, this.y + 41)
vertex(this.x + 21, this.y + 41)
vertex(this.x + 50.5, this.y + 11.5)
vertex(this.x + 81, this.y + 41)
vertex(this.x + 73, this.y + 41)
vertex(this.x + 73, this.y + 75)
vertex(this.x + 56, this.y + 75)
vertex(this.x + 56, this.y + 60)
vertex(this.x + 46, this.y + 60)
vertex(this.x + 46, this.y + 75)
endShape(CLOSE)
}
twoBut() {
noStroke()
fill(348, 12, 14)
rect(this.x, this.y, 102, 102)
textSize(14)
textFont(button);
fill(colours[1], s, b)
text("no", this.x + 52, this.y + 86) //235, 777
noFill()
stroke(colours[1], s, b)
strokeWeight(6.7)
line(this.x + 76, this.y + 23, this.x + 24, this.y + 75)
line(this.x + 24, this.y + 23, this.x + 76, this.y + 75)
}
}
class bolts {
constructor(nx, ny) {
this.x = nx;
this.y = ny;
this.r = 28;
}
show() {
push()
let targetAngle = atan2(mouseY - this.y, mouseX - this.x);
translate(this.x, this.y)
rotate(targetAngle)
stroke(240, 0, 92)
strokeWeight(2)
fill(colours[1], s, b)
circle(0, 0, this.r)
line(0 - (this.r / 2), 0, 0 + (this.r / 2), 0)
pop()
}
}
class disco {
constructor(xx, yy) {
this.x = xx;
this.y = yy;
this.c = 150;
this.sb = 0;
}
be() {
push()
translate(this.x, this.y);
noStroke()
// this.c = map(mouseX, 0, width, 0, 360)
// this.sb = map(mouseY, 0, height, 70,100)
fill(348, 12, 14)
ellipse(0, 0, 15, 15)
pop()
}
}
class thanks {
constructor(tx, ty, tr) {
this.x = tx;
this.y = ty;
this.r = tr
}
dis() {
lastChar = displaytext[displaytext.length - 1];
temptext = '';
for (let i = 0; i < displaytext.length - 1; i++) {
temptext = temptext + displaytext[i]
}
displaytext = lastChar + temptext;
push()
translate(this.x, this.y)
rotate(this.r)
noStroke()
fill(240, 0, 92)
rect(-405, -20.5, 810, 60)
textFont(border);
fill(348, 12, 14)
textSize(70)
text(displaytext, 0, 0);
pop()
}
}
class goHome {
constructor(tyx, tyy, tysc) {
this.x = tyx;
this.y = tyy;
this.script = tysc;
}
show() {
textSize(145)
textFont(scream);
noStroke()
fill(210, 0, 40, 25)
text(this.script, this.x + 20, this.y + 20);
stroke(240, 0, 100)
strokeWeight(2)
for (let i = 0; i < 26; i = i + 5) {
if (i < 5) {
fill(colours[0], s, b)
} else if (i >= 5 && i < 10) {
fill(colours[1], s, b)
} else if (i >= 10 && i < 15) {
fill(colours[2], s, b)
} else if (i >= 15 && i < 20) {
fill(colours[3], s, b)
} else if (i >= 20 && i < 25) {
fill(colours[4], s, b)
} else if (i == 25) {
fill(colours[4], 0, b)
}
text(this.script, this.x - i, this.y - i);
}
}
}
function mouseClicked() {
count++;
can = new goHome(mouseX, mouseY, "can")
we = new goHome(mouseX, mouseY, "we")
please = new goHome(mouseX, mouseY, "please")
just = new goHome(mouseX, mouseY, "just")
go = new goHome(mouseX, mouseY, "go")
home = new goHome(mouseX, mouseY, "home")
now = new goHome(mouseX, mouseY, "now")
tired = new goHome(random(250, width - 250), random(100, height - 100), "v tired")
please2 = new goHome(random(250, width - 250), random(100, height - 100), "please")
if (count == 1) {
can.show();
}
if (count == 2) {
image(clapclap, mouseX - 100, mouseY - 100, 200, 200);
}
if (count == 3) {
we.show();
}
if (count == 4) {
image(clapclap, mouseX - 100, mouseY - 100, 200, 200);
}
if (count == 5) {
please.show();
}
if (count == 6) {
image(clapclap, mouseX - 100, mouseY - 100, 200, 200);
}
if (count == 7) {
just.show();
}
if (count == 8) {
image(clapclap, mouseX - 100, mouseY - 100, 200, 200);
}
if (count == 9) {
go.show();
}
if (count == 10) {
image(clapclap, mouseX - 100, mouseY - 100, 200, 200);
}
if (count == 11) {
home.show();
}
if (count == 12) {
image(clapclap, mouseX - 100, mouseY - 100, 200, 200);
}
if (count == 13) {
now.show();
}
if (count == 14) {
image(clapclap, mouseX - 100, mouseY - 100, 200, 200);
}
if (count > 14) {
textSize(30)
textFont(scream);
noStroke()
fill(210, 0, 40, 50)
text("v tired", mouseX, mouseY);
}
if (mouseY > 777 && mouseY < 777 + 102) {
if (mouseX > 125 && mouseX < 125 + 102) {
image(back, 0, 0, 1000, 1000);
draw()
count = 0;
}
if (mouseX > 235 && mouseX < 235 + 102) {
image(back, 0, 0, 1000, 1000);
draw()
tired.show()
please2.show()
count = 0;
}
}
}