تست: تفاوت میان نسخهها
ظاهر
بدون خلاصۀ ویرایش |
بدون خلاصۀ ویرایش |
||
خط ۴: | خط ۴: | ||
<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> | ||
< | <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> | ||
<style> | <style> | ||
:root { | |||
--primary-color: #2c3e50; | |||
--secondary-color: #3e6f73; | |||
--accent-color: #A52A2A; | |||
--light-color: #f8f5f2; | |||
--dark-color: #3E2723; | |||
--border-color: #D2B48C; | |||
--font-family: 'Times New Roman', serif; | |||
} | |||
* { | |||
margin: 0; | |||
padding: 0; | |||
box-sizing: border-box; | |||
} | |||
body { | body { | ||
font-family: Tahoma, Arial, sans-serif; | font-family: Tahoma, Arial, sans-serif; | ||
background-color: # | background-color: #f5f1eb; | ||
color: var(--dark-color); | |||
line-height: 1.6; | |||
padding: 0; | |||
margin: 0; | margin: 0; | ||
} | } | ||
/* مخفی کردن هدرهای اضافی ویکی */ | |||
body > header:first-child, | |||
.wiki-header, | |||
.mw-header, | |||
#mw-header, | |||
#header, | |||
.header { | |||
display: none !important; | |||
} | |||
.container { | .container { | ||
max-width: 1200px; | max-width: 1200px; | ||
margin: 0 auto; | margin: 0 auto; | ||
padding: 5px 15px; | |||
padding: | |||
} | } | ||
.header { | |||
.app-header { | |||
text-align: center; | |||
padding: 20px; | margin-bottom: 20px; | ||
padding: 15px 20px; | |||
border-bottom: 2px solid var(--border-color); | |||
background: linear-gradient(to bottom, #f9f6f2, #f0e6d6); | |||
border-radius: 8px; | border-radius: 8px; | ||
box-shadow: 0 2px 8px rgba(0,0,0,0.1); | |||
} | } | ||
h1 { | |||
.app-header h1 { | |||
color: var(--primary-color); | |||
margin-bottom: 8px; | |||
font-weight: | font-size: 1.8rem; | ||
font-weight: 700; | |||
} | } | ||
.description { | .description { | ||
color: #666; | color: #666; | ||
font-size: | font-size: 1rem; | ||
margin-top: | margin-top: 5px; | ||
} | } | ||
. | |||
.selector-container { | |||
display: grid; | |||
grid-template-columns: 1fr 1fr; | |||
gap: 15px; | |||
margin-bottom: 20px; | margin-bottom: 20px; | ||
background: white; | background: white; | ||
padding: 15px; | |||
border-radius: 8px; | |||
box-shadow: 0 4px 8px rgba(0,0,0,0.08); | |||
border: 1px solid var(--border-color); | |||
} | } | ||
.selector-box { | |||
. | |||
background: white; | background: white; | ||
border-radius: 6px; | |||
padding: 12px; | |||
border: 1px solid var(--border-color); | |||
} | } | ||
. | |||
.selector-title { | |||
font-size: 1rem; | |||
margin-bottom: 8px; | |||
color: var(--primary-color); | |||
border-bottom: 1px solid var(--border-color); | |||
border: 1px solid | padding-bottom: 5px; | ||
text-align: center; | |||
} | } | ||
select { | |||
width: 100%; | width: 100%; | ||
padding: | padding: 10px 12px; | ||
border: 1px solid | border: 1px solid var(--border-color); | ||
border-radius: 4px; | border-radius: 4px; | ||
background-color: white; | |||
font-size: 0.95rem; | |||
color: var(--dark-color); | |||
cursor: pointer; | cursor: pointer; | ||
font-family: Tahoma, Arial; | |||
} | } | ||
select:focus { | |||
outline: none; | |||
border-color: var(--accent-color); | |||
} | } | ||
. | |||
border-bottom: | .library-content { | ||
background: white; | |||
border-radius: 8px; | |||
box-shadow: 0 4px 12px rgba(0,0,0,0.1); | |||
padding: 25px; | |||
min-height: 500px; | |||
border: 1px solid var(--border-color); | |||
margin-bottom: 20px; | |||
} | } | ||
. | |||
.content-title { | |||
color | text-align: center; | ||
margin-bottom: 20px; | |||
color: var(--primary-color); | |||
font-size: 1.5rem; | |||
padding-bottom: 10px; | |||
border-bottom: 2px solid var(--border-color); | |||
} | } | ||
.content- | .content-display { | ||
width: 100%; | width: 100%; | ||
height: | height: 550px; | ||
border: | border: 1px solid var(--border-color); | ||
border-radius: 6px; | |||
background: white; | background: white; | ||
} | } | ||
.navigation { | |||
. | |||
display: flex; | display: flex; | ||
justify-content: flex-end; | justify-content: flex-end; | ||
align-items: center; | align-items: center; | ||
margin-top: 25px; | |||
gap: 10px; | |||
} | } | ||
.wiki-link { | .wiki-link { | ||
color: | display: inline-flex; | ||
align-items: center; | |||
justify-content: center; | |||
gap: 8px; | |||
padding: 12px 20px; | |||
background-color: var(--secondary-color); | |||
color: white; | |||
text-decoration: none; | text-decoration: none; | ||
border-radius: 6px; | |||
border-radius: | |||
transition: all 0.3s; | transition: all 0.3s; | ||
font-size: 1rem; | |||
box-shadow: 0 2px 4px rgba(0,0,0,0.2); | |||
} | } | ||
.wiki-link:hover { | .wiki-link:hover { | ||
background-color: # | background-color: #2d5257; | ||
color: | transform: translateY(-2px); | ||
box-shadow: 0 4px 8px rgba(0,0,0,0.2); | |||
} | |||
.instructions { | |||
text-align: center; | |||
color: #7f8c8d; | |||
padding: 40px 20px; | |||
border: 2px dashed var(--border-color); | |||
border-radius: 8px; | |||
margin-top: 20px; | |||
font-size: 1.1rem; | |||
background-color: var(--light-color); | |||
} | |||
/* استایل برای حالت انتخاب نشده */ | |||
.placeholder { | |||
display: flex; | |||
flex-direction: column; | |||
align-items: center; | |||
justify-content: center; | |||
height: 100%; | |||
color: #7f8c8d; | |||
text-align: center; | |||
} | |||
.placeholder i { | |||
font-size: 3rem; | |||
margin-bottom: 15px; | |||
color: var(--border-color); | |||
} | } | ||
/* استایلهای مخصوص موبایل */ | |||
@media (max-width: 768px) { | @media (max-width: 768px) { | ||
. | .container { | ||
padding: 8px 10px; | |||
} | } | ||
.content- | |||
height: | .selector-container { | ||
grid-template-columns: 1fr; | |||
} | |||
.library-content { | |||
padding: 15px; | |||
} | |||
.content-display { | |||
height: 450px; | |||
} | } | ||
} | } | ||
خط ۲۰۳: | خط ۲۲۲: | ||
<body> | <body> | ||
<div class="container"> | <div class="container"> | ||
<div class="header"> | <div class="app-header"> | ||
<h1>کتابخانه پدیا بایبل</h1> | <h1>کتابخانه پدیا بایبل</h1> | ||
< | <p class="description">مطالعه کتابها و مقالات مذهبی - انتخاب هوشمند و نمایش محتوای تمیز</p> | ||
</div> | </div> | ||
<div | <div id="content-wrapper"> | ||
< | <!-- محتوا توسط JavaScript پر میشود --> | ||
</div> | </div> | ||
</div> | </div> | ||
<script> | <script> | ||
// 🔒 سیستم حفاظتی - بررسی دامنه مجاز | |||
const ALLOWED_DOMAINS = [ | |||
'pediabible.com', | |||
'www.pediabible.com', | |||
'localhost', | |||
'127.0.0.1' | |||
]; | |||
const | // تابع بررسی مجاز بودن دامنه | ||
function isDomainAllowed() { | |||
const currentDomain = window.location.hostname; | |||
if (!currentDomain || currentDomain === '' || currentDomain === 'null') { | |||
return true; | |||
} | |||
return ALLOWED_DOMAINS.some(domain => | |||
currentDomain === domain || currentDomain.endsWith('.' + domain) | |||
); | |||
} | |||
// تابع نمایش پیام دسترسی غیرمجاز | |||
function showAccessDenied() { | |||
const wrapper = document.getElementById('content-wrapper'); | |||
wrapper.innerHTML = ` | |||
<div style="text-align: center; padding: 40px; background: #fee; border-radius: 8px; border: 2px solid #f5c6cb; color: #721c24;"> | |||
<h3><i class="fas fa-ban"></i> دسترسی محدود شده</h3> | |||
<p>این صفحه فقط بر روی دامنه <strong>pediabible.com</strong> قابل دسترسی است.</p> | |||
<p>لطفاً از <a href="https://www.pediabible.com" style="color: #721c24; text-decoration: underline;">سایت اصلی</a> بازدید کنید.</p> | |||
</div> | |||
`; | |||
} | |||
// تابع اصلی بارگذاری برنامه | |||
function loadApplication() { | |||
if (!isDomainAllowed()) { | |||
showAccessDenied(); | |||
return; | |||
} | } | ||
initializeLibraryApp(); | |||
} | |||
// دادههای کتابها و مقالات | |||
const libraryData = { | |||
'کتاب': [ | |||
{ name: "عیسی", displayName: "عیسی" }, | |||
{ name: "انجیل_متی", displayName: "انجیل متی" } | |||
], | |||
'مقاله': [ | |||
{ name: "مسیح", displayName: "مسیح" }, | |||
{ name: "تثلیث", displayName: "تثلیث" } | |||
] | |||
}; | |||
// 🔧 برنامه اصلی کتابخانه | |||
function initializeLibraryApp() { | |||
const wrapper = document.getElementById('content-wrapper'); | |||
// | // ایجاد ساختار HTML برنامه | ||
wrapper.innerHTML = ` | |||
<div class="selector-container"> | |||
<div class="selector-box"> | |||
<h3 class="selector-title">دستهبندی</h3> | |||
<select id="category-select"> | |||
<option value="">انتخاب دستهبندی</option> | |||
<option value="کتاب">کتاب</option> | |||
<option value="مقاله">مقاله</option> | |||
</select> | |||
</div> | |||
<div class="selector-box"> | |||
<h3 class="selector-title">انتخاب محتوا</h3> | |||
<select id="content-select" disabled> | |||
<option value="">انتخاب محتوا</option> | |||
</select> | |||
</div> | |||
</div> | |||
<div class="library-content"> | |||
<h2 class="content-title" id="content-title">لطفاً دستهبندی و محتوای مورد نظر را انتخاب کنید</h2> | |||
<div id="content-container"> | |||
<div class="instructions"> | |||
<div class="placeholder"> | |||
<i class="fas fa-book-open"></i> | |||
// | <p>برای مطالعه، لطفاً ابتدا دستهبندی و سپس محتوای مورد نظر خود را انتخاب کنید.</p> | ||
document. | </div> | ||
</div> | |||
</div> | |||
<div class="navigation"> | |||
<a href="#" class="wiki-link" id="wiki-page-link" target="_blank" style="display: none;"> | |||
<i class="fas fa-external-link-alt"></i> | |||
مشاهده صفحه کامل | |||
</a> | |||
</div> | |||
// | </div> | ||
`; | |||
// عناصر DOM | |||
const categorySelect = document.getElementById('category-select'); | |||
const contentSelect = document.getElementById('content-select'); | |||
const contentTitle = document.getElementById('content-title'); | |||
const contentContainer = document.getElementById('content-container'); | |||
const wikiPageLink = document.getElementById('wiki-page-link'); | |||
// متغیرهای وضعیت فعلی | |||
let currentCategory = ''; | |||
let currentContent = ''; | |||
// رویداد تغییر دستهبندی | |||
categorySelect.addEventListener('change', function() { | |||
currentCategory = this.value; | |||
if (currentCategory) { | |||
contentSelect.disabled = false; | |||
contentSelect.innerHTML = '<option value="">انتخاب محتوا</option>'; | |||
// پر کردن لیست محتوا بر اساس دستهبندی | |||
libraryData[currentCategory].forEach((item, index) => { | |||
const option = document.createElement('option'); | |||
option.value = index; | |||
option.textContent = item.displayName; | |||
contentSelect.appendChild(option); | |||
}); | }); | ||
resetContent(); | |||
} | } else { | ||
contentSelect.disabled = true; | |||
contentSelect.innerHTML = '<option value="">انتخاب محتوا</option>'; | |||
resetContent(); | |||
} | } | ||
}); | }); | ||
// | // رویداد تغییر محتوا | ||
contentSelect.addEventListener('change', function() { | |||
currentContent = this.value; | |||
if (currentContent !== '') { | |||
displayContentWithIframe(); | |||
} else { | } else { | ||
resetContent(); | |||
} | } | ||
}); | }); | ||
// نمایش | // نمایش محتوا با iframe - فقط محتوای اصلی | ||
function | function displayContentWithIframe() { | ||
const contentIndex = parseInt(currentContent); | |||
const contentData = libraryData[currentCategory][contentIndex]; | |||
const contentName = contentData.name; | |||
const contentDisplayName = contentData.displayName; | |||
contentTitle.textContent = `${contentDisplayName}`; | |||
const contentUrl = `https://www.pediabible.com/index.php/${contentName}?action=render`; | |||
const wikiUrl = `https://www.pediabible.com/index.php/${contentName}`; | |||
contentContainer.innerHTML = ` | |||
<iframe | |||
id="content-iframe" | |||
src="${contentUrl}" | |||
class="content-display" | |||
frameborder="0" | |||
loading="lazy"> | |||
</iframe> | |||
`; | |||
wikiPageLink.href = wikiUrl; | |||
wikiPageLink.style.display = 'flex'; | |||
} | |||
function resetContent() { | |||
contentTitle.textContent = 'لطفاً دستهبندی و محتوای مورد نظر را انتخاب کنید'; | |||
contentContainer.innerHTML = ` | |||
<div class="instructions"> | |||
<div class="placeholder"> | |||
<i class="fas fa-book-open"></i> | |||
<p>برای مطالعه، لطفاً ابتدا دستهبندی و سپس محتوای مورد نظر خود را انتخاب کنید.</p> | |||
</div> | |||
</div> | |||
`; | |||
wikiPageLink.style.display = 'none'; | |||
} | } | ||
console.log('✅ برنامه کتابخانه روی دامنه مجاز بارگذاری شد'); | |||
} | |||
// 🔒 شروع برنامه با بررسی امنیتی | |||
document.addEventListener('DOMContentLoaded', function() { | |||
loadApplication(); | |||
}); | |||
// 🔒 جلوگیری از دسترسی به توابع از کنسول | |||
Object.defineProperty(window, 'libraryData', { | |||
value: null, | |||
writable: false, | |||
configurable: false | |||
}); | }); | ||
</script> | </script> | ||
</body> | </body> | ||
</html> | </html> |
نسخهٔ ۱۲ اکتبر ۲۰۲۵، ساعت ۱۹:۲۸
<!DOCTYPE html>
کتابخانه پدیا بایبل
مطالعه کتابها و مقالات مذهبی - انتخاب هوشمند و نمایش محتوای تمیز