MapStory / mapstory

MapStory is the free atlas of change that everyone can edit
http://mapstory.org
GNU General Public License v3.0
54 stars 41 forks source link

Modify homepage CSS for new gif dimensions #649

Closed glynnis closed 7 years ago

glynnis commented 7 years ago

@reynalddizon has made some new gifs at a higher resolution to cut down on graininess and better match branding for the homepage.

However, because of the size/resolution change, we need to adjust the CSS for those areas of the homepage, since adding the new images in Django admin still relies on the current CSS, which has properties calibrated to current image sizes.

Once there's a fix for this, we'll need to coordinate with @Coop56 or @travislbrundage on the deploy so that the new images can be added via django admin as soon as the deploy goes live. Once I make the CSS adjustments the old images will probably look even worse, so we’ll want to be on call to add the new images as soon as the deploy goes out, or get the image files to the person making the deploy.

glynnis commented 7 years ago

I looked more closely at this and I don't think these higher-res gifs actually end up being a good solution (especially as a quick fix) for a few reasons:

  1. The gifs that are more visually interesting, have more base map detail, or longer change over time end up being extremely large files, especially at a higher resolution that will look less stretched and grainy. Load time is already pretty significant for the gifs on production, and trying to reduce file size will make image quality suffer more than it already does.
  2. Using gifs for this style of display--stretched to 100% width no matter the browser width, which includes cinema displays, etc.--doesn't look good even at file sizes with higher dimensions. This is due to the inherent restrictions of the gif file format, which limits images to 256 colors and applies dithering effects (more technical details on that here: http://designingforperformance.com/optimizing-images/#gif).

More information about page load time:

Some possible ways to move forward from here:

  1. Examine other ways to use gifs in a homepage design that won't impact performance so severely. Gifs with smaller dimensions, fewer frames, and less visual noise will result in smaller file types. Some tricks like using a gradient over the gif (or some other visual treatment) may be a way to draw attention away from the low resolution and still make the homepage look good while decreasing load time.
  2. Choose a different way to showcase animations or change over time features of MapStory. Some possibilities include: a short looping video (a la carto.com), an SVG (vector) background with CSS (or SVG) animations showing changes over time (made to look like a real MapStory with a basemap, etc.). APNGs might be an option in the future but don't have browser support or fallbacks sufficient for the browser types and versions we support currently.
  3. Look into embedding a trimmed-down MapStory directly on the homepage that may load faster, or that could lazy-load subsequent map animations as the user scrolls rather than all at once on page load (carto.com does something like this). Lazy-loading may not have much of an effect in reducing the performance hit, though, since MapStory has less homepage content/height than other sites. I'm guessing this also may be more effort in the short run than some other approaches.

Happy to chat more about this and possible solutions, either for implementing new gifs that are more enticing without negatively impacting performance, or trying to reduce performance hits for the current ones. We could also look at those two things as separate issues if that's preferable.

Let me know what sounds best in terms of how to proceed! 👍

jonpmarino commented 7 years ago

video probably makes sense to me, ala carto.com. that way we can change it regularly pretty easily if we have the recipe for making the proper video...benefit is it aligns with what you were envisioning for the homepage design upgrade yeah?

glynnis commented 7 years ago

Given the new homepage design (see #720), I think this issue can be closed.