ts1 / flipbook-vue

3D page flip effect for Vue.js
https://ts1.github.io/flipbook-vue/
595 stars 155 forks source link

Next pages show current page instead of loader when flipping #86

Open mediavrog opened 1 year ago

mediavrog commented 1 year ago

Version: 1.0.0-beta.4 used with VueJS3 inside nuxt

Steps to reproduce:

<template>
  <div>
    <client-only>
      <flipbook
          class="flipbook"
          :pages="images"
          :pagesHiRes="imagesHq"
          gloss="0.5"
      ></flipbook>
    </client-only>
  </div>
</template>

What I expected:

Will attach a video

mediavrog commented 1 year ago

https://user-images.githubusercontent.com/160785/213959510-e4ac2f94-8bf7-4d50-be1c-382c016c8fb8.mp4

kabaluyot commented 1 year ago

@mediavrog that use case looks great. How did to worked with opensea? The image src points to html page with flipbook?

mediavrog commented 1 year ago

@mediavrog that use case looks great. How did to worked with opensea? The image src points to html page with flipbook?

animation_url is used. Html and assets need proper CORS then all works well

ts1 commented 1 year ago

I tried it on my demo page and was able to reproduce it on Chrome's slow network emulation, but not on an Android machine on a very slow network with Wi-Fi turned off.

Flipbook-vue loads the same image URL in advance with new Image and then after onload actually uses it in <img>, background-image etc. This means that if caching is properly enabled on the browser side, this problem will not occur. Conceivably, the server on which you are hosting the image does not allow caching properly?

mediavrog commented 1 year ago

Screenshot 2023-01-29 at 21 56 13

I set cache to one week and headers look alright. I wonder if an iframe could somehow interfere with this.

mediavrog commented 1 year ago

Ok I also noticed the issue occurs mainly if I disable caching in the network console. But shouldn't the flipper show the loading svg in that case and then the image?

ts1 commented 1 year ago

It should, but since it is difficult to manage strictly, it treats URLs as cached once they have been loaded successfully.

mediavrog commented 1 year ago

I see. A proper caching inside the plugin would resolve this then..