Currently, I am developing a component that involves transitioning an image from a specific starting position and scale to an end position and scale in order to fill the screen. This transition is achieved through a CSS transform animation on translate and scale properties.
An issue that has arisen is that certain images being transitioned may have been altered by users of the component using the object-fit property. It seems that the CSS translate does not maintain the object-fit property during the transition.
To view a demonstration of this issue, please visit: https://codepen.io/cathyxz/pen/mXgEMB
While I could animate width and height instead, I prefer to stick with properties that browsers can animate efficiently for performance reasons. This means avoiding properties that affect layout, leaving us with only position, rotation, scale, and opacity as viable options for animation.
If you're interested in learning more about high-performance animations, check out: https://www.html5rocks.com/en/tutorials/speed/high-performance-animations/
I am seeking a solution to gradually animate the transition to "uncrop" images without stretching them. Any advice or suggestions would be greatly appreciated!