Download qg..html from Hosdroid/Aplood: direct link, hf CLI and curl.
- Browser
- Download file 14.1 kB
-
https://huggingface.co/spaces/Hosdroid/Aplood/resolve/main/qg..html
- Command line
-
hf download hf://spaces/Hosdroid/Aplood/qg..html
-
curl -L -o qg..html https://huggingface.co/spaces/Hosdroid/Aplood/resolve/main/qg..html
14.1 kB
| <html lang="fa" dir="rtl"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>قرآن هوشمند | سوره مبارکه یونس</title> | |
| <link href="https://fonts.googleapis.com/css2?family=Amiri+Quran&family=Vazirmatn:wght@400;700&display=swap" rel="stylesheet"> | |
| <style> | |
| :root { | |
| --bg-primary: #0a1f18; | |
| --bg-secondary: #133327; | |
| --accent-gold: #d4af37; | |
| --accent-gold-light: #f3e5ab; | |
| --text-light: #f0f7f4; | |
| --text-muted: #a3c2b5; | |
| --active-ayah: #1b4d3e; | |
| --border-color: #245745; | |
| } | |
| * { | |
| box-sizing: border-box; | |
| margin: 0; | |
| padding: 0; | |
| font-family: 'Vazirmatn', sans-serif; | |
| } | |
| body { | |
| background-color: var(--bg-primary); | |
| color: var(--text-light); | |
| display: flex; | |
| flex-direction: column; | |
| min-height: 100vh; | |
| padding-bottom: 90px; | |
| } | |
| header { | |
| background: linear-gradient(135deg, #0d281e, #1a4234); | |
| border-bottom: 2px solid var(--accent-gold); | |
| padding: 20px; | |
| text-align: center; | |
| box-shadow: 0 4px 15px rgba(0,0,0,0.5); | |
| } | |
| header h1 { | |
| color: var(--accent-gold); | |
| font-size: 1.8rem; | |
| margin-bottom: 5px; | |
| } | |
| .controls { | |
| background: var(--bg-secondary); | |
| border: 1px solid var(--border-color); | |
| border-radius: 12px; | |
| max-width: 1000px; | |
| margin: 15px auto; | |
| padding: 15px; | |
| display: flex; | |
| flex-wrap: wrap; | |
| gap: 12px; | |
| justify-content: space-around; | |
| align-items: center; | |
| } | |
| .control-group { | |
| display: flex; | |
| align-items: center; | |
| gap: 8px; | |
| } | |
| label { | |
| font-size: 0.9rem; | |
| color: var(--text-muted); | |
| } | |
| select, button { | |
| background: var(--bg-primary); | |
| color: var(--text-light); | |
| border: 1px solid var(--accent-gold); | |
| padding: 8px 12px; | |
| border-radius: 6px; | |
| outline: none; | |
| cursor: pointer; | |
| font-size: 0.9rem; | |
| } | |
| button:hover, select:hover { | |
| background: var(--border-color); | |
| } | |
| .container { | |
| max-width: 1000px; | |
| margin: 0 auto; | |
| padding: 10px 20px; | |
| width: 100%; | |
| } | |
| .bismillah { | |
| font-family: 'Amiri Quran', serif; | |
| font-size: 2.2rem; | |
| text-align: center; | |
| color: var(--accent-gold); | |
| margin: 25px 0; | |
| text-shadow: 0 2px 4px rgba(0,0,0,0.3); | |
| } | |
| /* View Modes */ | |
| .ayah-list-view .ayah-card { | |
| background: var(--bg-secondary); | |
| border: 1px solid var(--border-color); | |
| border-radius: 10px; | |
| padding: 20px; | |
| margin-bottom: 15px; | |
| transition: all 0.3s ease; | |
| cursor: pointer; | |
| } | |
| .ayah-list-view .ayah-card.active { | |
| background: var(--active-ayah); | |
| border-color: var(--accent-gold); | |
| box-shadow: 0 0 10px rgba(212, 175, 55, 0.3); | |
| } | |
| .quran-text { | |
| font-family: 'Amiri Quran', serif; | |
| font-size: 1.9rem; | |
| line-height: 2.5rem; | |
| text-align: right; | |
| direction: rtl; | |
| color: var(--accent-gold-light); | |
| margin-bottom: 12px; | |
| } | |
| .translation-text { | |
| color: var(--text-muted); | |
| font-size: 1rem; | |
| line-height: 1.6rem; | |
| text-align: right; | |
| } | |
| .ayah-number { | |
| display: inline-block; | |
| color: var(--accent-gold); | |
| border: 1px solid var(--accent-gold); | |
| border-radius: 50%; | |
| width: 32px; | |
| height: 32px; | |
| text-align: center; | |
| line-height: 30px; | |
| font-size: 0.85rem; | |
| margin-right: 10px; | |
| } | |
| /* Page View Styling */ | |
| .page-view { | |
| background: var(--bg-secondary); | |
| border: 1px solid var(--border-color); | |
| border-radius: 10px; | |
| padding: 30px; | |
| line-height: 3.2rem; | |
| text-align: justify; | |
| direction: rtl; | |
| } | |
| .page-view .inline-ayah { | |
| font-family: 'Amiri Quran', serif; | |
| font-size: 1.8rem; | |
| color: var(--text-light); | |
| cursor: pointer; | |
| padding: 2px 4px; | |
| border-radius: 4px; | |
| } | |
| .page-view .inline-ayah.active { | |
| background-color: var(--accent-gold); | |
| color: #000; | |
| } | |
| /* Fixed Bottom Player */ | |
| .player-bar { | |
| position: fixed; | |
| bottom: 0; | |
| left: 0; | |
| right: 0; | |
| background: #071712; | |
| border-top: 2px solid var(--accent-gold); | |
| padding: 12px 20px; | |
| display: flex; | |
| justify-content: space-between; | |
| align-items: center; | |
| z-index: 1000; | |
| } | |
| .player-info { | |
| font-size: 0.95rem; | |
| color: var(--accent-gold); | |
| } | |
| .player-controls { | |
| display: flex; | |
| gap: 10px; | |
| } | |
| .loading { | |
| text-align: center; | |
| font-size: 1.2rem; | |
| color: var(--accent-gold); | |
| margin-top: 50px; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <header> | |
| <h1>سوره مبارکه یونس (ع)</h1> | |
| <p>قرآن هوشمند با قابلیت تکرار و قرائت آیه به آیه</p> | |
| </header> | |
| <div class="controls"> | |
| <div class="control-group"> | |
| <label>قاری:</label> | |
| <select id="reciterSelect"> | |
| <option value="Parhizgar_48kbps">استاد شهریار پرهیزگار</option> | |
| <option value="Alafasy_128kbps">استاد مشاری العفاسی</option> | |
| <option value="Minshawy_Murattal_128kbps">استاد محمد صدیق منشاوی</option> | |
| <option value="Husary_128kbps">استاد خلیل الحصری</option> | |
| <option value="Abdul_Basit_Murattal_192kbps">استاد عبدالباسط</option> | |
| </select> | |
| </div> | |
| <div class="control-group"> | |
| <label>تکرار هر آیه:</label> | |
| <select id="repeatSelect"> | |
| <option value="1">۱ بار</option> | |
| <option value="2">۲ بار</option> | |
| <option value="3">۳ بار</option> | |
| <option value="5">۵ بار</option> | |
| </select> | |
| </div> | |
| <div class="control-group"> | |
| <label>حالت نمایش:</label> | |
| <select id="viewSelect"> | |
| <option value="list">آیه به آیه (با ترجمه)</option> | |
| <option value="page">حالت صفحه ای (پیوسته)</option> | |
| </select> | |
| </div> | |
| </div> | |
| <div class="container"> | |
| <div class="bismillah">بِسْمِ ٱللَّهِ ٱلرَّحْمَـٰنِ ٱلرَّحِيمِ</div> | |
| <div id="content" class="loading">در حال دریافت اطلاعات سوره یونس...</div> | |
| </div> | |
| <div class="player-bar"> | |
| <div class="player-info" id="playerStatus">آیهای انتخاب نشده است</div> | |
| <div class="player-controls"> | |
| <button id="prevBtn">آیه قبل</button> | |
| <button id="playBtn">پخش / توقف</button> | |
| <button id="nextBtn">آیه بعد</button> | |
| </div> | |
| </div> | |
| <audio id="audioPlayer"></audio> | |
| <script> | |
| const SURAH_NUMBER = 10; | |
| let versesData = []; | |
| let currentAyahIndex = 0; | |
| let currentRepeatCount = 0; | |
| let isPlaying = false; | |
| const audioPlayer = document.getElementById('audioPlayer'); | |
| const contentDiv = document.getElementById('content'); | |
| const reciterSelect = document.getElementById('reciterSelect'); | |
| const repeatSelect = document.getElementById('repeatSelect'); | |
| const viewSelect = document.getElementById('viewSelect'); | |
| const playBtn = document.getElementById('playBtn'); | |
| const prevBtn = document.getElementById('prevBtn'); | |
| const nextBtn = document.getElementById('nextBtn'); | |
| const playerStatus = document.getElementById('playerStatus'); | |
| // Fetch Quran Data (Uthmani + Translation) | |
| async function fetchSurahData() { | |
| try { | |
| const response = await fetch(`https://api.alquran.cloud/v1/surah/${SURAH_NUMBER}/editions/quran-uthmani,fa.fooladvand`); | |
| const json = await response.json(); | |
| const arabic = json.data[0].ayahs; | |
| const translation = json.data[1].ayahs; | |
| versesData = arabic.map((item, index) => ({ | |
| numberInSurah: item.numberInSurah, | |
| text: item.text, | |
| translation: translation[index].text | |
| })); | |
| render(); | |
| } catch (error) { | |
| contentDiv.innerHTML = 'خطا در بارگیری دادهها. لطفاً اتصال اینترنت خود را بررسی کنید.'; | |
| } | |
| } | |
| function render() { | |
| const mode = viewSelect.value; | |
| contentDiv.className = mode === 'list' ? 'ayah-list-view' : 'page-view'; | |
| contentDiv.innerHTML = ''; | |
| if (mode === 'list') { | |
| versesData.forEach((ayah, index) => { | |
| const card = document.createElement('div'); | |
| card.className = `ayah-card ${index === currentAyahIndex ? 'active' : ''}`; | |
| card.id = `ayah-${index}`; | |
| card.onclick = () => playAyah(index); | |
| card.innerHTML = ` | |
| <div class="quran-text">${ayah.text} <span class="ayah-number">${ayah.numberInSurah}</span></div> | |
| <div class="translation-text">${ayah.translation}</div> | |
| `; | |
| contentDiv.appendChild(card); | |
| }); | |
| } else { | |
| versesData.forEach((ayah, index) => { | |
| const span = document.createElement('span'); | |
| span.className = `inline-ayah ${index === currentAyahIndex ? 'active' : ''}`; | |
| span.id = `ayah-${index}`; | |
| span.onclick = () => playAyah(index); | |
| span.innerHTML = `${ayah.text} <span class="ayah-number">${ayah.numberInSurah}</span> `; | |
| contentDiv.appendChild(span); | |
| }); | |
| } | |
| } | |
| function getAudioUrl(surah, ayah) { | |
| const reciter = reciterSelect.value; | |
| const sStr = String(surah).padStart(3, '0'); | |
| const aStr = String(ayah).padStart(3, '0'); | |
| return `https://everyayah.com/data/${reciter}/${sStr}${aStr}.mp3`; | |
| } | |
| function playAyah(index) { | |
| if (index < 0 || index >= versesData.length) return; | |
| if (currentAyahIndex !== index) { | |
| currentAyahIndex = index; | |
| currentRepeatCount = 0; | |
| } | |
| const ayah = versesData[currentAyahIndex]; | |
| audioPlayer.src = getAudioUrl(SURAH_NUMBER, ayah.numberInSurah); | |
| audioPlayer.play(); | |
| isPlaying = true; | |
| updateUI(); | |
| } | |
| function updateUI() { | |
| renderHighlights(); | |
| const ayah = versesData[currentAyahIndex]; | |
| const maxRepeat = parseInt(repeatSelect.value); | |
| playerStatus.textContent = `آیه ${ayah.numberInSurah} از ۱۰۹ (تکرار: ${currentRepeatCount + 1} از ${maxRepeat})`; | |
| playBtn.textContent = isPlaying ? 'توقف' : 'پخش'; | |
| const activeElem = document.getElementById(`ayah-${currentAyahIndex}`); | |
| if (activeElem) { | |
| activeElem.scrollIntoView({ behavior: 'smooth', block: 'center' }); | |
| } | |
| } | |
| function renderHighlights() { | |
| document.querySelectorAll('.active').forEach(el => el.classList.remove('active')); | |
| const activeElem = document.getElementById(`ayah-${currentAyahIndex}`); | |
| if (activeElem) activeElem.classList.add('active'); | |
| } | |
| audioPlayer.onended = () => { | |
| const maxRepeat = parseInt(repeatSelect.value); | |
| currentRepeatCount++; | |
| if (currentRepeatCount < maxRepeat) { | |
| audioPlayer.play(); | |
| updateUI(); | |
| } else { | |
| currentRepeatCount = 0; | |
| if (currentAyahIndex + 1 < versesData.length) { | |
| playAyah(currentAyahIndex + 1); | |
| } else { | |
| isPlaying = false; | |
| updateUI(); | |
| } | |
| } | |
| }; | |
| playBtn.onclick = () => { | |
| if (isPlaying) { | |
| audioPlayer.pause(); | |
| isPlaying = false; | |
| } else { | |
| if (!audioPlayer.src) { | |
| playAyah(0); | |
| } else { | |
| audioPlayer.play(); | |
| isPlaying = true; | |
| } | |
| } | |
| playBtn.textContent = isPlaying ? 'توقف' : 'پخش'; | |
| }; | |
| prevBtn.onclick = () => playAyah(currentAyahIndex - 1); | |
| nextBtn.onclick = () => playAyah(currentAyahIndex + 1); | |
| viewSelect.onchange = render; | |
| reciterSelect.onchange = () => { if (isPlaying) playAyah(currentAyahIndex); }; | |
| fetchSurahData(); | |
| </script> | |
| </body> | |
| </html> |