Commit Graph

8 Commits

Author SHA1 Message Date
schroda
a45338647e Fix infinite scroll intersection info calculation
Scrollbars need to be considered since they decrease the available viewport size in which the element can be visible
2025-02-10 22:40:53 +01:00
schroda
174d850093 Preload previous/next chapter in reader 2025-02-10 22:40:49 +01:00
schroda
9d3aeafe0e Use "BasePager" for infinite scroll chapter change detection
There can be cases where when scrolling backward/forward the first/last page never gets visible in the viewport due to a large width/height of another page.
In that case the intersection observer would never trigger and thus, the chapter wouldn't get changed.

By using the Pager, which always takes up the full width/height, this problem will not be possible, since the start/end of the Pager always enters or leaves the viewport.
2025-02-05 22:25:35 +01:00
schroda
19f2d99345 Center "ReaderChapterViewers"
The viewers can have different sizes which caused theme to not be properly centered.

E.g. for the "vertical mode" in case "chapter 1" is greater in width than "chapter 2", the pages of "chapter 2" were not correctly centered due to the "viewers" having different widths.
2025-02-05 00:34:44 +01:00
schroda
636f48107f Prevent "ReaderChapterViewer" from overlapping each other
Seems like not all browsers handle

width/height: 100%
min-width/min-height: fit-content

correctly.
the "min" setting just never applies and the size is stuck at 100%.
2025-02-04 23:11:34 +01:00
schroda
2ec42d962a Remove context usage from ReaderPage
In case many chapters are rendered, even just the HOC wrapper component re-render due to the context change increases the render time.

Thus, getting rid of these HOC wrapper re-renders by moving the context usage up to the ReaderViewer decreases the render time.
2025-02-03 17:17:35 +01:00
schroda
b01b23b069 Remove context usage from ReaderChapterViewer
In case many chapters are rendered, even just the HOC wrapper component re-render due to the context change increases the render time.

Thus, getting rid of these HOC wrapper re-renders by moving the context usage up to the ReaderViewer decreases the render time.
2025-02-03 17:17:35 +01:00
schroda
4a9d2903b8 Add infinite scroll to reader 2025-02-03 17:17:35 +01:00