-
Notifications
You must be signed in to change notification settings - Fork 0
/
colour.js
43 lines (34 loc) · 1.56 KB
/
colour.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
document.getElementById("red").addEventListener("mouseover", () => {
document.getElementById("red").style.backgroundColor = "rgba(255, 0, 0, 0.5)";
});
document.getElementById("red").addEventListener("mouseleave", () => {
document.getElementById("red").style.backgroundColor = "rgba(255, 0, 0, 0.25)";
});
document.getElementById("green").addEventListener("mouseover", () => {
document.getElementById("green").style.backgroundColor = "rgba(0, 255, 0, 0.5)";
});
document.getElementById("green").addEventListener("mouseleave", () => {
document.getElementById("green").style.backgroundColor = "rgba(0, 255, 0, 0.25)";
});
document.getElementById("pink").addEventListener("mouseover", () => {
document.getElementById("pink").style.backgroundColor = "rgba(255, 0, 255, 0.5)";
});
document.getElementById("pink").addEventListener("mouseleave", () => {
document.getElementById("pink").style.backgroundColor = "rgba(255, 0, 255, 0.25)";
});
function setColour(colour) {
localStorage.setItem("colour", colour);
location.href = ".";
}
setInterval(() => {
if (window.innerWidth < window.innerHeight) {
document.getElementById("red").style.borderBottomLeftRadius = "7.5px";
document.getElementById("pink").style.borderBottomRightRadius = "24px";
document.getElementById("blue").style.borderBottomLeftRadius = "24px";
}
else {
document.getElementById("red").style.borderBottomLeftRadius = "24px";
document.getElementById("pink").style.borderBottomRightRadius = "24px";
document.getElementById("blue").style.borderBottomLeftRadius = "7.4px";
}
});