-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfalcon-themes.lib
More file actions
341 lines (317 loc) · 10.2 KB
/
falcon-themes.lib
File metadata and controls
341 lines (317 loc) · 10.2 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
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
<!-- FALCON THEMES LIBRARY v2.2 -->
<!--
Usage:
- Themes are set automatically on DOMContentLoaded
- setTheme(): Loads the theme from USER_SETTINGS
-->
<!-- CSS THEMES -->
<style>
:root, :root.Falcon-Light {
color-scheme: light;
--primary-color: #4db6ac; /* Teal 300 */
--accent-color: #80cbc4; /* Teal 200 */
--page-background-color: #eeeeee; /* Gray 200 */
--page-accent-color: white;
--menu-icon-color: black;
--element-background-color: white;
--element-accent-color: #e0e0e0; /* Gray 300 */
--text-primary-color: black;
--text-accent-color: #757575; /* Gray 600 */
--warning-color: #ff9800; /* Orange 500 */
--error-color: #f44336; /* Red 500 */
--green: #c8e6c9; /* Green 100 */
--orange: #ffe0b2; /* Orange 100 */
--red: #ffcdd2; /* Red 100 */
--blue: #bbdefb; /* Blue 100 */
--pink: #f8bbd0; /* Pink 100 */
--gray: #e0e0e0; /* Gray 300 */
}
:root.Falcon-Dark {
color-scheme: dark;
--primary-color: #00796b; /* Teal 700 */
--accent-color: #00897b; /* Teal 600 */
--page-background-color: #2e2e2e; /* Same color as dark mode select */
--page-accent-color: #212121; /* Gray 900 */
--menu-icon-color: white;
--element-background-color: #121212; /* Gray Custom */
--element-accent-color: #424242; /* Gray 800 */
--text-primary-color: white;
--text-accent-color: #bdbdbd; /* Gray 400 */
--warning-color: #ff9800; /* Orange 500 */
--error-color: #f44336; /* Red 500 */
--green: #1b5e20; /* Green 900 */
--orange: #e65100; /* Orange 900 */
--red: #b71c1c; /* Red 900 */
--blue: #0d47a1; /* Blue 900 */
--pink: #880e4f; /* Pink 900 */
--gray: #616161; /* Gray 700 */
}
:root.Flamingo-Nights {
color-scheme: dark;
--primary-color: #ff4081; /* Pink A200 */
--accent-color: #ff80ab; /* Pink A100 */
--page-background-color: #2e2e2e; /* Same color as dark mode select */
--page-accent-color: #212121; /* Gray 900 */
--menu-icon-color: white;
--element-background-color: #121212; /* Gray Custom */
--element-accent-color: #424242; /* Gray 800 */
--text-primary-color: white;
--text-accent-color: #bdbdbd; /* Gray 400 */
--warning-color: #ff9800; /* Orange 500 */
--error-color: #f44336; /* Red 500 */
--green: #1b5e20; /* Green 900 */
--orange: #e65100; /* Orange 900 */
--red: #b71c1c; /* Red 900 */
--blue: #0d47a1; /* Blue 900 */
--pink: #880e4f; /* Pink 900 */
--gray: #616161; /* Gray 700 */
}
:root.Purple-Lightning {
color-scheme: dark;
--primary-color: #6200ea; /* Deep Purple A700 */
--accent-color: #7c4dff; /* Deep Purple A200 */
--page-background-color: #2e2e2e; /* Same color as dark mode select */
--page-accent-color: #212121; /* Gray 900 */
--menu-icon-color: white;
--element-background-color: #121212; /* Gray Custom */
--element-accent-color: #424242; /* Gray 800 */
--text-primary-color: white;
--text-accent-color: #bdbdbd; /* Gray 400 */
--warning-color: #ff9800; /* Orange 500 */
--error-color: #f44336; /* Red 500 */
--green: #1b5e20; /* Green 900 */
--orange: #e65100; /* Orange 900 */
--red: #b71c1c; /* Red 900 */
--blue: #0d47a1; /* Blue 900 */
--pink: #880e4f; /* Pink 900 */
--gray: #616161; /* Gray 700 */
}
:root.Monochrome {
color-scheme: light;
--primary-color: #90a4ae; /* Blue Grey 300 */
--accent-color: #b0bec5; /* Blue Grey 200 */
--page-background-color: #cfd8dc; /* Blue Grey 100 */
--page-accent-color: #eceff1; /* Blue Grey 50 */
--menu-icon-color: black;
--element-background-color: white;
--element-accent-color: #e0e0e0; /* Gray 300 */
--text-primary-color: black;
--text-accent-color: #757575; /* Gray 600 */
--warning-color: #ff9800; /* Orange 500 */
--error-color: #f44336; /* Red 500 */
--green: #c8e6c9; /* Green 100 */
--orange: #ffe0b2; /* Orange 100 */
--red: #ffcdd2; /* Red 100 */
--blue: #bbdefb; /* Blue 100 */
--pink: #f8bbd0; /* Pink 100 */
--gray: #e0e0e0; /* Gray 300 */
}
:root.Yuzu {
color-scheme: light;
--primary-color: #FFD54F; /* Amber 300 */
--accent-color: #FFE082; /* Amber 200 */
--page-background-color: #FFECB3; /* Amber 100 */
--page-accent-color: #FFF8E1; /* Amber 50 */
--menu-icon-color: black;
--element-background-color: white;
--element-accent-color: #e0e0e0; /* Gray 300 */
--text-primary-color: black;
--text-accent-color: #757575; /* Gray 600 */
--warning-color: #ff9800; /* Orange 500 */
--error-color: #f44336; /* Red 500 */
--green: #c8e6c9; /* Green 100 */
--orange: #ffe0b2; /* Orange 100 */
--red: #ffcdd2; /* Red 100 */
--blue: #bbdefb; /* Blue 100 */
--pink: #f8bbd0; /* Pink 100 */
--gray: #e0e0e0; /* Gray 300 */
}
/* Highlighted text classes */
.highlight-green {
background-color: var(--green);
margin: 10px 10px 0 10px;
padding: 5px;
border-radius: 10px;
border: 2px solid var(--element-accent-color);
}
.highlight-orange {
background-color: var(--orange);
margin: 10px 10px 0 10px;
padding: 5px;
border-radius: 10px;
border: 2px solid var(--element-accent-color);
}
.highlight-red {
background-color: var(--red);
margin: 10px 10px 0 10px;
padding: 5px;
border-radius: 10px;
border: 2px solid var(--element-accent-color);
}
.highlight-gray {
background-color: var(--gray);
margin: 10px 10px 0 10px;
padding: 5px;
border-radius: 10px;
border: 2px solid var(--element-accent-color);
}
.highlight-none {
background-color: var(--element-background-color);
margin: 10px 10px 0 10px;
padding: 5px;
border-radius: 10px;
border: 2px solid var(--element-accent-color);
}
</style>
<!-- JAVASCRIPT FUNCTIONS -->
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function() {
setTheme();
});
function setTheme() {
const root = document.querySelector(':root');
// Define a dictionary mapping theme names to class names
const themeClasses = {
'falconLight': 'Falcon-Light',
'falconDark': 'Falcon-Dark',
'flamingoNights': 'Flamingo-Nights',
'monochrome': 'Monochrome',
'purpleLightning': 'Purple-Lightning',
'yuzu': 'Yuzu'
};
// Remove all theme classes from root element
Object.values(themeClasses).forEach(className => {
root.classList.remove(className);
});
// Check for custom theme
if (USER_SETTINGS.theme === 'custom') {
if (USER_SETTINGS.customThemeType === 'light') {
root.classList.add(themeClasses['falconLight']);
} else {
root.classList.add(themeClasses['falconDark']);
}
// Apply custom theme colors
root.style.setProperty('--primary-color', USER_SETTINGS.customThemePrimaryColor);
root.style.setProperty('--accent-color', USER_SETTINGS.customThemeAccentColor);
} else {
// Remove custom theme colors if any
root.style.removeProperty('--primary-color');
root.style.removeProperty('--accent-color');
// Add the selected theme to the root element
root.classList.add(themeClasses[USER_SETTINGS.theme]);
}
}
// Return colors for Google Charts, color values should not have leading '#'
function getChartTheme() {
const theme = USER_SETTINGS.theme;
const barsLight = [
'c8e6c9', // Green 100
'ffe0b2', // Orange 100
'ffcdd2', // Red 100
'bbdefb', // Blue 100
'f8bbd0', // Pink 100
'e0e0e0', // Grey 300
'e1bee7', // Purple 100
'd1c4e9', // Deep Purple 100
'c5cae9', // Indigo 100
'b3e5fc', // Light Blue 100
'b2ebf2', // Cyan 100
'b2dfdb', // Teal 100
'dcedc8', // Light Green 100
'f0f4c3', // Lime 100
'fff9c4', // Yellow 100
'ffecb3', // Amber 100
'ffccbc', // Deep Orange 100
'd7ccc8', // Brown 100
'cfd8dc' // Blue Grey 100
];
const barsDark = [
'1b5e20', // Green 900
'e65100', // Orange 900
'b71c1c', // Red 900
'0d47a1', // Blue 900
'880e4f', // Pink 900
'616161', // Grey 700
'4a148c', // Purple 900
'311b92', // Deep Purple 900
'1a237e', // Indigo 900
'01579b', // Light Blue 900
'006064', // Cyan 900
'004d40', // Teal 900
'33691e', // Light Green 900
'827717', // Lime 900
'f57f17', // Yellow 900
'ff6f00', // Amber 900
'bf360c', // Deep Orange 900
'3e2723', // Brown 900
'263238' // Blue Grey 900
];
switch (theme) {
case 'falconLight':
return {
backgroundColor: 'ffffff',
text: '000000',
bars: barsLight,
gridLines: 'e0e0e0'
};
case 'falconDark':
return {
background: '121212',
text: 'ffffff',
bars: barsDark,
gridLines: '424242'
};
case 'flamingoNights':
return {
background: '121212',
text: 'ffffff',
bars: barsDark,
gridLines: '424242'
};
case 'monochrome':
return {
background: 'ffffff',
text: '000000',
bars: barsLight,
gridLines: 'e0e0e0'
};
case 'purpleLightning':
return {
background: '121212',
text: 'ffffff',
bars: barsDark,
gridLines: '424242'
};
case 'yuzu':
return {
background: 'ffffff',
text: '000000',
bars: barsLight,
gridLines: 'e0e0e0'
};
case 'custom':
let backgroundColor;
let textColor;
let barColor;
let gridlinesColor;
if (USER_SETTINGS.customThemeType === 'light') {
backgroundColor = 'ffffff';
textColor = '000000';
barColor = barsLight;
gridLines = 'e0e0e0';
}
if (USER_SETTINGS.customThemeType === 'dark') {
backgroundColor = '121212';
textColor = 'ffffff';
barColor = barsDark;
gridLines = '424242';
}
return {
background: backgroundColor,
text: textColor,
bars: barColor,
gridLines: gridLinesColor
};
}
}
</script>