Spaces:
Running
Running
Upload 5 files
Browse files- index.html +4 -4
- quran_reader.js +19 -10
- quran_reader_registry.json +82 -7
index.html
CHANGED
|
@@ -4,7 +4,7 @@
|
|
| 4 |
<meta charset="utf-8">
|
| 5 |
<meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover">
|
| 6 |
<title></title>
|
| 7 |
-
<link rel="stylesheet" href="quran_reader.css?v=
|
| 8 |
<style>
|
| 9 |
*{box-sizing:border-box}
|
| 10 |
html,body{margin:0;min-height:100%;font-family:system-ui,-apple-system,"Noto Sans Arabic",sans-serif}
|
|
@@ -230,9 +230,9 @@ body{padding-bottom:190px}
|
|
| 230 |
<script src="personal_reminder_engine.js?v=20260929-complete1"></script>
|
| 231 |
<script src="hijri_calendar_engine.js?v=20260926-worship1"></script>
|
| 232 |
<script src="worship_event_engine.js?v=20260926-worship1"></script>
|
| 233 |
-
<script src="quran_khatma.js?v=
|
| 234 |
-
<script src="quran_audio.js?v=
|
| 235 |
-
<script src="quran_reader.js?v=
|
| 236 |
<script src="registry_app.js?v=20260929-complete1"></script>
|
| 237 |
<script>
|
| 238 |
(function () {
|
|
|
|
| 4 |
<meta charset="utf-8">
|
| 5 |
<meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover">
|
| 6 |
<title></title>
|
| 7 |
+
<link rel="stylesheet" href="quran_reader.css?v=20261001-nav2">
|
| 8 |
<style>
|
| 9 |
*{box-sizing:border-box}
|
| 10 |
html,body{margin:0;min-height:100%;font-family:system-ui,-apple-system,"Noto Sans Arabic",sans-serif}
|
|
|
|
| 230 |
<script src="personal_reminder_engine.js?v=20260929-complete1"></script>
|
| 231 |
<script src="hijri_calendar_engine.js?v=20260926-worship1"></script>
|
| 232 |
<script src="worship_event_engine.js?v=20260926-worship1"></script>
|
| 233 |
+
<script src="quran_khatma.js?v=20261001-nav2"></script>
|
| 234 |
+
<script src="quran_audio.js?v=20261001-nav2"></script>
|
| 235 |
+
<script src="quran_reader.js?v=20261001-nav2"></script>
|
| 236 |
<script src="registry_app.js?v=20260929-complete1"></script>
|
| 237 |
<script>
|
| 238 |
(function () {
|
quran_reader.js
CHANGED
|
@@ -115,7 +115,9 @@
|
|
| 115 |
metadata_revision: saved?.metadata_revision,
|
| 116 |
page: Number.isInteger(saved?.page) && saved.page >= 1 && saved.page <= 604 ? saved.page : 1,
|
| 117 |
theme: ['auto','light','dark'].includes(saved?.theme) ? saved.theme : c.defaults.theme,
|
| 118 |
-
follow_audio: typeof saved?.follow_audio === 'boolean' ? saved.follow_audio : c.defaults.follow_audio
|
|
|
|
|
|
|
| 119 |
};
|
| 120 |
return preferences;
|
| 121 |
}
|
|
@@ -225,7 +227,12 @@
|
|
| 225 |
let audioAttempt = 0;
|
| 226 |
cleanup = () => {saveAudio(player?.snapshot(),true);mounted=false;audioAttempt++;player?.dispose();window.removeEventListener('pagehide',flushAudio);document.removeEventListener('visibilitychange',flushAudio);};
|
| 227 |
const toolbar = node('div', null, 'quran-toolbar');
|
| 228 |
-
const
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 229 |
const select = (items, label) => {
|
| 230 |
const input = node('select');
|
| 231 |
for (const [value, text] of items) { const option = node('option', text); option.value = value; input.append(option); }
|
|
@@ -234,7 +241,7 @@
|
|
| 234 |
const surahSelect = select(source.surahs.map(s => [s.id, s.id + '. ' + s.name]), ui.surah);
|
| 235 |
const surahSearch = node('input');surahSearch.type='search';surahSearch.placeholder=ui.search_surah;surahSearch.setAttribute('aria-label',ui.search_surah);
|
| 236 |
const surahSearchLabel=node('label',ui.search_surah);surahSearchLabel.append(surahSearch);
|
| 237 |
-
|
| 238 |
surahSearch.addEventListener('input',()=>{
|
| 239 |
const term=normalize(surahSearch.value);
|
| 240 |
for(const option of surahSelect.options) option.hidden=Boolean(term)&&!normalize(option.textContent).includes(term);
|
|
@@ -249,9 +256,8 @@
|
|
| 249 |
const pageInput = node('input');
|
| 250 |
pageInput.type = 'number'; pageInput.min = 1; pageInput.max = source.counts.pages; pageInput.required = true;
|
| 251 |
pageLabel.append(pageInput); pageForm.append(pageLabel);
|
| 252 |
-
const go = node('button', ui.go); go.type = 'submit'; pageForm.append(go);
|
| 253 |
-
toolbar.append(button(ui.
|
| 254 |
-
toolbar.append(themeField(c,p,value=>{p.theme=value;applyTheme(c,p);if(!persist(c))status.textContent=ui.storage_error;}));
|
| 255 |
const searchForm = node('form', null, 'quran-search'); searchForm.setAttribute('role', 'search');
|
| 256 |
const query = node('input'); query.type = 'search'; query.setAttribute('aria-label', ui.search); query.placeholder = ui.search;
|
| 257 |
const submit = node('button', ui.search_submit); submit.type = 'submit'; searchForm.append(query, submit);
|
|
@@ -306,8 +312,9 @@
|
|
| 306 |
const point=wird.progress?.audio;
|
| 307 |
if(point)bookmarks.append(button(ui.wird_resume_audio,()=>{const v=source.verses[point.verseId-1];if(v&&player){showPage(v.page,v);player.resumeFrom(point);}}));
|
| 308 |
}
|
| 309 |
-
const metadataLink=node('a',ui.partition_source);metadataLink.href=source.partitions.sources[0].url;metadataLink.target='_blank';metadataLink.rel='noopener noreferrer';
|
| 310 |
-
|
|
|
|
| 311 |
function updateBookmarks(){
|
| 312 |
const saved=progress(c),v=source.verses[saved.reading?.verseId-1],a=source.verses[saved.audio?.verseId-1];
|
| 313 |
readingStatus.textContent=v?format(ui.reading_position,{surah:source.surahs[v.surah-1].name,ayah:v.ayah,page:v.page}):format(ui.saved_page,{page:p.page});
|
|
@@ -464,9 +471,11 @@
|
|
| 464 |
const status = node('p'); status.setAttribute('role', 'status');
|
| 465 |
const theme=themeField(c,p,value=>{p.theme=value;applyTheme(c,p);});
|
| 466 |
const followLabel=node('label',ui.follow_audio),follow=node('input');follow.type='checkbox';follow.checked=p.follow_audio;followLabel.prepend(follow);
|
| 467 |
-
|
|
|
|
|
|
|
| 468 |
p.font_size = Number(font.value); p.remember_page = remember.checked;
|
| 469 |
-
p.follow_audio=follow.checked;
|
| 470 |
if (!p.remember_page) p.page = 1;
|
| 471 |
status.textContent = persist(c) ? ui.saved : ui.storage_error;
|
| 472 |
}), status);
|
|
|
|
| 115 |
metadata_revision: saved?.metadata_revision,
|
| 116 |
page: Number.isInteger(saved?.page) && saved.page >= 1 && saved.page <= 604 ? saved.page : 1,
|
| 117 |
theme: ['auto','light','dark'].includes(saved?.theme) ? saved.theme : c.defaults.theme,
|
| 118 |
+
follow_audio: typeof saved?.follow_audio === 'boolean' ? saved.follow_audio : c.defaults.follow_audio,
|
| 119 |
+
show_partition_status: typeof saved?.show_partition_status === 'boolean' ? saved.show_partition_status : c.defaults.show_partition_status,
|
| 120 |
+
show_swipe_hint: typeof saved?.show_swipe_hint === 'boolean' ? saved.show_swipe_hint : c.defaults.show_swipe_hint
|
| 121 |
};
|
| 122 |
return preferences;
|
| 123 |
}
|
|
|
|
| 227 |
let audioAttempt = 0;
|
| 228 |
cleanup = () => {saveAudio(player?.snapshot(),true);mounted=false;audioAttempt++;player?.dispose();window.removeEventListener('pagehide',flushAudio);document.removeEventListener('visibilitychange',flushAudio);};
|
| 229 |
const toolbar = node('div', null, 'quran-toolbar');
|
| 230 |
+
const navigator = node('details', null, 'quran-navigator');
|
| 231 |
+
const navigatorTitle = node('summary', ui.navigate);
|
| 232 |
+
const navigatorGrid = node('div', null, 'quran-navigator-grid');
|
| 233 |
+
navigator.append(navigatorTitle, navigatorGrid);
|
| 234 |
+
toolbar.append(navigator);
|
| 235 |
+
const field = (label, input) => { const wrap = node('label', label); wrap.append(input); navigatorGrid.append(wrap); return input; };
|
| 236 |
const select = (items, label) => {
|
| 237 |
const input = node('select');
|
| 238 |
for (const [value, text] of items) { const option = node('option', text); option.value = value; input.append(option); }
|
|
|
|
| 241 |
const surahSelect = select(source.surahs.map(s => [s.id, s.id + '. ' + s.name]), ui.surah);
|
| 242 |
const surahSearch = node('input');surahSearch.type='search';surahSearch.placeholder=ui.search_surah;surahSearch.setAttribute('aria-label',ui.search_surah);
|
| 243 |
const surahSearchLabel=node('label',ui.search_surah);surahSearchLabel.append(surahSearch);
|
| 244 |
+
navigatorGrid.insertBefore(surahSearchLabel,surahSelect.parentElement);
|
| 245 |
surahSearch.addEventListener('input',()=>{
|
| 246 |
const term=normalize(surahSearch.value);
|
| 247 |
for(const option of surahSelect.options) option.hidden=Boolean(term)&&!normalize(option.textContent).includes(term);
|
|
|
|
| 256 |
const pageInput = node('input');
|
| 257 |
pageInput.type = 'number'; pageInput.min = 1; pageInput.max = source.counts.pages; pageInput.required = true;
|
| 258 |
pageLabel.append(pageInput); pageForm.append(pageLabel);
|
| 259 |
+
const go = node('button', ui.go); go.type = 'submit'; pageForm.append(go); navigatorGrid.append(pageForm);
|
| 260 |
+
toolbar.append(button(ui.settings_short, () => openSettings(() => open({...options, page, surah: undefined, ayah: undefined}))));
|
|
|
|
| 261 |
const searchForm = node('form', null, 'quran-search'); searchForm.setAttribute('role', 'search');
|
| 262 |
const query = node('input'); query.type = 'search'; query.setAttribute('aria-label', ui.search); query.placeholder = ui.search;
|
| 263 |
const submit = node('button', ui.search_submit); submit.type = 'submit'; searchForm.append(query, submit);
|
|
|
|
| 312 |
const point=wird.progress?.audio;
|
| 313 |
if(point)bookmarks.append(button(ui.wird_resume_audio,()=>{const v=source.verses[point.verseId-1];if(v&&player){showPage(v.page,v);player.resumeFrom(point);}}));
|
| 314 |
}
|
| 315 |
+
const metadataLink=node('a',ui.partition_source);metadataLink.href=source.partitions.sources[0].url;metadataLink.target='_blank';metadataLink.rel='noopener noreferrer';metadataLink.className='quran-meta';navigatorGrid.append(metadataLink);
|
| 316 |
+
const swipeHint=node('p',ui.swipe_hint,'quran-meta');swipeHint.hidden=!p.show_swipe_hint;position.hidden=!p.show_partition_status;
|
| 317 |
+
root.append(toolbar,position,bookmarks,audioHost,searchForm,status,actions,swipeHint,content,nav,attribution);
|
| 318 |
function updateBookmarks(){
|
| 319 |
const saved=progress(c),v=source.verses[saved.reading?.verseId-1],a=source.verses[saved.audio?.verseId-1];
|
| 320 |
readingStatus.textContent=v?format(ui.reading_position,{surah:source.surahs[v.surah-1].name,ayah:v.ayah,page:v.page}):format(ui.saved_page,{page:p.page});
|
|
|
|
| 471 |
const status = node('p'); status.setAttribute('role', 'status');
|
| 472 |
const theme=themeField(c,p,value=>{p.theme=value;applyTheme(c,p);});
|
| 473 |
const followLabel=node('label',ui.follow_audio),follow=node('input');follow.type='checkbox';follow.checked=p.follow_audio;followLabel.prepend(follow);
|
| 474 |
+
const partitionLabel=node('label',ui.show_partition_status),partitionToggle=node('input');partitionToggle.type='checkbox';partitionToggle.checked=p.show_partition_status;partitionLabel.prepend(partitionToggle);
|
| 475 |
+
const swipeLabel=node('label',ui.show_swipe_hint),swipeToggle=node('input');swipeToggle.type='checkbox';swipeToggle.checked=p.show_swipe_hint;swipeLabel.prepend(swipeToggle);
|
| 476 |
+
root.append(label, rememberLabel, theme, followLabel, partitionLabel, swipeLabel, button(ui.save, () => {
|
| 477 |
p.font_size = Number(font.value); p.remember_page = remember.checked;
|
| 478 |
+
p.follow_audio=follow.checked; p.show_partition_status=partitionToggle.checked; p.show_swipe_hint=swipeToggle.checked;
|
| 479 |
if (!p.remember_page) p.page = 1;
|
| 480 |
status.textContent = persist(c) ? ui.saved : ui.storage_error;
|
| 481 |
}), status);
|
quran_reader_registry.json
CHANGED
|
@@ -3,12 +3,38 @@
|
|
| 3 |
"core_file": "quran_core_registry.json",
|
| 4 |
"source_file": "al_khatma_source_attribution.md",
|
| 5 |
"storage_key": "muslim_clock_quran_reader_v1",
|
| 6 |
-
"defaults": {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
"themes": {
|
| 8 |
-
"light": {
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
},
|
| 11 |
-
"limits": {"font_min": 20, "font_max": 40, "search_batch": 40, "request_timeout_ms": 30000},
|
| 12 |
"ui": {
|
| 13 |
"title": "القرآن الكريم",
|
| 14 |
"open": "قراءة القرآن الكريم",
|
|
@@ -30,7 +56,7 @@
|
|
| 30 |
"results": "نتائج البحث: {count}",
|
| 31 |
"more": "عرض نتائج إضافية",
|
| 32 |
"reader": "العودة للقراءة",
|
| 33 |
-
"page_status": "الصفحة {page} من {total}
|
| 34 |
"invalid_page": "أدخل رقم صفحة من 1 إلى {total}.",
|
| 35 |
"font_size": "حجم خط الآيات",
|
| 36 |
"remember_page": "تذكّر آخر صفحة مفتوحة على هذا الجهاز",
|
|
@@ -52,6 +78,55 @@
|
|
| 52 |
"close_actions": "إغلاق إجراءات الآية",
|
| 53 |
"audio_loading": "جارٍ تجهيز مشغل التلاوة…",
|
| 54 |
"audio_unavailable": "تعذّر تجهيز الصوت. القراءة متاحة؛ أعد محاولة تحميل المشغّل.",
|
| 55 |
-
"search_surah": "بحث عن سورة"
|
| 56 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
}
|
|
|
|
| 3 |
"core_file": "quran_core_registry.json",
|
| 4 |
"source_file": "al_khatma_source_attribution.md",
|
| 5 |
"storage_key": "muslim_clock_quran_reader_v1",
|
| 6 |
+
"defaults": {
|
| 7 |
+
"font_size": 26,
|
| 8 |
+
"remember_page": true,
|
| 9 |
+
"theme": "auto",
|
| 10 |
+
"follow_audio": true,
|
| 11 |
+
"show_partition_status": false,
|
| 12 |
+
"show_swipe_hint": false
|
| 13 |
+
},
|
| 14 |
"themes": {
|
| 15 |
+
"light": {
|
| 16 |
+
"bg": "#ffffff",
|
| 17 |
+
"fg": "#19241d",
|
| 18 |
+
"surface": "#f1f5f2",
|
| 19 |
+
"border": "#7b8980",
|
| 20 |
+
"highlight": "#c5e9d0",
|
| 21 |
+
"highlight_fg": "#102b1a"
|
| 22 |
+
},
|
| 23 |
+
"dark": {
|
| 24 |
+
"bg": "#171b18",
|
| 25 |
+
"fg": "#f0f5f1",
|
| 26 |
+
"surface": "#252c27",
|
| 27 |
+
"border": "#87978c",
|
| 28 |
+
"highlight": "#365a40",
|
| 29 |
+
"highlight_fg": "#ffffff"
|
| 30 |
+
}
|
| 31 |
+
},
|
| 32 |
+
"limits": {
|
| 33 |
+
"font_min": 20,
|
| 34 |
+
"font_max": 40,
|
| 35 |
+
"search_batch": 40,
|
| 36 |
+
"request_timeout_ms": 30000
|
| 37 |
},
|
|
|
|
| 38 |
"ui": {
|
| 39 |
"title": "القرآن الكريم",
|
| 40 |
"open": "قراءة القرآن الكريم",
|
|
|
|
| 56 |
"results": "نتائج البحث: {count}",
|
| 57 |
"more": "عرض نتائج إضافية",
|
| 58 |
"reader": "العودة للقراءة",
|
| 59 |
+
"page_status": "الصفحة {page} من {total}",
|
| 60 |
"invalid_page": "أدخل رقم صفحة من 1 إلى {total}.",
|
| 61 |
"font_size": "حجم خط الآيات",
|
| 62 |
"remember_page": "تذكّر آخر صفحة مفتوحة على هذا الجهاز",
|
|
|
|
| 78 |
"close_actions": "إغلاق إجراءات الآية",
|
| 79 |
"audio_loading": "جارٍ تجهيز مشغل التلاوة…",
|
| 80 |
"audio_unavailable": "تعذّر تجهيز الصوت. القراءة متاحة؛ أعد محاولة تحميل المشغّل.",
|
| 81 |
+
"search_surah": "بحث عن سورة",
|
| 82 |
+
"bookmark": "وصلت إلى هنا",
|
| 83 |
+
"bookmark_saved": "حُفظ موضع قراءتك عند هذه الآية.",
|
| 84 |
+
"resume_reading": "العودة إلى موضع القراءة المحفوظ",
|
| 85 |
+
"resume_audio": "استكمال الاستماع المحفوظ",
|
| 86 |
+
"reading_position": "موضع القراءة: {surah} · الآية {ayah} · الصفحة {page}",
|
| 87 |
+
"audio_position": "موضع الاستماع: {surah} · الآية {ayah} · {seconds} ثانية",
|
| 88 |
+
"tafsir": "تفسير الآية — يفتح موقعًا خارجيًا",
|
| 89 |
+
"tafsir_note": "روابط التفسير تحتاج الإنترنت وتفتح في تبويب جديد.",
|
| 90 |
+
"swipe_hint": "اسحب يمينًا للصفحة التالية ويسارًا للسابقة.",
|
| 91 |
+
"khatma": "خطة الختمة وورد اليوم",
|
| 92 |
+
"wird_range": "ورد اليوم {day}: الصفحات {start}–{end}",
|
| 93 |
+
"wird_audio_end": "انتهى المقطع المحدد لورد اليوم. لم يُسجّل إنجاز تلقائي.",
|
| 94 |
+
"wird_resume_audio": "استكمال استماع هذا الورد",
|
| 95 |
+
"quran_features_error": "تعذّر فتح خطة الختمة. تحقق من الملفات ثم أعد المحاولة.",
|
| 96 |
+
"saved_page": "الصفحة المحفوظة: {page}",
|
| 97 |
+
"progress_error": "تعذّر حفظ موضع القراءة أو الاستماع على هذا الجهاز.",
|
| 98 |
+
"navigate": "التنقل في القرآن",
|
| 99 |
+
"settings_short": "الإعدادات",
|
| 100 |
+
"show_partition_status": "إظهار الجزء والحزب وربع الحزب أثناء القراءة",
|
| 101 |
+
"show_swipe_hint": "إظهار تلميح السحب بين الصفحات"
|
| 102 |
+
},
|
| 103 |
+
"progress_storage_key": "muslim_clock_quran_progress_v1",
|
| 104 |
+
"swipe": {
|
| 105 |
+
"min_distance_px": 65,
|
| 106 |
+
"max_duration_ms": 650,
|
| 107 |
+
"horizontal_ratio": 1.6,
|
| 108 |
+
"click_suppression_ms": 350
|
| 109 |
+
},
|
| 110 |
+
"tafsirs": [
|
| 111 |
+
{
|
| 112 |
+
"id": "tabari",
|
| 113 |
+
"name": "تفسير الطبري",
|
| 114 |
+
"url": "https://quran.com/ar/{surah}:{ayah}/tafsirs/ar-tafsir-al-tabari"
|
| 115 |
+
},
|
| 116 |
+
{
|
| 117 |
+
"id": "jalalayn",
|
| 118 |
+
"name": "تفسير الجلالين",
|
| 119 |
+
"url": "https://quran.com/ar/{surah}:{ayah}/tafsirs/ar-tafsir-jalalayn"
|
| 120 |
+
},
|
| 121 |
+
{
|
| 122 |
+
"id": "saadi",
|
| 123 |
+
"name": "تفسير السعدي",
|
| 124 |
+
"url": "https://quran.com/ar/{surah}:{ayah}/tafsirs/ar-tafseer-al-saddi"
|
| 125 |
+
},
|
| 126 |
+
{
|
| 127 |
+
"id": "ibnkathir",
|
| 128 |
+
"name": "تفسير ابن كثير",
|
| 129 |
+
"url": "https://quran.com/ar/{surah}:{ayah}/tafsirs/ar-tafsir-ibn-kathir"
|
| 130 |
+
}
|
| 131 |
+
]
|
| 132 |
}
|