Full Source Code — Pulsing Attractive Button
HTML
CSS
JavaScript
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Pulsing Attractive Button</title> </head> <body> <a href="your-important-page" class="pulsing-button"> ACCESS THE DETAILS </a> </body> </html>
/* ── FULL SCREEN CENTERING ────────────────────────────────── */
body {
height: 100vh; margin: 0;
display: flex; justify-content: center; align-items: center;
background-color: #121212; /* Dark background makes the glow pop */
}
/* ── GLOW PULSE ANIMATION ─────────────────────────────────── */
/* Animates box-shadow from a tight 0px spread ring to a */
/* 20px expanded transparent ring and back — the ripple effect */
@keyframes pulse {
0% { box-shadow: 0 0 0 0 rgba(148, 0, 211, 0.7); } /* Tight intense ring */
70% { box-shadow: 0 0 0 20px rgba(148, 0, 211, 0); } /* Expanded faded ring */
100%{ box-shadow: 0 0 0 0 rgba(148, 0, 211, 0); } /* Reset for next cycle */
/* 70% midpoint: ring lingers at full expansion → realistic ripple feel */
}
/* ── FADE-IN ENTRANCE ANIMATION ──────────────────────────── */
@keyframes fadeIn {
from { opacity: 0; } /* Button is invisible at load */
to { opacity: 1; } /* Fades in over 0.5s */
}
/* ── MAIN BUTTON ──────────────────────────────────────────── */
.pulsing-button {
/* ── TWO SIMULTANEOUS ANIMATIONS (comma-separated) ──────── */
/* fadeIn: 0.5s one-shot entrance, 'forwards' keeps opacity:1 */
/* pulse: 2s infinite glow ring, loops forever */
animation: fadeIn 0.5s ease-out forwards,
pulse 2s infinite ease-out;
display: inline-block;
padding: 14px 32px;
font-size: 20px; font-weight: 700;
letter-spacing: 1px;
text-align: center; text-transform: uppercase; text-decoration: none;
cursor: pointer; border: none;
border-radius: 8px; color: #ffffff;
/* Violet → pink diagonal gradient */
background-image: linear-gradient(135deg, #9400D3, #C71585);
/* Resting glow shadow — different from the pulse (both coexist) */
box-shadow: 0 6px 20px rgba(148, 0, 211, 0.5);
/* Smooths hover box-shadow and transform changes */
/* cubic-bezier(0.25, 0.8, 0.25, 1) = fast start, gentle deceleration */
transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
/* ── HOVER STATE ─────────────────────────────────────────── */
.pulsing-button:hover {
/* Swap gradient color positions — instant apparent hue inversion */
/* (CSS gradients can't be transitioned — this is the workaround) */
background-image: linear-gradient(135deg, #C71585, #9400D3);
box-shadow: 0 10px 30px rgba(148, 0, 211, 0.8); /* Deeper glow when lifted */
transform: translateY(-4px); /* Lift 4px toward cursor */
}
/* ── ACTIVE (PRESS) STATE ────────────────────────────────── */
.pulsing-button:active {
box-shadow: 0 4px 10px rgba(148, 0, 211, 0.5); /* Reduced shadow — pressed down */
transform: translateY(0); /* Returns to resting position */
}
// No JavaScript required for this effect! // The entire pulsing glow, fade-in entrance, hover lift, // and active press are achieved with pure CSS alone. // // This makes the button: // ✓ Framework-agnostic — works in React, Vue, Svelte, plain HTML // ✓ Zero runtime overhead // ✓ Instantly copy-paste into any project // ✓ Fully accessible (keyboard, screen reader compatible as an <a> tag) // // To connect to a real page: change href="your-important-page" // To change CTA text: edit "ACCESS THE DETAILS" in the <a> tag // To change pulse color: replace rgba(148,0,211,...) with any rgba color