INTERACTION_082CSS
Liquid Hover Button
A rounded fill rises from the bottom edge and floods the button.
Buttons / LightView
A ripple expands from the exact press point. No ripple present before the trigger; scaling the ripple from 0 to cover the button while fading out once pointerdown on the button.
/* Ripple Click Effect — A ripple expands from the exact press point. */
.ripple-click-effect {
--dur: 620ms;
--ease: cubic-bezier(0.22, 1, 0.36, 1);
--stagger: 60ms;
will-change: transform, opacity;
}
.ripple-click-effect > * {
opacity: 0;
transform: translateY(14px);
animation: ripple-click-effect-in var(--dur) var(--ease) forwards;
animation-delay: calc(var(--i, 0) * var(--stagger));
}
/* no ripple present -> scaling the ripple from 0 to cover the button while fading out */
@keyframes ripple-click-effect-in {
to {
opacity: 1;
transform: none;
filter: none;
}
}
@media (prefers-reduced-motion: reduce) {
.ripple-click-effect > * {
opacity: 1;
transform: none;
animation: none;
}
}import { useEffect, useRef } from "react";
/** Ripple Click Effect — trigger: pointerdown on the button */
export function RippleClickEffect({ 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="ripple-click-effect" data-state="out">
{children}
</div>
);
}A rounded fill rises from the bottom edge and floods the button.
A soft glow tracks the pointer inside the button surface.
The label slides up and a duplicate takes its place.
The arrow exits right and re-enters from the left on hover.