diff --git a/README.md b/README.md index 34944ca..9648669 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,7 @@ log_level: info upload_path: ~/mango/uploads plugin_path: ~/mango/plugins download_timeout_seconds: 30 +page_margin: 30 mangadex: base_url: https://mangadex.org api_url: https://mangadex.org/api diff --git a/public/js/reader.js b/public/js/reader.js index e890644..321f131 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: ${data.margin}px; margin-bottom: ${data.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/routes/api.cr b/src/routes/api.cr index f48451e..c2a45c0 100644 --- a/src/routes/api.cr +++ b/src/routes/api.cr @@ -664,6 +664,7 @@ struct APIRouter send_json env, { "success" => true, "dimensions" => sizes, + "margin" => Config.current.page_margin, }.to_json rescue e send_json env, { 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 @@