File size: 661 Bytes
ae18532
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
() =>{
  const menu = document.querySelector("#menu");
  const menuButton = menu.querySelector("button");
  const content = document.querySelector("#content");

  const updateMenu = () => {
    const isOpen = menuButton.classList.contains("open");
    content.style.display = isOpen ? "none" : "flex";
  };

  const observer = new MutationObserver(updateMenu);
  observer.observe(menuButton, { attributes: true, attributeFilter: ["class"] });
  updateMenu();

  if (window.location.hostname.endsWith(".hf.space")) {
    const hfHeader = document.getElementById("huggingface-space-header");
    if (hfHeader) {
      hfHeader.style.display = "none";
    }
  }
}