-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
146 lines (132 loc) · 3.72 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
const button = document.querySelectorAll("button");
const audio = document.querySelector(".audio");
const message = document.querySelector("p");
const body = document.querySelector("body");
const spanText = document.querySelector(".friendly");
const emoji = document.querySelector(".emoji");
const titleText = document.querySelector("h1");
button.forEach(function (clickButton) {
clickButton.addEventListener("click", allFunctions);
});
function play() {
audio.play();
}
//selects a random message from the alerts array on every button click
let oldAlert = -1;
let newAlert = -1;
function alertMessage() {
while (newAlert == oldAlert) {
newAlert = Math.floor(Math.random() * alerts.length);
}
message.innerHTML = alerts[newAlert];
oldAlert = newAlert;
}
function background() {
if (body.style.backgroundColor === "var(--green)") {
} else {
body.style.backgroundColor = "black";
}
}
function titleSpan() {
spanText.style.color = "var(--red)";
spanText.innerHTML = '"friendly" ';
}
function emojiChange() {
if (emoji.innerHTML === " 💕") {
} else {
emoji.innerHTML = badEmojis[Math.floor(Math.random() * badEmojis.length)];
}
}
function secondText() {
if (titleText.style.fontFamily === "var(--text)") {
} else {
titleText.style.fontFamily = "var(--text2)";
}
}
function textColor() {
if (titleText.style.color === "var(--blue)") {
} else {
titleText.style.color = "var(--titleText)";
}
}
//displays a random emoji from the emojis array on every load of the page
window.addEventListener("load", () => {
emoji.innerHTML = emojis[Math.floor(Math.random() * emojis.length)];
});
//displays a random emoji from the emojis array when hovering over the emoji
emoji.addEventListener("mouseover", () => {
emoji.innerHTML = emojis[Math.floor(Math.random() * emojis.length)];
});
function allFunctions() {
background();
alertMessage();
play();
titleSpan();
secondText();
emojiChange();
textColor();
}
const alerts = [
"Please don't touch me.",
"Stay away from me.",
"What do you think you're doing?",
"Seriously, I didn't ask for this.",
"I can't believe you've done this.",
"You shouldn't do that!",
"Please, behave.",
"Who raised you?!",
"Wow, really? You don't care about anything do you?",
"Alright, alright, we got a real cool guy over here...",
"I want to punch you in the face for doing that.",
"I'll let it slide for now, but next time... beware!",
"Are you trying to piss me off?",
"You can't just do anything you want, where are your manners?",
"Look at you, walking around like you own this place... despicable.",
"I'll make you pay for this.",
"You're not getting away with this.",
"Wow, that's kinda disrespectful.",
"You really don't want to do that.",
"You'll regret this.",
"Why are you the way that you are?",
"Don't push it, or I'll give you a war you won't believe.",
"And you will know my name is the lord, when I lay my vengeance upon thee.",
"I will look for you, I will find you, and I will kill you.",
"I've got a bad feeling about this.",
"Ever notice how you come across somebody once in a while you shouldn't have fucked with? That's me.",
"Wake up — time to die.",
"Go ahead, punk, make my day.",
"Sounds like you've had a hard life. Good thing it's over.",
];
const emojis = [
"💞",
"💝",
"🌞",
"🌸",
"🌹",
"🎉",
"💖",
"💘",
"😍",
"😋",
"😘",
"🌻",
"🌷",
"🍭",
"🎊",
];
const badEmojis = [
"👺",
"👻",
"👽",
"👿",
"💀",
"💩",
"🔪",
"🖕",
"🗡",
"😡",
"🤡",
"🤢",
"🤬",
"🎃",
];