Core Components
Player
The main audio player component that handles playback, controls, and state management. Location:src/components/player.tsx:27
Array of playlist items containing surah information and audio links
- Audio playback with play/pause controls
- Shuffle and repeat modes
- Volume control
- Playback speed adjustment
- Fullscreen mode
- Media session integration
- Sleep timer
ReciterSelector
A button-style component for selecting reciters with search, favorite, and share functionality. Location:src/components/reciter-selector.tsx:18
Props: None (uses global state)
Features:
- Displays selected reciter name
- Opens reciter selection dialog
- Favorite/unfavorite functionality
- Share reciter via Web Share API or clipboard
- Skeleton loading state during SSR
Playlist
Displays a scrollable list of playlist items (surahs) with click handlers. Location:src/components/playlist.tsx:16
Function to control dialog open/close state
Function to set the currently playing track index
TrackInfo
Displays information about the currently playing track including surah name and timestamps. Location:src/components/track-info.tsx:17
Index of the currently playing track
Total duration of the track in seconds
Current playback position in seconds
AudioBarsVisualizer
Audio spectrum visualizer that displays animated bars during playback. Location:src/components/audio-bars-visualizer.tsx:14
DOM ID of the audio element to visualize
Whether audio is currently playing
- Responsive width calculation
- Only renders when visualizer is enabled (global state)
- Smooth animations
- Blue color scheme matching brand
Range
Custom range slider for seeking through audio tracks. Location:src/components/range.tsx:12
Current playback position in seconds
Total track duration in seconds
Callback to update current time
Reference to the audio element
- RTL support (direction-aware gradient)
- Smooth gradient fill showing progress
- Custom thumb styling
- Synchronized with audio element
UI Components
Dialog
Reusable modal dialog component with backdrop and animations. Location:src/components/dialog.tsx:14
Controls dialog visibility
Function to update open state
Dialog content
Hide the close button in top-right corner
Additional CSS classes for customization
- Native
<dialog>element - Backdrop click to close
- ESC key to close
- Slide-in animation
- Scrollable content
Tooltip
Simple tooltip that appears on hover. Location:src/components/tooltip.tsx:13
Tooltip text to display
Element to attach tooltip to
Additional CSS classes
PlayerControls
Comprehensive player control panel with play/pause, navigation, volume, and advanced features. Location:src/components/player-controls.tsx:53
Current playback state
Toggle play/pause callback
Skip to next track callback
Skip to previous track callback
Toggle playlist dialog callback
Ref for volume control container (click-outside detection)
- Responsive layout (mobile vs desktop)
- Volume slider with mute
- Playback speed control (1x, 1.5x, 2x)
- Shuffle and repeat modes
- Fullscreen toggle
- Sleep timer with presets
- Audio visualizer toggle
- Playlist access
- Internationalized labels
LanguageSwitcher
Toggle component to switch between Arabic and English interface languages. Location:src/components/language-switcher.tsx:7
Props: None (reads/writes to localeAtom)
Features:
- Fixed position (top-right corner)
- Animated sliding indicator
- Toggles between ‘ar’ (Arabic) and ‘en’ (English)
- Updates global locale state via Jotai
- Accessible with ARIA labels
- Responsive sizing (smaller on mobile)
PWAUpdater
Dialog that prompts users to reload when a new service worker version is available. Location:src/components/pwa-updater.tsx:7
Props: None (manages internal state)
Features:
- Listens for service worker
waitingevent - Shows update dialog automatically
- Reloads page when user confirms
- Skips waiting and activates new service worker
- Essential for PWA update flow
Footer
Application footer with navigation links to main pages. Location:src/components/footer.tsx:16
Props: None
Features:
- Fixed at bottom on mobile, static on desktop
- Links to: Home, About, Privacy, Contact
- SVG icons for each link
- Internationalized labels
- Clears selected reciter when navigating home
- Responsive layout (icon-only on mobile, icon+text on desktop)