gedoor / legado_web_bookshelf

阅读web端书架

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wrong narrow media size: @media screen and (max-width: 750px)

mozbugbox opened this issue · comments

The threshold of the small screen layout miniInterface was set to a wrong value. Pads with the width around 800px would have both the tool-bar and the read-bar cutoff the screen.

As can be see in the code

readWidth(width) {
this.chapterTheme.width = width;
let leftToolMargin = -((parseInt(width) + 130) / 2 + 68) + "px";
let rightToolMargin = -((parseInt(width) + 130) / 2 + 52) + "px";
this.leftBarTheme.marginLeft = leftToolMargin;
this.rightBarTheme.marginRight = rightToolMargin;
},

The minimal width for a non-miniInterface screen would be tool-bar + chapter + read-bar + 130.

Since the chapter size is set to 670px, i.e. 68 + 670 + 52 + 130 = 920.

Now the screen is symmetrical, the width has to take the max(tool-bar, read-bar). Therefore the minimum width: 68 * 2 + 670 + 130 = 936px.

The current threshold is set at 750px

@media screen and (max-width: 750px) {
.chapter-wrapper {
padding: 0;

commented

run code below in your browser

window.innerWidth

I used it on an ipad mini, which has a 768x1024 viewport.

https://yesviz.com/tablets.php

There's still quite a few Pad has viewport with <900 width in portrait view.

commented

fix