@import url('https://fonts.googleapis.com/css?family=Montserrat:600&display=swap');
body {
margin: 0;
padding: 0;
display: flex;
height: 100vh;
align-items: center;
justify-content: center;
background: #333; /* Fondo gris para mejor visualización */
}
span {
position: relative;
display: inline-flex;
width: 180px;
height: 55px;
margin: 0 15px;
perspective: 1000px;
box-shadow: 8px 8px 20px rgba(0, 0, 0, 0.6), 0 0 0 4px #fff; /* Sombra gris y contorno blanco */
justify-content: center;
}
span a {
font-size: 19px;
letter-spacing: 1px;
transform-style: preserve-3d;
transform: translateZ(-25px);
transition: transform.25s, box-shadow.25s; /* Añadir transición para box-shadow */
font-family: 'Montserrat', sans-serif;
position: relative;
background-clip: padding-box;
display: flex;
justify-content: center;
align-items: center;
}
span a:before,
span a:after {
position: absolute;
content: "BUTTON";
height: 55px;
width: 180px;
display: flex;
align-items: center;
justify-content: center;
border: 5px solid black;
box-sizing: border-box;
border-radius: 0; /* Asegurarse de que no haya redondeo */
background: #1b221b; /* Color de fondo actualizado */
}
span a:before {
color: #fff;
transform: rotateY(0deg) translateZ(25px);
}
span a:after {
color: #000;
background: #fff;
transform: rotateX(90deg) translateZ(25px);
}
span a:hover {
transform: translateZ(-25px) rotateX(-90deg);
box-shadow: 8px 8px 20px rgba(0, 0, 0, 0.6), 0 0 0 4px #fff; /* Mantener el contorno blanco durante el hover */
}
span a:active {
transform: scale(0.8) translateZ(-30px) rotateX(-90deg);
transform-origin: center; /* Añadir este propiedad para que el botón se reduzca desde el centro */
box-shadow: 6.4px 6.4px 16px rgba(0, 0, 0, 0.6), 0 0 0 3.2px #fff; /* Reducción proporcional del contorno blanco */
}