mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-28 12:07:35 +01:00
Allow setting night mode (and other themes) by default in theme.yml (#1612)
- Also fixes default color not being applied from theme.yml Affects issues: - Close #1274
This commit is contained in:
parent
8565578a88
commit
d0491a0dec
@ -10,15 +10,14 @@
|
||||
'brown', 'grey', 'blue-grey'];
|
||||
|
||||
const selectedColor = window.localStorage.getItem('themeColor');
|
||||
const themeDefaultColor = 'plan';
|
||||
const themeDefaultColor = '${defaultTheme}';
|
||||
let currentColor = 'plan';
|
||||
|
||||
if (selectedColor === null) {
|
||||
window.localStorage.setItem('themeColor', currentColor);
|
||||
}
|
||||
|
||||
// Function for changing color
|
||||
function setColor(nextColor) {
|
||||
if (selectedColor === null) {
|
||||
window.localStorage.setItem('themeColor', currentColor);
|
||||
}
|
||||
$('body').removeClass('theme-' + currentColor).addClass('theme-' + nextColor);
|
||||
if (!nextColor || nextColor == currentColor) {
|
||||
return;
|
||||
@ -71,7 +70,7 @@
|
||||
// Change the color of the theme
|
||||
setColor(selectedColor ? selectedColor : themeDefaultColor);
|
||||
|
||||
let nightMode = window.localStorage.getItem('nightMode') == 'true';
|
||||
let nightMode = window.localStorage.getItem('nightMode') == 'true' || '${defaultTheme}' == 'night';
|
||||
|
||||
const saturationReduction = 0.70;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user