forked from akai/readest
This commit is contained in:
@@ -1,13 +1,18 @@
|
||||
import { ViewSettings } from '@/types/book';
|
||||
|
||||
export const getMaxInlineSize = (viewSettings: ViewSettings) => {
|
||||
const isVertical = viewSettings.vertical!;
|
||||
const isVertical = viewSettings.vertical;
|
||||
const screenWidth = window.innerWidth;
|
||||
const screenHeight = window.innerHeight;
|
||||
|
||||
return isVertical && false
|
||||
const screenAspectRatio = isVertical ? screenHeight / screenWidth : screenWidth / screenHeight;
|
||||
const isUnfoldedScreen = screenAspectRatio < 1.3 && screenAspectRatio > 0.77 && screenWidth > 600;
|
||||
|
||||
return isVertical
|
||||
? Math.max(screenWidth, screenHeight, 720)
|
||||
: viewSettings.maxInlineSize!;
|
||||
: isUnfoldedScreen
|
||||
? viewSettings.maxInlineSize * 0.8
|
||||
: viewSettings.maxInlineSize;
|
||||
};
|
||||
|
||||
export const getDefaultMaxInlineSize = () => {
|
||||
|
||||
+1
-1
Submodule packages/foliate-js updated: a6b6252d7c...0fc05afef4
Reference in New Issue
Block a user