diff options
author | Andrew Dolgov <[email protected]> | 2017-02-25 17:04:26 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2017-02-25 17:04:26 +0300 |
commit | f858879a3d13bcec694a5e2493fbfe3a1a233e13 (patch) | |
tree | 997a6efb9fe2678b5e315a8d733361e569828929 /js/read.js | |
parent | 902664e1842357e11217ef9f4f09a55ce95fb478 (diff) |
add night mode
Diffstat (limited to 'js/read.js')
-rw-r--r-- | js/read.js | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -118,3 +118,25 @@ function save_and_close() { window.location = "index.php"; }); } + +function invert() { + localStorage["night_mode"] = localStorage["night_mode"] == "0" ? 1 : 0; + + apply_night_mode(); +} + +function apply_night_mode() { + if (localStorage["night_mode"] == "1") { + window.book.setStyle("background", "black"); + window.book.setStyle("color", "#ccc"); + + $("body").css("background", "black"); + + } else { + window.book.setStyle("background", "white"); + window.book.setStyle("color", "black"); + + $("body").css("background", "white"); + + } +} |