1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2024-10-30 19:56:16 +00:00
mycorrhiza/static/view.js
2021-07-15 22:19:10 +05:00

19 lines
731 B
JavaScript

let wrapper = document.getElementsByClassName("top-bar__wrapper")[0],
auth = document.getElementsByClassName("top-bar__section_auth")[0],
highlights = document.getElementsByClassName("top-bar__section_highlights")[0]
const toggleElement = el => el.classList.toggle("top-bar__section_hidden-on-mobile")
let hamburger = document.createElement("button")
hamburger.classList.add("top-bar__hamburger")
hamburger.onclick = _ => {
toggleElement(auth)
toggleElement(highlights)
}
hamburger.innerText = "Menu"
let hamburgerSection = document.createElement("li")
hamburgerSection.classList.add("top-bar__section", "top-bar__section_hamburger")
hamburgerSection.appendChild(hamburger)
wrapper.appendChild(hamburgerSection)