منو اصلی/بخشنده - فراغیب
بدون خلاصۀ ویرایش |
بدون خلاصۀ ویرایش |
||
| خط ۴: | خط ۴: | ||
<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> | ||
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; } | |||
*, *::before, *::after { | |||
body { font-family: 'Vazirmatn', Tahoma, sans-serif; } | |||
.poly-header { | .poly-header { | ||
background: #0a5c8a; | background: #0a5c8a; | ||
| خط ۳۷: | خط ۲۱: | ||
max-width: 1200px; | max-width: 1200px; | ||
margin: 0 auto; | margin: 0 auto; | ||
padding: | padding: 10px 16px; | ||
} | } | ||
| خط ۴۳: | خط ۲۷: | ||
display: flex; | display: flex; | ||
align-items: center; | align-items: center; | ||
gap: 16px; | |||
gap: | |||
} | } | ||
/* دکمه همبرگر */ | /* ===== دکمه همبرگر (فقط موبایل) ===== */ | ||
.poly-nav__toggle { | .poly-nav__toggle { | ||
display: | display: none; | ||
flex-direction: column; | flex-direction: column; | ||
gap: 5px; | gap: 5px; | ||
| خط ۶۳: | خط ۴۶: | ||
background: #fff; | background: #fff; | ||
border-radius: 3px; | border-radius: 3px; | ||
} | } | ||
/* لیست منو ( | /* ===== لیست منو (پیشفرض: دیده شود) ===== */ | ||
.poly-nav__list { | .poly-nav__list { | ||
display: | display: flex; | ||
flex-direction: | flex-direction: row; | ||
align-items: center; | |||
list-style: none; | list-style: none; | ||
gap: 4px; | |||
flex: 1; | |||
} | } | ||
| خط ۹۰: | خط ۶۴: | ||
display: block; | display: block; | ||
border-radius: 6px; | border-radius: 6px; | ||
white-space: nowrap; | |||
} | } | ||
.poly-nav__list a:hover | .poly-nav__list a:hover { background: rgba(255,255,255,0.15); } | ||
/* ===== منوی کشویی ===== */ | |||
} | .poly-dropdown { position: relative; } | ||
.poly-dropdown__content { | .poly-dropdown__content { | ||
display: none; | display: none; | ||
position: absolute; | |||
top: 100%; | |||
right: 0; | |||
background: #fff; | |||
min-width: 220px; | |||
border-radius: 8px; | |||
box-shadow: 0 8px 16px rgba(0,0,0,0.2); | |||
padding: 8px 0; | |||
z-index: 100; | |||
} | } | ||
.poly-dropdown__content a { | |||
color: #333; | |||
padding: 10px 20px; | |||
border-radius: 0; | |||
} | } | ||
.poly-dropdown__content a { | .poly-dropdown__content a:hover { background: #e8f4fd; color: #0a5c8a; } | ||
.poly-dropdown:hover .poly-dropdown__content, | |||
.poly-dropdown:focus-within .poly-dropdown__content { | |||
display: block; | |||
} | } | ||
/* دکمه ثبت نام سریع */ | /* ===== دکمه ثبت نام سریع ===== */ | ||
.poly-btn--register { | .poly-btn--register { | ||
background: #f59e0b; | background: #f59e0b; | ||
color: #1a1a1a; | color: #1a1a1a; | ||
font-weight: 700; | font-weight: 700; | ||
| خط ۱۲۵: | خط ۱۰۶: | ||
padding: 10px 20px; | padding: 10px 20px; | ||
border-radius: 8px; | border-radius: 8px; | ||
white-space: nowrap; | white-space: nowrap; | ||
transition: background 0.3s; | |||
} | } | ||
.poly-btn--register:hover | .poly-btn--register:hover { background: #fbbf24; } | ||
/* ======================================== | /* ======================================== | ||
موبایل: منو مخفی + همبرگر ظاهر | |||
======================================== */ | ======================================== */ | ||
@media ( | @media (max-width: 767px) { | ||
.poly-nav__toggle { | .poly-nav__toggle { | ||
display: | display: flex; | ||
} | } | ||
.poly-nav__list { | .poly-nav__list { | ||
display: none; | display: none; | ||
flex-direction: column; | |||
position: absolute; | position: absolute; | ||
top: 100%; | top: 100%; | ||
right: 0; | right: 0; | ||
left: 0; | |||
background: #0a5c8a; | |||
padding: 12px; | |||
box-shadow: 0 8px 16px rgba(0,0,0,0.2); | box-shadow: 0 8px 16px rgba(0,0,0,0.2); | ||
} | } | ||
.poly- | .poly-nav__list.is-open { | ||
display: flex; | |||
} | } | ||
.poly- | .poly-nav__list a { | ||
width: 100%; | |||
text-align: right; | |||
} | } | ||
.poly-dropdown__content { | |||
.poly- | position: static; | ||
background: rgba(0,0,0,0.15); | |||
margin: 4px 16px; | |||
} | } | ||
.poly-dropdown__content a { color: #fff; } | |||
.poly- | |||
} | } | ||
</style> | </style> | ||
| خط ۲۱۶: | خط ۱۵۳: | ||
<body> | <body> | ||
<header class="poly-header"> | <header class="poly-header"> | ||
<div class="poly-menu-container"> | <div class="poly-menu-container"> | ||
<nav class="poly-nav" aria-label="منوی محصولات مخزن پلی اتیلن"> | <nav class="poly-nav" aria-label="منوی محصولات مخزن پلی اتیلن"> | ||
<!-- | <!-- همبرگر --> | ||
<button class="poly-nav__toggle" aria-label="باز کردن منو" aria-expanded="false | <button class="poly-nav__toggle" id="menuToggle" aria-label="باز کردن منو" aria-expanded="false"> | ||
<span class="poly-nav__bar"></span> | <span class="poly-nav__bar"></span> | ||
<span class="poly-nav__bar"></span> | <span class="poly-nav__bar"></span> | ||
| خط ۲۲۸: | خط ۱۶۴: | ||
</button> | </button> | ||
<!-- | <!-- منو --> | ||
<ul class="poly-nav__list" id=" | <ul class="poly-nav__list" id="navMenu"> | ||
<li><a href="/wiki/اصلی">اصلی</a></li> | <li><a href="/wiki/اصلی">اصلی</a></li> | ||
<li><a href="/wiki/مخزن_پلی_اتیلن_آب_شرب">مخزن آب شرب</a></li> | <li><a href="/wiki/مخزن_پلی_اتیلن_آب_شرب">مخزن آب شرب</a></li> | ||
<li><a href="/wiki/مخزن_پلی_اتیلن_صنعتی">مخزن صنعتی</a></li> | <li><a href="/wiki/مخزن_پلی_اتیلن_صنعتی">مخزن صنعتی</a></li> | ||
<li class="poly-dropdown"> | <li class="poly-dropdown"> | ||
<a href="/wiki/انواع_مخزن_پلی_اتیلن | <a href="/wiki/انواع_مخزن_پلی_اتیلن">انواع و ظرفیتها ▾</a> | ||
<div class="poly-dropdown__content"> | <div class="poly-dropdown__content"> | ||
<a href="/wiki/مخزن_یک_قسمتی">مخزن یک قسمتی</a> | <a href="/wiki/مخزن_یک_قسمتی">مخزن یک قسمتی</a> | ||
| خط ۲۵۱: | خط ۱۸۴: | ||
</ul> | </ul> | ||
<!-- دکمه ثبت نام | <!-- دکمه ثبت نام --> | ||
<a href="/wiki/ثبت_نام" class="poly-btn poly-btn--register">ثبت نام سریع</a> | |||
</nav> | </nav> | ||
| خط ۲۶۱: | خط ۱۹۲: | ||
<script> | <script> | ||
const toggleBtn = document.getElementById('menuToggle'); | |||
const toggleBtn = document. | const navMenu = document.getElementById('navMenu'); | ||
const | |||
toggleBtn.addEventListener('click', () => { | toggleBtn.addEventListener('click', () => { | ||
const | const open = navMenu.classList.toggle('is-open'); | ||
toggleBtn.setAttribute('aria-expanded', | toggleBtn.setAttribute('aria-expanded', open); | ||
}); | }); | ||
// | // بستن با کلیک بیرون | ||
document.addEventListener('click', (e) => { | document.addEventListener('click', (e) => { | ||
if (!e.target.closest('.poly-nav')) { | if (!e.target.closest('.poly-nav')) { | ||
navMenu.classList.remove('is-open'); | |||
toggleBtn.setAttribute('aria-expanded', 'false'); | toggleBtn.setAttribute('aria-expanded', 'false'); | ||
} | } | ||
}); | }); | ||
نسخهٔ ۱۶ اوت ۲۰۲۶، ساعت ۰۶:۵۹