Spaces:
Running
Running
Update index.html
Browse files70 unmodified lines71727374757677158 unmodified lines23623723823924024124258 unmodified lines30130230330430530630782 unmodified lines39039139239339439539679 unmodified lines47647747847948048148246 unmodified lines52953053153253353453555 unmodified lines59159259359459559659790 unmodified lines68868969069169269369497 unmodified lines79279379479579679779884 unmodified lines88388488588688788888976 unmodified lines96696796896997097197274 unmodified lines104710481049105010511052105370 unmodified lines.authTabBtn.active{background:var(--bg-elevated); color:var(--text); font-weight:700; box-shadow:0 1px 5px rgba(0,0,0,.08);}.field{text-align:start; margin-bottom:12px;}.field label{display:block; font-size:12.5px; color:var(--muted); margin-bottom:5px;}[7/9/2026 5:06 PM] بايثون: .field input{width:100%; padding:11px 13px; border-radius:10px; border:1px solid var(--border); background:var(--bg);color:var(--text); font-family:inherit; font-size:14px;}158 unmodified lines.reader-page{flex:1; overflow-y:auto; padding:28px 22px 100px; max-width:640px; margin:0 auto; width:100%;}.reader-page .rp-chapter{font-size:12px; color:var(--accent); font-weight:700; margin-bottom:10px;}.reader-page .rp-text{font-size:16.5px; line-height:2.3;}[7/9/2026 5:06 PM] بايثون: html[data-lang="ar"] .reader-page .rp-text{font-family:'Amiri', serif;}.reader-nav{position:fixed; bottom:74px; inset-inline:0; display:flex; justify-content:space-between; padding:0 16px; pointer-events:none;}.reader-nav button{pointer-events:auto; width:42px; height:42px; border-radius:50%; border:1px solid var(--border);background:var(--bg-elevated); box-shadow:var(--shadow); cursor:pointer; font-size:16px; color:var(--text);}58 unmodified lines<form id="signupForm" hidden onsubmit="return handleSignup(event)"><div class="field"><label data-t="nameLabel">الاسم</label>[7/9/2026 5:06 PM] بايثون: <input type="text" id="signupName" required autocomplete="name"></div><div class="field"><label data-t="emailLabel">البريد الإلكتروني</label>82 unmodified lines<span class="nav-icon">📿</span><span data-t="navAdhkar">الأذكار</span></button></nav>[7/9/2026 5:06 PM] بايثون: <!-- DRAWER (Profile) --><div class="drawer-overlay" id="drawerOverlay" hidden onclick="closeDrawer()"></div><aside class="drawer" id="profileDrawer" hidden><button class="close-drawer" onclick="closeDrawer()">✕</button>79 unmodified lines: 'لم يتم الربط بقاعدة بيانات بعد: أضف رابط مشروع Supabase والمفتاح العام أعلى الكود لتفعيل الحسابات الحقيقية والكتب.';});}[7/9/2026 5:06 PM] بايثون: /* ---------------- Categories (يمكن لاحقًا سحبها من جدول categories) ---------------- */const CATEGORIES = [{key:'literature', ar:'أدب', en:'Literature', color:'#0F5C4E'},{key:'religion', ar:'دين', en:'Religion', color:'#B9902E'},46 unmodified linesloginBtn:'Log in', signupBtn:'Create account', forgotPassword:'Forgot password?',continueGoogle:'Continue with Google', or:'or', continueGuest:'Browse as guest',themePaper:'Light', themeSepia:'Sepia', themeNight:'Dark',[7/9/2026 5:06 PM] بايثون: homeTitle:'Picked for you today', shuffleBtn:'🔀 Shuffle', homeSub:'A selection from the library shelves, refreshed each visit',searchTitle:'Search the library', searchPlaceholder:'Search for a book or author...', categoriesLabel:'Categories',navHome:'Home', navSearch:'Search', navAdhkar:'Adhkar',adhkarTitle:'Ahlul Bayt Adhkar', adhkarSub:'Selected supplications and remembrances, added from the admin dashboard',55 unmodified lines}/* ---------------- Auth: real Supabase accounts ---------------- */[7/9/2026 5:06 PM] بايثون: async function handleLogin(e){e.preventDefault();if(!requireConfig()) return false;hideAuthMsg();90 unmodified lines/* ---------------- جلب الكتب من قاعدة البيانات (جدول books) ---------------- */async function loadBooks(){[7/9/2026 5:06 PM] بايثون: const grid = document.getElementById('homeGrid');if(grid) grid.innerHTML = Array(6).fill('<div class="skeleton"></div>').join('');if(!CONFIGURED){ BOOKS = []; state.booksLoaded = true; return; }const { data, error } = await supabaseClient97 unmodified linesstate.myRatings = {};(myRates||[]).forEach(r=>{ state.myRatings[r.book_id] = r.rating; });}[7/9/2026 5:06 PM] بايثون: /* ---------------- Theme & Language ---------------- */function setTheme(theme){state.theme = theme;document.documentElement.setAttribute('data-theme', theme);84 unmodified linesconst isFav = state.favorites.has(b.id);return `<div class="book-card" style="--cat-color:${b.color||info.color}" onclick="openBookModal('${b.id}')">${isFav ? '<span class="fav-mark">⭐</span>' : ''}[7/9/2026 5:06 PM] بايثون: <span class="book-tag">${state.lang==='ar'?info.ar:info.en}</span><div class="book-title">${b.title[state.lang]}</div><div class="book-author">${t('by')} ${b.author[state.lang]}</div></div>;76 unmodified linesrenderReader();if(resume) showToast(t('resumedMsg'));if(CONFIGURED){[7/9/2026 5:06 PM] بايثون: supabaseClient.rpc('increment_book_views', { p_book_id: id }).then(()=>{});}}function closeReader(){74 unmodified linesdocument.getElementById('drawerName').textContent = state.user.name;document.getElementById('drawerSub').textContent = state.user.sub;document.getElementById('avatarBtn').textContent = state.user.initial;[7/9/2026 5:06 PM] بايثون: renderDrawerList();}function closeDrawer(){document.getElementById('drawerOverlay').hidden = true;70 unmodified lines71727374757677158 unmodified lines23623723823924024124258 unmodified lines30130230330430530630782 unmodified lines39039139239339439539679 unmodified lines47647747847948048148246 unmodified lines52953053153253353453555 unmodified lines59159259359459559659790 unmodified lines68868969069169269369497 unmodified lines79279379479579679779884 unmodified lines88388488588688788888976 unmodified lines96696796896997097197274 unmodified lines104710481049105010511052105370 unmodified lines.authTabBtn.active{background:var(--bg-elevated); color:var(--text); font-weight:700; box-shadow:0 1px 5px rgba(0,0,0,.08);}.field{text-align:start; margin-bottom:12px;}.field label{display:block; font-size:12.5px; color:var(--muted); margin-bottom:5px;}.field input{width:100%; padding:11px 13px; border-radius:10px; border:1px solid var(--border); background:var(--bg);color:var(--text); font-family:inherit; font-size:14px;}158 unmodified lines.reader-page{flex:1; overflow-y:auto; padding:28px 22px 100px; max-width:640px; margin:0 auto; width:100%;}.reader-page .rp-chapter{font-size:12px; color:var(--accent); font-weight:700; margin-bottom:10px;}.reader-page .rp-text{font-size:16.5px; line-height:2.3;}html[data-lang="ar"] .reader-page .rp-text{font-family:'Amiri', serif;}.reader-nav{position:fixed; bottom:74px; inset-inline:0; display:flex; justify-content:space-between; padding:0 16px; pointer-events:none;}.reader-nav button{pointer-events:auto; width:42px; height:42px; border-radius:50%; border:1px solid var(--border);background:var(--bg-elevated); box-shadow:var(--shadow); cursor:pointer; font-size:16px; color:var(--text);}58 unmodified lines<form id="signupForm" hidden onsubmit="return handleSignup(event)"><div class="field"><label data-t="nameLabel">الاسم</label><input type="text" id="signupName" required autocomplete="name"></div><div class="field"><label data-t="emailLabel">البريد الإلكتروني</label>82 unmodified lines<span class="nav-icon">📿</span><span data-t="navAdhkar">الأذكار</span></button></nav><!-- DRAWER (Profile) --><div class="drawer-overlay" id="drawerOverlay" hidden onclick="closeDrawer()"></div><aside class="drawer" id="profileDrawer" hidden><button class="close-drawer" onclick="closeDrawer()">✕</button>79 unmodified lines: 'لم يتم الربط بقاعدة بيانات بعد: أضف رابط مشروع Supabase والمفتاح العام أعلى الكود لتفعيل الحسابات الحقيقية والكتب.';});}/* ---------------- Categories (يمكن لاحقًا سحبها من جدول categories) ---------------- */const CATEGORIES = [{key:'literature', ar:'أدب', en:'Literature', color:'#0F5C4E'},{key:'religion', ar:'دين', en:'Religion', color:'#B9902E'},46 unmodified linesloginBtn:'Log in', signupBtn:'Create account', forgotPassword:'Forgot password?',continueGoogle:'Continue with Google', or:'or', continueGuest:'Browse as guest',themePaper:'Light', themeSepia:'Sepia', themeNight:'Dark',homeTitle:'Picked for you today', shuffleBtn:'🔀 Shuffle', homeSub:'A selection from the library shelves, refreshed each visit',searchTitle:'Search the library', searchPlaceholder:'Search for a book or author...', categoriesLabel:'Categories',navHome:'Home', navSearch:'Search', navAdhkar:'Adhkar',adhkarTitle:'Ahlul Bayt Adhkar', adhkarSub:'Selected supplications and remembrances, added from the admin dashboard',55 unmodified lines}/* ---------------- Auth: real Supabase accounts ---------------- */async function handleLogin(e){e.preventDefault();if(!requireConfig()) return false;hideAuthMsg();90 unmodified lines/* ---------------- جلب الكتب من قاعدة البيانات (جدول books) ---------------- */async function loadBooks(){const grid = document.getElementById('homeGrid');if(grid) grid.innerHTML = Array(6).fill('<div class="skeleton"></div>').join('');if(!CONFIGURED){ BOOKS = []; state.booksLoaded = true; return; }const { data, error } = await supabaseClient97 unmodified linesstate.myRatings = {};(myRates||[]).forEach(r=>{ state.myRatings[r.book_id] = r.rating; });}/* ---------------- Theme & Language ---------------- */function setTheme(theme){state.theme = theme;document.documentElement.setAttribute('data-theme', theme);84 unmodified linesconst isFav = state.favorites.has(b.id);return `<div class="book-card" style="--cat-color:${b.color||info.color}" onclick="openBookModal('${b.id}')">${isFav ? '<span class="fav-mark">⭐</span>' : ''}<span class="book-tag">${state.lang==='ar'?info.ar:info.en}</span><div class="book-title">${b.title[state.lang]}</div><div class="book-author">${t('by')} ${b.author[state.lang]}</div></div>;76 unmodified linesrenderReader();if(resume) showToast(t('resumedMsg'));if(CONFIGURED){supabaseClient.rpc('increment_book_views', { p_book_id: id }).then(()=>{});}}function closeReader(){74 unmodified linesdocument.getElementById('drawerName').textContent = state.user.name;document.getElementById('drawerSub').textContent = state.user.sub;document.getElementById('avatarBtn').textContent = state.user.initial;renderDrawerList();}function closeDrawer(){document.getElementById('drawerOverlay').hidden = true;
index.html+12-12