Merge pull request #309 from bmartinez287/bmartinez287-fixes-header-anomaly

Fix Header anomaly on BasicScripts.astro
This commit is contained in:
André B
2024-01-07 05:19:44 -05:00
committed by GitHub

View File

@ -105,6 +105,17 @@ import { UI } from '~/utils/config';
newlink.click(); 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() { function appyHeaderStylesOnScroll() {
const header = document.querySelector('#header[data-aw-sticky-header]'); const header = document.querySelector('#header[data-aw-sticky-header]');
if (lastKnownScrollPosition > 60 && !header.classList.contains('scroll')) { if (lastKnownScrollPosition > 60 && !header.classList.contains('scroll')) {