Added basic theming to the epub reader

This commit is contained in:
Bharat KNV
2021-12-15 21:35:10 +05:30
parent f78d2245aa
commit 0693cb1ddb
4 changed files with 77 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
.lightTheme {
background: #fff;
color: #000;
}
.darkTheme {
background: #000;
color: #fff
}
.sepiaTheme {
background: #ece1ca;
color: #000;
}
+25
View File
@@ -567,6 +567,31 @@ input:-moz-placeholder { color: #454545; }
font-size: 0.8em;
}
.md-content .themes button {
display: inline-block;
border: none;
text-align: center;
text-decoration: none;
margin-top: 5%;
margin-right: 1%;
font-size: 16px;
}
.md-content .themes button.darkTheme {
background-color: black;
color: white;
}
.md-content .themes button.whiteTheme {
background-color: white;
color: black;
}
.md-content .themes button.sepiaTheme {
background-color: #ece1ca;
color: black;
}
/* Effect 1: Fade in and scale up */
.md-effect-1 .md-content {
-webkit-transform: scale(0.7);
+4
View File
@@ -13,6 +13,10 @@ var reader;
bookmarks: calibre.bookmark ? [calibre.bookmark] : []
});
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");
if (calibre.useBookmarks) {
reader.on("reader:bookmarked", updateBookmark.bind(reader, "add"));
reader.on("reader:unbookmarked", updateBookmark.bind(reader, "remove"));