mirror of
https://github.com/grocy/grocy.git
synced 2025-08-16 10:44:37 +00:00
Quick test implementation of night (references #71)
This commit is contained in:
20
public/js/grocy_nightmode.js
Normal file
20
public/js/grocy_nightmode.js
Normal 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);
|
||||
}
|
Reference in New Issue
Block a user