The problem
You need to draw attention to elements like notifications, live indicators, or CTAs.
The solution
/* Simple pulse */
.pulse {
animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes pulse {
0%, 100% { opacity: 1; }
50% { opacity: 0.5; }
}
/* Ping effect (ripple outward) */
.ping {
position: relative;
}
.ping::before {
content: '';
position: absolute;
inset: 0;
border-radius: inherit;
background: inherit;
animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}
@keyframes ping {
75%, 100% {
transform: scale(2);
opacity: 0;
}
}
/* Notification dot with ping */
.notification-dot {
position: relative;
width: 12px;
height: 12px;
background: #ef4444;
border-radius: 50%;
}
.notification-dot::before {
content: '';
position: absolute;
inset: 0;
background: #ef4444;
border-radius: 50%;
animation: ping 1.5s ease-out infinite;
}
/* Scale pulse for buttons */
.pulse-scale {
animation: pulse-scale 2s ease-in-out infinite;
}
@keyframes pulse-scale {
0%, 100% { transform: scale(1); }
50% { transform: scale(1.05); }
}See it live
Put it to work
<!-- Notification badge -->
<div class="icon-wrapper">
<svg>...</svg>
<span class="notification-dot"></span>
</div>
<!-- Live indicator -->
<span class="ping" style="width: 8px; height: 8px;
background: #22c55e; border-radius: 50%;"></span>
<!-- CTA button -->
<button class="pulse-scale">Buy Now!</button>Worth knowing
Use sparingly - too many animated elements can be distracting. Consider prefers-reduced-motion.