Pada snippet kali ini kita akan menggunakan efek skew.
<a href="#">button</a>
body {
height: 100vh;
margin: 0;
display: flex;
justify-content: center;
align-items: center;
font-family: "Lato", sans-serif;
background-color: #10ac84;
}
a {
text-transform: uppercase;
text-decoration: none;
font-weight: 700;
position: relative;
letter-spacing: 7px;
padding: 18px 30px;
background: transparent;
font-size: 28px;
color: white;
}
a:before {
content: "";
position: absolute;
height: 100%;
width: 50%;
left: -1%;
top: -5px;
background-color: #ee5253;
transform: skewX(30deg);
z-index: -1;
transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
a:hover:before {
transform: skewX(0deg);
left: 50%;
top: 0;
}
a:after {
content: "";
position: absolute;
height: 100%;
width: 50%;
left: 51%;
top: 5px;
background-color: #0a3d62;
transform: skewX(30deg);
z-index: -1;
transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
a:hover:after {
transform: skewX(0deg);
left: 0%;
top: 0;
}