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).
62 lines
1.5 KiB
TypeScript
62 lines
1.5 KiB
TypeScript
"use client";
|
|
|
|
import { motion } from "motion/react";
|
|
import Image, { type StaticImageData } from "next/image";
|
|
import { useState } from "react";
|
|
import { useReducedMotion } from "@/app/hooks/useReducedMotion";
|
|
|
|
interface LazyRevealImageProps {
|
|
src: string | StaticImageData;
|
|
alt: string;
|
|
className?: string;
|
|
imageClassName?: string;
|
|
sizes?: string;
|
|
}
|
|
|
|
export function LazyRevealImage({
|
|
src,
|
|
alt,
|
|
className = "",
|
|
imageClassName = "object-cover",
|
|
sizes = "(max-width: 1024px) 100vw, 50vw",
|
|
}: Readonly<LazyRevealImageProps>) {
|
|
const shouldReduceMotion = useReducedMotion();
|
|
const [loaded, setLoaded] = useState(false);
|
|
|
|
return (
|
|
<motion.div
|
|
className={`relative ${className}`.trim()}
|
|
initial={
|
|
shouldReduceMotion ? { opacity: 0 } : { opacity: 0, y: 20, scale: 1.02 }
|
|
}
|
|
animate={
|
|
loaded
|
|
? shouldReduceMotion
|
|
? { opacity: 1 }
|
|
: { opacity: 1, y: 0, scale: 1 }
|
|
: shouldReduceMotion
|
|
? { opacity: 0 }
|
|
: { opacity: 0, y: 20, scale: 1.02 }
|
|
}
|
|
transition={{
|
|
duration: shouldReduceMotion ? 0.25 : 0.75,
|
|
ease: [0.16, 1, 0.3, 1],
|
|
}}
|
|
style={{
|
|
willChange: !shouldReduceMotion ? "transform, opacity" : undefined,
|
|
}}
|
|
>
|
|
<Image
|
|
src={src}
|
|
alt={alt}
|
|
fill
|
|
loading="lazy"
|
|
sizes={sizes}
|
|
placeholder={typeof src === "string" ? "empty" : "blur"}
|
|
onLoad={() => setLoaded(true)}
|
|
className={imageClassName}
|
|
/>
|
|
</motion.div>
|
|
);
|
|
}
|