الگو:صفحه اصلی/دسته بندی موضوعی: تفاوت میان نسخه‌ها

بدون خلاصۀ ویرایش
بدون خلاصۀ ویرایش
 
(۲ نسخهٔ میانیِ ایجادشده توسط همین کاربر نشان داده نشد)
خط ۱: خط ۱:
<html>
<html>
<html>
<div class="mediawiki-category-container" style="direction: rtl; font-family: tahoma, arial; max-width: 1000px; margin: 20px auto; padding: 15px; background: #f9f9f9; border-radius: 18px; box-shadow: 0 8px 24px rgba(42, 128, 85, .14); border: 1px solid #c9e4d5;">
<!-- بخش استایل‌های اختصاصی و واکنش‌گرا -->
 
    <!-- بخش جستجو -->
    <div class="search-box" style="margin-bottom: 15px; text-align: center;">
        <input type="text" id="categorySearch" placeholder="جستجو در دسته‌بندی‌ها..."
              style="width: 90%; padding: 10px 18px; border: 1px solid #c9e4d5; border-radius: 25px; outline: none; font-size: 15px; transition: all 0.3s ease;">
    </div>
 
    <!-- بخش فیلترها -->
    <div class="filter-bar" style="display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 20px;">
        <button class="filter-btn active" onclick="filterSelection(event, 'all')" style="padding: 6px 16px; border-radius: 15px; border: none; background: #16bd78; color: white; cursor: pointer; font-size: 14px; font-weight: bold;">همه</button>
        <button class="filter-btn" onclick="filterSelection(event, 'tech')" style="padding: 6px 16px; border-radius: 15px; border: none; background: #eee; cursor: pointer; font-size: 14px;">تکنولوژی</button>
        <button class="filter-btn" onclick="filterSelection(event, 'art')" style="padding: 6px 16px; border-radius: 15px; border: none; background: #eee; cursor: pointer; font-size: 14px;">هنر</button>
        <button class="filter-btn" onclick="filterSelection(event, 'science')" style="padding: 6px 16px; border-radius: 15px; border: none; background: #eee; cursor: pointer; font-size: 14px;">علوم</button>
    </div>
 
    <!-- شبکه کارت‌های مستطیلی باریک -->
    <div id="categoryGrid" class="category-grid">
       
        <!-- کارت نمونه 1 -->
        <div class="category-card tech" style="background: white; padding: 8px 15px; border-radius: 10px; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 2px 6px rgba(0,0,0,0.05); border-right: 5px solid #16bd78;">
            <span class="card-title" style="font-weight: bold; color: #333; font-size: 16px;">هوش مصنوعی</span>
            <span style="font-size: 13px; color: #555; background: #f0fdf4; padding: 2px 10px; border-radius: 10px;">۱۲ مقاله</span>
        </div>
 
        <!-- کارت نمونه 2 -->
        <div class="category-card art" style="background: white; padding: 8px 15px; border-radius: 10px; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 2px 6px rgba(0,0,0,0.05); border-right: 5px solid #ff9f43;">
            <span class="card-title" style="font-weight: bold; color: #333; font-size: 16px;">نقاشی دیجیتال</span>
            <span style="font-size: 13px; color: #555; background: #fff7ed; padding: 2px 10px; border-radius: 10px;">۸ مقاله</span>
        </div>
 
        <!-- کارت نمونه 3 -->
        <div class="category-card science" style="background: white; padding: 8px 15px; border-radius: 10px; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 2px 6px rgba(0,0,0,0.05); border-right: 5px solid #54a0ff;">
            <span class="card-title" style="font-weight: bold; color: #333; font-size: 16px;">فیزیک کوانتوم</span>
            <span style="font-size: 13px; color: #555; background: #eff6ff; padding: 2px 10px; border-radius: 10px;">۵ مقاله</span>
        </div>
 
        <!-- کارت نمونه 4 -->
        <div class="category-card tech" style="background: white; padding: 8px 15px; border-radius: 10px; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 2px 6px rgba(0,0,0,0.05); border-right: 5px solid #16bd78;">
            <span class="card-title" style="font-weight: bold; color: #333; font-size: 16px;">برنامه‌نویسی</span>
            <span style="font-size: 13px; color: #555; background: #f0fdf4; padding: 2px 10px; border-radius: 10px;">۲۵ مقاله</span>
        </div>
 
        <!-- کارت نمونه 5 -->
        <div class="category-card art" style="background: white; padding: 8px 15px; border-radius: 10px; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 2px 6px rgba(0,0,0,0.05); border-right: 5px solid #ff9f43;">
            <span class="card-title" style="font-weight: bold; color: #333; font-size: 16px;">طراحی گرافیک</span>
            <span style="font-size: 13px; color: #555; background: #fff7ed; padding: 2px 10px; border-radius: 10px;">۱۰ مقاله</span>
        </div>
 
    </div>
