← Retour galerie
Boutons · html-css · beginner
Hack Glitch
CTA acid plein avec effet glitch au survol
Aperçu live
Code
:root {
--ink: #050607;
--acid: #c8ff3d;
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
min-height: 100vh;
display: grid;
place-items: center;
background: var(--ink);
font-family: "Segoe UI", system-ui, sans-serif;
}
.btn-glitch {
position: relative;
padding: 1rem 2rem;
border: none;
border-radius: 8px;
background: var(--acid);
color: #06100a;
font-weight: 900;
font-size: 0.95rem;
letter-spacing: 0.04em;
text-transform: uppercase;
cursor: pointer;
box-shadow: 0 0 0 0 rgba(200, 255, 61, 0.5);
transition: box-shadow 0.2s ease, transform 0.15s ease;
}
.btn-glitch:hover {
animation: glitch 0.35s steps(2) infinite;
box-shadow: 0 0 40px rgba(200, 255, 61, 0.55);
}
.btn-glitch:active {
transform: scale(0.96);
}
@keyframes glitch {
0% {
clip-path: inset(0 0 0 0);
transform: translate(0);
}
20% {
clip-path: inset(20% 0 40% 0);
transform: translate(-3px, 1px);
}
40% {
clip-path: inset(50% 0 10% 0);
transform: translate(3px, -1px);
}
60% {
clip-path: inset(10% 0 60% 0);
transform: translate(-2px, 2px);
}
80% {
clip-path: inset(70% 0 5% 0);
transform: translate(2px, -2px);
}
100% {
clip-path: inset(0 0 0 0);
transform: translate(0);
}
}
Envie de tweak les tokens ? Code Studio
