-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
89 lines (75 loc) · 2.46 KB
/
index.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
// Challenge 2:
// Replace the arguments below according to your preference.
// space, scary, military, romantic, cowboy, fantasy, superhero
favouriteMovieGenre("space")
// watermelon, tomato, banana, orange, avocado, blueberry
favouriteFruit("avocado")
// light, dark
favouriteMode("dark")
// sharp, soft, round
favouriteEdgeStyle("soft")
////////////////////////////////////
// IGONE THE CODE BELOW THIS LINE //
////////////////////////////////////
function setProp(prop, value) {
document.documentElement.style.setProperty(prop, value)
}
function favouriteEdgeStyle(style) {
setProp("--image", "var(--" + style + ")");
}
function favouriteMovieGenre(font) {
if (font) {
setProp("--font", "var(--" + font + ")");
}
}
function favouriteMode(mode) {
if (mode === "light" || !mode) {
setProp('--background', "var(--light)");
setProp('--text', "var(--dark)");
} else if (mode === "dark") {
setProp('--background', "var(--dark)");
setProp('--text', "var(--light)");
}
}
function favouriteFruit(theme) {
if (theme === "pastel") {
setProp('--light', "#f2f6c3")
setProp('--dark', "#68c4af")
} else if (theme === "muted") {
setProp('--light', "#4c5b64")
setProp('--dark', "#45241c")
} else if (theme === "love") {
setProp('--light', "#f06836")
setProp('--dark', "#ba0001")
} else if (theme === "sky") {
setProp('--light', "#99ccff")
setProp('--dark', "#3366ff")
} else if (theme === "forrest") {
setProp('--light', "#91B247")
setProp('--dark', "#597C2B")
} else if (theme === "shiny") {
setProp('--light', "#2e9afe")
setProp('--dark', "#02197c")
} else if (theme === "banana") {
setProp('--light', "#fbec5d")
setProp('--dark', "#6b3e26")
} else if (theme === "watermelon") {
setProp('--light', "#75b855")
setProp('--dark', "#ad3838")
} else if (theme === "tomato") {
setProp('--light', "#d62e2e")
setProp('--dark', "#600000")
} else if (theme === "avocado") {
setProp('--light', "#6b8c21")
setProp('--dark', "#704012")
} else if (theme === "orange") {
setProp('--light', "#ffca16")
setProp('--dark', "#f97300")
} else if (theme === "blueberry") {
setProp('--light', "#41a8f9")
setProp('--dark', "#064490")
} else {
setProp('--light', "#f5f5f5")
setProp('--dark', "#222222")
}
}