diff --git a/site/src/components/TopNav.html b/site/src/components/TopNav.html
index 42b322ce1b..831ca598fd 100644
--- a/site/src/components/TopNav.html
+++ b/site/src/components/TopNav.html
@@ -6,6 +6,7 @@
export let segment;
let open = false;
+ let visible = true;
// TODO remove this post-https://github.com/sveltejs/svelte/issues/1914
let ul;
@@ -28,6 +29,14 @@
});
};
});
+
+ let last_scroll = 0;
+ function handle_scroll() {
+ const scroll = window.pageYOffset;
+ visible = (scroll < 50 || scroll < last_scroll);
+
+ last_scroll = scroll;
+ }
-
+
-