From 2617bdaf52b5fbbdb24cf4bd90753308626d81d4 Mon Sep 17 00:00:00 2001 From: Wes Bradley Date: Sat, 30 Sep 2023 12:36:13 -0500 Subject: [PATCH] add epub reader flow setting --- cps/static/css/main.css | 8 ++++---- cps/static/css/reader.css | 2 +- cps/templates/read.html | 21 +++++++++++++++++++++ 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/cps/static/css/main.css b/cps/static/css/main.css index 03cb0a01..013a7d82 100644 --- a/cps/static/css/main.css +++ b/cps/static/css/main.css @@ -416,7 +416,7 @@ input:-moz-placeholder { color: #454545; } .md-content > div p { margin: 0; - padding: 10px 0; + padding: 0; } #searchResults li > p { @@ -551,11 +551,11 @@ input:-moz-placeholder { color: #454545; } position: relative; border-radius: 3px; margin: 0 auto; - height: 320px; + height: 265px; } .md-content > div { - padding: 15px 40px 30px; + padding: 15px 40px 10px; margin: 0; font-weight: 300; font-size: 14px; @@ -572,7 +572,7 @@ input:-moz-placeholder { color: #454545; } border: none; text-align: center; text-decoration: none; - margin-top: 5%; + margin-top: 2%; margin-right: 1%; font-size: 16px; } diff --git a/cps/static/css/reader.css b/cps/static/css/reader.css index ec8054ca..18639165 100644 --- a/cps/static/css/reader.css +++ b/cps/static/css/reader.css @@ -4,7 +4,7 @@ .slider { position: absolute; top: 50%; - transform: translate(0,-50%); + transform: translate(0,-20%); width: 90%; height: 60px; background: transparent; diff --git a/cps/templates/read.html b/cps/templates/read.html index b75c31fe..464bbf08 100644 --- a/cps/templates/read.html +++ b/cps/templates/read.html @@ -83,6 +83,16 @@ +
+

+ + + +

+

{{_('Reflow text when sidebars are open.')}} @@ -146,6 +156,17 @@ fontSizeFader.addEventListener ("change", function () { reader.rendition.themes.fontSize(`${this.value}%`) }); + + // reader flow settings logic + let readerFlow = document.getElementById('readerFlow'); + readerFlow.addEventListener ("change", function () { + reader.rendition.flow(this.value); + if (this.value === "paginated") { + document.getElementById("divider").classList.add("show"); + } else { + document.getElementById("divider").classList.remove("show"); + } + });