QiblaCompass
A visual compass component that displays the Qibla direction (direction to the Kaaba in Mecca).Props
The bearing angle in degrees (0-360) pointing to the Qibla direction
The size of the compass in pixels (both width and height)
Usage
Features
- Static compass rose with cardinal direction (North) marked
- Rotating Kaaba icon pointing to the Qibla direction
- Smooth rotation animations
- Customizable size
- Responsive to bearing changes
The compass uses the
Compass icon from Lucide Svelte and applies CSS transforms to rotate the Kaaba indicator to the calculated bearing angle.Lightswitch
A theme toggle switch component for switching between light and dark modes.Props
This component does not accept props. It internally manages the theme state using themodeLightSwitch store.
Usage
Features
- Automatically syncs with the
modeLightSwitchstore - Persists theme preference to local storage
- Updates the
data-modeattribute on the document root - Uses Skeleton UI’s
Switchcomponent - Smooth toggle animations
State Management
The component reads and writes tomodeLightSwitch.state.mode, which can be:
"light"- Light theme"dark"- Dark theme
- Updates the store value
- Sets
document.documentElement.setAttribute('data-mode', mode) - Automatically saves to persistent storage
OnboardingWizard
An interactive multi-step wizard that guides new users through initial setup.Props
An instance of the
OnboardingManager class that controls the wizard stateUsage
Features
The wizard guides users through three steps:Step 1: Location Setup
- OpenStreetMap search field with debouncing
- Automatic selection of the first search result
- Displays selected location with coordinates
- Shows error messages for failed searches
Step 2: Calculation Method
- Dropdown selection of 12 calculation methods
- Helpful tip about being able to change later
- Syncs with
calculationSettingsstore
Step 3: Notifications
- “Enable all prayer alerts” checkbox for bulk enable
- Individual checkboxes for each prayer (Fajr, Dhuhr, Asr, Maghrib, Isha)
- Automatic notification permission request
- Syncs with
selectedAlertstore
Visual Design
- Full-screen overlay with backdrop blur
- Card-based layout (max-width: 36rem)
- Progress indicator dots showing current step
- Back/Next/Finish buttons with appropriate states
- Fade transitions between steps
- Disabled states when required data is missing
The wizard automatically closes when the user clicks Finish and location data is set. The
PrayerManager.isSetupRequired derived state will become false, hiding the wizard.Component Architecture
All components follow Svelte 5’s runes-based reactivity model:- Use
$statefor local reactive variables - Use
$propsfor component props - Use
$effectfor side effects - Integrate with Tauri stores using
@tauri-store/svelte
Styling
Components use:- Tailwind CSS for utility classes
- Skeleton UI preset styles (e.g.,
preset-filled,preset-tonal) - Custom Praydo theme colors from
praydo.css - Dark mode support via
dark:modifiers