Hero: replace particle field with cobe globe (Capricorn view, multi-axis drag, reduced-motion safe), telemetry HUD with pointer parallax, particle text build effect, Space Grotesk display font. SEO: short titles with template, PT-BR accents, twitter cards on dynamic cases, escaped JSON-LD via lib/jsonld.ts, CSP report-only, 25 service FAQs answer-first. Design: fix TW4 layered reset killing spacing utilities, literal @theme tokens, mobile hero overflow, header overlap, empty case cards. Remove framer-motion (unified on motion/react), header version badge, phone number from hero CTA. Production build verified (24 static pages).
32 lines
816 B
TypeScript
32 lines
816 B
TypeScript
"use client";
|
|
|
|
import { useReducedMotion as useFramerReducedMotion } from "motion/react";
|
|
import { useEffect, useState } from "react";
|
|
/**
|
|
* 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 {
|
|
const systemPreference = useFramerReducedMotion();
|
|
const [isMounted, setIsMounted] = useState(false);
|
|
|
|
useEffect(() => {
|
|
setIsMounted(true);
|
|
}, []);
|
|
|
|
return isMounted && systemPreference === true;
|
|
}
|