Skip to content

Instantly share code, notes, and snippets.

@lorens-osman-dev
Created October 25, 2022 18:13
Show Gist options
  • Save lorens-osman-dev/f9955bb2ec292cc99631b3dc251d5190 to your computer and use it in GitHub Desktop.
Save lorens-osman-dev/f9955bb2ec292cc99631b3dc251d5190 to your computer and use it in GitHub Desktop.
WhatsApp Pulse Button
<a href="" class="btn-whatsapp-pulse">
<i class="fab fa-whatsapp"></i>
</a>
<a href="" class="btn-whatsapp-pulse btn-whatsapp-pulse-border">
<i class="fab fa-whatsapp"></i>
</a>
.btn-whatsapp-pulse {
background: #25d366;
color: white;
position: fixed;
bottom: 20px;
right: 20px;
font-size: 40px;
display: flex;
justify-content: center;
align-items: center;
width: 0;
height: 0;
padding: 35px;
text-decoration: none;
border-radius: 50%;
animation-name: pulse;
animation-duration: 1.5s;
animation-timing-function: ease-out;
animation-iteration-count: infinite;
}
@keyframes pulse {
0% {
box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5);
}
80% {
box-shadow: 0 0 0 14px rgba(37, 211, 102, 0);
}
}
.btn-whatsapp-pulse-border {
bottom: 120px;
right: 20px;
animation-play-state: paused;
}
.btn-whatsapp-pulse-border::before {
content: "";
position: absolute;
border-radius: 50%;
padding: 25px;
border: 5px solid #25d366;
opacity: 0.75;
animation-name: pulse-border;
animation-duration: 1.5s;
animation-timing-function: ease-out;
animation-iteration-count: infinite;
}
@keyframes pulse-border {
0% {
padding: 25px;
opacity: 0.75;
}
75% {
padding: 50px;
opacity: 0;
}
100% {
opacity: 0;
}
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.2/css/all.min.css" rel="stylesheet" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment