-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscripts.js
57 lines (52 loc) · 1.08 KB
/
scripts.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
var body = document.querySelector("body");
var localStorage = window.localStorage;
document.addEventListener("click", function (clickEvent) {
if (clickEvent.target.matches("[data-change-theme]")) {
setTheme(clickEvent.target.dataset.changeTheme);
console.log(clickEvent.target.dataset.changeTheme);
}
});
function setTheme(themeClicked) {
body.dataset.theme = themeClicked;
localStorage.setItem("theme", themeClicked);
}
if (!localStorage.getItem("theme")) {
changeTheme("old");
} else {
body.dataset.theme = localStorage.getItem("theme");
}
function redditColors() {
var colors = [
"#D8BFD8",
"#A0522D",
"#483D8B",
"#66CDAA",
"#DEB887",
"#FFE4E1",
"#2E8B57",
"#7B68EE",
"#90EE90",
"#228B22",
"#FF7F50",
"#EE82EE",
"#A52A2A",
"#4B0082",
"#000000",
"#AFEEEE",
"#D3D3D3",
"#9370DB",
"#7FFFD4",
"#7CFC00",
"#40E0D0",
"#FF6347",
"#FFE4B5",
"#20B2AA",
"#FFF0F5",
"#FF8C00",
"#800000",
"#98FB98",
"#F08080",
"#FFDAB9",
];
colors.forEach(function (color) {});
}