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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix browser preload warnings #28

Open
aod opened this issue Oct 4, 2022 · 0 comments
Open

Fix browser preload warnings #28

aod opened this issue Oct 4, 2022 · 0 comments

Comments

@aod
Copy link
Owner

aod commented Oct 4, 2022

Firefox and I'm sure other browser give the same warning when using preload and not using the resource soon after:

image

Either way, this was a hack for when the bot is playing a card or human is taking a card from the deck. The animation would be in progress while at the same time the browser would load the card image. This would mess up the animation.

Clearly it's not desirable for the player to preload every card asset in their browser. So this should get fixed, eventually...

One possible fix is to bundle the SVGs by importing/exporting them in a module. This will increase the bundle size. The total uncompressed size of all card assets is 2.66 MB.

Another solution could be looking at the top X cards of the deck and "preloading" the assets. Even only preloading the top most card of the deck should be good enough. The biggest card size with a face is 266 KB and non-face cards are ~15 KB.

Although depending on the player's internet stability bundling might be the better option. And also when the player goes offline they wouldn't be able to load further card assets.

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

No branches or pull requests

1 participant