Modern CSS Clip-path Effects
Cut images and blocks into polygons, circles, stars and waves, and animate between the shapes.
1Circle Reveal
Shows a circular window of an image that opens to the full picture on hover or keyboard focus. Class: fx-circle-reveal
<div class="d-flex flex-wrap align-items-center justify-content-center gap-3 p-3 h-100" style="min-height:200px">
<a href="#" class="d-inline-block" aria-label="Open project"><img src="https://images.unsplash.com/photo-1554366347-897a5113f6ab?auto=format&fit=crop&w=1200&h=800&q=70" alt="Project cover revealed in a circle" class="fx-circle-reveal object-fit-cover" style="width:220px;height:150px"></a>
</div>
/* CSS (already in assets/css/effects.css) */
.fx-circle-reveal { -webkit-clip-path: circle(36% at 50% 50%); clip-path: circle(36% at 50% 50%); transition: clip-path .7s cubic-bezier(.6, 0, .2, 1); }
.fx-circle-reveal:hover, .fx-circle-reveal:focus-visible, :focus-visible > .fx-circle-reveal { -webkit-clip-path: circle(75% at 50% 50%); clip-path: circle(75% at 50% 50%); }
@media (prefers-reduced-motion: reduce) {
.fx-circle-reveal, .fx-circle-reveal::before, .fx-circle-reveal::after, .fx-circle-reveal *, .fx-circle-reveal *::before, .fx-circle-reveal *::after { animation: none !important; transition: none !important; }
}2Complex Animation
Chains four eight-point shapes with rotation for an eye-catching hero ornament. Class: fx-complex-animation
<div class="d-flex flex-wrap align-items-center justify-content-center gap-3 p-3 h-100" style="min-height:200px">
<div class="fx-complex-animation" style="width:140px;height:140px">
</div>
</div>
/* CSS (already in assets/css/effects.css) */
.fx-complex-animation {
-webkit-clip-path: polygon(50% 0, 85% 15%, 100% 50%, 85% 85%, 50% 100%, 15% 85%, 0 50%, 15% 15%); clip-path: polygon(50% 0, 85% 15%, 100% 50%, 85% 85%, 50% 100%, 15% 85%, 0 50%, 15% 15%);
background: conic-gradient(from 45deg, var(--wt-primary), var(--wt-secondary), var(--wt-accent), var(--wt-primary));
animation: fx-complex-animation-shift 10s ease-in-out infinite;
}
@keyframes fx-complex-animation-shift {
0%, 100% { -webkit-clip-path: polygon(50% 0, 85% 15%, 100% 50%, 85% 85%, 50% 100%, 15% 85%, 0 50%, 15% 15%); clip-path: polygon(50% 0, 85% 15%, 100% 50%, 85% 85%, 50% 100%, 15% 85%, 0 50%, 15% 15%); transform: rotate(0deg); }
25% { -webkit-clip-path: polygon(50% 20%, 100% 0, 80% 50%, 100% 100%, 50% 80%, 0 100%, 20% 50%, 0 0); clip-path: polygon(50% 20%, 100% 0, 80% 50%, 100% 100%, 50% 80%, 0 100%, 20% 50%, 0 0); transform: rotate(45deg); }
50% { -webkit-clip-path: polygon(50% 0, 100% 0, 100% 50%, 100% 100%, 50% 100%, 0 100%, 0 50%, 0 0); clip-path: polygon(50% 0, 100% 0, 100% 50%, 100% 100%, 50% 100%, 0 100%, 0 50%, 0 0); transform: rotate(90deg) scale(.85); }
75% { -webkit-clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); transform: rotate(180deg); }
}
@media (prefers-reduced-motion: reduce) {
.fx-complex-animation, .fx-complex-animation::before, .fx-complex-animation::after, .fx-complex-animation *, .fx-complex-animation *::before, .fx-complex-animation *::after { animation: none !important; transition: none !important; }
}3Slide Reveal
Wipes an image or banner in from the left, holds it, then wipes it out to the right. Class: fx-slide-reveal
<div class="d-flex flex-wrap align-items-center justify-content-center gap-3 p-3 h-100" style="min-height:200px">
<img src="https://images.unsplash.com/photo-1529260830199-42c24126f198?auto=format&fit=crop&w=1200&h=800&q=70" alt="Banner image sliding into view" class="fx-slide-reveal object-fit-cover" style="width:220px;height:150px">
</div>
/* CSS (already in assets/css/effects.css) */
.fx-slide-reveal { -webkit-clip-path: inset(0 0 0 0); clip-path: inset(0 0 0 0); animation: fx-slide-reveal-wipe 5s cubic-bezier(.7, 0, .3, 1) infinite; }
@keyframes fx-slide-reveal-wipe {
0% { -webkit-clip-path: inset(0 100% 0 0); clip-path: inset(0 100% 0 0); }
25%, 75% { -webkit-clip-path: inset(0 0 0 0); clip-path: inset(0 0 0 0); }
100% { -webkit-clip-path: inset(0 0 0 100%); clip-path: inset(0 0 0 100%); }
}
@media (prefers-reduced-motion: reduce) {
.fx-slide-reveal, .fx-slide-reveal::before, .fx-slide-reveal::after, .fx-slide-reveal *, .fx-slide-reveal *::before, .fx-slide-reveal *::after { animation: none !important; transition: none !important; }
}