xwp / unsplash-wp

GNU General Public License v2.0
9 stars 3 forks source link

Fix initial view glitch when masonry layout renders #66

Closed pierlon closed 4 years ago

pierlon commented 4 years ago

Summary

Fixes UVP-169.

Checklist

spacedmonkey commented 4 years ago

Number of styling issues here. Screenshot from 2020-04-20 10-34-25

spacedmonkey commented 4 years ago

Screenshot from 2020-04-20 11-00-31 Screenshot from 2020-04-20 10-59-20 Screenshot from 2020-04-20 10-57-57 More weird styling issues on resize.

spacedmonkey commented 4 years ago

Some of the fixes for issues I have found are in #67

pierlon commented 4 years ago

Changes made in https://github.com/xwp/unsplash-wp/pull/66/commits/55db1e637fe6507210ccb9e984998d48e5454703 undo a lot of what was changed before. The images have a set width and height so the browser can pre-render the layout and calculate the aspect ratio for each image.

spacedmonkey commented 4 years ago

This now has a conflict, that needs to be resolved and a unit test added.

Idea would performance be better, we force the images to load when the api response returns. Here is an example of a simple preload function.