EventHeaderSection
The EventHeaderSection component displays a full-width hero section for FiNAN events with a background image, countdown timer, event details, and call-to-action buttons. It integrates with the RegistrationModal component to handle event registrations.
Component Type
Section titled “Component Type”Presentation Component - Displays event information with interactive elements (countdown timer and modal trigger).
Used on event pages to showcase conference details with visual appeal and urgency through the countdown timer.
Used on:
src/pages/triennial-gathering-2026.astro- Main event landing pagesrc/pages/index.astro- Homepage feature
interface Props { secondaryButtonText: string; // Text for secondary CTA button secondaryButtonLink: string; // URL for secondary CTA button headingLevel?: 'h1' | 'h2'; // Semantic heading level (default: 'h1') subtitleSize?: 'md:text-xl' | 'md:text-2xl'; // Responsive subtitle size countdownSize?: 'lg:text-4xl' | 'lg:text-5xl'; // Responsive countdown size id?: string; // Section ID for anchor links (default: 'triennial-gathering-2026')}Prop Details
Section titled “Prop Details”| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
secondaryButtonText | string | ✅ Yes | - | Label for the secondary button (e.g., “View Schedule”) |
secondaryButtonLink | string | ✅ Yes | - | URL destination for secondary button |
headingLevel | 'h1' | 'h2' | No | 'h1' | Controls semantic heading level for SEO |
subtitleSize | 'md:text-xl' | 'md:text-2xl' | No | 'md:text-2xl' | Tailwind class for responsive subtitle sizing |
countdownSize | 'lg:text-4xl' | 'lg:text-5xl' | No | 'lg:text-5xl' | Tailwind class for responsive countdown sizing |
id | string | No | 'triennial-gathering-2026' | HTML ID for section (enables anchor linking) |
Code Example
Section titled “Code Example”Basic Usage
Section titled “Basic Usage”---import EventHeaderSection from '@/components/EventHeaderSection.astro';---
<EventHeaderSection secondaryButtonText="View Schedule" secondaryButtonLink="/schedule"/>With Custom Sizing
Section titled “With Custom Sizing”---import EventHeaderSection from '@/components/EventHeaderSection.astro';---
<EventHeaderSection secondaryButtonText="Learn More" secondaryButtonLink="/about-event" headingLevel="h2" subtitleSize="md:text-xl" countdownSize="lg:text-4xl" id="event-2026"/>Component Structure
Section titled “Component Structure”The component consists of several key sections:
- Background Image - Full-width optimized image (Northern Lights over Reykjavik)
- Conference Label - Small descriptor text (“FiNAN Conference”)
- Main Title - Event name (h1 or h2: “Triennial Gathering 2026”)
- Subtitle - Event theme (“Amplifying Voices…”)
- Date & Location - Icon + text display for event details
- Countdown Timer - Real-time countdown to event date (March 30, 2026)
- CTA Buttons - Registration (modal trigger) + secondary action
Interactive Features
Section titled “Interactive Features”1. Countdown Timer
Section titled “1. Countdown Timer”The component includes a live countdown timer that:
- Counts down to March 30, 2026 (hardcoded for 2026 Triennial Gathering)
- Updates every second with days, hours, minutes, and seconds
- Displays
00:00:00:00after the event date passes - Automatically cleans up on navigation (Astro view transitions support)
2. Registration Modal Integration
Section titled “2. Registration Modal Integration”The primary “Register Now” button triggers the RegistrationModal component:
- Uses
data-modal-trigger="registration-modal"attribute - Calls the modal’s exposed
_openModal()method - Includes comprehensive error handling and logging
- Works with Astro view transitions
Image Optimization
Section titled “Image Optimization”The background image uses Astro’s optimized Image component:
<Image src={bannerImage} alt="Northern Lights over Reykjavik, Iceland" loading="lazy" format="webp" quality={65} width={1920} height={1080}/>Image source: src/assets/images/events/banner-triennial-gathering-2026.jpg
Responsive Design
Section titled “Responsive Design”The component is fully responsive with breakpoints:
- Mobile (< 768px): Single column, smaller text, stacked buttons
- Tablet (768px - 1024px): Larger text, horizontal layout for date/location
- Desktop (> 1024px): Maximum text sizes, full-width background
Key responsive features:
- Countdown timer maintains readability at all sizes
- Buttons switch from full-width to auto-width on larger screens
- Subtitle and countdown sizes can be customized via props
JavaScript Lifecycle
Section titled “JavaScript Lifecycle”The component manages two interactive features with proper cleanup:
Initialization
Section titled “Initialization”// Runs on:document.addEventListener('astro:page-load', initCountdown);document.addEventListener('DOMContentLoaded', initCountdown);Cleanup
Section titled “Cleanup”// Runs before navigation:document.addEventListener('astro:before-swap', () => { clearInterval(countdownIntervalId); // Stop countdown modalTriggerController.abort(); // Remove event listeners});This pattern ensures no memory leaks during navigation in Astro’s SPA mode.
Error Handling
Section titled “Error Handling”The component includes comprehensive error handling:
-
Countdown Timer
- Validates all DOM elements exist before updating
- Logs clear error messages if elements are missing
- Gracefully handles calculation errors
-
Modal Integration
- Checks for trigger button existence
- Verifies modal element is present
- Confirms
_openModal()method is available - Provides actionable error messages
Styling
Section titled “Styling”Uses Tailwind CSS with the following patterns:
- Background overlay:
bg-gray-900/70(70% opacity dark overlay) - Text hierarchy: White text with gray variants for secondary info
- Buttons:
- Primary: White background, gray text, shadow on hover
- Secondary: Bordered, transparent with hover background
- Countdown box: Backdrop blur with semi-transparent background
Accessibility
Section titled “Accessibility”- Semantic HTML with proper heading hierarchy
- Focus-visible ring on primary button
- Descriptive alt text for icons and images
- Keyboard-accessible modal trigger
- ARIA-friendly modal integration
Common Use Cases
Section titled “Common Use Cases”Event Landing Page
Section titled “Event Landing Page”---import EventHeaderSection from '@/components/EventHeaderSection.astro';import Layout from '@/layouts/Layout.astro';---
<Layout title="Triennial Gathering 2026"> <EventHeaderSection secondaryButtonText="View Full Schedule" secondaryButtonLink="#schedule" /> <!-- Rest of event page content --></Layout>Homepage Feature
Section titled “Homepage Feature”---import EventHeaderSection from '@/components/EventHeaderSection.astro';---
<EventHeaderSection headingLevel="h2" secondaryButtonText="Learn More" secondaryButtonLink="/triennial-gathering-2026" id="upcoming-event"/>Related Components
Section titled “Related Components”- RegistrationModal - Handles event registration form (automatically included)
- Modal - Base modal component used by RegistrationModal
- BannerTriennialGathering - Smaller announcement banner variant
Implementation Notes
Section titled “Implementation Notes”Source Code
Section titled “Source Code”File location: src/components/EventHeaderSection.astro
Key dependencies:
astro:assets- Image optimizationRegistrationModal.astro- Registration form modal- Background image:
src/assets/images/events/banner-triennial-gathering-2026.jpg
Troubleshooting
Section titled “Troubleshooting”Countdown timer not updating
Section titled “Countdown timer not updating”Issue: Timer shows 00:00:00:00 or doesn’t change
Solutions:
- Check browser console for error messages
- Verify DOM elements exist (IDs:
days,hours,minutes,seconds) - Ensure script is running (check Network tab for JS errors)
Registration modal not opening
Section titled “Registration modal not opening”Issue: Click on “Register Now” does nothing
Solutions:
- Check console for
[EventHeader]error messages - Verify
RegistrationModalcomponent is included in the page - Ensure modal has attribute
data-modal="registration-modal" - Check that modal’s
_openModal()method is available
Background image not loading
Section titled “Background image not loading”Issue: Section has no background image or shows broken image
Solutions:
- Verify image exists at
src/assets/images/events/banner-triennial-gathering-2026.jpg - Check browser Network tab for 404 errors
- Ensure Astro’s image optimization is working (run
pnpm build)