-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathscript.js
More file actions
26 lines (21 loc) · 1.11 KB
/
script.js
File metadata and controls
26 lines (21 loc) · 1.11 KB
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
// Chill Pill 🧘🏽♀️
// Codédex
const quoteList = [
"Some doors only open from the inside. Breath is a way of accessing that door.",
"What has to be taught first, is the breath.",
"Remember the blue sky. It may at times be obscured by clouds, but it is always there.",
"In the midst of movement and chaos, keep stillness inside of you.",
"We can't control the sea, but we can learn how to surf the waves.",
"Feelings come and go like clouds in a windy sky. Conscious breathing is my anchor.",
"To understand the immeasurable, the mind must be extraordinarily quiet, still."
];
const colors = ["#e81416", "#ffa500", "#faeb36", "#79c314", "#487de7", "#4b369d", "#70369d"];
let wrapperDiv = document.getElementById("wrapper");
let quoteText = document.getElementById("quote-text");
let quoteButton = document.getElementById("quote-button");
quoteButton.addEventListener("click", function() {
const randomIndex = Math.floor(Math.random() * quoteList.length);
const randomQuote = quoteList[randomIndex];
quoteText.innerText = randomQuote;
wrapperDiv.style.backgroundColor = colors[randomIndex];
});