Hi, friends. I found out a animation way: https://developers.google.com/web/updates/2017/03/performant-expand-and-collapse
They call it counter-transform, the parent element scale down, and the child element scale up
it can make a smooth animation to change to different aspect ratio.
But the question is, because the parent and child element scale in SAME time
so the timing function can't be use regular, in article above, they use javascript to generator css keyframes animation.
Then I thought of ExpoScaleEase, I use it on code,like:
timeline
.fromTo(container, { scaleX: 1 }, { scaleX: delta.scaleX, ease: `expoScale(1, ${delta.scaleX})` })
.fromTo(container, { scaleY: 1 }, { scaleY: delta.scaleY, ease: `expoScale(1, ${delta.scaleY})` }, '<')
.fromTo(image, { scaleX: 1 }, { scaleX: 1 / delta.scaleX, ease: `expoScale(1, ${1 / delta.scaleX})` }, '<')
.fromTo(image, { scaleY: 1 }, { scaleY: 1 / delta.scaleY, ease: `expoScale(1, ${1 / delta.scaleY})` }, '<')
The parent and child is actually doing animation
But their animations neutralize each other, Looks no animation
Can gsap had the ease plugin to solve it now?
generate css keyframes animation is so...