- Introduced DrawLine component for drawing animations. - Added LazyRevealImage component for lazy loading images with reveal animations. - Implemented TextDiffuseReveal for animated text reveals with staggered effects. - Created TopProgressBar for a dynamic loading indicator. - Added PointCloud mock for testing animations. - Developed useReducedMotion hook to handle user preferences for reduced motion. - Centralized animation configurations in config.ts for easier management. - Defined animation variants in variants.ts for consistent animation effects. - Established AnimationProvider to supply global animation settings. - Created tests for AnimationProvider and useReducedMotion hook. - Added SVG assets for branding and UI elements. - Documented frontend review plan and hero circuit board animation plan.
41 lines
1.1 KiB
TypeScript
41 lines
1.1 KiB
TypeScript
"use client";
|
|
|
|
import { motion, useReducedMotion } from "framer-motion";
|
|
|
|
interface TopProgressBarProps {
|
|
className?: string;
|
|
}
|
|
|
|
export function TopProgressBar({
|
|
className = "",
|
|
}: Readonly<TopProgressBarProps>) {
|
|
const shouldReduceMotion = useReducedMotion();
|
|
|
|
return (
|
|
<div
|
|
className={`pointer-events-none fixed inset-x-0 top-0 z-[120] h-[2px] overflow-hidden bg-white/10 ${className}`.trim()}
|
|
aria-hidden="true"
|
|
>
|
|
<motion.div
|
|
className="h-full w-1/3 bg-[var(--slash)] shadow-[0_0_12px_rgba(204,255,0,0.85)]"
|
|
initial={shouldReduceMotion ? { opacity: 1, x: "0%" } : { x: "-120%" }}
|
|
animate={
|
|
shouldReduceMotion
|
|
? { opacity: 1, x: "0%" }
|
|
: { x: ["-120%", "15%", "45%", "110%"] }
|
|
}
|
|
transition={
|
|
shouldReduceMotion
|
|
? { duration: 0 }
|
|
: {
|
|
duration: 1.5,
|
|
ease: [0.16, 1, 0.3, 1],
|
|
repeat: Number.POSITIVE_INFINITY,
|
|
repeatDelay: 0.1,
|
|
}
|
|
}
|
|
/>
|
|
</div>
|
|
);
|
|
}
|