summaryrefslogtreecommitdiff
path: root/js/setNavBarState.ts
diff options
context:
space:
mode:
Diffstat (limited to 'js/setNavBarState.ts')
-rw-r--r--js/setNavBarState.ts14
1 files changed, 14 insertions, 0 deletions
diff --git a/js/setNavBarState.ts b/js/setNavBarState.ts
new file mode 100644
index 0000000..04058f7
--- /dev/null
+++ b/js/setNavBarState.ts
@@ -0,0 +1,14 @@
+enum NavBarState {
+ Visible,
+ Hidden,
+}
+
+function setNavBarState(state: NavBarState) {
+ console.log("setting navigation bar to `" + NavBarState[state] + "`");
+
+ let nav_bar = document.getElementById("navBar")!;
+ let hamburger = document.getElementById("hamburger")!
+
+ nav_bar.setAttribute("data-state", NavBarState[state]);
+ hamburger.setAttribute("data-navBarState", NavBarState[state]);
+}