better double page on reader

This commit is contained in:
2025-12-31 18:33:03 +01:00
parent e3c366836f
commit 991c58d91d
4 changed files with 124 additions and 12 deletions

View File

@@ -469,6 +469,18 @@ function createImageElement(page, index) {
}
};
img.onload = () => {
const ratio = img.naturalWidth / img.naturalHeight;
if (ratio > 1.3) {
const double = img.closest('.double-container');
if (double) {
double.replaceWith(img);
}
}
};
if (config.manga.mode === 'longstrip' && index > 0) {
img.classList.add('longstrip-fit');
} else {

View File

@@ -613,3 +613,13 @@ input[type="color"] {
object-fit: contain !important;
}
}
.double-container.break-double {
display: block;
}
.double-container.break-double img {
width: 100%;
max-width: 100%;
display: block;
}