Quick test implementation of night (references #71)

This commit is contained in:
Bernd Bestel
2018-09-29 15:39:16 +02:00
parent 5a0b862d22
commit cda3dde120
3 changed files with 217 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
$("#night-mode-enabled").on("change", function()
{
var value = $(this).is(":checked");
window.localStorage.setItem("night_mode", value);
if (value)
{
$("body").addClass("night-mode");
}
else
{
$("body").removeClass("night-mode");
}
});
if (window.localStorage.getItem("night_mode") === "true")
{
$("body").addClass("night-mode");
$("#night-mode-enabled").prop("checked", true);
}