The logic didn't handle cases were the next/previous chapter wasn't loaded yet, which lead to the load happening in the background without any user feedback.
The pages only change in size with specific "page scale modes".
Thus, if these modes are not active, the scroll position will not be lost.
There are different cases were even with these modes active, the scroll position won't get lost (e.g. "fit width" while no page is larger than the available width), but handling these would be too cumbersome.
Ideally the relative scroll position would be preserved, however, from testing a little that seems to not work too well
The `.toLocalLowerCase` is english-specific, this should be handled via
a dedicated translation like everywhere else, `global.value` is being
abused here
Currently, a lot of manga have the same whit/black-ish background color, which results of the thumbnails containing a lot of white/black colors.
These changes improve this a little
- reduce impact of white and black colors
- use "precision" mode of algorithm
* Reader: Reset bounds on window size change
19f2d993 introduced a `minWidth` to make sure sizes are consistent over
chapter changes (or when images load later), but when the window itself
changes, this makes the reader incorrectly sized
* Reader: Update size on navbar width change
This happens mostly when the bar is pinned; same effect as previous
commit
* Reader: Attempt to set the page on resize
It's not perfect, but not changing position at all seems impossible due
to how resizes are handled by the browser (since we adjust our content
to the window size)
* Simplify and abstract reader size reset
Co-authored-by: schroda <50052685+schroda@users.noreply.github.com>
* fix: Reader page full width was not properly calculated for static navbar
Only relevant for Fit Content, this did not properly consider the navbar
when the user clamps the content to a custom width
* Refactor: Put reader min sizes to reader itself instead of chapter
This allows some logic simplification.
The `ResizeObserver` can needs to be on an element without restrictions;
previously, the observer would not see the chapter elements get smaller,
since the `min-width` prevented it from shrinking. By applying to the
outer element, we still preserve the centering (since `margin: auto` is
also applied here), but allow the chapter itself to be smaller.
* Reader: Only scroll in continuous reading modes
* Reader: clean up size tracking
Co-authored-by: schroda <50052685+schroda@users.noreply.github.com>
* Fixup previous commit stupidness
* Reader: move `minWidth`/`minHeight` back to chapter wrapper
* Apply suggestions from code review
Co-authored-by: schroda <50052685+schroda@users.noreply.github.com>
* Also revert `fullWidth` calculation
* Simplify `chapterViewerSize`
Co-authored-by: schroda <50052685+schroda@users.noreply.github.com>
* Move size logic entirely to hook
---------
Co-authored-by: schroda <50052685+schroda@users.noreply.github.com>
* Basic modal for switching extension settings
* Improve network usage by including field in query directly
Requesting individually is stupid, when it's a field that is already
available on the server
* Improve extension slider usability
- Always render the element, fixes animations
- Store the selected item in state, allows the back-button to re-open
dialog
* Update src/modules/extension/components/ExtensionOptions.tsx
Co-authored-by: schroda <50052685+schroda@users.noreply.github.com>
* Update src/modules/extension/components/ExtensionOptions.tsx
Co-authored-by: schroda <50052685+schroda@users.noreply.github.com>
* Fix suggestions
* Use dialog instead of optionsPanel
* Extension options remove redundant NSFW info
* Apply suggestions from code review
Co-authored-by: schroda <50052685+schroda@users.noreply.github.com>
* Use proper dialog title and content for settings dialog
* Use `string | undefined` instead of `string | null` to satisfy `tsc`
---------
Co-authored-by: schroda <50052685+schroda@users.noreply.github.com>
* Fixes two places where navbar was not considered
When set to static, the navbar consumes space, so `vw` units are not
enough.
On small screens, the `left`+`transform` approach does not work nicely,
so just use standard flex alignment, the container is already a flexbox.
* Change card also consider wide viewports
* Update src/modules/reader/components/viewer/ReaderTransitionPage.tsx
Co-authored-by: schroda <50052685+schroda@users.noreply.github.com>
* Reader: Apply new alignment code also to horizontal scroll mode
---------
Co-authored-by: schroda <50052685+schroda@users.noreply.github.com>
There were different issues with the direction the pages got preloaded.
- when resuming a chapter with an initial page > 1, it incorrectly preloaded leading pages instead of trailing ones.
- when going to the previous/next rendered chapter no pages got preloaded at all