Fix some errors with ViewTransitions

This commit is contained in:
prototypa
2024-04-12 12:21:13 -04:00
parent 0f557819ad
commit 3328fb955f

View File

@@ -118,10 +118,11 @@ import { UI } from 'astrowind:config';
function applyHeaderStylesOnScroll() { function applyHeaderStylesOnScroll() {
const header = document.querySelector('#header[data-aw-sticky-header]'); const header = document.querySelector('#header[data-aw-sticky-header]');
if (!header) return;
if (lastKnownScrollPosition > 60 && !header.classList.contains('scroll')) { if (lastKnownScrollPosition > 60 && !header.classList.contains('scroll')) {
document.getElementById('header').classList.add('scroll'); header.classList.add('scroll');
} else if (lastKnownScrollPosition <= 60 && header.classList.contains('scroll')) { } else if (lastKnownScrollPosition <= 60 && header.classList.contains('scroll')) {
document.getElementById('header').classList.remove('scroll'); header.classList.remove('scroll');
} }
ticking = false; ticking = false;
} }