From 3aeb5b026a10a9c95a6211363620f075e8ec6b71 Mon Sep 17 00:00:00 2001 From: Bernardo Martinez <39039024+bmartinez287@users.noreply.github.com> Date: Sun, 10 Dec 2023 23:36:49 -0500 Subject: [PATCH] Fix Header anomaly BasicScripts.astro Fixes issue #262 --- src/components/common/BasicScripts.astro | 11 +++++++++++ 1 file changed, 11 insertions(+) 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')) {