Media
INTERACTION_107CSS
Parallax Image
The image drifts slower than the frame that contains it.
Images / LightView
The image uncovers behind a mask while it settles from a slow zoom. Clipped to zero height with the image scaled to 1.12 before the trigger; opening the clip upward while the image scales back to 1 once entry into view.
/* Image Mask Reveal — The image uncovers behind a mask while it settles from a slow zoom. */
.image-mask-reveal {
--dur: 900ms;
--ease: cubic-bezier(0.22, 1, 0.36, 1);
--stagger: 60ms;
will-change: transform, opacity;
}
.image-mask-reveal > * {
opacity: 0;
transform: translateY(14px);
animation: image-mask-reveal-in var(--dur) var(--ease) forwards;
animation-delay: calc(var(--i, 0) * var(--stagger));
}
/* clipped to zero height with the image scaled to 1.12 -> opening the clip upward while the image scales back to 1 */
@keyframes image-mask-reveal-in {
to {
opacity: 1;
transform: none;
filter: none;
}
}
@media (prefers-reduced-motion: reduce) {
.image-mask-reveal > * {
opacity: 1;
transform: none;
animation: none;
}
}import { useEffect, useRef } from "react";
/** Image Mask Reveal — trigger: entry into view */
export function ImageMaskReveal({ children }: { children: React.ReactNode }) {
const ref = useRef<HTMLDivElement>(null);
useEffect(() => {
const el = ref.current;
if (!el) return;
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
el.dataset["state"] = "in";
return;
}
const io = new IntersectionObserver(
([entry]) => {
if (entry?.isIntersecting) {
el.dataset["state"] = "in";
io.unobserve(el);
}
},
{ threshold: 0.2 },
);
io.observe(el);
return () => io.disconnect();
}, []);
return (
<div ref={ref} className="image-mask-reveal" data-state="out">
{children}
</div>
);
}The image drifts slower than the frame that contains it.
A gallery track slides sideways while images uncover in turn.
The image magnifies around the exact pointer position.
Thumbnails trail the cursor and fade out behind it.