-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
32 lines (26 loc) · 824 Bytes
/
script.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
/* If you're feeling fancy you can add interactivity
to your site with Javascript */
const messageEl = document.getElementById("message");
const videoEl = document.getElementById("video");
const dateNow = new Date();
const day = dateNow.getDay();
const isWednesday = day === 3;
function getColours() {
const getColour = () => Math.ceil(Math.random() * 255);
const red = getColour();
const green = getColour();
const blue = getColour();
return { red, green, blue };
}
function setBackground(){
const { red, green, blue } = getColours();
document.body.style.background = `rgba(${red}, ${green}, ${blue}, .1`;
};
setBackground();
if (isWednesday) {
messageEl.innerText = "IT IS WEDNESDAY MY DUDES";
setInterval(()=>setBackground,2000)
} else {
messageEl.innerText = "NOPE";
videoEl.remove();
}