How To Make Animation Profile Card Using CSS And Bootstrap Part-4

admin_img Posted By Bajarangi soft , Posted On 28-01-2021

We made an Animated Profile Card with Hover Animation using HTML CSS & JavaScript. here we aslo created slider animation hover effect. here you can see, we made profile animation and home section animation.

How To Make Animation Profile Card Using CSS And Bootstrap Part-4

follow this step:
Step 1:Create css file like style.css.  
 

@import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;1,100;1,300&family=Slabo+27px&display=swap");


*::after,
*::before {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: "Roboto", sans-serif;
    font-style: normal;
}

a,
a:hover,
a:focus,
a:active,
a:link {
    outline: none;
    text-decoration: none;
    color: #000;
}

.bs-card {
    position: relative;
    padding: 100px 0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
}

.bs-card .card {
    position: relative;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    min-width: 350px;
    max-width: 350px;
    height: 375px;
    background-color: #fff;
    background-clip: border-box;
    box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.2);
    border-radius: 0;
    border: 0;
    overflow: hidden;
    -webkit-transition: all 0.4s ease;
    -moz-transition: all 0.4s ease;
    -o-transition: all 0.4s ease;
    transition: all 0.4s ease;
    margin: 25px 0;
}

.bs-card .card:hover {
    transform: translateY(-5px) scale(1.005) translateZ(0);
    box-shadow: 0 24px 36px rgb(115 12 229 / 40%),
    0 24px 46px rgb(115 12 229 / 40%);
}

.bs-card .card .card-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50% ,50%);
}

.bs-card .card .card-icon {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50% ,-50%);
    z-index: 1;
}

.bs-card .card .card-icon i {
    font-size: 150px;
    color: #fff;
}

.bs-card .card:hover .card-icon i {
    color: #fff;
}

.bs-card .card .card-body {
    position: relative;
    -webkit-box-flex: 1;
    -ms-flex: 1 1 auto;
    flex: 1 1 auto;
    padding: 1.25rem;
}

.bs-card .card .card-body .card-title {
    position: absolute;
    top: 70%;
    left: 50%;
    transform: translate(-50% ,-50%);
    margin-bottom: 0;
}

.bs-card .card .card-body .card-title h5 {
    font-size: 17px;
    color: #4C5656;
}

.bs-card .card:hover .card-body .card-title h5 {
    color: #fff;
}

.bs-card .card .card-overlay {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50% , -50%);
    background: #730ce5;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    z-index: 0;
    -webkit-transition: all 0.4s ease;
    -moz-transition: all 0.4s ease;
    -o-transition: all 0.4s ease;
    transition: all 0.4s ease;
}

.bs-card .card:hover .card-overlay {
    transform: scale(5) translateZ(0);
}

.bs-card .card .card-body .card-description {
    position: absolute;
    bottom: 15px;
    left: 0;
    right: 0;
    width: 100%;
    text-align: center;
}

.bs-card .card .card-body .card-description p {
    font-weight: 300;
    color: #000;
}

.bs-card .card:hover .card-body .card-description p {
    color: #fff;
}


@media (max-width: 340px) {

    .bs-card .card .card-body .card-description p {
        font-size: 15px;
    }
}

@media (max-width: 375px) {
    .bs-card .card {
        min-width: 100%;
        max-width: 100%;
    }

    .bs-card .card .card-body .card-description {
        bottom: 0;
    }
}

Step 2:Create html file like index.html and import style.css in it.
 
<!DOCTYPE html>
<html lang="en">
<head>
    <!-- Required meta tags -->
    <title>card hover</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="css/style.css" />

</head>
<body>
<!-- container -->
<div class="container">
    <section class="bs-card">
        <div class="card">
            <div class="card-icon">
                <i class="fa fa-user-circle-o"></i>
            </div>
            <div class="card-overlay"></div>
            <div class="card-body">
                <div class="card-title">
                    <h5>New Animation </h5>
                </div>
                <div class="card-description">
                    <p>Lorem ipsum dolor sit amet consectetur adipiscing laoreet nunc tristique interdum Nam malesuada ligula a liguelementum metus  </p>
                </div>
            </div>
        </div>

        <div class="card">
            <div class="card-icon">
                <i class='fa fa-home'></i>
            </div>
            <div class="card-overlay"></div>
            <div class="card-body">
                <div class="card-title">
                    <h5>New Animation </h5>
                </div>
                <div class="card-description">
                    <p>Lorem ipsum dolor sit amet consectetur adipiscing laoreet nunc tristique interdum Nam malesuada ligula a liguelementum metus  </p>
                </div>
            </div>
        </div>

        <div class="card">
            <div class="card-icon">
                <i class='fa fa-clock-o'></i>
            </div>
            <div class="card-overlay"></div>
            <div class="card-body">
                <div class="card-title">
                    <h5>New Animation </h5>
                </div>
                <div class="card-description">
                    <p>Lorem ipsum dolor sit amet consectetur adipiscing laoreet nunc tristique interdum Nam malesuada ligula a liguelementum metus  </p>
                </div>
            </div>
        </div>
    </section>
</div>
<!-- container end -->

<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
</body>
</html>

Related Post