diff --git a/public/js/reader.js b/public/js/reader.js index e890644..88ca8d6 100644 --- a/public/js/reader.js +++ b/public/js/reader.js @@ -25,7 +25,8 @@ const readerComponent = () => { id: i + 1, url: `${base_url}api/page/${tid}/${eid}/${i+1}`, width: d.width, - height: d.height + height: d.height, + style: `margin-top: ${d.margin}px; margin-bottom: ${d.margin}px;` }; }); diff --git a/src/config.cr b/src/config.cr index e85a2b7..845fc94 100644 --- a/src/config.cr +++ b/src/config.cr @@ -20,6 +20,7 @@ class Config property plugin_path : String = File.expand_path "~/mango/plugins", home: true property download_timeout_seconds : Int32 = 30 + property page_margin : Int32 = 30 property disable_login = false property default_username = "" property mangadex = Hash(String, String | Int32).new diff --git a/src/library/entry.cr b/src/library/entry.cr index 3e270cf..137b04d 100644 --- a/src/library/entry.cr +++ b/src/library/entry.cr @@ -117,6 +117,7 @@ class Entry sizes << { "width" => size.width, "height" => size.height, + "margin" => Config.current.page_margin, } rescue e Logger.warn "Failed to read page #{i} of entry #{zip_path}. #{e}" diff --git a/src/views/reader.html.ecr b/src/views/reader.html.ecr index 5475487..91beaf3 100644 --- a/src/views/reader.html.ecr +++ b/src/views/reader.html.ecr @@ -25,6 +25,7 @@