S
S
someden2016-09-08 20:23:28
JavaScript
someden, 2016-09-08 20:23:28

Is there a js script to generate a grid of photos like in the "Memories" section in iOS 10?

Please tell me a suitable script or formula by which the grid is formed in iOS
Some features:
1. The last row at the bottom should be one line (so masonry or isotope are not suitable)
As usual in masonry or isotope:

|__|--|  |_____|
      |__|

And this is how it should be:
|__|__|__|_____|
2. Some blocks occupy two columns at once.
3. No random. The grid is formed based on the available photos and their proportions.
Grid example:
538dd6ec583d4fd38da0d95488c9eb34.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Karponter, 2016-09-09
@karponter

object-fit:cover + fixed layout for Freewall
In general, everything depends on the user case. Offhand, I did not find a good library solution for such a task, so I would file a dozen fixed layouts for Freewall, for 3, 4, 5, 6, ... photos. Then vertically expose them sequentially, randomly selected.
But the algorithm for selecting the last 2-3 layouts, for good, will not be so simple.
If the details are interesting, I can expand the topic.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question