Overview
The home page (index.astro) is the main landing page of the Lake Ozark Christian Church website. It features dynamic content personalization based on visitor location, multiple interactive sections, and comprehensive functionality including forms, maps, countdowns, and video integration.
File location: src/pages/index.astro
Key features
Server-side rendering
The page uses SSR to enable dynamic location checking:Location-based personalization
The page adapts content based on whether the visitor is local or from out of town using theisLocalVisitor() utility function.
For local visitors:
- Hero message: “There’s a place for you here.”
- Focus on community programs and after-school activities
- Encourages regular participation
- Hero message: “Plan Your Visit to Lake Ozark Christian”
- Emphasis on visitor information and directions
- Family-friendly worship details
Announcement banner
Configurable announcement banner with toggle control:Major sections
Hero section
- Full-width background image with overlay
- Typed.js animation for dynamic messaging
- Conditional content based on visitor location
- Call-to-action buttons
Visit us section
- Interactive Mapbox map with route visualization
- Dynamic distance calculation and personalized greeting
- Service time and parking information
- Accessibility details
Live service countdown
- Flip clock countdown to next service
- Uses
@pqina/fliplibrary - Dynamic title updates based on time until service
- Shows/hides based on proximity to service time
After-school program
Location-aware content: Local visitors see:- After-school program details
- Registration link
- Program schedule and features
- Children’s Church information
- Nursery care details
- Family-friendly worship options
Donation section
- Embedded
DonationFormcomponent - Tax-deductible information
- Secure payment processing details
- Alternative giving methods
Prayer request form
EmbeddedPrayerRequestForm component for visitor engagement.
Salvation stories marquee
Scrolling testimonials using theSalvationMarquee React component:
Recent services
Dynamic YouTube video integration:- Loads latest service videos
- Loading states and error handling
- Video modal for playback
Calendar section
Embedded Google Calendar showing upcoming events.Components used
Layout- Main layout wrapperPrayerRequestForm- Prayer submission formSalvationMarquee- Testimonial carouselDonationForm- Online giving form
Blog posts integration
Fetches and displays recent blog posts:Interactive features
Mapbox integration
Advanced mapping with:- Church location marker
- User location detection (browser geolocation)
- Route visualization
- Distance and time calculation
- Fallback to IP-based geolocation
- LocalStorage caching for performance
Video modal
Modal system for service video playback with:- Click-to-play functionality
- Close button
- Backdrop click to close
- Season badges for liturgical context
Toast notifications
Reusable toast system for user feedback:Performance optimizations
Image preloading
Script loading strategy
- Typed.js loaded from CDN
- Mapbox GL JS loaded asynchronously
- Flip clock loaded on-demand
Lazy loading
Images below the fold useloading="lazy".
External dependencies
- Typed.js (
v2.1.0) - Hero text animation - Mapbox GL JS (
v3.3.0) - Interactive maps - @pqina/flip - Flip clock countdown
- Stripe - Payment processing (via DonationForm)
UTM tracking
All links include UTM parameters for analytics:Configuration
Key configurable elements:Related pages
- Worship page - Service times and visitor info
- Programs page - Ministry details
- Children & Youth page - Family programs
- Giving page - Donation information