I have a site where there are essentially 4 different sized blocks. They may contain text, images, etc.
On the page load, I want these different sized blocks to fit on the viewport and appear "randomly" filled in. I also don't want space between these blocks.
As an added complexity, these blocks would be sorted by their date. The date sorting would be "loose" since I know these blocks couldn't fill the space neatly while retaining a strict sorting.
The grey area is the viewport of the browser.
How would I logically go about sorting these blocks on to the page? The blocks towards the top should be loosely sorted by date and should fill the space neatly (even though my drawing is a little rough)
Note** I do want it to appear random. When new blocks are added, they should look "randomized" from the previous view of blocks
Note2** These are being pulled from a database. The divs are loaded into the html unsorted and unsized. I was thinking JavaScript could iterate through the logical part I am asking since I want it to be responsive.