Modern CSS Filter Effects
Grayscale, blur, hue, sepia, duotone and glow filters for photos, logos, icons and text.
1Blur Focus
Put it on a row of cards or images: the hovered item stays sharp while its siblings blur and fade. Class: fx-blur-focus
<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-blur-focus d-flex gap-2">
<img src="https://images.unsplash.com/photo-1531545514256-b1400bc00f31?auto=format&fit=crop&w=800&h=800&q=70" alt="First gallery item" class="rounded-3 object-fit-cover" style="width:82px;height:110px"><img src="https://images.unsplash.com/photo-1522202176988-66273c2fd55f?auto=format&fit=crop&w=800&h=800&q=70" alt="Second gallery item" class="rounded-3 object-fit-cover" style="width:82px;height:110px"><img src="https://images.unsplash.com/photo-1742440711276-679934f5b988?auto=format&fit=crop&w=800&h=800&q=70" alt="Third gallery item" class="rounded-3 object-fit-cover" style="width:82px;height:110px">
</div>
</div>
/* CSS (already in assets/css/effects.css) */
.fx-blur-focus > * { transition: filter .4s ease, opacity .4s ease, transform .4s ease; }
.fx-blur-focus:hover > :not(:hover) { filter: blur(3px) saturate(.6); opacity: .65; }
.fx-blur-focus > :hover { transform: translateY(-4px); }
@media (prefers-reduced-motion: reduce) {
.fx-blur-focus, .fx-blur-focus::before, .fx-blur-focus::after, .fx-blur-focus *, .fx-blur-focus *::before, .fx-blur-focus *::after { animation: none !important; transition: none !important; }
}2Hue Rotation
Continuously cycles the colours of a gradient, illustration or image through the colour wheel. Class: fx-hue-rotation
<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-hue-rotation rounded-circle" style="width:96px;height:96px;background:linear-gradient(135deg, var(--wt-primary), var(--wt-accent))">
</div>
<img src="https://images.unsplash.com/photo-1702301266409-ed1bfe210971?auto=format&fit=crop&w=1200&h=800&q=70" alt="Photo cycling through hues" class="fx-hue-rotation object-fit-cover rounded-3" style="width:150px;height:110px">
</div>
/* CSS (already in assets/css/effects.css) */
.fx-hue-rotation { animation: fx-hue-rotation-hue 8s linear infinite; }
@keyframes fx-hue-rotation-hue { to { filter: hue-rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
.fx-hue-rotation, .fx-hue-rotation::before, .fx-hue-rotation::after, .fx-hue-rotation *, .fx-hue-rotation *::before, .fx-hue-rotation *::after { animation: none !important; transition: none !important; }
}3Invert Colors
Flips an image or card to its negative on hover while hue-rotate keeps the colours recognisable. Class: fx-invert-colors
Five things we learned this year
<div class="d-flex flex-wrap align-items-center justify-content-center gap-3 p-3 h-100" style="min-height:200px">
<div class="card fx-invert-colors" style="width:12rem">
<img src="https://images.unsplash.com/photo-1690264350953-79ef8acbd562?auto=format&fit=crop&w=1200&h=800&q=70" alt="Card photo" class="card-img-top object-fit-cover" style="height:110px">
<div class="card-body py-2">
<p class="small mb-0 fw-semibold">Five things we learned this year</p>
</div>
</div>
</div>
/* CSS (already in assets/css/effects.css) */
.fx-invert-colors { transition: filter .4s ease; }
.fx-invert-colors:hover, .fx-invert-colors:focus-visible { filter: invert(1) hue-rotate(180deg); }
@media (prefers-reduced-motion: reduce) {
.fx-invert-colors, .fx-invert-colors::before, .fx-invert-colors::after, .fx-invert-colors *, .fx-invert-colors *::before, .fx-invert-colors *::after { animation: none !important; transition: none !important; }
}