Countdown drain
Countdown drain: a CSS button. Copy the rules, or the prompt that rebuilds it.
CSS
.btn-185 {
position: relative;
font: 600 14px/1 system-ui,sans-serif;
color: #0f172a;
background: #fff;
border: 1px solid #cbd5e1;
border-radius: 999px;
padding: 11px 24px;
cursor: pointer;
overflow: hidden;
isolation: isolate
}
.btn-185::before {
content: "";
position: absolute;
inset: 0;
background: #fef08a;
z-index: -1;
transform-origin: left;
animation: drain185 5s linear forwards
}
.btn-185:hover::before {
animation-play-state: paused
}
.btn-185:focus-visible {
outline: 2px solid #0f172a;
outline-offset: 3px
}
.btn-185:active {
background: #fde047
}
@keyframes drain185 {
to {
transform: scaleX(0)
}
}
@media (prefers-reduced-motion: reduce) {
.btn-185, .btn-185 * { animation: none; transition: none; }
}
HTML
<button class="btn-185">Undo</button>Prompt
An "Undo" pill that visually counts down: a yellow #fef08a fill behind the label shrinks from full width to zero over 5 seconds (scaleX from the left, forwards fill) as the window to act closes. White base, 1px #cbd5e1 border, #0f172a 14px semibold text, 11px by 24px padding. Hovering pauses the drain; active fills #fde047. Focus 2px dark outline.