Since Instagram embeds aren't as responsive as one would think, we need to change the feed page size adaptively – 4 on mobile/tablet, 3 on small desktop, and 4 on large desktop.
Because the pages are managed by JS, we can't simply do this with just media queries.
In this PR, we create an adaptive postsPerPage function which returns different values based on the current breakpoint. We also create an observer function which updates the number of currently visible posts based on postsPerPage. They both need to have separate resize listeners, because postsPerPage is used in other functions, too.
Since Instagram embeds aren't as responsive as one would think, we need to change the feed page size adaptively – 4 on mobile/tablet, 3 on small desktop, and 4 on large desktop.
Because the pages are managed by JS, we can't simply do this with just media queries.
In this PR, we create an adaptive
postsPerPage
function which returns different values based on the current breakpoint. We also create an observer function which updates the number of currently visible posts based onpostsPerPage
. They both need to have separateresize
listeners, becausepostsPerPage
is used in other functions, too.