let sidebarEl = document.getElementById("mySidebar")
let mainEl = document.getElementById("main")

/* Set the width of the sidebar to 250px and the left margin of the page content to 250px */
function openNav() {
    sidebarEl.style.width = "250px";
    mainEl.style.marginLeft = "250px";
}

/* Set the width of the sidebar to 0 and the left margin of the page content to 0 */
function closeNav() {
    sidebarEl.style.width = "0";
    mainEl.style.marginLeft = "0";
}

/* Toggle the sidebar */
function toggleNav() {
    if (sidebarEl.offsetWidth > 0) {
        closeNav()
    } else {
        openNav()
    }
}