-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcv.js
22 lines (20 loc) · 885 Bytes
/
cv.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { setupNav } from "./setupNav";
import { headerAutoHideOnVerticalScroll } from "./header-auto-hide-on-vertical-scroll";
const { onNavChange, isNavOpen } = (function () {
const burgerMenuContainer = document.getElementById("burger-menu-container");
const header = document.querySelector("header");
const body = document.querySelector("body");
let _isNavOpen = false;
return {
onNavChange: () => {
header.style.visibility = _isNavOpen ? "visible" : "hidden";
burgerMenuContainer.style.visibility = "visible";
burgerMenuContainer.style.position = _isNavOpen ? "absolute" : "fixed";
body.style.overflow = _isNavOpen ? "visible" : "hidden";
_isNavOpen = !_isNavOpen;
},
isNavOpen: () => _isNavOpen,
};
})();
setupNav(onNavChange);
headerAutoHideOnVerticalScroll(isNavOpen);