INTERACTION_115CSS
Layered Image Depth
Foreground, subject and background layers move at different rates.
Images / LightView
The image arrives with a letterbox open and a slow push-in. Letterbox bars closed over the image, scaled to 1.08 before the trigger; opening the bars while the image eases back to scale 1 once page load after fonts are ready.
/* Cinematic Image Entrance — The image arrives with a letterbox open and a slow push-in. */
.cinematic-image-entrance {
--dur: 1.2s;
--ease: cubic-bezier(0.22, 1, 0.36, 1);
--stagger: 60ms;
will-change: transform, opacity;
}
.cinematic-image-entrance > * {
opacity: 0;
transform: translateY(14px);
animation: cinematic-image-entrance-in var(--dur) var(--ease) forwards;
animation-delay: calc(var(--i, 0) * var(--stagger));
}
/* letterbox bars closed over the image, scaled to 1.08 -> opening the bars while the image eases back to scale 1 */
@keyframes cinematic-image-entrance-in {
to {
opacity: 1;
transform: none;
filter: none;
}
}
@media (prefers-reduced-motion: reduce) {
.cinematic-image-entrance > * {
opacity: 1;
transform: none;
animation: none;
}
}import { useEffect, useRef } from "react";
/** Cinematic Image Entrance — trigger: page load after fonts are ready */
export function CinematicImageEntrance({ 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="cinematic-image-entrance" data-state="out">
{children}
</div>
);
}Foreground, subject and background layers move at different rates.
The image uncovers behind a mask while it settles from a slow zoom.
A draggable handle wipes between two versions of an image.
The image drifts slower than the frame that contains it.