|
@ -5,6 +5,7 @@ let bottomHeightThreshold, sections; |
|
|
let hamburgerToggle; |
|
|
let hamburgerToggle; |
|
|
let mobileSearch; |
|
|
let mobileSearch; |
|
|
let sidebar; |
|
|
let sidebar; |
|
|
|
|
|
let toTop; |
|
|
|
|
|
|
|
|
class Modal { |
|
|
class Modal { |
|
|
constructor(element) { |
|
|
constructor(element) { |
|
@ -49,12 +50,19 @@ class SearchBar { |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function scrollToTop() { |
|
|
|
|
|
window.scrollTo({ top: 0, behavior: 'smooth' }); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
document.addEventListener('DOMContentLoaded', () => { |
|
|
document.addEventListener('DOMContentLoaded', () => { |
|
|
mobileSearch = new SearchBar(); |
|
|
mobileSearch = new SearchBar(); |
|
|
|
|
|
|
|
|
bottomHeightThreshold = document.documentElement.scrollHeight - 30; |
|
|
bottomHeightThreshold = document.documentElement.scrollHeight - 30; |
|
|
sections = document.querySelectorAll('section'); |
|
|
sections = document.querySelectorAll('section'); |
|
|
hamburgerToggle = document.getElementById('hamburger-toggle'); |
|
|
hamburgerToggle = document.getElementById('hamburger-toggle'); |
|
|
|
|
|
|
|
|
|
|
|
toTop = document.getElementById('to-top'); |
|
|
|
|
|
toTop.hidden = !(window.scrollY > 0); |
|
|
|
|
|
|
|
|
if (hamburgerToggle) { |
|
|
if (hamburgerToggle) { |
|
|
hamburgerToggle.addEventListener('click', (e) => { |
|
|
hamburgerToggle.addEventListener('click', (e) => { |
|
@ -76,6 +84,10 @@ document.addEventListener('DOMContentLoaded', () => { |
|
|
// insert ourselves after the element
|
|
|
// insert ourselves after the element
|
|
|
parent.insertBefore(table, element.nextSibling); |
|
|
parent.insertBefore(table, element.nextSibling); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
window.addEventListener('scroll', () => { |
|
|
|
|
|
toTop.hidden = !(window.scrollY > 0); |
|
|
|
|
|
}); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
document.addEventListener('keydown', (event) => { |
|
|
document.addEventListener('keydown', (event) => { |
|
|