From 4def05d0ef06f7014a98fb94d75fd0c2feb3b304 Mon Sep 17 00:00:00 2001 From: Hermes Bot Date: Thu, 6 Aug 2026 11:25:13 +0800 Subject: [PATCH] Phase 1: Prayer times, Qibla, Quran, Hijri, Tasbih, 99 Names PWA --- package.json | 20 ++++ public/favicon.svg | 10 ++ src/App.svelte | 148 +++++++++++++++++++++++++++ src/app.html | 14 +++ src/lib/Hijri.svelte | 80 +++++++++++++++ src/lib/Names99.svelte | 199 +++++++++++++++++++++++++++++++++++++ src/lib/PrayerTimes.svelte | 165 ++++++++++++++++++++++++++++++ src/lib/Qibla.svelte | 110 ++++++++++++++++++++ src/lib/Quran.svelte | 143 ++++++++++++++++++++++++++ src/lib/Tasbih.svelte | 105 +++++++++++++++++++ src/main.js | 4 + svelte.config.js | 2 + vite.config.js | 35 +++++++ 13 files changed, 1035 insertions(+) create mode 100644 package.json create mode 100644 public/favicon.svg create mode 100644 src/App.svelte create mode 100644 src/app.html create mode 100644 src/lib/Hijri.svelte create mode 100644 src/lib/Names99.svelte create mode 100644 src/lib/PrayerTimes.svelte create mode 100644 src/lib/Qibla.svelte create mode 100644 src/lib/Quran.svelte create mode 100644 src/lib/Tasbih.svelte create mode 100644 src/main.js create mode 100644 svelte.config.js create mode 100644 vite.config.js diff --git a/package.json b/package.json new file mode 100644 index 0000000..36a8f8a --- /dev/null +++ b/package.json @@ -0,0 +1,20 @@ +{ + "name": "muslimpro-clone-phase1", + "private": true, + "version": "0.1.0", + "type": "module", + "scripts": { + "dev": "vite dev", + "build": "vite build", + "preview": "vite preview" + }, + "devDependencies": { + "@sveltejs/vite-plugin-svelte": "^5.0.3", + "svelte": "^5.20.0", + "vite": "^6.2.0" + }, + "dependencies": { + "@vitejs/plugin-pwa": "^0.21.0", + "workbox-precaching": "^7.3.0" + } +} diff --git a/public/favicon.svg b/public/favicon.svg new file mode 100644 index 0000000..f87e929 --- /dev/null +++ b/public/favicon.svg @@ -0,0 +1,10 @@ + + + + + + + + + ู† + diff --git a/src/App.svelte b/src/App.svelte new file mode 100644 index 0000000..c67b688 --- /dev/null +++ b/src/App.svelte @@ -0,0 +1,148 @@ + + + + +
+
+

Nลซr

