-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex-min.js
1 lines (1 loc) · 5.71 KB
/
index-min.js
1
!function(){var e=[,function(){const e=document.querySelector(".columns"),t=document.querySelectorAll(".cert ul li"),n=e.querySelector(".overlay"),o=e.querySelector("button.close"),i=n.querySelector(".wrapper"),r=n.querySelectorAll(".wrapper img"),c=n.querySelectorAll(".arrow"),a=n.querySelector("p.description"),s=n.querySelector("nav .x"),l=n.querySelector(".nav-description figcaption a");function d(e){s.innerText=e+1,a.innerText=r[e].dataset.description,l.href=r[e].dataset.link,i.href=r[e].dataset.link}function u(e){c[1].classList.remove("disabled"),e.stopPropagation();let t=m();0!==t&&(c[1].tabIndex=0,v(t),L(t-1),d(t-1))}function f(e){c[0].classList.remove("disabled"),e.stopPropagation();let t=m();t!==r.length-1&&(c[0].tabIndex=0,v(t),L(t+1),d(t+1))}function m(){for(let t=0;t<r.length;t++)if(r[t].classList.contains("active")&&r[t].classList.contains("front")){var e=t;break}return e}function v(e){r[e-1]&&r[e-1].classList.remove("active"),r[e]&&(r[e].tabIndex=-1,r[e].classList.remove("active","front")),r[e+1]&&r[e+1].classList.remove("active","after")}function L(e){r[e].tabIndex=0,r[e].classList.add("active","front"),r[e-1]?r[e-1].classList.add("active"):(c[0].classList.add("disabled"),setTimeout((()=>{c[0].tabIndex=-1}),100)),r[e+1]?r[e+1].classList.add("active","after"):(c[1].classList.add("disabled"),c[1].tabIndex=-1)}function g(o){n.classList.add("active"),e.classList.add("container"),l.tabIndex=0,c[0].tabIndex=0,c[1].tabIndex=0;for(let e=0;e<t.length;e++)t[e].tabIndex=-1;for(let e=0;e<r.length;e++)r[e].addEventListener("click",(function(e){e.stopPropagation()})),r[e].classList[0]==o.target.classList[0]&&(L(e),d(e));document.querySelector(".img-border").addEventListener("click",(function(e){e.stopPropagation()}))}n.querySelector("nav .y").innerHTML=r.length,o.addEventListener("click",(function(){n.classList.remove("active"),e.classList.remove("container"),l.tabIndex=-1;for(let e=0;e<r.length;e++)r[e].tabIndex=-1,r[e].classList.remove("active","after");c[0].classList.remove("disabled"),c[0].tabIndex=-1,c[1].classList.remove("disabled"),c[1].tabIndex=-1;for(let e=0;e<t.length;e++)t[e].tabIndex=0})),document.querySelector(".cert ul").addEventListener("click",(function(e){g(e)})),document.querySelector(".cert ul").addEventListener("keyup",(function(e){"Enter"===e.code&&g(e)})),c[0].addEventListener("click",(e=>{u(e)})),document.addEventListener("keydown",(e=>{"ArrowLeft"===e.key&&u(e)})),c[1].addEventListener("click",(function(e){f(e)})),document.addEventListener("keydown",(e=>{"ArrowRight"===e.key&&f(e)}))},function(){var e=document.querySelectorAll(".flex_wrapper .item .link");document.addEventListener("mousemove",(function(){for(let t=0;t<e.length;t++)e[t].matches(":hover")||e[t].nextElementSibling.matches(":hover")?e[t].parentNode.classList.add("hover"):e[t].parentNode.classList.remove("hover")})),document.addEventListener("keyup",(function(t){if("Tab"===t.code)for(let t=0;t<e.length;t++)e[t].matches(":focus-visible")?e[t].parentNode.classList.add("focus"):e[t].parentNode.classList.remove("focus")}));var t=document.querySelectorAll(".bar .expand");for(let e=0;e<t.length;e++)t[e].addEventListener("click",(function(){this.parentNode.parentNode.classList.toggle("toggle"),this.classList.toggle("on")}));document.querySelector(".pinkwug .hidden").addEventListener("click",(function(e){window.location="/pinkwug.html"})),document.querySelector(".miguel .hidden").addEventListener("click",(function(e){window.location="/miguelgarbageremoval.html"}))},function(){function e(){var e=document.querySelectorAll("main section.column ul");for(let t=0;t<e.length;t++)e[t].classList.contains("animation")||o(e[t])&&e[t].classList.add("animation")}function t(){var e,t,n=document.querySelectorAll(".work .item");for(let i=0;i<n.length;i++)n[i].classList.contains("animation")||o(n[i])&&n[i].classList.add("animation"),n[i].classList.contains("v")||(e=n[i],t=void 0,(t=e.getBoundingClientRect()).top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth&&(n[i].classList.add("v"),setTimeout((()=>{n[i].classList.add("toggle"),n[i].querySelector(".expand").classList.add("on"),setTimeout((()=>{n[i].classList.remove("toggle"),n[i].querySelector(".expand").classList.remove("on")}),4500)}),2e3)))}function n(){var e=document.querySelector("section.contact");e.classList.contains("animation")||o(e)&&e.classList.add("animation")}function o(e){var t=e.getBoundingClientRect(),n=Math.max(document.documentElement.clientHeight,window.innerHeight);return!(t.bottom<0||t.top-n>=0)}window.onload=function(){e(),t(),n()},window.onscroll=function(e,t){let n;return function(){const o=this,i=arguments,r=function(){n=null,e.apply(o,i)};clearTimeout(n),n=setTimeout(r,t)}}((function(){e(),t(),n()}),100)},function(){function e(){let e=document.querySelector("section.contact"),t=-e.offsetHeight/2+"px";e.style.marginBottom=t}function t(){let e=document.querySelectorAll("section.work .item"),t=e[0].querySelector(".bar"),n=e[0].querySelector(".link"),o=t.offsetHeight+9*n.offsetWidth/16+"px";for(let t=0;t<e.length;t++)e[t].style.minHeight=o}window.addEventListener("load",(()=>{e(),t()})),window.addEventListener("resize",(()=>{e(),t()}))}],t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var r=t[o]={exports:{}};return e[o](r,r.exports,n),r.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};!function(){"use strict";n.r(o);n(1),n(2),n(3),n(4)}()}();