hivewallet / hive-js

Hive digital currency wallet
http://www.hivewallet.com
GNU General Public License v2.0
81 stars 57 forks source link

Images sometimes load in late #94

Closed ghost closed 10 years ago

ghost commented 10 years ago

Maybe preload all images while user is sitting on the login/pin screen to avoid image 'pop-in effect' that makes it feel like a web page?

ghost commented 10 years ago

Images being things like app icons

weilu commented 10 years ago

My understanding is that this will be addressed by https://github.com/hivewallet/hive-js/issues/85

edit: #85 deals with individual svg asset instead of creating a sprite. After fiddling with the (heroku) app on a simulator, I still think it's more of an issue with fetching assets from network. So if we can pack all image assets in a sprite and load the sprite at the beginning, I believe it will help address this issue.

haustraliaer commented 10 years ago

Yep will look into that, I think it's related to ractive re-building HTML in the DOM, so the browser thinks it has to go and get new resources (or perhaps just re-render them).

mackuba commented 10 years ago

@weilu: I don't think it's a network issue, if I enter the pin wrong repeatedly I have to wait for the error icon in the overlay to load every single time, even though I've seen it a few seconds ago.

haustraliaer commented 10 years ago

Yeah I'm pretty sure at this stage it's a rendering issue - will be looking into fixing it over the weekend.

haustraliaer commented 10 years ago

After extensive testing with preloading / pre-rendering img tag links and css background-image links we're going to have to use inline SVGs for this - I don't see any other way around it.

General Disadvantages:

  1. They'll have to be inlined to the js file, which will increase the filesize.
  2. Ugly code / horrible to maintain.
  3. Can't re-use (cache) these assets across web pages.

Arguments to the above:

  1. It's still xmlish text (not data-uris) so should be g-zipped just fine (and greatly reduces the amount of requests made).
  2. We can probably setup partials to make this easier.
  3. ... it's a single page app anyway! (for now)

So in conclusion, I think this is the right choice as the browser support has finally caught up and all of our svg assets will be pre-loaded and pre-rendered for a retina optimised speedy interface!

I'll get started on converting them over this afternoon.

haustraliaer commented 10 years ago

wheee... closed with https://github.com/hivewallet/hive-js/commit/b26316a459a8

Still need to convert over some stuff to inline, but waiting on final assets for that.