Overview
The Header component serves as the hero section of your pages. It displays the Velaria logo with animated fade-up effects, along with a customizable title and subtitle. The component features a dark overlay for enhanced text readability and is fully responsive.Component code
Props
The main heading text displayed in the header. Shows as a large, bold title below the logo.
The subtitle text displayed below the title. Used for additional descriptive information.
Usage example
Styling details
Layout and positioning
Layout and positioning
The header uses flexbox to center content both horizontally and vertically. It includes:
- Full-width container with centered content
- Absolute-positioned overlay with semi-transparent black background (10% opacity)
- Relative-positioned content layer with z-index 10 to appear above the overlay
Typography
Typography
- Title (h1): 2.5rem font size with 700 weight, white color
- Subtitle (p): 1.8rem font size with text shadow for readability
- Both elements use white text color for contrast against the overlay
Animations
Animations
The component uses Tailwind CSS animation utilities:
- Logo:
animate-fade-upwith 400ms delay and 1000ms duration - Title:
animate-fade-upwith 500ms delay - Subtitle:
animate-fade-upwith 600ms delay
Responsive behavior
Responsive behavior
On mobile devices (max-width: 720px):
- Title font size reduces to 1.5rem
- Subtitle font size reduces to 1rem
- Subtitle gains 1.5rem padding for better spacing
The logo image is loaded with
loading="eager" to ensure immediate visibility on page load, which is important for above-the-fold content.Dependencies
- astro:assets: Used for the
Imagecomponent to optimize image loading - Tailwind CSS: Animation utilities for fade-up effects
- Vercel Blob Storage: Hosts the Velaria logo image
