diff --git a/_astro/hoisted.b39f1d8e.js b/_astro/hoisted.580bccfd.js similarity index 79% rename from _astro/hoisted.b39f1d8e.js rename to _astro/hoisted.580bccfd.js index f3effee..46ef0ff 100644 --- a/_astro/hoisted.b39f1d8e.js +++ b/_astro/hoisted.580bccfd.js @@ -1,2 +1,2 @@ function oe(n,t){for(var o=0;on.length)&&(t=n.length);for(var o=0,e=new Array(t);o0&&this.registerTriggers.apply(this,v(a)),this.onClick=this.onClick.bind(this),this.onKeydown=this.onKeydown.bind(this)}var t,o;return t=n,(o=[{key:"registerTriggers",value:function(){for(var e=this,i=arguments.length,r=new Array(i),a=0;a0&&arguments[0]!==void 0?arguments[0]:null;if(this.activeElement=document.activeElement,this.modal.setAttribute("aria-hidden","false"),this.modal.classList.add(this.config.openClass),this.scrollBehaviour("disable"),this.addEventListeners(),this.config.awaitOpenAnimation){var r=function a(){e.modal.removeEventListener("animationend",a,!1),e.setFocusToFirstNode()};this.modal.addEventListener("animationend",r,!1)}else this.setFocusToFirstNode();this.config.onShow(this.modal,this.activeElement,i)}},{key:"closeModal",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,i=this.modal;if(this.modal.setAttribute("aria-hidden","true"),this.removeEventListeners(),this.scrollBehaviour("enable"),this.activeElement&&this.activeElement.focus&&this.activeElement.focus(),this.config.onClose(this.modal,this.activeElement,e),this.config.awaitCloseAnimation){var r=this.config.openClass;this.modal.addEventListener("animationend",function a(){i.classList.remove(r),i.removeEventListener("animationend",a,!1)},!1)}else i.classList.remove(this.config.openClass)}},{key:"closeModalById",value:function(e){this.modal=document.getElementById(e),this.modal&&this.closeModal()}},{key:"scrollBehaviour",value:function(e){if(this.config.disableScroll){var i=document.querySelector("body");switch(e){case"enable":Object.assign(i.style,{overflow:""});break;case"disable":Object.assign(i.style,{overflow:"hidden"})}}}},{key:"addEventListeners",value:function(){this.modal.addEventListener("touchstart",this.onClick),this.modal.addEventListener("click",this.onClick),document.addEventListener("keydown",this.onKeydown)}},{key:"removeEventListeners",value:function(){this.modal.removeEventListener("touchstart",this.onClick),this.modal.removeEventListener("click",this.onClick),document.removeEventListener("keydown",this.onKeydown)}},{key:"onClick",value:function(e){(e.target.hasAttribute(this.config.closeTrigger)||e.target.parentNode.hasAttribute(this.config.closeTrigger))&&(e.preventDefault(),e.stopPropagation(),this.closeModal(e))}},{key:"onKeydown",value:function(e){e.keyCode===27&&this.closeModal(e),e.keyCode===9&&this.retainFocus(e)}},{key:"getFocusableNodes",value:function(){var e=this.modal.querySelectorAll(q);return Array.apply(void 0,v(e))}},{key:"setFocusToFirstNode",value:function(){var e=this;if(!this.config.disableFocus){var i=this.getFocusableNodes();if(i.length!==0){var r=i.filter(function(a){return!a.hasAttribute(e.config.closeTrigger)});r.length>0&&r[0].focus(),r.length===0&&i[0].focus()}}}},{key:"retainFocus",value:function(e){var i=this.getFocusableNodes();if(i.length!==0)if(i=i.filter(function(a){return a.offsetParent!==null}),this.modal.contains(document.activeElement)){var r=i.indexOf(document.activeElement);e.shiftKey&&r===0&&(i[i.length-1].focus(),e.preventDefault()),!e.shiftKey&&i.length>0&&r===i.length-1&&(i[0].focus(),e.preventDefault())}else i[0].focus()}}])&&oe(t.prototype,o),n}(),d=null,w=function(n){if(!document.getElementById(n))return console.warn("MicroModal: ❗Seems like you have missed %c'".concat(n,"'"),"background-color: #f8f9fa;color: #50596c;font-weight: bold;","ID somewhere in your code. Refer example below to resolve it."),console.warn("%cExample:","background-color: #f8f9fa;color: #50596c;font-weight: bold;",'')),!1},I=function(n,t){if(function(e){e.length<=0&&(console.warn("MicroModal: ❗Please specify at least one %c'micromodal-trigger'","background-color: #f8f9fa;color: #50596c;font-weight: bold;","data attribute."),console.warn("%cExample:","background-color: #f8f9fa;color: #50596c;font-weight: bold;",''))}(n),!t)return!0;for(var o in t)w(o);return!0},{init:function(n){var t=Object.assign({},{openTrigger:"data-micromodal-trigger"},n),o=v(document.querySelectorAll("[".concat(t.openTrigger,"]"))),e=function(a,u){var l=[];return a.forEach(function(f){var m=f.attributes[u].value;l[m]===void 0&&(l[m]=[]),l[m].push(f)}),l}(o,t.openTrigger);if(t.debugMode!==!0||I(o,e)!==!1)for(var i in e){var r=e[i];t.targetModal=i,t.triggers=v(r),d=new p(t)}},show:function(n,t){var o=t||{};o.targetModal=n,o.debugMode===!0&&w(n)===!1||(d&&d.removeEventListeners(),(d=new p(o)).showModal())},close:function(n){n?d.closeModalById(n):d.closeModal()}});typeof window<"u"&&(window.MicroModal=M);var ie=!0,E="Invariant failed";function s(n,t){if(!n){if(ie)throw new Error(E);var o=typeof t=="function"?t():t,e=o?"".concat(E,": ").concat(o):E;throw new Error(e)}}const C="menu-modal",x=document.querySelector("#page-header"),B=document.documentElement,z=document.querySelector(`#${C} ul`),j=document.querySelector("#open-nav-button"),K=document.querySelector("#close-nav-button");s(x,"header should not be null");s(z,"menu should not be null");s(j,"openNavButton should not be null");s(K,"closeNavButton should not be null");const re=()=>{M.show(C,{disableScroll:!0})},$=()=>{M.close(C)};j.addEventListener("click",re);K.addEventListener("click",$);document.addEventListener("scroll",()=>{const n=B.clientHeight-B.scrollTop-x.offsetHeight;x.classList.toggle("fixed-header",n<0)});z.addEventListener("click",n=>{n.target.tagName==="A"&&$()});const k=["light","dark"],D=document.querySelector("#theme-switcher");s(D,"button should not be null");const H=()=>document.documentElement.dataset.theme,R=()=>{const n=H();s(n,"themeCurrent should not be undefined");const t=k.indexOf(n);return k[(t+1)%k.length]},W=()=>{const n=H();document.querySelector(`#icon-theme-${n}`)?.classList.add("hidden");const t=R();document.querySelector(`#icon-theme-${t}`)?.classList.remove("hidden")};D.addEventListener("click",()=>{const n=R();document.documentElement.dataset.theme=n,localStorage.setItem("theme",n),W()});W();const ae=800,se=.1;class le{x;y;z;xPrev;yPrev;constructor(t=0,o=0,e=0){this.x=t,this.y=o,this.z=e,this.xPrev=t,this.yPrev=o}update(t,o,e){this.xPrev=this.x,this.yPrev=this.y,this.z+=e*.0675,this.x+=this.x*(e*.0225)*this.z,this.y+=this.y*(e*.0225)*this.z,(this.x>t/2||this.x<-t/2||this.y>o/2||this.y<-o/2)&&(this.x=Math.random()*t-t/2,this.y=Math.random()*o-o/2,this.xPrev=this.x,this.yPrev=this.y,this.z=0)}draw(t){t.lineWidth=this.z,t.beginPath(),t.moveTo(this.x,this.y),t.lineTo(this.xPrev,this.yPrev),t.stroke()}}const U=Array.from({length:ae},()=>new le(0,0,0));let g=0;const h=document.querySelector("#starfield-canvas");s(h,"canvas should not be null");const c=h.getContext("2d"),y=document.querySelector("#starfield");s(y,"container should not be null");const ce=new ResizeObserver(de);ce.observe(y);function de(){s(c,"canvas context should not be null"),g>0&&cancelAnimationFrame(g);const{clientWidth:n,clientHeight:t}=y,o=window.devicePixelRatio||1;h.width=n*o,h.height=t*o,h.style.width=`${n}px`,h.style.height=`${t}px`,c.scale(o,o);for(const e of U)e.x=Math.random()*n-n/2,e.y=Math.random()*t-t/2,e.z=0;c.translate(n/2,t/2),c.fillStyle="rgba(0, 0, 0, 0.4)",c.strokeStyle="white",g=requestAnimationFrame(G)}function G(){s(c,"canvas context should not be null");const{clientWidth:n,clientHeight:t}=y;for(const o of U)o.update(n,t,se),o.draw(c);c.fillRect(-n/2,-t/2,n,t),g=requestAnimationFrame(G)} +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function b(n,t){(t==null||t>n.length)&&(t=n.length);for(var o=0,e=new Array(t);o0&&this.registerTriggers.apply(this,v(a)),this.onClick=this.onClick.bind(this),this.onKeydown=this.onKeydown.bind(this)}var t,o;return t=n,(o=[{key:"registerTriggers",value:function(){for(var e=this,i=arguments.length,r=new Array(i),a=0;a0&&arguments[0]!==void 0?arguments[0]:null;if(this.activeElement=document.activeElement,this.modal.setAttribute("aria-hidden","false"),this.modal.classList.add(this.config.openClass),this.scrollBehaviour("disable"),this.addEventListeners(),this.config.awaitOpenAnimation){var r=function a(){e.modal.removeEventListener("animationend",a,!1),e.setFocusToFirstNode()};this.modal.addEventListener("animationend",r,!1)}else this.setFocusToFirstNode();this.config.onShow(this.modal,this.activeElement,i)}},{key:"closeModal",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,i=this.modal;if(this.modal.setAttribute("aria-hidden","true"),this.removeEventListeners(),this.scrollBehaviour("enable"),this.activeElement&&this.activeElement.focus&&this.activeElement.focus(),this.config.onClose(this.modal,this.activeElement,e),this.config.awaitCloseAnimation){var r=this.config.openClass;this.modal.addEventListener("animationend",function a(){i.classList.remove(r),i.removeEventListener("animationend",a,!1)},!1)}else i.classList.remove(this.config.openClass)}},{key:"closeModalById",value:function(e){this.modal=document.getElementById(e),this.modal&&this.closeModal()}},{key:"scrollBehaviour",value:function(e){if(this.config.disableScroll){var i=document.querySelector("body");switch(e){case"enable":Object.assign(i.style,{overflow:""});break;case"disable":Object.assign(i.style,{overflow:"hidden"})}}}},{key:"addEventListeners",value:function(){this.modal.addEventListener("touchstart",this.onClick),this.modal.addEventListener("click",this.onClick),document.addEventListener("keydown",this.onKeydown)}},{key:"removeEventListeners",value:function(){this.modal.removeEventListener("touchstart",this.onClick),this.modal.removeEventListener("click",this.onClick),document.removeEventListener("keydown",this.onKeydown)}},{key:"onClick",value:function(e){(e.target.hasAttribute(this.config.closeTrigger)||e.target.parentNode.hasAttribute(this.config.closeTrigger))&&(e.preventDefault(),e.stopPropagation(),this.closeModal(e))}},{key:"onKeydown",value:function(e){e.keyCode===27&&this.closeModal(e),e.keyCode===9&&this.retainFocus(e)}},{key:"getFocusableNodes",value:function(){var e=this.modal.querySelectorAll(q);return Array.apply(void 0,v(e))}},{key:"setFocusToFirstNode",value:function(){var e=this;if(!this.config.disableFocus){var i=this.getFocusableNodes();if(i.length!==0){var r=i.filter(function(a){return!a.hasAttribute(e.config.closeTrigger)});r.length>0&&r[0].focus(),r.length===0&&i[0].focus()}}}},{key:"retainFocus",value:function(e){var i=this.getFocusableNodes();if(i.length!==0)if(i=i.filter(function(a){return a.offsetParent!==null}),this.modal.contains(document.activeElement)){var r=i.indexOf(document.activeElement);e.shiftKey&&r===0&&(i[i.length-1].focus(),e.preventDefault()),!e.shiftKey&&i.length>0&&r===i.length-1&&(i[0].focus(),e.preventDefault())}else i[0].focus()}}])&&oe(t.prototype,o),n}(),d=null,w=function(n){if(!document.getElementById(n))return console.warn("MicroModal: ❗Seems like you have missed %c'".concat(n,"'"),"background-color: #f8f9fa;color: #50596c;font-weight: bold;","ID somewhere in your code. Refer example below to resolve it."),console.warn("%cExample:","background-color: #f8f9fa;color: #50596c;font-weight: bold;",'')),!1},I=function(n,t){if(function(e){e.length<=0&&(console.warn("MicroModal: ❗Please specify at least one %c'micromodal-trigger'","background-color: #f8f9fa;color: #50596c;font-weight: bold;","data attribute."),console.warn("%cExample:","background-color: #f8f9fa;color: #50596c;font-weight: bold;",''))}(n),!t)return!0;for(var o in t)w(o);return!0},{init:function(n){var t=Object.assign({},{openTrigger:"data-micromodal-trigger"},n),o=v(document.querySelectorAll("[".concat(t.openTrigger,"]"))),e=function(a,u){var l=[];return a.forEach(function(f){var m=f.attributes[u].value;l[m]===void 0&&(l[m]=[]),l[m].push(f)}),l}(o,t.openTrigger);if(t.debugMode!==!0||I(o,e)!==!1)for(var i in e){var r=e[i];t.targetModal=i,t.triggers=v(r),d=new p(t)}},show:function(n,t){var o=t||{};o.targetModal=n,o.debugMode===!0&&w(n)===!1||(d&&d.removeEventListeners(),(d=new p(o)).showModal())},close:function(n){n?d.closeModalById(n):d.closeModal()}});typeof window<"u"&&(window.MicroModal=M);var ie=!0,E="Invariant failed";function s(n,t){if(!n){if(ie)throw new Error(E);var o=typeof t=="function"?t():t,e=o?"".concat(E,": ").concat(o):E;throw new Error(e)}}const C="menu-modal",x=document.querySelector("#page-header"),B=document.documentElement,z=document.querySelector(`#${C} ul`),j=document.querySelector("#open-nav-button"),K=document.querySelector("#close-nav-button");s(x,"header should not be null");s(z,"menu should not be null");s(j,"openNavButton should not be null");s(K,"closeNavButton should not be null");const re=()=>{M.show(C,{disableScroll:!0})},$=()=>{M.close(C)};j.addEventListener("click",re);K.addEventListener("click",$);document.addEventListener("scroll",()=>{const n=B.clientHeight-B.scrollTop-x.offsetHeight;x.classList.toggle("fixed-header",n<0)});z.addEventListener("click",n=>{n.target.tagName==="A"&&$()});const ae=800,se=.1;class le{x;y;z;xPrev;yPrev;constructor(t=0,o=0,e=0){this.x=t,this.y=o,this.z=e,this.xPrev=t,this.yPrev=o}update(t,o,e){this.xPrev=this.x,this.yPrev=this.y,this.z+=e*.0675,this.x+=this.x*(e*.0225)*this.z,this.y+=this.y*(e*.0225)*this.z,(this.x>t/2||this.x<-t/2||this.y>o/2||this.y<-o/2)&&(this.x=Math.random()*t-t/2,this.y=Math.random()*o-o/2,this.xPrev=this.x,this.yPrev=this.y,this.z=0)}draw(t){t.lineWidth=this.z,t.beginPath(),t.moveTo(this.x,this.y),t.lineTo(this.xPrev,this.yPrev),t.stroke()}}const D=Array.from({length:ae},()=>new le(0,0,0));let g=0;const h=document.querySelector("#starfield-canvas");s(h,"canvas should not be null");const c=h.getContext("2d"),y=document.querySelector("#starfield");s(y,"container should not be null");const ce=new ResizeObserver(de);ce.observe(y);function de(){s(c,"canvas context should not be null"),g>0&&cancelAnimationFrame(g);const{clientWidth:n,clientHeight:t}=y,o=window.devicePixelRatio||1;h.width=n*o,h.height=t*o,h.style.width=`${n}px`,h.style.height=`${t}px`,c.scale(o,o);for(const e of D)e.x=Math.random()*n-n/2,e.y=Math.random()*t-t/2,e.z=0;c.translate(n/2,t/2),c.fillStyle="rgba(0, 0, 0, 0.4)",c.strokeStyle="white",g=requestAnimationFrame(H)}function H(){s(c,"canvas context should not be null");const{clientWidth:n,clientHeight:t}=y;for(const o of D)o.update(n,t,se),o.draw(c);c.fillRect(-n/2,-t/2,n,t),g=requestAnimationFrame(H)}const k=["light","dark"],R=document.querySelector("#theme-switcher");s(R,"button should not be null");const W=()=>document.documentElement.dataset.theme,U=()=>{const n=W();s(n,"themeCurrent should not be undefined");const t=k.indexOf(n);return k[(t+1)%k.length]},G=()=>{const n=W();document.querySelector(`#icon-theme-${n}`)?.classList.add("hidden");const t=U();document.querySelector(`#icon-theme-${t}`)?.classList.remove("hidden")};R.addEventListener("click",()=>{const n=U();document.documentElement.dataset.theme=n,localStorage.setItem("theme",n),G()});G(); diff --git a/index.html b/index.html index 5891f4f..cde8dfe 100644 --- a/index.html +++ b/index.html @@ -41,7 +41,7 @@ }); - +