Browsing Movies
Movies are displayed in an easy-to-browse grid layout that adapts to your screen size:- Homepage: Shows all movies currently playing in Lagos
- Movies Directory (
/movies): Complete catalog of available films - Responsive Grid: 2 columns on mobile, up to 5 columns on large screens
What You See
Each movie card displays:Movie Poster
Movie Poster
High-quality poster images automatically loaded from the database. If a poster isn’t available, a placeholder icon is shown.
Movie Title
Movie Title
The film’s title with hover effects for interactivity. Clicking anywhere on the card takes you to the detailed movie page.
Duration
Duration
Runtime displayed in hours and minutes format (e.g., “2h 15m”). Implemented using the
formatDuration() utility that converts minutes to a readable format.Ratings from Multiple Sources
Ratings from Multiple Sources
- IMDb: Displayed with IMDb icon, formatted to 1 decimal place
- Metacritic: Score out of 100 with Metacritic icon
- Rotten Tomatoes: Percentage score with Tomato icon
Movie Detail Pages
Click any movie to view comprehensive details:Page Layout
The movie detail page (/movies/[id]-[slug]) features:
Left Side: Visual
- Large poster image (2:3 aspect ratio)
- Fallback emoji if no poster available
- Responsive sizing: 1/3 width on desktop, full width on mobile
- Movie title as main heading
- Release year
- Duration in readable format
- All available ratings with logos
- Full description/synopsis
Movie URLs include both the ID and a slugified version of the title for SEO-friendly URLs like
/movies/42-the-matrixShowtimes Section
Below the movie details, you’ll find:- Interactive Date Picker: Horizontal scrollable list showing available dates
- Showtimes by Cinema: Organized by cinema location
- Cinema Information: Name and location for each venue
- Time Slots: All available showtimes as clickable buttons
- Screen Types: 3D, IMAX, or other formats shown in parentheses
- Direct Booking Links: When available, click a time to go directly to the cinema’s booking page
How Movies Are Sorted
Movies are intelligently sorted to help you find what to watch:- Primary Sort: By earliest available showtime (soonest playing movies first)
- Secondary Sort: Alphabetically by title when showtimes are equal
Only movies with future showtimes are displayed. The system automatically filters out movies whose last showtime has passed using
gte('showtimes.start_time', now) in the database query.Technical Implementation
Components
Movie listings use these key components fromsrc/components/:
- MovieCard.astro: Individual movie card with poster, title, and ratings
- ShowtimesWithDatePicker.astro: Interactive date selection and showtime display
- ShowtimeList.astro: Grouped showtime presentation
Data Fetching
Movies are fetched from Supabase using:- Joins movies with their showtimes
- Filters to only future showtimes
- Sorts by earliest showtime, then alphabetically
- Returns complete movie data including ratings from multiple sources
URL Structure
Movie pages use a dual-identifier URL pattern:- ID: Numeric database identifier
- Slug: Slugified movie title (lowercase, hyphens instead of spaces)
/movies/123-dune-part-two
User Experience Features
Hover Effects
Interactive hover states provide visual feedback:- Cards scale up slightly on hover (scale-105)
- Movie titles change to accent color
- Smooth transitions for all interactions
Lazy Loading
Poster images useloading="lazy" attribute to optimize page load performance by only loading images as they come into view.
Responsive Design
The grid automatically adjusts:- Mobile: 2 columns
- Tablet: 3 columns
- Desktop: 4 columns
- Large screens: 5 columns
Finding Movies
While Showtimes NG doesn’t currently have a search feature, you can:- Scroll through the grid - Movies are sorted by earliest showtime
- Browse by date - Use the date picker on movie pages to see when it’s playing
- Check cinema pages - See what’s playing at specific venues
All movie data including ratings, posters, and descriptions are aggregated from cinema websites and enhanced with information from movie databases.