INTERACTION_096CSS
Glass Reflection Card
A soft reflection sweeps across the glass surface on hover.
Cards / LightView
A key card breathes gently above the grid to signal importance. At rest with a soft shadow before the trigger; translating 6px up and back with a matching shadow shift once in view, looping every 6 seconds.
/* Floating Feature Card — A key card breathes gently above the grid to signal importance. */
.floating-feature-card {
--dur: 6s;
--ease: ease-in-out;
--stagger: 60ms;
will-change: transform, opacity;
}
.floating-feature-card > * {
opacity: 0;
transform: translateY(14px);
animation: floating-feature-card-in var(--dur) var(--ease) forwards;
animation-delay: calc(var(--i, 0) * var(--stagger));
}
/* at rest with a soft shadow -> translating 6px up and back with a matching shadow shift */
@keyframes floating-feature-card-in {
to {
opacity: 1;
transform: none;
filter: none;
}
}
@media (prefers-reduced-motion: reduce) {
.floating-feature-card > * {
opacity: 1;
transform: none;
animation: none;
}
}import { useEffect, useRef } from "react";
/** Floating Feature Card — trigger: in view, looping every 6 seconds */
export function FloatingFeatureCard({ 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="floating-feature-card" data-state="out">
{children}
</div>
);
}A soft reflection sweeps across the glass surface on hover.
The image uncovers from behind the card copy on hover.
The recommended plan lifts, brightens and holds a moving border.