Pulse Effect Animation

Home / Web Code Snippet / Pulse Effect Animation

Pulse Effect Animation


                                                        https://youtube.com/shorts/f6wq1cp_mk8?si=b3hkANKbupvGGuxM

HTML CODE:-
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" integrity="sha512-DTOQO9RWCH3ppGqcWaEA1BIZOC6xxalwEsw9c2QQeAIftl+Vegovlnee1c9QX4TctnWMn13TZye+giMm8e2LwA==" crossorigin="anonymous" referrerpolicy="no-referrer" />
    <title></title>
</head>
<body>
    <div class="container">
        <i class="fa-solid fa-phone"></i>
    </div>
</body>
</html>
CSS CODE:-
body{
            padding: 0px;
            margin: 0px;
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            background-color: black;
        }
        .container{
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%,-50%);
            width: 90px;
            height: 90px;
            background-color: #043dd9;
            color: white;
            border-radius: 50%;
            text-align: center;
            line-height: 90px;
            font-size: 40px;
            box-shadow: 0px 0px 10px #043dd9;
        }
        .container:before,
        .container:after{
            content: "";
            display: block;
            position: absolute;
            border: 50%;
            border: 2px solid #043dd9;
            border-radius: 50%;
            inset: -20px;
            animation:animate 1.5s linear infinite;
            opacity: 0;
            backface-visibility: hidden;
            box-shadow: 0px 0px 10px #043dd9;
        }
        .container:after{
            animation-delay: 0.5s;
        }
        @keyframes animate{
            0%{
                opacity: 0;
                transform: scale(0.5);
            }
            50%{
                opacity: 1;
            }
            100%{
                opacity: 0;
                transform: scale(1.2);
            }
        }