I have got a problem with a CSS3 animation.
.child {
opacity: 0;
display: none;
-webkit-transition: opacity 0.5s ease-in-out;
-moz-transit
To have animation on both ways onHoverIn/Out I did this solution. Hope it will help to someone
@keyframes fadeOutFromBlock {
0% {
position: relative;
opacity: 1;
transform: translateX(0);
}
90% {
position: relative;
opacity: 0;
transform: translateX(0);
}
100% {
position: absolute;
opacity: 0;
transform: translateX(-999px);
}
}
@keyframes fadeInFromNone {
0% {
position: absolute;
opacity: 0;
transform: translateX(-999px);
}
1% {
position: relative;
opacity: 0;
transform: translateX(0);
}
100% {
position: relative;
opacity: 1;
transform: translateX(0);
}
}
.drafts-content {
position: relative;
opacity: 1;
transform: translateX(0);
animation: fadeInFromNone 1s ease-in;
will-change: opacity, transform;
&.hide-drafts {
position: absolute;
opacity: 0;
transform: translateX(-999px);
animation: fadeOutFromBlock 0.5s ease-out;
will-change: opacity, transform;
}
}