PageSourceSearch

https://aarhus2025.org/_frsh/js/c6c6aeb6cc3bfb6dca85bc8c85f2eb86cf14c10b/island-navdropdown.js

js aarhus2025.org collected 2026-10-01 15:55:53 UTC 2,256 bytes, 2 lines download raw bytes

1import{I,z}from"./chunk-IIPGOJ4W.js";import{g}from"./chunk-7W3IZPRH.js";import"./chunk-3IXZY32A.js";function NavDropdown({link,currentPath}){let[activeDropdown,setActiveDropdown]=I(!1),[isTouchDevice,setIsTouchDevice]=I(!1);z(()=>{(()=>{setIsTouchDevice("ontouchstart"in window||navigator&&navigator.maxTouchPoints>0)})();let touchHandler=()=>setIsTouchDevice(!0);window.addEventListener("touchstart",touchHandler,{once:!0});let handleClickOutside=e=>{e.target.closest(".dropdown-container")||setActiveDropdown(!1)};return document.addEventListener("click",handleClickOutside),()=>{window.removeEventListener("touchstart",touchHandler),document.removeEventListener("click",handleClickOutside)}},[]);let handleDropdownClick=e=>{isTouchDevice&&(e.stopPropagation(),setActiveDropdown(!activeDropdown))},ensureAbsolutePath=path=>path.startsWith("/")?path:`/${path}`;return g("div",{class:"py-4 dropdown-container relative",children:[g("div",{class:"flex items-center",children:[g("a",{href:ensureAbsolutePath(link.path),class:`text-black uppercase text-lg hover:opacity-90 ${currentPath===link.path?"opacity-100 font-bold":"opacity-60"}`,children:link.label}),g("button",{onClick:handleDropdownClick,class:"ml-1 p-1","aria-label":"Toggle dropdown",children:g("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:g("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})})]}),g("div",{class:`absolute top-full left-0 mt-1 min-w-[200px] w-max md:w-auto bg-white shadow-xl rounded-md py-3 z-50 transition-all duration-200 ${isTouchDevice?activeDropdown?"opacity-100 visible transform translate-y-0":"opacity-0 invisible transform translate-y-2":"opacity-0 invisible group-hover:opacity-100 group-hover:visible transform translate-y-2 group-hover:translate-y-0"}`,children:g("div",{class:"px-2",children:link.dropdownItems?.map(item=>g("a",{href:ensureAbsolutePath(item.path),class:`block px-4 py-3 text-md hover:bg-gray-50 rounded-md transition-colors duration-150 whitespace-nowrap ${currentPath===item.path?"font-bold text-aarhus-red":"text-gray-800 hover:text-aarhus-red"}`,children:item.label},item.path))})})]})}export{NavDropdown as default};
2//# sourceMappingURL=island-navdropdown.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.