~xdavidwu/xdavidwu.link

52d5464084f65be6b08bf7a74cbc4d45f9b5212d — xdavidwu 3 years ago 869033f
greedy nav: remove debug custom attr
2 files changed, 2 insertions(+), 1 deletions(-)

M assets/js/_greedy-navigation.js
M assets/js/main.min.js
M assets/js/_greedy-navigation.js => assets/js/_greedy-navigation.js +1 -0
@@ 53,6 53,7 @@ window.addEventListener('resize', () => {

$btn.addEventListener('click', () => {
  $hlinks.classList.toggle('hidden');
  $btn.classList.toggle('close');
});

check();

M assets/js/main.min.js => assets/js/main.min.js +1 -1
@@ 1,1 1,1 @@
!function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){n(1),document.addEventListener("DOMContentLoaded",()=>{document.addEventListener("keyup",e=>{27===e.keyCode&&document.getElementsByClassName("initial-content")[0].classList.contains("is--hidden")&&(document.getElementsByClassName("search-content")[0].classList.toggle("is--visible"),document.getElementsByClassName("initial-content")[0].classList.toggle("is--hidden"))}),document.getElementsByClassName("search__toggle")[0].addEventListener("click",()=>{document.getElementsByClassName("search-content")[0].classList.toggle("is--visible"),document.getElementsByClassName("initial-content")[0].classList.toggle("is--hidden"),setTimeout((function(){document.querySelector(".search-content input").focus()}),400)})})},function(e,t){const n=document.querySelector("nav.greedy-nav .greedy-nav__toggle"),o=document.querySelector("nav.greedy-nav .visible-links"),s=document.querySelector("nav.greedy-nav .hidden-links");var r,l,d=0,c=0,a=[];for(i of o.children)c+=i.offsetWidth,d+=1,a.push(c);function u(){r=o.offsetWidth,l=o.children.length,a[l-1]>r?(s.prepend(o.lastChild),l-=1,u()):r>a[l]&&(o.append(s.firstChild),l+=1,u()),l===d?n.classList.add("hidden"):n.classList.remove("hidden")}window.addEventListener("resize",()=>{u()}),n.addEventListener("click",()=>{s.classList.toggle("hidden")}),u()}]);
\ No newline at end of file
!function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){n(1),document.addEventListener("DOMContentLoaded",()=>{document.addEventListener("keyup",e=>{27===e.keyCode&&document.getElementsByClassName("initial-content")[0].classList.contains("is--hidden")&&(document.getElementsByClassName("search-content")[0].classList.toggle("is--visible"),document.getElementsByClassName("initial-content")[0].classList.toggle("is--hidden"))}),document.getElementsByClassName("search__toggle")[0].addEventListener("click",()=>{document.getElementsByClassName("search-content")[0].classList.toggle("is--visible"),document.getElementsByClassName("initial-content")[0].classList.toggle("is--hidden"),setTimeout((function(){document.querySelector(".search-content input").focus()}),400)})})},function(e,t){const n=document.querySelector("nav.greedy-nav .greedy-nav__toggle"),o=document.querySelector("nav.greedy-nav .visible-links"),s=document.querySelector("nav.greedy-nav .hidden-links");var r,l,c=0,d=0,a=[];for(i of o.children)d+=i.offsetWidth,c+=1,a.push(d);function u(){r=o.offsetWidth,l=o.children.length,a[l-1]>r?(s.prepend(o.lastChild),l-=1,u()):r>a[l]&&(o.append(s.firstChild),l+=1,u()),l===c?n.classList.add("hidden"):n.classList.remove("hidden")}window.addEventListener("resize",()=>{u()}),n.addEventListener("click",()=>{s.classList.toggle("hidden"),n.classList.toggle("close")}),u()}]);
\ No newline at end of file