docs: remove header animation

This makes the header a fixed height without animation.

Signed-off-by: Andrew Rynhard <andrew@andrewrynhard.com>
This commit is contained in:
Andrew Rynhard
2019-10-22 00:54:57 +00:00
parent 7f6fdc3e6f
commit 12c650457e
3 changed files with 4 additions and 33 deletions

View File

@@ -1,6 +1,6 @@
<template>
<header id="header" class="flex">
<div class="flex items-center justify-start max-w-6xl mx-auto py-6">
<div class="flex items-center justify-start max-w-6xl mx-auto py-2">
<Logo></Logo>
</div>
<div class="flex items-center justify-end max-w-6xl mx-auto py-6">
@@ -32,29 +32,6 @@ export default {
components: {
Logo,
CommunityDropdown
},
mounted() {
window.addEventListener('scroll', this.handleScroll)
},
destroyed() {
window.removeEventListener('scroll', this.handleScroll)
},
methods: {
handleScroll() {
const distanceY = window.pageYOffset || document.documentElement.scrollTop
const shrinkOn = 240
const shrinkOff = 140
const headerEl = document.getElementById('header')
if (distanceY > shrinkOn) {
headerEl.classList.add('scrolled')
} else if (distanceY < shrinkOff) {
headerEl.classList.remove('scrolled')
}
}
}
}
</script>