Skip to content

Commit

Permalink
Merge pull request #309 from bmartinez287/bmartinez287-fixes-header-a…
Browse files Browse the repository at this point in the history
…nomaly

Fix Header anomaly on BasicScripts.astro
  • Loading branch information
prototypa authored Jan 7, 2024
2 parents d509e93 + 3aeb5b0 commit 155a602
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/components/common/BasicScripts.astro
Original file line number Diff line number Diff line change
Expand Up @@ -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')) {
Expand Down

0 comments on commit 155a602

Please sign in to comment.