kc0bfv / autophugo

AutoPhugo [ˌɔtoʊˈfjuːgəʊ] is a gallery/photoblog theme for Hugo that's a little more automatic than Phugo.
Other
97 stars 56 forks source link

column_count by device or screen size? #18

Open sjabby opened 3 years ago

sjabby commented 3 years ago

Is it possible to add a parameter to set column_count by device (ie mobile) or screen size to have the site be more responsive?

kc0bfv commented 3 years ago

The default was two columns, which worked pretty well at a lot of device sizes. Unfortunately, to have the columns show up as columns (instead of something like a flexbox row) the photos are laid out at build time. To do something like variable-column-count based on device width, in CSS, would require a different layout that wouldn't produce the nice columns. Or it could maybe get built at runtime with JS... Or it could just reflow columns to show up at the bottom below the first columns...

I think the first one isn't what this theme is going for. The second would be a lot of JS for little gain. The third is a bit of a hack but might be a good option. I'll keep thinking about this one - the original purpose was definitely just to use 2 columns though. Maybe I should just mention this tradeoff in the readme.

sjabby commented 3 years ago

Thanks for the feedback. I think with some adjustments to columns etc this theme would also work very well with portrait photos.

vicevolf commented 2 years ago

On the contrary, if I browse the website with 4K monitor, the thumbnail will be stretched and blurred. Maybe max-width: 1200px will help?

kc0bfv commented 2 years ago

@volfclub I think you're right. I've temporarily set a max-width in the "cur_ver_release" branch. I don't love the way that looks, so might change it a little still.

I also think I'm gonna have to go the Javascript route to solve the underlying problem in an all-around acceptable way. Just not taking the time yet to do it. The tradeoffs there are - it's probably possible to meet every requirement except the "low javascript" one. I'll probably screw up some accessibility type things along the way too, although this theme isn't great with that anyway...

kc0bfv commented 2 years ago

I merged the max-width into main now, I haven't taken the time to do the better javascript fix yet....