import { EASE_OUT_CSS } from "@/lib/ease"; import { cn } from "@/lib/utils"; export type ScrollHintVariant = "mouse" | "chevron"; export interface ScrollHintProps { /** Which glyph to render. */ variant?: ScrollHintVariant; className?: string; /** Optional caption under the glyph, e.g. "Scroll". */ label?: string; } /** * A quiet "there's more below" cue for the foot of a hero section. Two * glyphs, both pure CSS loops: a mouse shell with a dot that falls and fades, * or a pair of chevrons pulsing downward out of step with each other. * `motion-reduce:` freezes the loop and leaves the glyph sitting still. */ export function ScrollHint({ variant = "mouse", className, label, }: ScrollHintProps) { return ( <>
{variant === "mouse" && } {variant === "chevron" && } {label && ( {label} )}
); } const KEYFRAMES = ` @keyframes uilab-scroll-hint-dot { 0% { transform: translateY(0); opacity: 0; } 20% { opacity: 1; } 60% { opacity: 1; } 100% { transform: translateY(10px); opacity: 0; } } @keyframes uilab-scroll-hint-chevron { 0%, 100% { opacity: 0.3; transform: translateY(-2px); } 50% { opacity: 1; transform: translateY(2px); } } `; function MouseGlyph() { return ( ); } function ChevronGlyph() { return ( ); }