تست: تفاوت میان نسخهها
ظاهر
بدون خلاصۀ ویرایش |
بدون خلاصۀ ویرایش |
||
خط ۷: | خط ۷: | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> | <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> | ||
<style> | <style> | ||
* { | * { | ||
margin: 0; | margin: 0; | ||
خط ۶۰: | خط ۵۱: | ||
font-size: 16px; | font-size: 16px; | ||
margin-top: 10px; | margin-top: 10px; | ||
} | } | ||
خط ۸۴: | خط ۷۴: | ||
} | } | ||
.custom-select-container { | .custom-select-container { | ||
position: relative; | position: relative; | ||
خط ۱۳۹: | خط ۱۲۸: | ||
cursor: pointer; | cursor: pointer; | ||
border-bottom: 1px solid #f0f0f0; | border-bottom: 1px solid #f0f0f0; | ||
} | } | ||
.option-item:hover { | .option-item:hover { | ||
background-color: #e9ecef; | background-color: #e9ecef; | ||
} | } | ||
خط ۲۰۸: | خط ۱۹۲: | ||
.wiki-link { | .wiki-link { | ||
background-color: #3e6f73; | background-color: #3e6f73; | ||
color: white | color: white; | ||
text-decoration: none; | text-decoration: none; | ||
font-weight: bold; | font-weight: bold; | ||
padding: 10px 20px; | padding: 10px 20px; | ||
border-radius: 4px; | border-radius: 4px; | ||
border: none; | |||
cursor: pointer; | |||
} | } | ||
خط ۲۵۹: | خط ۲۳۸: | ||
ابتدا دستهبندی را انتخاب کنید | ابتدا دستهبندی را انتخاب کنید | ||
</div> | </div> | ||
<div class="custom-select-dropdown" id="customDropdown"> | <div class="custom-select-dropdown" id="customDropdown"> | ||
خط ۲۶۸: | خط ۲۴۴: | ||
</div> | </div> | ||
<div class="options-container" id="optionsContainer"> | <div class="options-container" id="optionsContainer"> | ||
</div> | </div> | ||
</div> | </div> | ||
خط ۲۹۵: | خط ۲۷۰: | ||
<script> | <script> | ||
const booksData = { | const booksData = { | ||
'کتاب': [ | 'کتاب': [ | ||
خط ۳۱۱: | خط ۲۸۵: | ||
}; | }; | ||
const categorySelect = document.getElementById('categorySelect'); | const categorySelect = document.getElementById('categorySelect'); | ||
const customSelectDisplay = document.getElementById('customSelectDisplay'); | const customSelectDisplay = document.getElementById('customSelectDisplay'); | ||
const customDropdown = document.getElementById('customDropdown'); | const customDropdown = document.getElementById('customDropdown'); | ||
خط ۳۲۶: | خط ۲۹۸: | ||
let currentSelection = { value: '', text: '' }; | let currentSelection = { value: '', text: '' }; | ||
function updateBookList() { | function updateBookList() { | ||
const selectedCategory = categorySelect.value; | const selectedCategory = categorySelect.value; | ||
خط ۳۳۲: | خط ۳۰۳: | ||
if (!selectedCategory) { | if (!selectedCategory) { | ||
customSelectDisplay.textContent = 'ابتدا دستهبندی را انتخاب کنید'; | customSelectDisplay.textContent = 'ابتدا دستهبندی را انتخاب کنید'; | ||
customSelectDisplay.style.color = '#6c757d'; | customSelectDisplay.style.color = '#6c757d'; | ||
خط ۳۳۹: | خط ۳۰۹: | ||
} | } | ||
customSelectDisplay.textContent = 'لطفاً محتوا انتخاب کنید'; | customSelectDisplay.textContent = 'لطفاً محتوا انتخاب کنید'; | ||
customSelectDisplay.style.color = '#333'; | customSelectDisplay.style.color = '#333'; | ||
خط ۳۴۵: | خط ۳۱۴: | ||
} | } | ||
customSelectDisplay.addEventListener('click', function(e) { | customSelectDisplay.addEventListener('click', function(e) { | ||
if (!currentCategory) return; | if (!currentCategory) return; | ||
خط ۳۶۰: | خط ۳۲۸: | ||
}); | }); | ||
document.addEventListener('click', function() { | document.addEventListener('click', function() { | ||
isDropdownOpen = false; | isDropdownOpen = false; | ||
خط ۳۶۶: | خط ۳۳۳: | ||
}); | }); | ||
customDropdown.addEventListener('click', function(e) { | customDropdown.addEventListener('click', function(e) { | ||
e.stopPropagation(); | e.stopPropagation(); | ||
}); | }); | ||
function populateDropdownOptions(searchTerm = '') { | function populateDropdownOptions(searchTerm = '') { | ||
if (!currentCategory) return; | if (!currentCategory) return; | ||
خط ۴۱۷: | خط ۳۸۲: | ||
noResult.textContent = 'نتیجهای یافت نشد'; | noResult.textContent = 'نتیجهای یافت نشد'; | ||
noResult.style.color = '#999'; | noResult.style.color = '#999'; | ||
optionsContainer.appendChild(noResult); | optionsContainer.appendChild(noResult); | ||
} | } | ||
} | } | ||
dropdownSearch.addEventListener('input', function() { | dropdownSearch.addEventListener('input', function() { | ||
populateDropdownOptions(this.value); | populateDropdownOptions(this.value); | ||
}); | }); | ||
function showContent(bookValue, bookText) { | function showContent(bookValue, bookText) { | ||
if (!bookValue) { | if (!bookValue) { | ||
resetContent(); | resetContent(); | ||
خط ۴۳۹: | خط ۳۹۹: | ||
const wikiUrl = `https://www.pediabible.com/index.php/${bookValue}`; | const wikiUrl = `https://www.pediabible.com/index.php/${bookValue}`; | ||
contentFrame.style.display = 'none'; | contentFrame.style.display = 'none'; | ||
iframePlaceholder.style.display = 'flex'; | iframePlaceholder.style.display = 'flex'; | ||
خط ۴۵۱: | خط ۴۰۸: | ||
`; | `; | ||
contentFrame.src = contentUrl; | contentFrame.src = contentUrl; | ||
contentFrame.onload = function() { | contentFrame.onload = function() { | ||
contentFrame.style.display = 'block'; | contentFrame.style.display = 'block'; | ||
iframePlaceholder.style.display = 'none'; | iframePlaceholder.style.display = 'none'; | ||
}; | }; | ||
contentFrame.onerror = function() { | contentFrame.onerror = function() { | ||
iframePlaceholder.style.display = 'flex'; | iframePlaceholder.style.display = 'flex'; | ||
iframePlaceholder.innerHTML = ` | iframePlaceholder.innerHTML = ` | ||
خط ۴۷۴: | خط ۴۲۶: | ||
}; | }; | ||
wikiLink.href = wikiUrl; | wikiLink.href = wikiUrl; | ||
wikiLink.textContent = `مشاهده صفحه کامل "${bookText}"`; | wikiLink.textContent = `مشاهده صفحه کامل "${bookText}"`; | ||
خط ۴۸۰: | خط ۴۳۱: | ||
} | } | ||
function resetContent() { | function resetContent() { | ||
currentSelection = { value: '', text: '' }; | currentSelection = { value: '', text: '' }; | ||
خط ۴۹۵: | خط ۴۴۵: | ||
} | } | ||
categorySelect.addEventListener('change', updateBookList); | categorySelect.addEventListener('change', updateBookList); | ||
updateBookList(); | updateBookList(); | ||
</script> | </script> | ||
</body> | </body> | ||
</html> | </html> |
نسخهٔ ۱۲ اکتبر ۲۰۲۵، ساعت ۲۰:۴۵
<!DOCTYPE html>
کتابخانه پدیا بایبل
در این بخش میتوانید کتابها و مقالات مختلف را مطالعه کنید.
برای شروع، دستهبندی و سپس مورد مورد نظر خود را انتخاب نمایید.
ابتدا دستهبندی را انتخاب کنید
لطفاً یک کتاب یا مقاله از لیست انتخاب کنید