body{
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #222;
}
a{
    position: relative;
    color: white;
    text-decoration: none;
    font-size: 40px;
    border: 3px solid white;
    font-family: sans-serif;
    padding: 40px 80px;
    overflow: hidden;
    transition: all 1s;

}
a::before{
    position: absolute;
    content: '';
    top: 40px;
    left: 0;
    width: 100%;
    height: 30%;
    
    background-color: white;
    transform: translateX(-100%) rotate(45deg);
    transition: all 0.5s;
   
}
a:hover::before{
    transform: translateX(100%) rotate(45deg);
}
a:hover{
    background-color: red;
}