-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
23 lines (17 loc) · 773 Bytes
/
Copy pathscript.js
File metadata and controls
23 lines (17 loc) · 773 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
const globe = document.querySelector("#globe");
const button = document.querySelector("#shake");
const message = document.querySelector("#message");
const messages = [
"you are someone's favourite person to sit next to.",
"the thing you are building counts, even half finished.",
"you are allowed to be a beginner for as long as you need.",
"someone is going to love what you make with this.",
"hot chocolate tastes better after a hard day. you've earned one.",
"you ask good questions. that is the whole skill.",
];
button.addEventListener("click", () => {
globe.classList.add("shaking");
setTimeout(() => globe.classList.remove("shaking"), 600);
const pick = Math.floor(Math.random() * messages.length);
message.textContent = messages[pick];
});