پرش به محتوا

تست: تفاوت میان نسخه‌ها

از دانشنامه کتاب مقدس
بدون خلاصۀ ویرایش
بدون خلاصۀ ویرایش
خط ۱۳۳: خط ۱۳۳:
         .custom-select:hover {
         .custom-select:hover {
             border-color: var(--accent-color);
             border-color: var(--accent-color);
        }
       
        .custom-select.active {
            border-color: var(--primary-color);
         }
         }
          
          
خط ۱۵۹: خط ۱۶۳:
             max-height: 250px;
             max-height: 250px;
             overflow: hidden;
             overflow: hidden;
        }
       
        .custom-select-dropdown.show {
            display: block;
         }
         }
          
          
خط ۶۰۰: خط ۶۰۸:
         const recentItems = document.getElementById('recentItems');
         const recentItems = document.getElementById('recentItems');


        let isDropdownOpen = false;
         let currentCategory = '';
         let currentCategory = '';
         let currentSelection = { value: '', text: '' };
         let currentSelection = { value: '', text: '' };
خط ۶۴۳: خط ۶۵۰:
         }
         }


         function updateBookList() {
         // مدیریت باز و بسته شدن dropdown
            const selectedCategory = categorySelect.value;
         function toggleDropdown() {
            currentCategory = selectedCategory;
           
            if (!selectedCategory) {
                customSelectDisplay.innerHTML = '<span>ابتدا دسته‌بندی را انتخاب کنید</span><i class="fas fa-chevron-down"></i>';
                customSelectDisplay.style.color = '#6c757d';
                resetContent();
                return;
            }
           
            customSelectDisplay.innerHTML = '<span>لطفاً محتوا انتخاب کنید</span><i class="fas fa-chevron-down"></i>';
            customSelectDisplay.style.color = '#333';
            resetContent();
           
            // وقتی دسته‌بندی تغییر کرد، dropdown را با محتواهای جدید پر کن
            populateDropdownOptions();
         }
 
        customSelectDisplay.addEventListener('click', function(e) {
             if (!currentCategory) {
             if (!currentCategory) {
                 alert('لطفاً ابتدا یک دسته‌بندی انتخاب کنید');
                 alert('لطفاً ابتدا یک دسته‌بندی انتخاب کنید');
خط ۶۶۸: خط ۶۵۷:
             }
             }
              
              
             e.stopPropagation();
             const isOpen = customDropdown.classList.contains('show');
             isDropdownOpen = !isDropdownOpen;
              
             customDropdown.style.display = isDropdownOpen ? 'block' : 'none';
             // بستن تمام dropdownهای دیگر
            customSelectDisplay.classList.toggle('active', isDropdownOpen);
            document.querySelectorAll('.custom-select-dropdown.show').forEach(dropdown => {
                dropdown.classList.remove('show');
            });
            document.querySelectorAll('.custom-select.active').forEach(select => {
                select.classList.remove('active');
            });
              
              
             if (isDropdownOpen) {
             if (!isOpen) {
                customDropdown.classList.add('show');
                customSelectDisplay.classList.add('active');
                 populateDropdownOptions();
                 populateDropdownOptions();
                 dropdownSearch.value = '';
                 dropdownSearch.value = '';
                 dropdownSearch.focus();
                 setTimeout(() => dropdownSearch.focus(), 100);
             }
             }
         });
         }
 
        document.addEventListener('click', function() {
            isDropdownOpen = false;
            customDropdown.style.display = 'none';
            customSelectDisplay.classList.remove('active');
        });
 
        customDropdown.addEventListener('click', function(e) {
            e.stopPropagation();
        });


        // پر کردن dropdown با گزینه‌ها
         function populateDropdownOptions(searchTerm = '') {
         function populateDropdownOptions(searchTerm = '') {
             if (!currentCategory) {
             if (!currentCategory) return;
                optionsContainer.innerHTML = '<div class="option-item">لطفاً ابتدا دسته‌بندی انتخاب کنید</div>';
                return;
            }
              
              
             const books = booksData[currentCategory];
             const books = booksData[currentCategory];
خط ۷۳۳: خط ۷۱۷:
                     customSelectDisplay.style.color = '#333';
                     customSelectDisplay.style.color = '#333';
                      
                      
                     isDropdownOpen = false;
                     // بستن dropdown
                     customDropdown.style.display = 'none';
                     customDropdown.classList.remove('show');
                     customSelectDisplay.classList.remove('active');
                     customSelectDisplay.classList.remove('active');
                      
                      
خط ۷۴۴: خط ۷۲۸:
         }
         }


         dropdownSearch.addEventListener('input', function() {
         // به روزرسانی لیست کتاب‌ها وقتی دسته‌بندی تغییر می‌کند
             populateDropdownOptions(this.value);
        function updateBookList() {
         });
            const selectedCategory = categorySelect.value;
            currentCategory = selectedCategory;
           
            if (!selectedCategory) {
                customSelectDisplay.innerHTML = '<span>ابتدا دسته‌بندی را انتخاب کنید</span><i class="fas fa-chevron-down"></i>';
                customSelectDisplay.style.color = '#6c757d';
                resetContent();
                return;
            }
           
            customSelectDisplay.innerHTML = '<span>لطفاً محتوا انتخاب کنید</span><i class="fas fa-chevron-down"></i>';
            customSelectDisplay.style.color = '#333';
             resetContent();
         }


        // نمایش محتوا
         function showContent(bookValue, bookText) {
         function showContent(bookValue, bookText) {
             if (!bookValue) {
             if (!bookValue) {
خط ۸۴۴: خط ۸۴۲:
         }
         }


         // مدیریت بزرگ‌نمایی و کوچک‌نمایی
         // event listeners
        customSelectDisplay.addEventListener('click', toggleDropdown);
 
        document.addEventListener('click', function(e) {
            if (!customSelectDisplay.contains(e.target) && !customDropdown.contains(e.target)) {
                customDropdown.classList.remove('show');
                customSelectDisplay.classList.remove('active');
            }
        });
 
        dropdownSearch.addEventListener('input', function() {
            populateDropdownOptions(this.value);
        });
 
        categorySelect.addEventListener('change', updateBookList);
 
         zoomIn.addEventListener('click', function() {
         zoomIn.addEventListener('click', function() {
             if (currentZoom < 150) {
             if (currentZoom < 150) {
خط ۸۵۹: خط ۸۷۲:
         });
         });


        // بارگذاری مجدد
         refreshBtn.addEventListener('click', function() {
         refreshBtn.addEventListener('click', function() {
             if (currentSelection.value) {
             if (currentSelection.value) {
خط ۸۶۶: خط ۸۷۸:
         });
         });


        // رویدادهای اولیه
        categorySelect.addEventListener('change', updateBookList);
       
         // مقداردهی اولیه
         // مقداردهی اولیه
         updateStats();
         updateStats();

نسخهٔ ‏۱۲ اکتبر ۲۰۲۵، ساعت ۲۱:۲۲

<!DOCTYPE html> کتابخانه پدیا بایبل - مطالعه کتاب‌ها و مقالات

کتابخانه پدیا بایبل

در این بخش می‌توانید کتاب‌ها و مقالات مختلف را مطالعه کنید. برای شروع، دسته‌بندی و سپس مورد مورد نظر خود را انتخاب نمایید.
تعداد کتاب‌ها: 4
تعداد مقالات: 4
مطالب مطالعه شده: 0
ابتدا دسته‌بندی را انتخاب کنید
هیچ محتوایی انتخاب نشده است

لطفاً یک کتاب یا مقاله از لیست انتخاب کنید

مطالب مطالعه شده اخیر
هیچ مطلبی اخیراً مطالعه نشده است