From 9efd644360ef8eefc02363ba1109151773f6301c Mon Sep 17 00:00:00 2001 From: Bharat KNV Date: Sun, 6 Mar 2022 15:56:54 +0530 Subject: [PATCH] Change dark theme from black to dark gray and add a black theme --- cps/static/css/epub_themes.css | 7 ++++++- cps/static/css/main.css | 7 ++++++- cps/static/js/reading/epub.js | 1 + cps/templates/read.html | 6 +++++- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/cps/static/css/epub_themes.css b/cps/static/css/epub_themes.css index 4f686681..16c27805 100644 --- a/cps/static/css/epub_themes.css +++ b/cps/static/css/epub_themes.css @@ -4,11 +4,16 @@ } .darkTheme { - background: #000; + background: #202124; color: #fff } .sepiaTheme { background: #ece1ca; color: #000; +} + +.blackTheme { + background: #000; + color: #fff } \ No newline at end of file diff --git a/cps/static/css/main.css b/cps/static/css/main.css index 84f03229..03cb0a01 100644 --- a/cps/static/css/main.css +++ b/cps/static/css/main.css @@ -578,7 +578,7 @@ input:-moz-placeholder { color: #454545; } } .md-content .themes button.darkTheme { - background-color: black; + background-color: #202124; color: white; } @@ -592,6 +592,11 @@ input:-moz-placeholder { color: #454545; } color: black; } +.md-content .themes button.blackTheme { + background-color: black; + color: white; +} + /* Effect 1: Fade in and scale up */ .md-effect-1 .md-content { -webkit-transform: scale(0.7); diff --git a/cps/static/js/reading/epub.js b/cps/static/js/reading/epub.js index 5e674812..79f74b74 100644 --- a/cps/static/js/reading/epub.js +++ b/cps/static/js/reading/epub.js @@ -16,6 +16,7 @@ var reader; reader.rendition.themes.register("lightTheme", "/static/css/epub_themes.css"); reader.rendition.themes.register("darkTheme", "/static/css/epub_themes.css"); reader.rendition.themes.register("sepiaTheme", "/static/css/epub_themes.css"); + reader.rendition.themes.register("blackTheme", "/static/css/epub_themes.css"); if (calibre.useBookmarks) { reader.on("reader:bookmarked", updateBookmark.bind(reader, "add")); diff --git a/cps/templates/read.html b/cps/templates/read.html index ed33e850..7f473d1f 100644 --- a/cps/templates/read.html +++ b/cps/templates/read.html @@ -76,6 +76,7 @@ +

@@ -115,7 +116,7 @@ // Apply theme to rest of the page. TODO - Do this smarter if (id == "darkTheme") { - document.getElementById("main").style.backgroundColor = "black"; + document.getElementById("main").style.backgroundColor = "#202124"; } else if (id == "lightTheme") { document.getElementById("main").style.backgroundColor = "white"; @@ -123,6 +124,9 @@ else if (id == "sepiaTheme") { document.getElementById("main").style.backgroundColor = "#ece1ca"; } + else if (id == "blackTheme") { + document.getElementById("main").style.backgroundColor = "black"; + } }