Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance the paged mode reader #219

Merged
merged 6 commits into from
Aug 20, 2021

Conversation

Leeingnyo
Copy link
Member

1. Preload next images

This resolve #196

image
Preload lookahead: 3 pages
Started from p32, it preloaded next 3 pages (pp.33-35)
After reading p33 and p34, it preloaded p36, p37 each.

2. Prevent to load unnecessary images

Fix #217

3. Fix CSS to fit image 'contain' properly

Fix #218

4. Option for enabling/disabling a flip animation

This resolve one of suggestion from #147


A below picture shows a modal menu when the mode is paged mode.
It has the checkbox for toggling flip animation and the range input to set preload pages

image

I'm curious that its layout looks good (especially about a position of the checkbox... 馃槣)

@@ -52,6 +54,16 @@ const readerComponent = () => {
if (savedMargin) {
this.margin = savedMargin;
}

// Preload Images
this.preloadLookahead = +localStorage.getItem('preloadLookahead') ?? 3;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the key doesn't exist in local storage, getItem returns null, but the + sign turns it into 0 (because +null evaluates to 0). I think we can remove the plus sign here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see! Since getItem() returns a string and I want to keep this.preloadLookahead as a number, I'll parenthesize them.

Copy link
Member

@hkalexling hkalexling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Splendid job! Thanks!

@hkalexling hkalexling merged commit 400c302 into getmango:dev Aug 20, 2021
@Leeingnyo Leeingnyo deleted the feature/enhance-paged-mode branch August 20, 2021 03:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants