anka-213 / webcomic_reader

Webcomic Reader userscript at
https://openuserjs.org/scripts/anka-213/Webcomic_Reader
MIT License
120 stars 27 forks source link

Suggestion: 2 page support #155

Open LitDub opened 3 years ago

LitDub commented 3 years ago

It would be great if webcomic reader supported viewing 2 pages side by side.

anka-213 commented 3 years ago

Oh, that's a good idea. I have not been using nor working on this project for a long time, but if I or anyone else gets a chance to look at it, this could be a great addition to the script.

SoraHjort commented 2 years ago

Trying to think how to go about it.

The thing to keep in mind the way wcr works, at the very basic level, is by changing the source url of a image when navigating forward or backward.

So, to implement 2 side by side, it would require two separate wcr images side by side (Image A and B). The second one disabled by default.

When enabled Image A loads every odd image, image B loads every even image.

Idealy in the settings there would be a way to specify even or odds. Though, when enabled, I'd probably also have it add a button under the image (With the other buttons) to swap between the two options, so you wouldn't have to go into the settings every time a webcomic goes to a new issue. (some comics do issue titles)

This way, any images that would have been next together in print, would be easy enough to set to be next to each other. Otherwise there isn't a way to properly detect a new "issue" to realign.

You would also have to have the URL jump ahead two pages, while also checking to make sure there is one, and also stuff to do incase a second image isn't detected.

Though alternative idea would be similar in setup, wouldn't require any additional settings than enable/disable, and that would be to have the second image load the next image in the cache. And when navigating forward, the main image becomes the second image, while the second image loads the next. Thus keeping the main image the "url anchor" point, if that make sense.

If you really wanted to get fancy, with some css/javascript you could create a horizontal scrolling effect by having a third image "scroller".

So that Image A and B get pushed in a direction, with Scroller having the new image. Going to the right it would be: Scroller loads cached image +2 Scroller moves to the right, off screen. Image A and B move Left, with C coming in from the Right. Image A goes off screen, with B moving into Image A's original location Image A gets moved behind Image B, gets changed to Image B's image Image B gets moved behind Scroller, gets changed into Scroller's Image

Going left would be much of the same, with direction reversed, but with a -2 on step 1.

This effect could be implemented in general as part of a fancy animation mode. Already thinking on a image fade in/out to help alleviate one of the visually jarring problems that got reported. However, I wonder if such fanciness would be much more than the scope of wcr. There is something nice to having it somewhat minimal.

Plus the first idea would probably be easier to implement.

I'm not gonna pick up on this suggestion, or atleast not any time soon, got other stuff to update on. But if anyone does take it up, I recommend attempting the first idea.