mirror of
https://github.com/qdrant/landing_page.git
synced 2026-10-01 17:08:30 +02:00
Some fixes for new site (#929)
* menu fix * hybrid cloud partners overlay fix * pricing adjustment * email form error message fix * marketplaces overlay fix * body's scroll over the mobile menu fix * pricing fix * benchmarks plot labels fix
This commit is contained in:
@@ -40,4 +40,39 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
removeScrollStateFromPage();
|
||||
}
|
||||
});
|
||||
|
||||
// Mobile menu
|
||||
|
||||
const closeBtn = document.querySelector('.menu-mobile__close');
|
||||
const menuTrigger = document.querySelector('.main-menu__trigger');
|
||||
const menu = document.querySelector('.menu-mobile');
|
||||
menuTrigger.addEventListener('click', () => {
|
||||
menu.classList.add('menu-mobile--visible');
|
||||
body.classList.add('no-scroll');
|
||||
});
|
||||
closeBtn.addEventListener('click', () => {
|
||||
menu.classList.remove('menu-mobile--visible');
|
||||
body.classList.remove('no-scroll');
|
||||
});
|
||||
function toggleMenu(id) {
|
||||
const menuItem = document.querySelector(`[data-path=${id}]`);
|
||||
if (menuItem) {
|
||||
menuItem.classList.toggle('menu-mobile__item--active');
|
||||
}
|
||||
}
|
||||
|
||||
document.querySelectorAll('.menu-mobile__item').forEach((item) => {
|
||||
item.addEventListener('click', () => {
|
||||
console.log(item.dataset.path);
|
||||
toggleMenu(item.dataset.path);
|
||||
});
|
||||
});
|
||||
|
||||
// close mobile menu on resize
|
||||
window.addEventListener('resize', () => {
|
||||
if (window.innerWidth >= XXL_BREAKPOINT) {
|
||||
menu.classList.remove('menu-mobile--visible');
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user