youssefreda9 commited on
Commit
5786389
·
1 Parent(s): 60d29ae

feat: Amiri Quran font + copy button + Ctrl+Q shortcut

Browse files
Files changed (2) hide show
  1. src/css/components.css +20 -3
  2. src/index.html +27 -3
src/css/components.css CHANGED
@@ -3126,9 +3126,9 @@ input[type="range"]::-moz-range-thumb {
3126
  }
3127
 
3128
  .quran-uthmani {
3129
- font-family: 'Traditional Arabic', 'Amiri', 'Scheherazade New', serif;
3130
- font-size: 24px;
3131
- line-height: 2.2;
3132
  color: var(--color-text-primary);
3133
  text-align: center;
3134
  direction: rtl;
@@ -3161,6 +3161,23 @@ input[type="range"]::-moz-range-thumb {
3161
  }
3162
  .quran-apply-btn.is-hidden { display: none; }
3163
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3164
  .quran-lang-select {
3165
  padding: 6px 12px;
3166
  border-radius: 8px;
 
3126
  }
3127
 
3128
  .quran-uthmani {
3129
+ font-family: 'Amiri Quran', 'Amiri', 'Traditional Arabic', 'Scheherazade New', serif;
3130
+ font-size: 26px;
3131
+ line-height: 2.4;
3132
  color: var(--color-text-primary);
3133
  text-align: center;
3134
  direction: rtl;
 
3161
  }
3162
  .quran-apply-btn.is-hidden { display: none; }
3163
 
3164
+ .quran-copy-btn {
3165
+ padding: 6px 10px;
3166
+ border-radius: 8px;
3167
+ border: 1px solid rgba(6, 182, 212, 0.3);
3168
+ background: rgba(6, 182, 212, 0.1);
3169
+ color: var(--color-text-primary);
3170
+ font-size: 16px;
3171
+ cursor: pointer;
3172
+ transition: all 0.2s;
3173
+ line-height: 1;
3174
+ }
3175
+ .quran-copy-btn:hover {
3176
+ background: rgba(6, 182, 212, 0.2);
3177
+ transform: scale(1.05);
3178
+ }
3179
+ .quran-copy-btn.is-hidden { display: none; }
3180
+
3181
  .quran-lang-select {
3182
  padding: 6px 12px;
3183
  border-radius: 8px;
src/index.html CHANGED
@@ -11,7 +11,7 @@
11
  <script src="https://cdn.tailwindcss.com"></script>
12
  <link rel="preconnect" href="https://fonts.googleapis.com">
13
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
14
- <link href="https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700&display=swap" rel="stylesheet">
15
  <link rel="stylesheet" href="/css/tokens.css">
16
  <link rel="stylesheet" href="/css/base.css">
17
  <link rel="stylesheet" href="/css/components.css">
@@ -1251,8 +1251,9 @@
1251
  _quranRef = reference;
1252
  document.getElementById('quran-uthmani-text').textContent = verseText;
1253
  document.getElementById('quran-reference').textContent = reference ? '[' + reference + ']' : '';
1254
- // Show apply button
1255
  document.getElementById('quran-apply-btn').classList.remove('is-hidden');
 
1256
 
1257
  } catch (err) {
1258
  document.getElementById('quran-uthmani-text').innerHTML =
@@ -1310,6 +1311,26 @@
1310
  document.body.style.overflow = '';
1311
  }
1312
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1313
  function _replaceInEditor(newText, ref) {
1314
  var editor = document.getElementById('editor-container');
1315
  if (!editor || !_quranCurrentQuery) return false;
@@ -1736,7 +1757,10 @@
1736
  <div class="quran-result-card">
1737
  <div class="flex items-center justify-between mb-3">
1738
  <div class="text-sm font-bold" style="color:#06b6d4;">✓ النص القرآني المدقق</div>
1739
- <button id="quran-apply-btn" onclick="applyQuranText()" class="quran-apply-btn is-hidden" type="button">تطبيق ✓</button>
 
 
 
1740
  </div>
1741
  <p id="quran-uthmani-text" class="quran-uthmani"></p>
1742
  <p id="quran-reference" class="quran-reference"></p>
 
11
  <script src="https://cdn.tailwindcss.com"></script>
12
  <link rel="preconnect" href="https://fonts.googleapis.com">
13
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
14
+ <link href="https://fonts.googleapis.com/css2?family=Amiri+Quran&family=Cairo:wght@400;500;600;700&display=swap" rel="stylesheet">
15
  <link rel="stylesheet" href="/css/tokens.css">
16
  <link rel="stylesheet" href="/css/base.css">
17
  <link rel="stylesheet" href="/css/components.css">
 
1251
  _quranRef = reference;
1252
  document.getElementById('quran-uthmani-text').textContent = verseText;
1253
  document.getElementById('quran-reference').textContent = reference ? '[' + reference + ']' : '';
1254
+ // Show apply & copy buttons
1255
  document.getElementById('quran-apply-btn').classList.remove('is-hidden');
1256
+ document.getElementById('quran-copy-btn').classList.remove('is-hidden');
1257
 
1258
  } catch (err) {
1259
  document.getElementById('quran-uthmani-text').innerHTML =
 
1311
  document.body.style.overflow = '';
1312
  }
1313
 
1314
+ function copyQuranResult() {
1315
+ const verse = _quranVerseClean || '';
1316
+ const ref = _quranRef ? ' [' + _quranRef + ']' : '';
1317
+ const text = verse + ref;
1318
+ if (!text.trim()) return;
1319
+ navigator.clipboard.writeText(text).then(() => {
1320
+ if (typeof showToast === 'function') showToast('✓ تم نسخ النص المدقق');
1321
+ const btn = document.getElementById('quran-copy-btn');
1322
+ if (btn) { btn.textContent = '✅'; setTimeout(() => { btn.textContent = '📋'; }, 1500); }
1323
+ });
1324
+ }
1325
+
1326
+ // Ctrl+Q → Quran verification shortcut
1327
+ document.addEventListener('keydown', (e) => {
1328
+ if ((e.ctrlKey || e.metaKey) && (e.key === 'q' || e.key === 'Q')) {
1329
+ e.preventDefault();
1330
+ verifyQuranText();
1331
+ }
1332
+ });
1333
+
1334
  function _replaceInEditor(newText, ref) {
1335
  var editor = document.getElementById('editor-container');
1336
  if (!editor || !_quranCurrentQuery) return false;
 
1757
  <div class="quran-result-card">
1758
  <div class="flex items-center justify-between mb-3">
1759
  <div class="text-sm font-bold" style="color:#06b6d4;">✓ النص القرآني المدقق</div>
1760
+ <div class="flex items-center gap-2">
1761
+ <button id="quran-copy-btn" onclick="copyQuranResult()" class="quran-copy-btn is-hidden" type="button" title="نسخ النص المدقق">📋</button>
1762
+ <button id="quran-apply-btn" onclick="applyQuranText()" class="quran-apply-btn is-hidden" type="button">تطبيق ✓</button>
1763
+ </div>
1764
  </div>
1765
  <p id="quran-uthmani-text" class="quran-uthmani"></p>
1766
  <p id="quran-reference" class="quran-reference"></p>