الگو:صفحه اصلی مغازه شما/دسته بندی موضوعی: تفاوت میان نسخهها
Esfandiari (بحث | مشارکتها) بدون خلاصۀ ویرایش |
Esfandiari (بحث | مشارکتها) بدون خلاصۀ ویرایش |
||
| خط ۳: | خط ۳: | ||
<div class="faraghaib-custom-container"> | <div class="faraghaib-custom-container"> | ||
<!-- بخش جستجو --> | |||
<div class="fz-search-wrapper"> | <div class="fz-search-wrapper"> | ||
<input type="text" id="categorySearch" placeholder="جستجو در دستهبندیها..."> | <input type="text" id="categorySearch" placeholder="جستجو در دستهبندیها..."> | ||
</div> | </div> | ||
<!-- بخش فیلترها --> | |||
<div class="fz-filter-bar"> | <div class="fz-filter-bar"> | ||
<button class="fz-filter-btn active" onclick="filterSelection(event, 'all')">همه</button> | <button class="fz-filter-btn active" onclick="filterSelection(event, 'all')">همه</button> | ||
| خط ۱۴: | خط ۱۶: | ||
</div> | </div> | ||
<!-- شبکه کارتها --> | |||
<div id="categoryGrid" class="fz-category-grid"> | <div id="categoryGrid" class="fz-category-grid"> | ||
<!-- نمونه کارتها (کلاسها را مطابق دستهبندی تغییر بده) --> | |||
<div class="fz-card tech"> | <div class="fz-card tech"> | ||
<span class="fz-title">هوش مصنوعی</span> | <span class="fz-title">هوش مصنوعی</span> | ||
</div> | </div> | ||
<div class="fz-card art"> | <div class="fz-card art"> | ||
<span class="fz-title">نقاشی دیجیتال</span> | <span class="fz-title">نقاشی دیجیتال</span> | ||
</div> | </div> | ||
<div class="fz-card science"> | <div class="fz-card science"> | ||
<span class="fz-title">فیزیک کوانتوم</span> | <span class="fz-title">فیزیک کوانتوم</span> | ||
</div> | </div> | ||
<div class="fz-card tech"> | <div class="fz-card tech"> | ||
<span class="fz-title">برنامهنویسی</span> | <span class="fz-title">برنامهنویسی</span> | ||
</div> | </div> | ||
<div class="fz-card art"> | <div class="fz-card art"> | ||
<span class="fz-title">طراحی گرافیک</span> | <span class="fz-title">طراحی گرافیک</span> | ||
<span class="fz- | </div> | ||
<div class="fz-card tech"> | |||
<span class="fz-title">امنیت شبکه</span> | |||
</div> | </div> | ||
| خط ۴۵: | خط ۴۸: | ||
<style> | <style> | ||
/* کانتینر اصلی */ | |||
.faraghaib-custom-container { | .faraghaib-custom-container { | ||
direction: rtl !important; | direction: rtl !important; | ||
| خط ۵۸: | خط ۶۲: | ||
} | } | ||
.fz-search-wrapper { | /* استایل ورودی جستجو */ | ||
.fz-search-wrapper { margin-bottom: 15px; text-align: center; } | |||
} | |||
.fz-search-wrapper input { | .fz-search-wrapper input { | ||
width: 90%; | width: 90%; | ||
padding: | padding: 10px 18px; | ||
border: 1px solid #c9e4d5; | border: 1px solid #c9e4d5; | ||
border-radius: | border-radius: 25px; | ||
outline: none; | outline: none; | ||
font-size: | font-size: 15px; | ||
font-family: 'IRANSans', 'IRANSansWeb', Tahoma, Arial, sans-serif !important; | font-family: 'IRANSans', 'IRANSansWeb', Tahoma, Arial, sans-serif !important; | ||
transition: 0.3s; | |||
} | } | ||
.fz-search-wrapper input:focus { border-color: #16bd78; box-shadow: 0 0 5px rgba(22, 189, 120, 0.2); } | |||
.fz-filter-bar { | /* استایل دکمههای فیلتر */ | ||
.fz-filter-bar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 20px; } | |||
} | |||
.fz-filter-btn { | .fz-filter-btn { | ||
padding: | padding: 6px 18px; | ||
border-radius: | border-radius: 20px; | ||
border: none; | border: none; | ||
background: #eee; | background: #eee; | ||
cursor: pointer; | cursor: pointer; | ||
font-size: | font-size: 14px; | ||
font-family: 'IRANSans', 'IRANSansWeb', Tahoma, Arial, sans-serif !important; | font-family: 'IRANSans', 'IRANSansWeb', Tahoma, Arial, sans-serif !important; | ||
transition: 0.3s; | transition: 0.3s; | ||
} | } | ||
.fz-filter-btn.active { background: #16bd78 !important; color: white !important; font-weight: bold; } | |||
/* چیدمان شبکه کارتها */ | |||
.fz-category-grid { | .fz-category-grid { | ||
display: grid !important; | display: grid !important; | ||
| خط ۱۰۴: | خط ۹۸: | ||
} | } | ||
/* استایل کارت نهایی */ | |||
.fz-card { | .fz-card { | ||
background: white !important; | background: white !important; | ||
| خط ۱۰۹: | خط ۱۰۴: | ||
display: flex !important; | display: flex !important; | ||
align-items: center !important; | align-items: center !important; | ||
justify-content: | justify-content: center !important; | ||
padding: 0 | padding: 0 10px !important; | ||
border-radius: 8px !important; | border-radius: 8px !important; | ||
box-shadow: 0 2px 5px rgba(0,0,0,0.05) !important; | box-shadow: 0 2px 5px rgba(0,0,0,0.05) !important; | ||
border-bottom: 4px solid #ddd !important; | border-bottom: 4px solid #ddd !important; /* خط رنگی پایین */ | ||
box-sizing: border-box !important; | box-sizing: border-box !important; | ||
cursor: pointer; | cursor: pointer; | ||
| خط ۱۲۳: | خط ۱۱۵: | ||
} | } | ||
.fz-card:hover { | .fz-card:hover { transform: translateY(-3px); box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important; } | ||
} | |||
/* استایل فونت داخل کارت (بزرگ شده) */ | |||
.fz-title { | .fz-title { | ||
font-family: 'IRANSans', 'IRANSansWeb', Tahoma, Arial, sans-serif !important; | font-family: 'IRANSans', 'IRANSansWeb', Tahoma, Arial, sans-serif !important; | ||
font-weight: 500 !important; | font-weight: 500 !important; | ||
color: #333 !important; | color: #333 !important; | ||
font-size: | font-size: 16px !important; /* اندازه فونت بزرگ شده */ | ||
text-align: center; | |||
white-space: nowrap; | white-space: nowrap; | ||
overflow: hidden; | overflow: hidden; | ||
| خط ۱۳۸: | خط ۱۲۹: | ||
} | } | ||
/* رنگبندی دستهبندیها */ | |||
.fz-card.tech { border-bottom-color: #16bd78 !important; } | .fz-card.tech { border-bottom-color: #16bd78 !important; } | ||
.fz-card.art { border-bottom-color: #ff9f43 !important; } | .fz-card.art { border-bottom-color: #ff9f43 !important; } | ||
.fz-card.science { border-bottom-color: #54a0ff !important; } | .fz-card.science { border-bottom-color: #54a0ff !important; } | ||
/* واکنشگرایی موبایل */ | |||
@media (max-width: 768px) { | @media (max-width: 768px) { | ||
.fz-category-grid { | .fz-category-grid { grid-template-columns: repeat(2, 1fr) !important; } | ||
} | } | ||
.is-hidden { | /* کلاس مخفیسازی برای فیلتر و جستجو */ | ||
.is-hidden { display: none !important; } | |||
} | |||
</style> | </style> | ||
<script> | <script> | ||
// تابع فیلتر دستهبندی | |||
function filterSelection(event, category) { | function filterSelection(event, category) { | ||
const cards = document.getElementsByClassName("fz-card"); | const cards = document.getElementsByClassName("fz-card"); | ||
const buttons = document.getElementsByClassName("fz-filter-btn"); | const buttons = document.getElementsByClassName("fz-filter-btn"); | ||
for (let btn of buttons) | // حذف حالت فعال از همه دکمهها | ||
for (let btn of buttons) btn.classList.remove("active"); | |||
// اضافه کردن حالت فعال به دکمه کلیک شده | |||
event.currentTarget.classList.add("active"); | event.currentTarget.classList.add("active"); | ||
// نمایش یا عدم نمایش کارتها | |||
for (let card of cards) { | for (let card of cards) { | ||
if (category === 'all' || card.classList.contains(category)) { | if (category === 'all' || card.classList.contains(category)) { | ||
| خط ۱۸۲: | خط ۱۶۴: | ||
} | } | ||
// تابع جستجوی زنده | |||
document.getElementById('categorySearch').addEventListener('keyup', function() { | document.getElementById('categorySearch').addEventListener('keyup', function() { | ||
const val = this.value.toLowerCase().trim(); | const val = this.value.toLowerCase().trim(); | ||
| خط ۱۸۸: | خط ۱۷۱: | ||
for (let card of cards) { | for (let card of cards) { | ||
const title = card.querySelector('.fz-title').innerText.toLowerCase(); | const title = card.querySelector('.fz-title').innerText.toLowerCase(); | ||
card.classList. | if (title.includes(val)) { | ||
card.classList.remove("is-hidden"); | |||
} else { | |||
card.classList.add("is-hidden"); | |||
} | |||
} | } | ||
}); | }); | ||