added scroll functionality for navbar: hide on scroll down, show on scroll up
diff --git a/dev/js/src/init.js b/dev/js/src/init.js
index 6243bc7..5b0e7d1 100644
--- a/dev/js/src/init.js
+++ b/dev/js/src/init.js
@@ -127,6 +127,19 @@
}
);
+ // Hide and show navbar on scroll
+ let prevScrollPos = window.scrollY;
+
+ window.onscroll = function() {
+ let currentScrollPos = window.scrollY;
+ if (prevScrollPos > currentScrollPos) {
+ document.querySelector('.navbar').style.top = '0';
+ } else {
+ document.querySelector('.navbar').style.top = '-3rem';
+ }
+ prevScrollPos = currentScrollPos;
+ }
+
/**
* Replace Virtual Corpus field
*/