Skip to content

Commit

Permalink
Fix Header anomaly BasicScripts.astro
Browse files Browse the repository at this point in the history
Fixes issue onwidget#262
  • Loading branch information
bmartinez287 authored Dec 11, 2023
1 parent 0be813a commit 3aeb5b0
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 3aeb5b0

Please sign in to comment.