just close the nav drawer when the page loads

This commit is contained in:
Steve Russo 2022-04-25 08:37:58 -04:00
parent 758f060611
commit 1bb22b9aaf
1 changed files with 2 additions and 14 deletions

View File

@ -1,12 +1,11 @@
<script>
function openNavDrawer() {
navDrawerOverlay.classList.toggle('d-none')
navDrawerOverlay.classList.remove('d-none')
navDrawer.style.transform = 'translate(0)'
window.location.hash = '#nav'
}
function closeNavDrawer() {
navDrawerOverlay.classList.toggle('d-none')
navDrawerOverlay.classList.add('d-none')
navDrawer.style.transform = 'translate(100%)'
}
@ -65,15 +64,4 @@
initToggle(th)
closeNavDrawer()
})()
if (window.location.hash == '#nav') {
history.replaceState("", document.title, window.location.pathname);
}
window.addEventListener('hashchange', function(e) {
if (window.location.hash == '') {
closeNavDrawer()
history.replaceState("", document.title, window.location.pathname);
}
})
</script>