summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2017-03-03 17:30:36 +0300
committerAndrew Dolgov <[email protected]>2017-03-03 17:30:36 +0300
commit53d62a4ec7c53d8e1a947dd4600d977e94cfee8d (patch)
tree25f333ebf02d789ef14a2b8bdd95ad1a1dba6650
parent18fed64bcdee212a10fc3200807c12a19a40b936 (diff)
night mode should apply to loading splash
-rw-r--r--css/read.css9
-rw-r--r--js/read.js4
-rw-r--r--read.html2
3 files changed, 12 insertions, 3 deletions
diff --git a/css/read.css b/css/read.css
index 66806ef..fd9f076 100644
--- a/css/read.css
+++ b/css/read.css
@@ -1,3 +1,11 @@
+body.night {
+ background : black;
+ color : #999;
+}
+
+body.night .loading {
+ background : black;
+}
.loading {
position : absolute;
color : #999;
@@ -92,3 +100,4 @@
height : auto;
overflow : auto;
}
+
diff --git a/js/read.js b/js/read.js
index e87b0f8..0e1da94 100644
--- a/js/read.js
+++ b/js/read.js
@@ -164,14 +164,14 @@ function apply_night_mode() {
window.book.setStyle("background", "black");
window.book.setStyle("color", "#ccc");
- $("body").css("background", "black");
+ $("body").addClass("night");
} else {
window.book.setStyle("background", "white");
window.book.setStyle("color", "black");
- $("body").css("background", "white");
+ $("body").removeClass("night");
}
});
}
diff --git a/read.html b/read.html
index 3f76139..c1c45e4 100644
--- a/read.html
+++ b/read.html
@@ -228,6 +228,7 @@
}
$(document).ready(function() {
+ apply_night_mode();
$(window).on('online', function() {
console.log("we're online, storing lastread");
@@ -376,7 +377,6 @@
//styles: { fontSize: '24px', lineHeight: '130%', fontFamily: 'Georgia' }
window.book = book;
- apply_night_mode();
var rendered = book.renderTo("reader");