diff --git a/LICENSE.txt b/LICENSE.txt index 3e8436b..4f27b80 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2016-2023 Individual contributors to hamburger-menu +Copyright (c) 2016-2024 Individual contributors to hamburger-menu Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/dist/hamburger-menu.css b/dist/hamburger-menu.css index 121175a..5cff5f7 100644 --- a/dist/hamburger-menu.css +++ b/dist/hamburger-menu.css @@ -1,4 +1,4 @@ -/*! hamburger-menu v0.6.0 ☰ https://github.com/center-key/hamburger-menu ☰ MIT License */ +/*! hamburger-menu v0.6.1 ☰ https://github.com/center-key/hamburger-menu ☰ MIT License */ /* Structure for HamburgerMenu: diff --git a/dist/hamburger-menu.js b/dist/hamburger-menu.js index b54af9a..b52bb95 100644 --- a/dist/hamburger-menu.js +++ b/dist/hamburger-menu.js @@ -1,4 +1,4 @@ -//! hamburger-menu v0.6.0 ☰ https://github.com/center-key/hamburger-menu ☰ MIT License +//! hamburger-menu v0.6.1 ☰ https://github.com/center-key/hamburger-menu ☰ MIT License const hamburgerMenu = { // - version: '0.6.0', + version: '0.6.1', selectItem(elem) { const menuItem = elem.closest('li'); diff --git a/dist/hamburger-menu.min.css b/dist/hamburger-menu.min.css index a9c16a4..b916801 100644 --- a/dist/hamburger-menu.min.css +++ b/dist/hamburger-menu.min.css @@ -1,2 +1,2 @@ -/*! hamburger-menu v0.6.0 ☰ https://github.com/center-key/hamburger-menu ☰ MIT License */ +/*! hamburger-menu v0.6.1 ☰ https://github.com/center-key/hamburger-menu ☰ MIT License */ body{margin:0;padding:0 50px 0 200px}nav.hamburger-menu a.hamburger{display:none;color:inherit;background-color:inherit}nav.hamburger-menu aside{position:fixed;top:0;bottom:0;left:0;float:none;background-color:inherit;padding:0;margin:0;overflow-y:scroll;z-index:5000}nav.hamburger-menu aside ul{list-style:none;padding:0;margin:0}nav.hamburger-menu aside ul li a,nav.hamburger-menu aside ul li span{display:block;font-size:1.1rem;font-weight:700;text-align:left;text-decoration:none;color:inherit;border-top:1px solid transparent;border-bottom:1px solid transparent;padding:10px 0 10px 15px;transition:all 400ms;cursor:pointer}nav.hamburger-menu aside ul li.current>a,nav.hamburger-menu aside ul li.current>span{border-color:inherit;cursor:default}nav.hamburger-menu aside ul ul li a,nav.hamburger-menu aside ul ul li span{font-size:.8rem;padding:4px 0 4px 30px}@media (max-width:667px){html body{padding:35px 10px 0;cursor:pointer}nav.hamburger-menu{cursor:auto}nav.hamburger-menu a.hamburger{display:block;position:absolute;top:0;left:0;font-size:1.4rem;font-weight:700;text-decoration:none;padding:6px 10px 8px 8px}nav.hamburger-menu a.hamburger:not(:hover){transition:opacity .5s .8s}nav.hamburger-menu a.hamburger:hover{opacity:0}nav.hamburger-menu aside{max-width:0;overflow:hidden;transition:max-width 1s}nav.hamburger-menu aside ul li{white-space:nowrap}nav.hamburger-menu:not(.collapse-menu):hover .hamburger+aside{max-width:400px;overflow-y:scroll}}nav.hamburger-menu aside{width:150px}nav.hamburger-menu{color:#dcdcdc;background-color:teal}nav.hamburger-menu aside ul li.current{border-color:#fff}nav.hamburger-menu aside ul li.current>a,nav.hamburger-menu aside ul li.current>span,nav.hamburger-menu aside ul li>a:hover,nav.hamburger-menu aside ul li>span:hover{color:#fff;background-color:#008b8b} diff --git a/dist/hamburger-menu.min.js b/dist/hamburger-menu.min.js index d743a8f..18ea9d9 100644 --- a/dist/hamburger-menu.min.js +++ b/dist/hamburger-menu.min.js @@ -1,2 +1,2 @@ -//! hamburger-menu v0.6.0 ☰ https://github.com/center-key/hamburger-menu ☰ MIT License -const hamburgerMenu={version:"0.6.0",selectItem(elem){const menuItem=elem.closest("li");const navMenu=menuItem.closest(".hamburger-menu");const reset=elem=>elem.classList.remove("current");menuItem.closest("aside").querySelectorAll("li").forEach(reset);menuItem.classList.add("current");navMenu.classList.add("collapse-menu");navMenu.dataset.menuCollapsed=String(Date.now());const restoreAllowExand=()=>{navMenu.classList.remove("collapse-menu");globalThis.document.removeEventListener("click",restoreAllowExand);globalThis.document.removeEventListener("mousemove",restoreAllowExand)};const listen=()=>{globalThis.document.addEventListener("click",restoreAllowExand);globalThis.document.addEventListener("mousemove",restoreAllowExand)};const afterCurrentClick=100;globalThis.setTimeout(listen,afterCurrentClick)},setup(){globalThis.document.addEventListener("click",()=>{});const navMenu=globalThis.document.querySelector(".hamburger-menu");const aside=navMenu?.querySelector("aside");const autoHighlightMultiPage=()=>{const currentUrl=new globalThis.URL(globalThis.location.href);const currentPath=globalThis.location.pathname.replace(/\/$/,"");const setCurrent=elem=>{const linkUrl=new globalThis.URL(elem.href,currentUrl);const isCurrent=linkUrl.pathname.replace(/\/$/,"")===currentPath;elem.parentElement.classList.add(isCurrent?"current":"other-page")};navMenu.querySelectorAll("li >a").forEach(setCurrent)};const delegateSelectItem=event=>{const elem=event.target.closest(".hamburger-menu li");if(elem)hamburgerMenu.selectItem(elem)};const autoHighlightSinglePageApp=()=>globalThis.document.addEventListener("click",delegateSelectItem);const autoHighlight=()=>{autoHighlightMultiPage();autoHighlightSinglePageApp()};if(aside&&!aside.classList.contains("disable-auto-highlight"))autoHighlight()},dom:{onReady(callback){if(globalThis.document.readyState==="complete")callback();else globalThis.window.addEventListener("DOMContentLoaded",callback)}}};hamburgerMenu.dom.onReady(hamburgerMenu.setup); +//! hamburger-menu v0.6.1 ☰ https://github.com/center-key/hamburger-menu ☰ MIT License +const hamburgerMenu={version:"0.6.1",selectItem(elem){const menuItem=elem.closest("li");const navMenu=menuItem.closest(".hamburger-menu");const reset=elem=>elem.classList.remove("current");menuItem.closest("aside").querySelectorAll("li").forEach(reset);menuItem.classList.add("current");navMenu.classList.add("collapse-menu");navMenu.dataset.menuCollapsed=String(Date.now());const restoreAllowExand=()=>{navMenu.classList.remove("collapse-menu");globalThis.document.removeEventListener("click",restoreAllowExand);globalThis.document.removeEventListener("mousemove",restoreAllowExand)};const listen=()=>{globalThis.document.addEventListener("click",restoreAllowExand);globalThis.document.addEventListener("mousemove",restoreAllowExand)};const afterCurrentClick=100;globalThis.setTimeout(listen,afterCurrentClick)},setup(){globalThis.document.addEventListener("click",()=>{});const navMenu=globalThis.document.querySelector(".hamburger-menu");const aside=navMenu?.querySelector("aside");const autoHighlightMultiPage=()=>{const currentUrl=new globalThis.URL(globalThis.location.href);const currentPath=globalThis.location.pathname.replace(/\/$/,"");const setCurrent=elem=>{const linkUrl=new globalThis.URL(elem.href,currentUrl);const isCurrent=linkUrl.pathname.replace(/\/$/,"")===currentPath;elem.parentElement.classList.add(isCurrent?"current":"other-page")};navMenu.querySelectorAll("li >a").forEach(setCurrent)};const delegateSelectItem=event=>{const elem=event.target.closest(".hamburger-menu li");if(elem)hamburgerMenu.selectItem(elem)};const autoHighlightSinglePageApp=()=>globalThis.document.addEventListener("click",delegateSelectItem);const autoHighlight=()=>{autoHighlightMultiPage();autoHighlightSinglePageApp()};if(aside&&!aside.classList.contains("disable-auto-highlight"))autoHighlight()},dom:{onReady(callback){if(globalThis.document.readyState==="complete")callback();else globalThis.window.addEventListener("DOMContentLoaded",callback)}}};hamburgerMenu.dom.onReady(hamburgerMenu.setup); diff --git a/docs/hamburger-menu.css b/docs/hamburger-menu.css index 121175a..5cff5f7 100644 --- a/docs/hamburger-menu.css +++ b/docs/hamburger-menu.css @@ -1,4 +1,4 @@ -/*! hamburger-menu v0.6.0 ☰ https://github.com/center-key/hamburger-menu ☰ MIT License */ +/*! hamburger-menu v0.6.1 ☰ https://github.com/center-key/hamburger-menu ☰ MIT License */ /* Structure for HamburgerMenu: diff --git a/docs/hamburger-menu.js b/docs/hamburger-menu.js index b54af9a..b52bb95 100644 --- a/docs/hamburger-menu.js +++ b/docs/hamburger-menu.js @@ -1,4 +1,4 @@ -//! hamburger-menu v0.6.0 ☰ https://github.com/center-key/hamburger-menu ☰ MIT License +//! hamburger-menu v0.6.1 ☰ https://github.com/center-key/hamburger-menu ☰ MIT License const hamburgerMenu = { // - version: '0.6.0', + version: '0.6.1', selectItem(elem) { const menuItem = elem.closest('li'); diff --git a/docs/index.html b/docs/index.html index 7cbc118..3f8d3cc 100644 --- a/docs/index.html +++ b/docs/index.html @@ -9,9 +9,9 @@ - - - + + + - - + + diff --git a/docs/multipage/index.html b/docs/multipage/index.html index fce80e2..d4593dc 100644 --- a/docs/multipage/index.html +++ b/docs/multipage/index.html @@ -12,7 +12,7 @@