satorumurmur / bibi

Bibi | EPUB Reader on your website.
https://bibi.epub.link
MIT License
859 stars 123 forks source link

Lazy Load/Preload #44

Open chocolatkey opened 7 years ago

chocolatkey commented 7 years ago

Is there a way to start reading the book before all the images and content has loaded? If a book has a lot of images, it can sometimes take a while to load, and I was thinking that maybe instead of seeing "Loading x/x items loaded" the pages could already start to display.

chocolatkey commented 6 years ago

It seems like you have done so at sai-zen-sen.jp, I guess I'll work it out from there for now

schroef commented 6 years ago

Did you solve this? I tried looking at that Japanese site but cant not see a lazy loader script there?

schroef commented 6 years ago

Did have a quick look. dont you think this part is saying it must wait in the original.

screen shot 2018-10-18 at 13 14 09

This is the part on the Japanese site. See that the bottom of the loading is different. Ill check if im correct here.

L.loadNavigation().then(function() {
        E.dispatch("bibi:prepared"),
        S.autostart || L.Played ? L.loadItemsInSpreads() : L.wait().then(function() {
            L.loadItemsInSpreads()
        })
    })
screen shot 2018-10-18 at 13 14 23
chocolatkey commented 6 years ago

Yes, I did manage to solve it, however I was not able to maintain development with bibi. Make no mistake, bibi is a great project, but it's very hard for me to work with the way bibi's code is structured. I started splitting the code, as you can see here: https://github.com/chocolatkey/comicake/tree/master/frontend/material/assets/js/reader but it's a nice little mess (support for comics only). For now I am developing my own alternative since it's just for fixed layout comics, but it would be great if Bibi weren't just one massive file. It took me weeks to figure out all the workings and re-purpose it for my needs, so sorry, but I can't give you the answer because I have forgotten since it was 5mo ago.

schroef commented 6 years ago

Okay, wow you have really a weird name of naming files... hahah just one letter??? how can you understand that? Do you have a link or example of it working?

chocolatkey commented 6 years ago

That's the whole point, I couldn't understand Bibi either. If you check the main code file: https://github.com/satorumurmur/bibi/blob/master/dev-bib/i/res/scripts/bibi.heart.js you'll see it has those one-letter acronyms too. For better or worse you get used to the: B: Bibi E: Events I: Interface L: Loader M: Messages O: Operations P: Preset R: Reader S: Settings U: User X: "X"tensions

But that's part of what made me sick of it. Working example: https://whimsubs.xyz/r/read/0498a652-8f5a-4107-9c2b-b8c04676c55e/ . Once again let me emphasize that my version I have commented out full EPUB support and am using webpub files (https://github.com/readium/webpub-manifest) in my backend, and it's only for comics. I'm sure that could be undone, but yeah, when I eventually add full EPUB (reflowable) support I'll be writing something else from scratch based on Bibi.

Edit: sorry about that accidental issue close and open

schroef commented 6 years ago

Ah okay, looks like something of that sai-zen-sen.jp indeed, nice job.

I tried a different epub read as well but it didnt look nice, its more for books i think. https://github.com/futurepress/epubjs-reader/

I wanted to do this quick and already have invested to much time in this. I went on and used the adobe version of indesign. I believe it does do preloading and also has thumbs, no TOC though.

Thanks for taking the time!

gotchane commented 5 years ago

@satorumurmur

Is there any progress or idea on this issue? I wanna use bibi with lazy loading.

chocolatkey commented 5 years ago

Just to update, I ended up creating my own reader since unfortunately it does not look like development is very active on bibi. I have definitely learned a lot about these kinds of readers from bibi's code