aboutsummaryrefslogtreecommitdiff
path: root/docs/public/nav.js
diff options
context:
space:
mode:
authorGravatar Fred K. Schott <fkschott@gmail.com> 2021-07-16 13:39:48 -0400
committerGravatar Fred K. Schott <fkschott@gmail.com> 2021-07-16 13:39:48 -0400
commitdc4ba25b01254ed1c2088c081e8c861172ae58a4 (patch)
treee8424c9266de0886e8fb3c133da7f87e2eeacb11 /docs/public/nav.js
parent94fdd0db1b0a8ba2f109c5a240dc5770fdf784b8 (diff)
downloadastro-dc4ba25b01254ed1c2088c081e8c861172ae58a4.tar.gz
astro-dc4ba25b01254ed1c2088c081e8c861172ae58a4.tar.zst
astro-dc4ba25b01254ed1c2088c081e8c861172ae58a4.zip
Revert "New getting started guide (#715)"
This reverts commit 2827f077baab6674a8ee47f3006e82ce991118b8.
Diffstat (limited to 'docs/public/nav.js')
-rw-r--r--docs/public/nav.js37
1 files changed, 0 insertions, 37 deletions
diff --git a/docs/public/nav.js b/docs/public/nav.js
deleted file mode 100644
index 93fadcd61..000000000
--- a/docs/public/nav.js
+++ /dev/null
@@ -1,37 +0,0 @@
-const nav = document.querySelector('body > header');
-
-if (!window.matchMedia('(prefers-reduced-motion)').matches) {
- window.addEventListener('scroll', onScroll, { passive: true });
-}
-
-let prev = -1;
-let prevDir = 0;
-let threshold = 32;
-
-function onScroll() {
- const curr = window.scrollY;
- const dir = curr > prev ? 1 : -1;
-
- if (curr < threshold) {
- show();
- document.documentElement.classList.add('initial');
- } else if (dir !== prevDir) {
- if (dir === 1) {
- hide();
- } else {
- show();
- }
- }
-
- prev = curr;
-}
-
-const hide = () => {
- nav.classList.add('hidden')
- document.documentElement.classList.add('scrolled');
- document.documentElement.classList.remove('initial');
-};
-const show = () => {
- nav.classList.remove('hidden');
- document.documentElement.classList.remove('scrolled');
-}