Overview
The Hero component is the main landing section of the portfolio, featuring an animated background with floating blobs, a profile image with rotating gradient border, introduction text, and call-to-action buttons.Source Location
/src/components/Hero.astro
Features
- Animated background gradient blobs with
animate-floateffects - Profile image with rotating gradient border animation
- Responsive two-column layout (image + text)
- Multilingual support (English/Spanish)
- Call-to-action buttons (Contact & Download CV)
- Scroll indicator with bounce animation
- Status badge showing current role
Props
This component doesn’t accept props. It retrieves data from:- Language detection: Uses
getLangFromUrl(Astro.url)to detect current language - Translations: Uses
useTranslations(lang)for all text content - Profile image: Imports from
../assets/imgProfile.png
Structure
Main Elements
- Animated Background Blobs - Three positioned divs with blur and animation
- Text Content - Left column with greeting, name, role, bio, and CTAs
- Profile Photo - Right column with bordered, animated image
- Scroll Indicator - Bottom-centered bounce animation
Code Example
Translation Keys
The component uses these translation keys (fromuseTranslations):
Greeting text (e.g., “Hello, I’m”)
Full name display
Current job role
Biography paragraph
Contact button text
Download CV button text
Styling Details
Animated Background
- Three blobs positioned absolutely
- Uses
blur-2xlfor soft edges - Custom animations:
animate-float,animate-float-delayed,animate-pulse-slow - Performance optimized with
will-changeandcontainproperties
Profile Image Border
- Rotating gradient border using
animate-border-spin - Layered approach: blur layer + solid layer + content
- Image optimized with Astro’s
Imagecomponent (WebP, quality 80)
CTA Buttons
Primary Button (Contact):Responsive Behavior
- Mobile: Single column, image above text, smaller profile photo (w-48 h-48)
- Desktop: Two-column flex layout, larger profile photo (w-64 h-64)
- Text alignment: Center on mobile, left-aligned on desktop
Accessibility
aria-labelon CTA buttons for screen readers- Proper heading hierarchy (h1 for name)
loading="eager"on profile image for faster LCP- Keyboard-accessible buttons and links
Performance Optimizations
will-change: transform, opacityon animated elementscontain: layout paint stylefor better paint performance- WebP image format with optimized quality (80)
- Minimal layout shifts with fixed dimensions
Customization
Changing Colors
Update the gradient colors in the background blobs:CV Download Path
The CV path is language-specific:/public/cv/en/ and /public/cv/es/ directories.
Related Components
- Navbar - Contains navigation to Hero section
- ThemeToggle - Controls dark mode styles
- LanguageSelector - Switches translation language