Weekend in Lisbon
Three days of tiles, tarts and trams.
A colored overlay grows out of the center of the photo as an expanding circle, carrying the title with it. One clip-path transition from circle(0) to a circle wider than the frame.
Also known as: clip path circle hover, circular overlay reveal, radial wipe image.
<a href="#" class="hfx-image-circle-reveal">
<span class="hfx-image-circle-reveal-overlay">
<strong>Coastline</strong>
<em>View gallery</em>
</span>
</a>.hfx-image-circle-reveal {
--c: var(--hfx-color, #3b82f6);
font-size: var(--hfx-size, 16px);
position: relative;
display: block;
width: 15em;
height: 9.5em;
border-radius: 0.75em;
overflow: hidden;
background:
radial-gradient(9% 30% at 50% 74%, rgb(255 255 255 / 0.55), transparent),
linear-gradient(transparent 62%, color-mix(in srgb, var(--c) 78%, #0f172a) 62%, color-mix(in srgb, var(--c) 62%, #0f172a) 74%, color-mix(in srgb, var(--c) 40%, #020617)),
radial-gradient(34% 16% at 6% 63%, color-mix(in srgb, var(--c) 36%, #0f172a) 99%, transparent),
radial-gradient(20% 9% at 92% 62%, color-mix(in srgb, var(--c) 48%, #1e293b) 99%, transparent),
radial-gradient(circle at 50% 50%, #fffbeb 0 0.9em, rgb(254 243 199 / 0.5) 1em, transparent 3.6em),
linear-gradient(color-mix(in srgb, var(--c) 56%, #fff), color-mix(in srgb, var(--c) 18%, #fed7aa) 62%);
color: #fff;
font-family: system-ui, sans-serif;
text-decoration: none;
}
.hfx-image-circle-reveal-overlay {
position: absolute;
inset: 0;
display: grid;
place-content: center;
gap: 0.35em;
text-align: center;
background: color-mix(in srgb, var(--c) 86%, transparent);
clip-path: circle(0% at 50% 50%);
transition: clip-path 0.55s cubic-bezier(0.65, 0, 0.35, 1);
}
.hfx-image-circle-reveal strong {
font-size: 1.25em;
transform: translateY(0.4em);
transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.hfx-image-circle-reveal em {
justify-self: center;
padding: 0.3em 0.8em;
border: 1px solid rgb(255 255 255 / 0.7);
border-radius: 99em;
font-size: 0.75em;
font-style: normal;
letter-spacing: 0.06em;
opacity: 0;
transition: opacity 0.3s ease;
}
.hfx-image-circle-reveal:is(:hover, :focus-visible) .hfx-image-circle-reveal-overlay {
clip-path: circle(75% at 50% 50%);
}
.hfx-image-circle-reveal:is(:hover, :focus-visible) strong {
transform: none;
}
.hfx-image-circle-reveal:is(:hover, :focus-visible) em {
opacity: 1;
transition-delay: 0.25s;
}
@media (prefers-reduced-motion: reduce) {
.hfx-image-circle-reveal, .hfx-image-circle-reveal *, .hfx-image-circle-reveal::before, .hfx-image-circle-reveal::after, .hfx-image-circle-reveal *::before, .hfx-image-circle-reveal *::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
}--hfx-color on the element or a parent.
Currently previewing #3b82f6.--hfx-size. Every other dimension is in
em, so the whole thing scales together. Currently previewing 16px.transition or animation
shorthand. Staggered delays are relative, so they keep their rhythm.