trigger light/dark mode automatically

Signed-off-by: si458 <simonsmith5521@gmail.com>
This commit is contained in:
si458 2023-11-11 03:33:43 +00:00
parent 27b750813e
commit a7f996678f

View File

@ -2047,6 +2047,8 @@
setNightMode(); setNightMode();
} }
if(window.matchMedia) { window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', setNightMode); }
function setNightMode() { function setNightMode() {
// Set night mode // Set night mode
var nNightMode = getstore('nightMode', '0') var nNightMode = getstore('nightMode', '0')