🎉 Initial setup

🎉 Initial setup

Setup deployment
This commit is contained in:
Dennis Reimann
2020-10-03 21:49:25 +02:00
commit 0202e858e6
55 changed files with 11718 additions and 0 deletions

35
static/js/main.js Normal file
View File

@@ -0,0 +1,35 @@
document.addEventListener("DOMContentLoaded", () => {
const $body = document.body
const $headerAnchor = document.getElementById('header-anchor')
// Topbar
const topbarClass = 'topbar'
const topbarAppearClass = 'topbar--appear'
const addTopbar = () => {
$body.classList.add(topbarClass)
window.setTimeout(() => {
$body.classList.add(topbarAppearClass)
}, 25)
}
const removeTopbar = () => {
$body.classList.remove(topbarClass)
$body.classList.remove(topbarAppearClass)
}
if (
"IntersectionObserver" in window &&
"IntersectionObserverEntry" in window &&
"intersectionRatio" in window.IntersectionObserverEntry.prototype
) {
const headerObserver = new IntersectionObserver(entries => {
const { boundingClientRect: { y, height } } = entries[0]
if (Math.abs(y) > height) {
addTopbar()
} else {
removeTopbar()
}
})
headerObserver.observe($headerAnchor)
}
})