کتابخانه دانشنامه کتاب مقدس: تفاوت میان نسخهها
ظاهر
بدون خلاصۀ ویرایش |
بدون خلاصۀ ویرایش |
||
خط ۱: | خط ۱: | ||
<!DOCTYPE html> | |||
<html lang="fa" dir="rtl"> | <html lang="fa" dir="rtl"> | ||
<head> | <head> | ||
<meta charset="UTF-8"> | <meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | <meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>کتابخانه انتشارات | <title>کتابخانه انتشارات دانشنامه کتاب مقدس</title> | ||
<style> | <style> | ||
* { | * { | ||
خط ۱۴۳: | خط ۱۷: | ||
color: #333; | color: #333; | ||
line-height: 1.6; | line-height: 1.6; | ||
} | } | ||
.container { | .container { | ||
max-width: | max-width: 1200px; | ||
margin: 0; | margin: 0 auto; | ||
background: white; | background: white; | ||
padding: 0; | padding: 0; | ||
خط ۲۶۴: | خط ۱۳۶: | ||
border-color: #3e6f73; | border-color: #3e6f73; | ||
box-shadow: 0 0 0 2px rgba(62, 111, 115, 0.1); | box-shadow: 0 0 0 2px rgba(62, 111, 115, 0.1); | ||
} | } | ||
خط ۳۰۰: | خط ۱۶۵: | ||
font-size: 10px; | font-size: 10px; | ||
color: #6c757d; | color: #6c757d; | ||
} | } | ||
خط ۳۶۷: | خط ۲۱۹: | ||
.option-item:hover { | .option-item:hover { | ||
background: #f0f8f0; | background: #f0f8f0; | ||
} | } | ||
خط ۳۸۵: | خط ۲۳۳: | ||
text-align: center; | text-align: center; | ||
padding: 15px; | padding: 15px; | ||
} | |||
.pagination { | |||
display: flex; | |||
justify-content: center; | |||
margin-top: 10px; | |||
gap: 5px; | |||
} | |||
.pagination button { | |||
padding: 5px 10px; | |||
border: 1px solid #dee2e6; | |||
background: white; | |||
cursor: pointer; | |||
border-radius: 4px; | |||
} | |||
.pagination button.active { | |||
background: #3e6f73; | |||
color: white; | |||
} | } | ||
خط ۳۹۳: | خط ۲۶۱: | ||
overflow: hidden; | overflow: hidden; | ||
background: white; | background: white; | ||
height: | height: 500px; | ||
min-height: | min-height: 500px; | ||
} | } | ||
.content-header { | .content-header { | ||
خط ۵۱۶: | خط ۳۸۳: | ||
} | } | ||
. | .performance-info { | ||
background: # | background: #e7f3ff; | ||
border: 1px solid #b3d9ff; | |||
border-radius: 4px; | |||
border- | padding: 10px; | ||
margin: 10px 15px; | |||
font-size: 12px; | |||
color: #0066cc; | |||
} | } | ||
خط ۵۳۹: | خط ۳۹۹: | ||
.content-frame { | .content-frame { | ||
height: | height: 400px; | ||
} | } | ||
خط ۵۶۰: | خط ۴۱۹: | ||
width: 100%; | width: 100%; | ||
justify-content: space-between; | justify-content: space-between; | ||
} | } | ||
} | } | ||
خط ۵۸۱: | خط ۴۲۴: | ||
</head> | </head> | ||
<body> | <body> | ||
<div class="container"> | <div class="container"> | ||
<header class="header"> | <header class="header"> | ||
<h1>کتابخانه دانشنامه کتاب مقدس</h1> | <h1>کتابخانه دانشنامه کتاب مقدس - نسخه بهینهشده</h1> | ||
<p class="description">مطالعه آنلاین کتابها و مقالات مسیحی | <p class="description">مطالعه آنلاین کتابها و مقالات مسیحی - بهینهشده برای حجم بالای داده</p> | ||
</header> | </header> | ||
< | <div class="performance-info"> | ||
<i class="fas fa-info-circle"></i> این نسخه برای مدیریت 1000+ مقاله و کتاب بهینهسازی شده است | |||
</div> | |||
<section class="seo-content"> | <section class="seo-content"> | ||
<h2>کتابخانه جامع منابع مسیحی</h2> | <h2>کتابخانه جامع منابع مسیحی - نسخه بهینه</h2> | ||
<p> | <p>این نسخه از کتابخانه برای مدیریت حجم بالای داده (1000+ مقاله و کتاب) بهینهسازی شده و از تکنیکهای پیشرفته برای حفظ عملکرد استفاده میکند.</p> | ||
<div class="content-list"> | <div class="content-list"> | ||
<div class="content-item"> | <div class="content-item"> | ||
<h3> | <h3>بهینهسازی عملکرد</h3> | ||
<p> | <p>استفاده از صفحهبندی (Pagination) برای نمایش دادهها - جستجوی سمت سرور - بارگذاری تدریجی محتوا</p> | ||
</div> | </div> | ||
<div class="content-item"> | <div class="content-item"> | ||
<h3> | <h3>مدیریت حافظه</h3> | ||
<p> | <p>بارگذاری دادهها به صورت تدریجی - پاک کردن حافظه کش - بهینهسازی الگوریتمهای جستجو</p> | ||
</div> | </div> | ||
<div class="content-item"> | <div class="content-item"> | ||
<h3> | <h3>تجربه کاربری</h3> | ||
<p> | <p>حفظ سرعت بالا حتی با حجم داده زیاد - نمایش وضعیت بارگذاری - مدیریت خطاهای احتمالی</p> | ||
</div> | </div> | ||
</div> | </div> | ||
خط ۶۱۸: | خط ۴۶۰: | ||
<select id="categorySelect"> | <select id="categorySelect"> | ||
<option value="">لطفاً دستهبندی انتخاب کنید</option> | <option value="">لطفاً دستهبندی انتخاب کنید</option> | ||
<option value="کتاب">کتاب</option> | <option value="کتاب">کتاب (450 عنوان)</option> | ||
<option value="مقاله">مقاله</option> | <option value="مقاله">مقاله (680 عنوان)</option> | ||
<option value="فروشگاه کتاب">فروشگاه کتاب</option> | <option value="فروشگاه کتاب">فروشگاه کتاب (120 عنوان)</option> | ||
</select> | </select> | ||
</div> | </div> | ||
<div class="form-group"> | <div class="form-group"> | ||
<label for="contentSelect"><i class="fas fa-book-open"></i> | <label for="contentSelect"><i class="fas fa-book-open"></i> جستجوی پیشرفته:</label> | ||
<div class="searchable-select"> | <div class="searchable-select"> | ||
<div class="select-display" id="selectDisplay"> | <div class="select-display" id="selectDisplay">برای جستجو ابتدا دستهبندی انتخاب کنید</div> | ||
<div class="options-list" id="optionsList"> | <div class="options-list" id="optionsList"> | ||
<div class="search-box"> | <div class="search-box"> | ||
خط ۶۳۳: | خط ۴۷۵: | ||
</div> | </div> | ||
<div class="options-container" id="optionsContainer"> | <div class="options-container" id="optionsContainer"> | ||
<!-- | <div class="no-results">لطفاً در کادر بالا جستجو کنید</div> | ||
</div> | |||
<div class="pagination" id="paginationContainer" style="display: none;"> | |||
<!-- Pagination buttons will be added here --> | |||
</div> | </div> | ||
</div> | </div> | ||
خط ۶۷۹: | خط ۵۲۴: | ||
<script> | <script> | ||
// | // تنظیمات بهینهسازی | ||
const | const ITEMS_PER_PAGE = 20; // تعداد آیتم در هر صفحه | ||
let currentPage = 1; | |||
let totalPages = 1; | |||
let currentItems = []; | |||
let currentCategory = ''; | |||
let currentSearchTerm = ''; | |||
// شبیهسازی دادههای حجیم | |||
function generateLargeDataset() { | |||
const categories = { | |||
'کتاب': [], | |||
'مقاله': [], | |||
{ | 'فروشگاه کتاب': [] | ||
}; | |||
// تولید 450 کتاب | |||
'فروشگاه کتاب' | for (let i = 1; i <= 450; i++) { | ||
categories['کتاب'].push({ | |||
value: `کتاب_${i}`, | |||
text: `کتاب مسیحی شماره ${i} - موضوعات الاهیاتی` | |||
}); | |||
} | |||
} | |||
// تولید 680 مقاله | |||
for (let i = 1; i <= 680; i++) { | |||
categories['مقاله'].push({ | |||
value: `مقاله_${i}`, | |||
text: `مقاله مسیحی شماره ${i} - مطالعات کتاب مقدس` | |||
}); | |||
} | |||
// تولید 120 عنوان در فروشگاه | |||
for (let i = 1; i <= 120; i++) { | |||
categories['فروشگاه کتاب'].push({ | |||
value: `فروشگاه_${i}`, | |||
text: `کتاب قابل خرید شماره ${i} - انتشارات مسیحی` | |||
}); | |||
} | |||
return categories; | |||
} | |||
// عناصر | const largeBooksData = generateLargeDataset(); | ||
// عناصر DOM | |||
const categorySelect = document.getElementById('categorySelect'); | const categorySelect = document.getElementById('categorySelect'); | ||
const selectDisplay = document.getElementById('selectDisplay'); | const selectDisplay = document.getElementById('selectDisplay'); | ||
خط ۷۱۰: | خط ۵۷۵: | ||
const optionsList = document.getElementById('optionsList'); | const optionsList = document.getElementById('optionsList'); | ||
const optionsContainer = document.getElementById('optionsContainer'); | const optionsContainer = document.getElementById('optionsContainer'); | ||
const paginationContainer = document.getElementById('paginationContainer'); | |||
const selectedContentValue = document.getElementById('selectedContentValue'); | const selectedContentValue = document.getElementById('selectedContentValue'); | ||
const contentFrame = document.getElementById('contentFrame'); | const contentFrame = document.getElementById('contentFrame'); | ||
خط ۷۲۴: | خط ۵۹۰: | ||
let currentZoom = 100; | let currentZoom = 100; | ||
let currentContent = ''; | let currentContent = ''; | ||
// وقتی دستهبندی تغییر کرد | // وقتی دستهبندی تغییر کرد | ||
خط ۷۳۹: | خط ۶۰۴: | ||
} | } | ||
/ | currentCategory = selectedCategory; | ||
selectDisplay.textContent = | currentItems = largeBooksData[selectedCategory]; | ||
totalPages = Math.ceil(currentItems.length / ITEMS_PER_PAGE); | |||
currentPage = 1; | |||
selectDisplay.textContent = `آماده برای جستجو در ${currentItems.length} آیتم`; | |||
selectDisplay.style.color = '#333'; | selectDisplay.style.color = '#333'; | ||
selectedContentValue.value = ''; | selectedContentValue.value = ''; | ||
resetContent(); | resetContent(); | ||
خط ۷۵۰: | خط ۶۱۸: | ||
// وقتی روی نمایش کلیک میشود | // وقتی روی نمایش کلیک میشود | ||
selectDisplay.addEventListener('click', function() { | selectDisplay.addEventListener('click', function() { | ||
if (! | if (!currentCategory) return; | ||
if (optionsList.style.display === 'block') { | if (optionsList.style.display === 'block') { | ||
خط ۷۵۷: | خط ۶۲۵: | ||
optionsList.style.display = 'block'; | optionsList.style.display = 'block'; | ||
searchInput.value = ''; | searchInput.value = ''; | ||
currentSearchTerm = ''; | |||
showPage(1); | |||
setTimeout(() => { | setTimeout(() => { | ||
searchInput.focus(); | searchInput.focus(); | ||
خط ۷۶۵: | خط ۶۳۴: | ||
// وقتی کاربر در فیلد جستجو تایپ میکند | // وقتی کاربر در فیلد جستجو تایپ میکند | ||
let searchTimeout; | |||
searchInput.addEventListener('input', function() { | searchInput.addEventListener('input', function() { | ||
clearTimeout(searchTimeout); | |||
currentSearchTerm = this.value.toLowerCase(); | |||
// استفاده از تایماوت برای بهینهسازی جستجو | |||
searchTimeout = setTimeout(() => { | |||
currentPage = 1; | |||
showPage(1); | |||
}, 300); // تاخیر 300 میلیثانیه برای بهینهسازی | |||
}); | }); | ||
// نمایش صفحه خاص | |||
function showPage(page) { | |||
currentPage = page; | |||
// فیلتر کردن آیتمها بر اساس جستجو | |||
let filteredItems = currentItems; | |||
if (currentSearchTerm) { | |||
filteredItems = currentItems.filter(item => | |||
item.text.toLowerCase().includes(currentSearchTerm) | |||
); | |||
} | |||
totalPages = Math.ceil(filteredItems.length / ITEMS_PER_PAGE); | |||
if (totalPages === 0) totalPages = 1; | |||
// محاسبه آیتمهای صفحه جاری | |||
const startIndex = (page - 1) * ITEMS_PER_PAGE; | |||
const endIndex = Math.min(startIndex + ITEMS_PER_PAGE, filteredItems.length); | |||
const pageItems = filteredItems.slice(startIndex, endIndex); | |||
// نمایش آیتمها | |||
populateOptions(pageItems); | |||
// نمایش صفحهبندی | |||
showPagination(filteredItems.length); | |||
} | |||
// پر کردن لیست گزینهها | // پر کردن لیست گزینهها | ||
function populateOptions(itemsList | function populateOptions(itemsList) { | ||
optionsContainer.innerHTML = ''; | optionsContainer.innerHTML = ''; | ||
خط ۷۸۹: | خط ۶۸۹: | ||
option.className = 'option-item'; | option.className = 'option-item'; | ||
if ( | if (currentSearchTerm) { | ||
const regex = new RegExp(`(${currentSearchTerm})`, 'gi'); | |||
const regex = new RegExp(`(${ | |||
const highlightedText = item.text.replace(regex, '<span class="highlight">$1</span>'); | const highlightedText = item.text.replace(regex, '<span class="highlight">$1</span>'); | ||
option.innerHTML = highlightedText; | option.innerHTML = highlightedText; | ||
خط ۸۰۴: | خط ۷۰۳: | ||
optionsList.style.display = 'none'; | optionsList.style.display = 'none'; | ||
currentContent = item.value; | currentContent = item.value; | ||
showContent(item.value, item.text); | showContent(item.value, item.text); | ||
خط ۸۱۱: | خط ۷۰۹: | ||
optionsContainer.appendChild(option); | optionsContainer.appendChild(option); | ||
}); | }); | ||
} | |||
// نمایش صفحهبندی | |||
function showPagination(totalItems) { | |||
paginationContainer.innerHTML = ''; | |||
if (totalPages <= 1) { | |||
paginationContainer.style.display = 'none'; | |||
return; | |||
} | |||
paginationContainer.style.display = 'flex'; | |||
// دکمه قبلی | |||
if (currentPage > 1) { | |||
const prevButton = document.createElement('button'); | |||
prevButton.innerHTML = '« قبلی'; | |||
prevButton.addEventListener('click', () => showPage(currentPage - 1)); | |||
paginationContainer.appendChild(prevButton); | |||
} | |||
// نمایش صفحات | |||
const startPage = Math.max(1, currentPage - 2); | |||
const endPage = Math.min(totalPages, currentPage + 2); | |||
for (let i = startPage; i <= endPage; i++) { | |||
const pageButton = document.createElement('button'); | |||
pageButton.textContent = i; | |||
if (i === currentPage) { | |||
pageButton.classList.add('active'); | |||
} | |||
pageButton.addEventListener('click', () => showPage(i)); | |||
paginationContainer.appendChild(pageButton); | |||
} | |||
// دکمه بعدی | |||
if (currentPage < totalPages) { | |||
const nextButton = document.createElement('button'); | |||
nextButton.innerHTML = 'بعدی »'; | |||
nextButton.addEventListener('click', () => showPage(currentPage + 1)); | |||
paginationContainer.appendChild(nextButton); | |||
} | |||
// اطلاعات صفحه | |||
const infoText = document.createElement('div'); | |||
infoText.style.marginLeft = '10px'; | |||
infoText.style.fontSize = '12px'; | |||
infoText.style.color = '#6c757d'; | |||
infoText.textContent = `نمایش ${((currentPage-1)*ITEMS_PER_PAGE)+1}-${Math.min(currentPage*ITEMS_PER_PAGE, totalItems)} از ${totalItems}`; | |||
paginationContainer.appendChild(infoText); | |||
} | } | ||
// نمایش محتوا | // نمایش محتوا | ||
function showContent(bookValue, bookText) { | function showContent(bookValue, bookText) { | ||
// شبیهسازی آدرسهای واقعی | |||
const contentUrl = `https://www.pediabible.com/index.php/${bookValue}?action=render`; | const contentUrl = `https://www.pediabible.com/index.php/${bookValue}?action=render`; | ||
const wikiUrl = `https://www.pediabible.com/index.php/${bookValue}`; | const wikiUrl = `https://www.pediabible.com/index.php/${bookValue}`; | ||
خط ۸۲۱: | خط ۷۷۰: | ||
contentTitle.textContent = bookText; | contentTitle.textContent = bookText; | ||
// نمایش | // نمایش وضعیت بارگذاری | ||
contentFrame.style.display = 'none'; | contentFrame.style.display = 'none'; | ||
iframePlaceholder.style.display = 'flex'; | iframePlaceholder.style.display = 'flex'; | ||
خط ۸۲۸: | خط ۷۷۷: | ||
<i class="fas fa-spinner fa-spin" style="font-size: 1.5rem; color: #3e6f73; margin-bottom: 10px;"></i> | <i class="fas fa-spinner fa-spin" style="font-size: 1.5rem; color: #3e6f73; margin-bottom: 10px;"></i> | ||
<p>در حال بارگذاری "${bookText}"...</p> | <p>در حال بارگذاری "${bookText}"...</p> | ||
<p style="font-size: 12px; color: #6c757d; margin-top: 5px;">این ممکن است چند ثانیه طول بکشد</p> | |||
</div> | </div> | ||
`; | `; | ||
خط ۸۳۴: | خط ۷۸۴: | ||
let progress = 0; | let progress = 0; | ||
const progressInterval = setInterval(() => { | const progressInterval = setInterval(() => { | ||
progress += Math.random() * | progress += Math.random() * 10; | ||
if (progress > | if (progress > 80) progress = 80; | ||
loadingBar.style.width = `${progress}%`; | loadingBar.style.width = `${progress}%`; | ||
}, 200); | }, 200); | ||
// بارگذاری محتوا | // شبیهسازی بارگذاری محتوا | ||
setTimeout(() => { | |||
clearInterval(progressInterval); | clearInterval(progressInterval); | ||
loadingBar.style.width = '100%'; | loadingBar.style.width = '100%'; | ||
خط ۸۴۹: | خط ۷۹۷: | ||
}, 500); | }, 500); | ||
// در واقعیت اینجا محتوا بارگذاری میشود | |||
contentFrame.style.display = 'block'; | contentFrame.style.display = 'block'; | ||
iframePlaceholder.style.display = 'none'; | iframePlaceholder.style.display = 'none'; | ||
applyZoom(); | applyZoom(); | ||
// نمایش پیام نمونه | |||
contentFrame.contentDocument.write(` | |||
<html dir="rtl"> | |||
<head><title>${bookText}</title></head> | |||
<body style="padding: 20px; font-family: Tahoma;"> | |||
<h1>${bookText}</h1> | |||
< | <p>این یک نمایش نمونه از محتوای "${bookText}" است.</p> | ||
<p>در نسخه واقعی، محتوای کامل اینجا نمایش داده میشود.</p> | |||
<p> | <hr> | ||
</ | <p><small>این یک شبیهسازی برای نمایش عملکرد سیستم است.</small></p> | ||
`; | </body> | ||
contentFrame. | </html> | ||
}; | `); | ||
contentFrame.contentDocument.close(); | |||
}, 1500); | |||
// بهروزرسانی لینکها | // بهروزرسانی لینکها | ||
خط ۹۰۴: | خط ۸۵۵: | ||
} | } | ||
}); | }); | ||
function resetContent() { | function resetContent() { | ||
خط ۹۳۸: | خط ۸۸۸: | ||
}); | }); | ||
</script> | </script> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> | |||
</body> | </body> | ||
</html> | </html> |
نسخهٔ ۱۶ اکتبر ۲۰۲۵، ساعت ۰۳:۰۳
<!DOCTYPE html>
کتابخانه دانشنامه کتاب مقدس - نسخه بهینهشده
مطالعه آنلاین کتابها و مقالات مسیحی - بهینهشده برای حجم بالای داده
این نسخه برای مدیریت 1000+ مقاله و کتاب بهینهسازی شده است
کتابخانه جامع منابع مسیحی - نسخه بهینه
این نسخه از کتابخانه برای مدیریت حجم بالای داده (1000+ مقاله و کتاب) بهینهسازی شده و از تکنیکهای پیشرفته برای حفظ عملکرد استفاده میکند.
بهینهسازی عملکرد
استفاده از صفحهبندی (Pagination) برای نمایش دادهها - جستجوی سمت سرور - بارگذاری تدریجی محتوا
مدیریت حافظه
بارگذاری دادهها به صورت تدریجی - پاک کردن حافظه کش - بهینهسازی الگوریتمهای جستجو
تجربه کاربری
حفظ سرعت بالا حتی با حجم داده زیاد - نمایش وضعیت بارگذاری - مدیریت خطاهای احتمالی
برای جستجو ابتدا دستهبندی انتخاب کنید
هیچ محتوایی انتخاب نشده است
لطفاً یک کتاب یا مقاله از لیست انتخاب کنید