</div>
 
<style>
<style>
  .wiki-province-container {
/* تنظیمات گرید اصلی */
    direction: rtl;
.category-grid {
    margin: 5px auto;
     display: grid;
    max-width: 1200px;
     grid-template-columns: repeat(4, 1fr); /* ۴ ستون در دسکتاپ */
    padding: 10px;
     gap: 12px;
  }
}
  .wiki-province-grid {
 
     display: grid !important;
/* حالت موبایل: ۲ ستون */
     grid-template-columns: repeat(4, 1fr) !important;
@media (max-width: 768px) {
     gap: 15px !important;
     .category-grid {
  }
        grid-template-columns: repeat(2, 1fr);
  .wiki-province-card {
     }
    background: #ffffff;
}
    border: 1.5px solid #8ee0d8; /* رنگ پایه با ۲۵ درصد روشنایی بیشتر */
 
    border-radius: 8px;
/* استایل‌ها */
     padding: 15px 5px;
.category-card { transition: all 0.2s ease; cursor: pointer; }
    text-align: center;
.category-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
.filter-btn:hover { opacity: 0.8; }
     transition: all 0.3s ease;
 
    cursor: pointer;
/* کلاس مخفی سازی برای حل مشکل جستجو */
    color: #2d3748;
.is-hidden {
    font-weight: 600;
     display: none !important;
    /* استفاده از clamp برای تغییر اندازه فونت پویا بین 14px تا 17px متناسب با عرض صفحه */
}
    font-size: clamp(14px, 1.2vw, 17px) !important;
</style>
   
 
    /* جلوگیری از شکستن متن و دوخطی شدن */
<script>
    white-space: nowrap !important;
// تابع فیلتر
    overflow: hidden !important;
function filterSelection(event, category) {
    text-overflow: ellipsis !important;
     const cards = document.getElementsByClassName("category-card");
    display: block !important;
    const buttons = document.getElementsByClassName("filter-btn");
  }
 
  .wiki-province-card:hover {
    // ریست کردن دکمه‌ها
    transform: translateY(-3px);
    for (let btn of buttons) {
    box-shadow: 0 4px 12px rgba(101, 195, 186, 0.15);
        btn.style.background = "#eee";
    border-color: #65c3ba; /* تغییر رنگ به رنگ پایه در حالت هاور */
        btn.style.color = "black";
     color: #65c3ba;
  }
  /* تنظیمات نمایشگر موبایل و تبلت‌های کوچک */
  @media (max-width: 768px) {
     .wiki-province-grid {
      grid-template-columns: repeat(2, 1fr) !important; /* ۲ کادر در هر ردیف */
      gap: 10px !important;
     }
     }
     .wiki-province-card {
     // فعال کردن دکمه کلیک شده
      padding: 12px 4px !important;
    event.currentTarget.style.background = "#16bd78";
      /* در موبایل اندازه فونت به صورت پویا با توجه به عرض صفحه بین 10.5px تا 14.5px تغییر می‌کند */
    event.currentTarget.style.color = "white";
      font-size: clamp(10.5px, 3.5vw, 14.5px) !important;
 
    for (let card of cards) {
        if (category === 'all') {
            card.classList.remove("is-hidden");
        } else {
            if (card.classList.contains(category)) {
                card.classList.remove("is-hidden");
            } else {
                card.classList.add("is-hidden");
            }
        }
     }
     }
  }
}
</style>
<!-- بدنه اصلی ساختار دسته‌بندی استان‌ها -->
<div class="wiki-province-container">
    <div style="text-align: center; margin-bottom: 15px;">
        <h2 style="color: #2c3e50; border-bottom: 2px solid #65c3ba; display: inline-block; padding-bottom: 10px; font-weight: bold; font-size: 24px;"> دسته بندی موضوعی</h2>
        <p style="color: #7f8c8d; font-size: 14px; margin-top: 10px;">برای مشاهده کسب‌وکارها، موضوع مورد نظر خود را انتخاب کنید.</p>
    </div>
