menu-open-fix
This commit is contained in:
@@ -96,14 +96,11 @@ section > .container {
|
|||||||
|
|
||||||
.header-menu-toggle {
|
.header-menu-toggle {
|
||||||
display: none;
|
display: none;
|
||||||
|
|
||||||
width: 48px;
|
width: 48px;
|
||||||
height: 48px;
|
height: 48px;
|
||||||
|
|
||||||
border: none;
|
border: none;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -121,21 +118,26 @@ section > .container {
|
|||||||
|
|
||||||
.header-mobile-menu {
|
.header-mobile-menu {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
inset: 0;
|
||||||
right: 0;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100dvh;
|
height: 100dvh;
|
||||||
background: #ffffff !important;
|
background: #ffffff !important;
|
||||||
display: none;
|
display: none;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
z-index: 1002;
|
z-index: 99999;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-mobile-menu.active {
|
.header-mobile-menu.active {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
position: fixed;
|
||||||
|
inset: 0;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
body.menu-open {
|
||||||
|
overflow: hidden;
|
||||||
|
height: 100vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-mobile-top {
|
.header-mobile-top {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -209,7 +211,9 @@ section > .container {
|
|||||||
}
|
}
|
||||||
.header-mobile-back{
|
.header-mobile-back{
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
.header-mobile-socials {
|
.header-mobile-socials {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
// ====================================هدر===========================
|
// ====================================هدر===========================
|
||||||
const headerMenuBtn = document.querySelector('.header-menu-toggle');
|
const headerMenuBtn = document.querySelector('.header-menu-toggle');
|
||||||
const headerMobileMenu = document.querySelector('.header-mobile-menu');
|
const headerMobileMenu = document.querySelector('.header-mobile-menu');
|
||||||
|
const headerCloseBtn = document.querySelector('.header-mobile-close');
|
||||||
|
|
||||||
headerMenuBtn.addEventListener('click', () => {
|
headerMenuBtn.addEventListener('click', () => {
|
||||||
headerMobileMenu.classList.toggle('active');
|
headerMobileMenu.classList.add('active');
|
||||||
|
document.body.classList.add('menu-open');
|
||||||
});
|
});
|
||||||
|
|
||||||
const headerCloseBtn = document.querySelector('.header-mobile-close');
|
|
||||||
|
|
||||||
headerCloseBtn.addEventListener('click', () => {
|
headerCloseBtn.addEventListener('click', () => {
|
||||||
headerMobileMenu.classList.remove('active');
|
headerMobileMenu.classList.remove('active');
|
||||||
|
document.body.classList.remove('menu-open');
|
||||||
});
|
});
|
||||||
|
|
||||||
// ==========================هیروسکشن===================================
|
// ==========================هیروسکشن===================================
|
||||||
|
|
||||||
window.addEventListener('load', () => {
|
window.addEventListener('load', () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user