Good evening, I try to make an effect of flipping a letter, but when I do it my rear image appears to me the other way around, I have this code.
.flip{
position: relative;
transition: all 1s ease;
transform: perspective(600px);
transform-origin: 100% 50%;
transform-style: preserve-3d;
}
.flip:hover{
transform: perspective(600px) rotateY(-180deg) translateX(100%);
}
And I'm applying it to this image:
<img class ="flip" id = "cara" onMouseOver="cambiar()" onMouseOut = "volver()" width="100" height="150" src="carta1.jpg" onclick="cartasDeJugador()">
js functions
function cambiar () {
if(mazo[mazo.length-1] === undefined)
iniciarJuego();
else
document.getElementById('cara').src = mazo[mazo.length-1];
}
function volver () {
document.getElementById('cara').src = "carta1.jpg";
}
I would like the rear image to appear correct and not the other way around