- 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.
25 lines
606 B
TypeScript
25 lines
606 B
TypeScript
"use client";
|
|
|
|
import { useReducedMotion as useFramerReducedMotion } from "framer-motion";
|
|
|
|
/**
|
|
* Hook que detecta a preferência prefers-reduced-motion do sistema operacional.
|
|
* Wrapper sobre o hook useReducedMotion do Framer Motion.
|
|
*
|
|
* @returns {boolean} true se prefers-reduced-motion está ativo, false caso contrário
|
|
*
|
|
* @example
|
|
* ```tsx
|
|
* const reducedMotion = useReducedMotion();
|
|
*
|
|
* return (
|
|
* <motion.div
|
|
* animate={{ opacity: 1, y: reducedMotion ? 0 : 20 }}
|
|
* />
|
|
* );
|
|
* ```
|
|
*/
|
|
export function useReducedMotion(): boolean {
|
|
return useFramerReducedMotion() ?? false;
|
|
}
|