how to make #CSS view transitions swoop or have motion blur or how I learned to help view transitions not always go in straight lines ⤷ nerdy.dev/swoop-there-...
11 reposts68 likes
how to make #CSS view transitions swoop or have motion blur or how I learned to help view transitions not always go in straight lines ⤷ nerdy.dev/swoop-there-...
11 reposts68 likes
> They dont perfectly match Hi @nerdy.dev, I reckon delaying the start of the green ball in codepen.io/argyleink/pe... would sync them? (requestAnimationFrame(()=>requestAnimationFrame(()=>ball2.classList.add(state)));
Yep, `translate` is the one to manipulate. It’s the same approach I use in www.bram.us/2025/02/07/v... to make the keyframes more performant, allowing the animations to run on the compositor.
My approach there only works with elements that don’t change size between the old and new state though. To deal with that, throw more code at it and extract the needed info from the generated keyframes. Then adjust the `transform` with that info. See www.bram.us/2025/03/04/v... for details.
Also, I’m working on something to automate this all for you … bsky.app/profile/bram... 😉
Here’s an updated version of that first demo, using a technique @kvndy.bsky.social taught me: relative animations. The path the dot follows is much smoother now as it doesn’t get interrupted at its mid-flight location but, instead, the new animation gets added to the existing ones. However …