From cc797fd2626138db62ff4339e4c26959c71b413b Mon Sep 17 00:00:00 2001 From: Anas Rashid Date: Sat, 10 Oct 2026 01:17:45 +0200 Subject: [PATCH] Switching to Nastaliq shows a short note that it is for the text and the rest of the site stays Naskh Co-Authored-By: Claude Opus 5.5 --- web/src/layouts/Base.astro | 6 +++++- web/src/styles/global.css | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/web/src/layouts/Base.astro b/web/src/layouts/Base.astro index c2641dfb..bb1e05ea 100644 --- a/web/src/layouts/Base.astro +++ b/web/src/layouts/Base.astro @@ -210,7 +210,11 @@ import { siteUrl } from '../lib/site-url'; }); panel.addEventListener('click', (e) => { const b = e.target.closest('button'); if (!b) return; - if (b.dataset.font) { root.classList.toggle('nastaliq', b.dataset.font === 'nastaliq'); store('divan-font', b.dataset.font); } + if (b.dataset.font) { + // switching to Nastaliq: a short note that it is for the text (the interface stays Naskh, by design) + if (b.dataset.font === 'nastaliq' && !root.classList.contains('nastaliq')) toast('نستعلیق صرف کلام اور متن پر؛ باقی سائٹ نسخ میں رہتی ہے', 'info'); + root.classList.toggle('nastaliq', b.dataset.font === 'nastaliq'); store('divan-font', b.dataset.font); + } if (b.dataset.palette != null) { if (b.dataset.palette) root.dataset.palette = b.dataset.palette; else delete root.dataset.palette; store('divan-palette', b.dataset.palette); } if (b.dataset.digits != null) { // numerals: a cookie, so the server sends pages with them; switching back to Eastern reloads the page diff --git a/web/src/styles/global.css b/web/src/styles/global.css index c65f15df..67ad5665 100644 --- a/web/src/styles/global.css +++ b/web/src/styles/global.css @@ -684,6 +684,7 @@ h1 + .muted { text-align: center; margin-top: 0; } font: var(--fs-sm)/1.8 var(--font-ui); animation: toast-in .25s ease-out; } .toast::before { content: '✓ '; color: var(--ok); font-weight: 700; } .toast.error::before { content: '! '; color: var(--danger); } +.toast.info::before { content: 'ⓘ '; color: var(--accent); } .toast.out { animation: toast-out .3s ease-in forwards; } @keyframes toast-in { from { opacity: 0; transform: translateY(14px); } } @keyframes toast-out { to { opacity: 0; transform: translateY(14px); } }