In my React project, I am working on animating the transition from multiple images to one when a specific image is selected.
The CSS I am using for the animation is based on the x and y position of the original clicked image. Currently, these values are hardcoded. However, when I input them into the CSS 'translate' property, they seem to be inaccurate and I can't determine why.
I positioned a div absolutely with the same values, and that appears to be correct. But, the initial values for 'translate' in the CSS animation do not match what I input.
@keyframes move-image {
from {
transform: translate(383.125px, 7.998px) scale(1);
}
}
.animation {
animation: move-image 6.6s;
}
You can view the animation CSS in the CSS tab by following this link: https://codepen.io/nickjsdevelope1/pen/QoWEPV