diff --git a/web/src/components/Icon.astro b/web/src/components/Icon.astro index 71611e9d..29459cf9 100644 --- a/web/src/components/Icon.astro +++ b/web/src/components/Icon.astro @@ -1,7 +1,7 @@ --- // Icons (Lucide, ISC licence; https://lucide.dev): drawn with currentColor, so they take the colour of their button // or link. Decorative: the button or link carries the words (aria-label/title, or its text). -const { name, size = 20 } = Astro.props as { name: keyof typeof PATHS; size?: number }; +const { name, size = 20, class: cls } = Astro.props as { name: keyof typeof PATHS; size?: number; class?: string }; const PATHS = { admin: '', edit: '', @@ -23,6 +23,7 @@ const PATHS = { undo: '', send: '', save: '', + exitfull: '', full: '', next: '', // points left: forward in a right-to-left page prev: '', @@ -34,6 +35,21 @@ const PATHS = { sun: '', moon: '', external: '', + // editor toolbar + couplet: '', + para: '', + h2: '', + h3: '', + dict: '', + note: '', + variant: '', + redo: '', + keyboard: '', + code: '', + up: '', + down: '', + top: '', + bottom: '', }; --- - + diff --git a/web/src/lib/pdfreader.ts b/web/src/lib/pdfreader.ts index 04c481ff..cf8e10fb 100644 --- a/web/src/lib/pdfreader.ts +++ b/web/src/lib/pdfreader.ts @@ -57,7 +57,7 @@ export async function pdfReader(root: HTMLElement) { const full = root.querySelector('.pdf-full')!; const toggle = () => (document.fullscreenElement ? document.exitFullscreen() : root.requestFullscreen()).catch(() => {}); full.onclick = toggle; - document.addEventListener('fullscreenchange', () => { full.title = document.fullscreenElement === root ? 'پوری اسکرین سے واپس (F)' : 'پوری اسکرین (F)'; show(page); }); + document.addEventListener('fullscreenchange', () => { const on = document.fullscreenElement === root; full.title = on ? 'پوری اسکرین سے واپس (F)' : 'پوری اسکرین (F)'; full.setAttribute('aria-label', on ? 'پوری اسکرین سے واپس' : 'پوری اسکرین'); show(page); }); // a click on the half the book turns towards goes forward pagesBox.onclick = (e) => { const left = e.clientX < pagesBox.getBoundingClientRect().left + pagesBox.clientWidth / 2; step(left === rtl ? 1 : -1); }; document.addEventListener('keydown', (e) => { diff --git a/web/src/pages/[...path].astro b/web/src/pages/[...path].astro index 73b476ee..819fe458 100644 --- a/web/src/pages/[...path].astro +++ b/web/src/pages/[...path].astro @@ -151,8 +151,8 @@ import Icon from '../components/Icon.astro';

کسی لفظ کو منتخب کریں تو اس کے معنی اور تلفظ ساتھ نظر آئیں گے۔

{page.divan && (

diff --git a/web/src/pages/admin/audit.astro b/web/src/pages/admin/audit.astro index 0d60edc3..804ebf26 100644 --- a/web/src/pages/admin/audit.astro +++ b/web/src/pages/admin/audit.astro @@ -1,6 +1,7 @@ --- // Admin: audit log of admin actions import Base from '../../layouts/Base.astro'; +import Icon from '../../components/Icon.astro'; import AdminNav from '../../components/AdminNav.astro'; import { asUser, COOKIE } from '../../lib/auth'; import { ud } from '../../lib/urdu'; @@ -38,9 +39,9 @@ const when = (d: string) => ud(new Date(d).toISOString().slice(0, 16).replace('T {pages > 1 && (

)} diff --git a/web/src/pages/admin/index.astro b/web/src/pages/admin/index.astro index 6b06abdf..df95a90d 100644 --- a/web/src/pages/admin/index.astro +++ b/web/src/pages/admin/index.astro @@ -1,6 +1,7 @@ --- // Admin: users. Password resets happen here on a reader's request (no email server yet). import Base from '../../layouts/Base.astro'; +import Icon from '../../components/Icon.astro'; import AdminNav from '../../components/AdminNav.astro'; import { asUser, COOKIE } from '../../lib/auth'; import { ud } from '../../lib/urdu'; @@ -92,9 +93,9 @@ const link = (n: number) => `/admin?q=${encodeURIComponent(q)}&page=${n}`; {pages > 1 && ( )} diff --git a/web/src/pages/design.astro b/web/src/pages/design.astro new file mode 100644 index 00000000..101d9c31 --- /dev/null +++ b/web/src/pages/design.astro @@ -0,0 +1,105 @@ +--- +// Design system reference (dev only): the real tokens and components from global.css, so it cannot drift. +// Switch palette, light/dark and font from the header's display settings. +import Base from '../layouts/Base.astro'; +import Icon from '../components/Icon.astro'; +if (import.meta.env.PROD) return new Response(null, { status: 404 }); +const colours = [ + ['surfaces', ['surface-page', 'surface-raised', 'surface-poem', 'surface-sunken']], + ['text and lines', ['text', 'text-muted', 'link', 'heading', 'border', 'line']], + ['brand and accent', ['brand', 'accent', 'accent-soft', 'active', 'focus']], + ['roles', ['action', 'action-ink', 'ok', 'danger']], +] as const; +const sizes = ['xs', 'sm', 'md', 'lg', 'xl', '2xl']; +const radii = ['sm', 'md', 'lg', 'pill']; +--- + +

ڈیزائن سسٹم

+

رنگ، خط اور روشنی اوپر کی ترتیبات سے بدلیں

+ +
+

رنگ

+ {colours.map(([group, names]) => ( +
+ {group} + {names.map((n) => --{n})} +
+ ))} + +

خط

+ {sizes.map((s) =>

--fs-{s} دل ہی تو ہے نہ سنگ و خشت درد سے بھر نہ آئے کیوں

)} + +

گولائی

+
{radii.map((r) => --r-{r})}
+ +

بٹن

+
+ + + + + + + + +
+
+ + + + + + +
+ +

ایڈیٹر

+ + +

چپس اور نشان

+

عشق ۱۲فراق ۴

+
+ + +
+

+ منظور شدہ + شائع شدہواپس +

+ +

خانے

+ + +

کارڈ

+ + +

بارہویں صدی ہجری

+ +

شعر

+
+

دل ہی تو ہے نہ سنگ و خشت درد سے بھر نہ آئے کیوں

روئیں گے ہم ہزار بار کوئی ہمیں ستائے کیوں

+

دیر نہیں حرم نہیں در نہیں آستاں نہیں

بیٹھے ہیں رہ گزر پہ ہم غالب ہمیں اٹھائے کیوں

+
+
+ +

تلاش

+
غزل ۱۲

دل ہی تو ہے نہ سنگ و خشت

+ +
+ + + diff --git a/web/src/pages/ebook/[id].astro b/web/src/pages/ebook/[id].astro index 668f8e46..40fb9905 100644 --- a/web/src/pages/ebook/[id].astro +++ b/web/src/pages/ebook/[id].astro @@ -51,7 +51,7 @@ import Icon from '../../components/Icon.astro'; صفحہ از … - + {b.published && } @@ -64,7 +64,7 @@ import Icon from '../../components/Icon.astro'; {b.kind === 'epub' && ( <>
- + )}