Animation on Button



CSS


body{
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: rgb(214, 185, 147);
}
.btn-slide{
   
    border: none;
    background-color: rgb(31, 192, 192);
    text-align: center;
    padding: 10px 0px;
    width: 300px;
    cursor: pointer;
    outline: none;
    color:white;
    font-weight: bold;
    border-radius: 5px;
    position: relative;
    z-index: 1;
    transition: all .3s ease-in-out;
    font-size: 20px;
}
.btn-slide:hover{

    background-color: yellowgreen;
    box-shadow: 1px 6px 15px rgb(104, 103, 103);
}
.btn-slide::before{

    content: "\1F329";
    font-size: 30px;
    top: 0px;
    bottom: 0px;
    left: 0px;
    visibility: hidden;
    position: absolute;
    z-index: -1;
    transition: all .3s ease-in;
    transform-origin: left;
    

}
.btn-slide:hover::before{
    transform: scale(1);
    left: 250px;
    visibility: visible;
    

}

Comments

Popular posts from this blog

Bootstrap 6: New Features, Major Changes, and What Developers Need to Know

Why Reflections Disappear in Games When You Tilt the Camera

How Games Fake Underwater Worlds: Fog, Color Absorption and Caustics