<div class="wiki-province-container">
  <div class="wiki-province-grid">
    <a class="wiki-province-card" href="/wiki/مراکز_بهداشتی_و_درمانی">مراکز بهداشتی و درمانی</a>
    <a class="wiki-province-card" href="/wiki/پوشاک_خیاطی_و_مد">پوشاک، خیاطی و مد</a>
    <a class="wiki-province-card" href="/wiki/ادارات_و_خدمات_عمومی">ادارات و خدمات عمومی</a>
    <a class="wiki-province-card" href="/wiki/لوازم_خانه_و_دکوراسیون">لوازم خانه و دکوراسیون</a>
    <a class="wiki-province-card" href="/wiki/فناوری_دیجیتال_و_خدمات_اداری">فناوری، دیجیتال و خدمات اداری</a>


    <a class="wiki-province-card" href="/wiki/حمل‌ونقل_باربری_و_لجستیک">حمل‌ونقل، باربری و لجستیک</a>
// تابع جستجو
    <a class="wiki-province-card" href="/wiki/مواد_غذایی_و_خرید_روزمره">مواد غذایی و خرید روزمره</a>
document.getElementById('categorySearch').addEventListener('keyup', function() {
    <a class="wiki-province-card" href="/wiki/صنعت_تولید_و_کارگاه">صنعت، تولید و کارگاه</a>
     const searchValue = this.value.toLowerCase().trim();
     <a class="wiki-province-card" href="/wiki/طلا_جواهر_و_هدایا">طلا، جواهر و هدایا</a>
     const cards = document.getElementsByClassName("category-card");
     <a class="wiki-province-card" href="/wiki/ساختمان_املاک_و_تأسیسات">ساختمان، املاک و تأسیسات</a>


     <a class="wiki-province-card" href="/wiki/چاپ_نشر_و_تبلیغات">چاپ، نشر و تبلیغات</a>
     for (let card of cards) {
    <a class="wiki-province-card" href="/wiki/کشاورزی_دام_و_شیلات">کشاورزی، دام و شیلات</a>
        const titleElement = card.querySelector('.card-title');
    <a class="wiki-province-card" href="/wiki/سفر_گردشگری_و_اقامت">سفر، گردشگری و اقامت</a>
        const titleText = titleElement.innerText.toLowerCase();
    <a class="wiki-province-card" href="/wiki/حقوق_و_دفاتر_رسمی">حقوق و دفاتر رسمی</a>
    <a class="wiki-province-card" href="/wiki/تجارت_بازرگانی_و_مرز">تجارت، بازرگانی و مرز</a>


    <a class="wiki-province-card" href="/wiki/هتل_مراسم_و_تشریفات">هتل، مراسم و تشریفات</a>
        if (titleText.includes(searchValue)) {
    <a class="wiki-province-card" href="/wiki/آموزش_و_پرورش">آموزش و پرورش</a>
            card.classList.remove("is-hidden");
     <a class="wiki-province-card" href="/wiki/پزشکان_و_متخصصین">پزشکان و متخصصین</a>
        } else {
    <a class="wiki-province-card" href="/wiki/ورزش_بازی_و_تفریح">ورزش، بازی و تفریح</a>
            card.classList.add("is-hidden");
    <a class="wiki-province-card" href="/wiki/خدمات_منزل_و_نظافت">خدمات منزل و نظافت</a>
        }
     }
});
</script>


    <a class="wiki-province-card" href="/wiki/زیبایی_و_آرایشی">زیبایی و آرایشی</a>
    <a class="wiki-province-card" href="/wiki/رستوران_کافه_و_پذیرایی">رستوران، کافه و پذیرایی</a>
    <a class="wiki-province-card" href="/wiki/روانشناسان_و_مشاوره">روانشناسان و مشاوره</a>
    <a class="wiki-province-card" href="/wiki/خودرو_و_موتورسیکلت">خودرو و موتورسیکلت</a>
    <a class="wiki-province-card" href="/wiki/فرهنگ_هنر_و_رسانه">فرهنگ، هنر و رسانه</a>
  </div>
</div>


</html>
</html>