Overview
This component is built with Astro and uses theScrollAnimation wrapper for smooth entrance animations. It displays a badge, title, subtitle, call-to-action buttons, and a responsive hero image.
Source Location
Props
Main heading text displayed prominently in the hero section
Supporting text that appears below the title
Text for the primary call-to-action button
URL or anchor link for the primary CTA button
Image source for light mode
Image source for dark mode
Alt text for the hero image (accessibility)
Usage
Basic Usage
Custom Props
Features
Animation System
The Hero component usesScrollAnimation with different delays for staggered entrance effects:
- Content area: 0.2s delay with default fade-in-up animation
- Image area: 0.4s delay with scale animation
Theme-Aware Images
The component automatically switches between light and dark images based on the current theme:Secondary CTA
In addition to the primary CTA, there’s a secondary link that directs to the “about” section:Layout Structure
Responsive Behavior
- Mobile: Single column, stacked layout
- Tablet (768px+): Two-column grid with 4rem gap
- Desktop (1024px+): Two-column grid with 5rem gap
Styling Notes
- Uses CSS custom properties for colors:
--color-green-dark,--color-orange,--color-white - Font families:
--font-montserrat(titles),--font-pop(buttons),--font-sans(body text) - Hover effects on CTAs include
translateY(-2px)and custom shadows - Image has 4:3 aspect ratio with rounded corners (1rem border-radius)
Dependencies
ScrollAnimation.jsx- Animation wrapper component- Framer Motion (via ScrollAnimation)
- CSS custom properties defined in global styles