An iris opens from the center of the word while the text settles from slightly zoomed in. One clip-path circle that grows from 0% to past the corners, plus a small scale on the same element.
Also known as: circle clip path reveal, iris reveal text, circular text reveal css.
<div class="txt-circle-reveal-text">Picture this</div>
.txt-circle-reveal-text {
--c: var(--txt-color, #3b82f6);
font-size: var(--txt-size, 32px);
font-family: system-ui, sans-serif;
font-weight: 700;
line-height: 1.2;
display: inline-block;
padding: 0.1em 0.3em;
white-space: nowrap;
color: var(--c);
clip-path: circle(0% at 50% 50%);
animation: txt-circle-reveal-text-iris 1s cubic-bezier(0.5, 0, 0.2, 1) forwards;}
@keyframes txt-circle-reveal-text-iris {
from { clip-path: circle(0% at 50% 50%); transform: scale(1.15); }
to { clip-path: circle(75% at 50% 50%); transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
.txt-circle-reveal-text, .txt-circle-reveal-text *, .txt-circle-reveal-text::before, .txt-circle-reveal-text::after, .txt-circle-reveal-text *::before, .txt-circle-reveal-text *::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.