A thin arm pivots from the bottom center like a windshield wiper, uncovering the text as it sweeps from left to right. A conic-gradient mask whose angle is a registered @property.
Also known as: clock wipe text reveal, windshield wiper reveal, conic gradient mask reveal.
<div class="txt-radial-wipe-reveal"><span class="txt-radial-wipe-reveal-t">Clear view</span></div>
@property --txt-radial-wipe-reveal-a {
syntax: "<angle>";
inherits: false;
initial-value: 0deg;
}
.txt-radial-wipe-reveal {
--c: var(--txt-color, #3b82f6);
font-size: var(--txt-size, 32px);
font-family: system-ui, sans-serif;
font-weight: 700;
line-height: 1.2;
position: relative;
display: inline-block;
overflow: hidden;
padding: 0.15em 0.3em 0;
white-space: nowrap;
color: var(--c);}
/* the mask sweeps from 9 o'clock to 3 o'clock around the bottom center */
.txt-radial-wipe-reveal-t {
display: inline-block;
-webkit-mask-image: conic-gradient(from -90deg at 50% 100%, #000 var(--txt-radial-wipe-reveal-a), transparent 0);
mask-image: conic-gradient(from -90deg at 50% 100%, #000 var(--txt-radial-wipe-reveal-a), transparent 0);
animation: txt-radial-wipe-reveal-sweep 1.2s cubic-bezier(0.45, 0, 0.25, 1) forwards;
}
/* the wiper arm rides the edge of the mask */
.txt-radial-wipe-reveal::after {
content: "";
position: absolute;
left: calc(50% - 0.03em);
bottom: 0;
width: 0.06em;
height: 4em;
border-radius: 0.03em;
background: var(--c);
transform-origin: 50% 100%;
animation: txt-radial-wipe-reveal-arm 1.2s cubic-bezier(0.45, 0, 0.25, 1) forwards, txt-radial-wipe-reveal-fade 0.3s ease-out 1.05s forwards;
}
@keyframes txt-radial-wipe-reveal-sweep {
from { --txt-radial-wipe-reveal-a: 0deg; }
to { --txt-radial-wipe-reveal-a: 180deg; }
}
@keyframes txt-radial-wipe-reveal-arm {
from { transform: rotate(-90deg); }
to { transform: rotate(90deg); }
}
@keyframes txt-radial-wipe-reveal-fade {
to { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
.txt-radial-wipe-reveal, .txt-radial-wipe-reveal *, .txt-radial-wipe-reveal::before, .txt-radial-wipe-reveal::after, .txt-radial-wipe-reveal *::before, .txt-radial-wipe-reveal *::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
}--txt-color on the element or a parent.
Currently previewing #3b82f6.--txt-size. Every other dimension is in
em, so the whole thing scales together. Currently previewing 40px.transition or animation
shorthand. Staggered delays are relative, so they keep their rhythm.