+ Muslim Companion +
+ + + +
+ {#if activeTab === 0} + + {:else if activeTab === 1} + + {:else if activeTab === 2} + + {:else if activeTab === 3} + + {:else if activeTab === 4} + + {:else if activeTab === 5} + + {/if} +
+
+ + diff --git a/src/app.html b/src/app.html new file mode 100644 index 0000000..f8358f9 --- /dev/null +++ b/src/app.html @@ -0,0 +1,14 @@ + + + + + + + + Nลซr โ€” Muslim Companion + + + +
+ + diff --git a/src/lib/Hijri.svelte b/src/lib/Hijri.svelte new file mode 100644 index 0000000..95d7e97 --- /dev/null +++ b/src/lib/Hijri.svelte @@ -0,0 +1,80 @@ + + +
+

๐Ÿ“… Hijri Calendar

+ + {#if loading} +

โณ Loadingโ€ฆ

+ {:else if hijriDate} +
+
+ {hijriDate.day} + {hijriDate.month.en} + {hijriDate.year} AH +
+
+ Gregorian: {gregorian} +
+
+
Weekday{hijriDate.weekday.en}
+
Month #{hijriDate.month.number}
+
Days in month{hijriDate.month.days}
+
Designation{hijriDate.designation.expanded}
+
+
+ {/if} +
+ + diff --git a/src/lib/Names99.svelte b/src/lib/Names99.svelte new file mode 100644 index 0000000..06fcfc1 --- /dev/null +++ b/src/lib/Names99.svelte @@ -0,0 +1,199 @@ + + +
+

๐Ÿ’š 99 Names of Allah

+ + + +
+ {#each filtered as n} + + {/each} +
+
+ + diff --git a/src/lib/PrayerTimes.svelte b/src/lib/PrayerTimes.svelte new file mode 100644 index 0000000..7839e3d --- /dev/null +++ b/src/lib/PrayerTimes.svelte @@ -0,0 +1,165 @@ + + +
+

๐Ÿ•Œ Prayer Times

+ + {#if geoLoading} +

๐Ÿ“ Getting locationโ€ฆ

+ {:else if loading} +

โณ Loading prayer timesโ€ฆ

+ {:else if error} +

{error}

+ + {:else if prayers} + {#if nextPrayer} +
+ Next: {nextPrayer.name} + {nextPrayer.time} +
+ {/if} + +
+ {#each ['Fajr', 'Sunrise', 'Dhuhr', 'Asr', 'Maghrib', 'Isha'] as name} +
+ {name} + {prayers[name]} +
+ {/each} +
+ +
+ + +
+ {/if} +
+ + diff --git a/src/lib/Qibla.svelte b/src/lib/Qibla.svelte new file mode 100644 index 0000000..d0bb283 --- /dev/null +++ b/src/lib/Qibla.svelte @@ -0,0 +1,110 @@ + + +
+

๐Ÿงญ Qibla Finder

+ + {#if loading} +

๐Ÿ“ Getting locationโ€ฆ

+ {:else if error} +

{error}

+ {:else} +
+
+
+ + + +
+
+
+ {Math.round(bearing)}ยฐ + from North +
+

{deviceAlpha === 0 ? '๐Ÿ—บ๏ธ Move your device to calibrate compass' : 'โ†—๏ธ Point the needle towards the Kaaba'}

+
+ {/if} +
+ + diff --git a/src/lib/Quran.svelte b/src/lib/Quran.svelte new file mode 100644 index 0000000..08fe843 --- /dev/null +++ b/src/lib/Quran.svelte @@ -0,0 +1,143 @@ + + +
+

๐Ÿ“– Holy Quran

+ + {#if loading} +

โณ Loadingโ€ฆ

+ {:else if error} +

{error}

+ {:else if selectedSurah} +
+ +

{selectedSurah.name} ({selectedSurah.english})

+ {selectedSurah.type} +
+
+ {#each ayahs as ayah} +
+ {ayah.numberInSurah} +

{ayah.text}

+
+ {/each} +
+ {:else} +
+ {#each surahs as s} + + {/each} +
+ {/if} +
+ + diff --git a/src/lib/Tasbih.svelte b/src/lib/Tasbih.svelte new file mode 100644 index 0000000..a469fb5 --- /dev/null +++ b/src/lib/Tasbih.svelte @@ -0,0 +1,105 @@ + + +
+

๐Ÿ“ฟ Tasbih Counter

+ +
+
+ + + + {count} + / {target} + +
+ +
+ Total today: + {total} +
+ +
+
+ + +
+ +
+ +

๐Ÿ‘† Tap the circle or press Space to count

+
+
+ + diff --git a/src/main.js b/src/main.js new file mode 100644 index 0000000..4dc6745 --- /dev/null +++ b/src/main.js @@ -0,0 +1,4 @@ +import App from './App.svelte'; +import { mount } from 'svelte'; +const app = mount(App, { target: document.getElementById('app') }); +export default app; diff --git a/svelte.config.js b/svelte.config.js new file mode 100644 index 0000000..0378127 --- /dev/null +++ b/svelte.config.js @@ -0,0 +1,2 @@ +import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'; +export default { preprocess: vitePreprocess() }; diff --git a/vite.config.js b/vite.config.js new file mode 100644 index 0000000..f9f9e02 --- /dev/null +++ b/vite.config.js @@ -0,0 +1,35 @@ +import { defineConfig } from 'vite'; +import { svelte } from '@sveltejs/vite-plugin-svelte'; +import { VitePWA } from '@vitejs/plugin-pwa'; + +export default defineConfig({ + plugins: [ + svelte(), + VitePWA({ + registerType: 'autoUpdate', + manifest: { + name: 'Nลซr โ€” Muslim Companion', + short_name: 'Nลซr', + description: 'Prayer times, Quran, Qibla, and more โ€” your daily Islamic companion', + theme_color: '#0f766e', + background_color: '#f0fdfa', + display: 'standalone', + orientation: 'portrait-primary', + icons: [ + { src: '/icon-192.png', sizes: '192x192', type: 'image/png' }, + { src: '/icon-512.png', sizes: '512x512', type: 'image/png' } + ] + }, + workbox: { + globPatterns: ['**/*.{js,css,html,svg,png,woff2}'], + runtimeCaching: [ + { + urlPattern: /^https:\/\/api\.alquran\.cloud\/.*/i, + handler: 'StaleWhileRevalidate', + options: { cacheName: 'quran-api', expiration: { maxEntries: 50, maxAgeSeconds: 86400 * 7 } } + } + ] + } + }) + ] +});