Post

New demo: Animated CSS Grid Layout. codepen.io/bramus/pen/o... Here’s the thing: No View Transitions. No JS at all. Instead, it uses Anchor Positioning to anchor the cell contents to the cell. Then, CSS transitions are used to animate the contents to their new location as the grid re-layouts.

22 reposts164 likes

Hehe, I did a version of this in my reservoir sampling post. I called the elements in the grid “slots” and FLIPped cards into them. No anchor positioning (still haven’t taken the time to learn it), but yes JS. Awesome that you can do it without JS!

What helped here is that you can’t actually do it with Document-Scoped View Transitions because the viewport constantly changes size (which makes the VT skip), so I was forced to look for a different (and better) hammer 😅

Yes, that is a very compelling argument. The preview below is from an upcoming, completely redesigned version of the Bag's Inspection Chamber, resizing an iframe with a nailed down viewport to prevent the view transitions from being interrupted while the dimension change.