miromannino / Justified-Gallery

Javascript library to help creating high quality justified galleries of images. Used by thousands of websites as well as the photography community 500px.
http://miromannino.github.io/Justified-Gallery/
MIT License
1.68k stars 298 forks source link

Separate row height for smartphone/mobile devices #373

Closed godfatherjohn closed 1 year ago

godfatherjohn commented 1 year ago

It would be nice to have a separate option to determine the row height for mobile devices. The reason being that an array of images looks good on the desktop but on the phone it simply is one image (full width of screen) per row.

My current workaround is to keep the row height at 100px, this way it is two images per row on a phone and six images per row on the desktop. It is not optimal but I can live with it. It would be nicer to only have 3 per row on the desktop.

acwolff commented 1 year ago

I define the rowheight as for instance 15% of the screen.height.

see this test album.

godfatherjohn commented 1 year ago

Your workaround is JS to calculate the height and then... ... oh, may pages are becoming messy. ;-)

acwolff commented 1 year ago

Your workaround is JS to calculate the height and then... ... oh, may pages are becoming messy. ;-)

Well my example album is not messy, so apparently you do it in the wrong way! Why don’t you give a link to yout webpage?

godfatherjohn commented 1 year ago

No, it was not meant like that, and surely not as an offence. For some context, I use Grav CMS (which I find is [one of] the best CMSs out there). By messy I mean the content inside the 'page files' (markdown, backend), not the frontend part. I try to keep as much code outside of the page files. I'm very happy that Justified-Gallery exists!