Convert reader image placeholder styling to vw/vh

This commit is contained in:
schroda
2025-01-20 01:29:04 +01:00
parent 7fad96dab7
commit db7aad58ec
7 changed files with 65 additions and 27 deletions

View File

@@ -34,6 +34,17 @@ export const shouldApplyReaderWidth = (
pageScaleMode: IReaderSettings['pageScaleMode'],
): boolean => !!readerWidth?.enabled && isReaderWidthEditable(pageScaleMode);
export const getSetReaderWidth = (
readerWidth: IReaderSettings['readerWidth'] | undefined,
pageScaleMode: IReaderSettings['pageScaleMode'],
): number | undefined => {
if (!shouldApplyReaderWidth(readerWidth, pageScaleMode)) {
return undefined;
}
return readerWidth?.value;
};
export const isContinuousReadingMode = (readingMode: IReaderSettings['readingMode']): boolean =>
[ReadingMode.CONTINUOUS_VERTICAL, ReadingMode.CONTINUOUS_HORIZONTAL, ReadingMode.WEBTOON].includes(readingMode);