INTERACTION_105CSS
Image Mask Reveal
The image uncovers behind a mask while it settles from a slow zoom.
Images / LightView
A muted loop fades over the poster image on hover. The poster visible, the video paused at 0 opacity before the trigger; playing and cross-fading the video over the poster once hover with a 120ms intent delay.
/* Hover Video Preview — A muted loop fades over the poster image on hover. */
.hover-video-preview {
--dur: 320ms;
--ease: cubic-bezier(0.22, 1, 0.36, 1);
--stagger: 60ms;
will-change: transform, opacity;
}
.hover-video-preview > * {
opacity: 0;
transform: translateY(14px);
animation: hover-video-preview-in var(--dur) var(--ease) forwards;
animation-delay: calc(var(--i, 0) * var(--stagger));
}
/* the poster visible, the video paused at 0 opacity -> playing and cross-fading the video over the poster */
@keyframes hover-video-preview-in {
to {
opacity: 1;
transform: none;
filter: none;
}
}
@media (prefers-reduced-motion: reduce) {
.hover-video-preview > * {
opacity: 1;
transform: none;
animation: none;
}
}import { useEffect, useRef } from "react";
/** Hover Video Preview — trigger: hover with a 120ms intent delay */
export function HoverVideoPreview({ 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="hover-video-preview" data-state="out">
{children}
</div>
);
}The image uncovers behind a mask while it settles from a slow zoom.
The image drifts slower than the frame that contains it.
The image magnifies around the exact pointer position.
A gallery track slides sideways while images uncover in turn.