Fix Header anomaly BasicScripts.astro

Fixes issue #262
This commit is contained in:
Bernardo Martinez
2023-12-10 23:36:49 -05:00
committed by GitHub
parent 0be813aba2
commit 3aeb5b026a

View File

@ -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')) {