diff --git a/app/globals.css b/app/globals.css index 11423b830..7498e076b 100644 --- a/app/globals.css +++ b/app/globals.css @@ -87,3 +87,35 @@ } } /* trigger rebuild */ + +@layer utilities { + @keyframes hero-fade-in-up { + from { + opacity: 0; + transform: translateY(30px); + } + to { + opacity: 1; + transform: translateY(0); + } + } + + .animate-hero-fade-in-up { + animation: hero-fade-in-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards; + } +} + +@layer utilities { + @keyframes hero-zoom-out { + from { + transform: scale(1.05); + } + to { + transform: scale(1); + } + } + + .animate-hero-zoom-out { + animation: hero-zoom-out 1.5s ease-out forwards; + } +} diff --git a/components/blocks/HeroSection.tsx b/components/blocks/HeroSection.tsx index e3ec92c5e..d8061187d 100644 --- a/components/blocks/HeroSection.tsx +++ b/components/blocks/HeroSection.tsx @@ -3,7 +3,6 @@ import React from 'react'; import Image from 'next/image'; import { usePathname } from 'next/navigation'; -import { m } from 'framer-motion'; import { Badge, Container, Heading } from '@/components/ui'; import { Button } from '@/components/ui/Button'; @@ -17,25 +16,7 @@ export interface HeroSectionProps { ctaHref?: string; } -const containerVariants = { - hidden: { opacity: 0 }, - visible: { - opacity: 1, - transition: { - staggerChildren: 0.15, - delayChildren: 0.1, - }, - }, -}; - -const itemVariants = { - hidden: { opacity: 0, y: 30 }, - visible: { - opacity: 1, - y: 0, - transition: { duration: 0.8, ease: [0.16, 1, 0.3, 1] as const } - }, -}; +// CSS animations replace Framer Motion for better LCP export const HeroSection: React.FC = (props) => { const { title, badge, subtitle, backgroundImage, alignment, ctaLabel, ctaHref } = props; @@ -47,12 +28,9 @@ export const HeroSection: React.FC = (props) => { className={`relative min-h-[35vh] md:min-h-[50vh] flex items-center pt-28 pb-10 md:pt-36 md:pb-24 overflow-hidden bg-neutral-dark ${alignment === 'center' ? 'justify-center text-center' : ''}`} > {bgSrc && ( - = (props) => { {/* Top Fade for Header Navigation Readability */}
- +
)} - {badge && ( - +
{badge} - +
)} - - - {title} - - +
+ + {title} + +
{subtitle && ( - +

{subtitle}

- +
)} {ctaLabel && ctaHref && ( - +
- +
)} -
+
);