@keyframes flip {

    0% {
    animation-timing-function: ease-out;
    transform: perspective(400px) rotate3d(0, 1, 0, -360deg);
    }

    40% {
    animation-timing-function: ease-out;
    transform: perspective(400px) translate3d(0, 0, 150px) rotate3d(0, 1, 0, -190deg);
    }

    50% {
    animation-timing-function: ease-in;
    transform: perspective(400px) translate3d(0, 0, 150px) rotate3d(0, 1, 0, -170deg);
    }

    80% {
    animation-timing-function: ease-in;
    transform: perspective(400px) scale3d(0.95, 0.95, 0.95);
    }

    100% {
    animation-timing-function: ease-in;
    transform: perspective(400px);
    }
}

.flip {
animation-duration: 0.75s;
animation-name: flip;
backface-visibility: visible;
}