Commit 0bb3be0e authored by diesys's avatar diesys 🎈

fix auto theme daytime

parent 886d3c8a
......@@ -4,3 +4,6 @@
//TODO:
git sui json ad ogni submit di dati così da avere una timeline (commit con ora data e tipo di azione)
//TODO:
ampliare ad ogni tipo di torneo (anche punteggi)
\ No newline at end of file
......@@ -29,6 +29,25 @@ function getUrlVars() {
}
window.onload = function () {
/////////// Auto NIGHT MODE ///////////////////
var urlVars = getUrlVars();
var d = new Date();
var hour = d.getHours();
if (urlVars["night"]) {
if (urlVars["night"] == "true") {
nightMode();
} else if (urlVars["night"] == "false") {
dayMode();
}
} else {
if (hour < 7 | hour > 18) {
toggleTheme();
console.log('auto-enabling dark mode...')
}
}
/////////// BINDING ///////////////////////////
// theme / logo
......@@ -165,23 +184,4 @@ window.onload = function () {
$('#buttonDoppio').addClass('active');
}
});
/////////// Auto NIGHT MODE ///////////////////
var urlVars = getUrlVars();
var d = new Date();
var hour = d.getHours();
if (urlVars["night"]) {
if (urlVars["night"] == "true") {
nightMode();
} else if (urlVars["night"] == "false") {
dayMode();
}
} else {
if ((hour > 0 || hour < 7) && (hour > 0 || hour < 7)) {
toggleTheme();
console.log('auto-enabling dark mode...')
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment