diff --git a/src/components/common/BasicScripts.astro b/src/components/common/BasicScripts.astro index d9c5ad5..a2f9c29 100644 --- a/src/components/common/BasicScripts.astro +++ b/src/components/common/BasicScripts.astro @@ -105,6 +105,17 @@ import { UI } from '~/utils/config'; newlink.click(); }); + let screenSize = window.matchMedia('(max-width: 767px)'); + screenSize.addEventListener('change', function () { + document.querySelector('[data-aw-toggle-menu]')?.classList.remove('expanded'); + document.body.classList.remove('overflow-hidden'); + document.getElementById('header')?.classList.remove('h-screen'); + document.getElementById('header')?.classList.remove('expanded'); + document.getElementById('header')?.classList.remove('bg-page'); + document.querySelector('#header nav')?.classList.add('hidden'); + document.querySelector('#header > div > div:last-child')?.classList.add('hidden'); + }); + function appyHeaderStylesOnScroll() { const header = document.querySelector('#header[data-aw-sticky-header]'); if (lastKnownScrollPosition > 60 && !header.classList.contains('scroll')) {