I'm looking to create an animation that involves the following steps:
- Initial:
elementA
starts with opacity set at 0; - When hovering over
containerA
, which containselementA
:elementA
transitions from position (-5px, 5px) to (0px, 0px);elementA
changes opacity from0
to1
;- animation duration is 0.5s;
- Upon exiting the hover state of
containerA
:elementA
changes opacity from1
to0
;elementA
maintains its position without moving;- animation duration remains at 0.5s;
I was able to achieve this effect by adding or removing CSS classes, as seen here (https://jsbin.com/buqexadiru/edit?html,css,js,console,output)
My query now is whether it's possible to replicate this effect using only pure CSS, without the need for additional class manipulations. Can this be done?