first commit

This commit is contained in:
anael committed 2026-11-08 15:17:21 +01:00
commit b903eb32cf
61 files changed
+17306

No files matched your search

@@ -0,0 +1,6 @@
document.addEventListener("DOMContentLoaded",function(){document.querySelectorAll(".hextra-alert[data-alert-fold]").forEach(function(e){const t=e.querySelector(".hextra-alert-toggle"),n=e.querySelector(".hextra-alert-content");if(!t||!n)return;const s=function(s){e.dataset.alertFold=s?"+":"-",t.setAttribute("aria-expanded",s?"true":"false"),n.setAttribute("aria-hidden",s?"false":"true"),n.toggleAttribute("inert",!s)};s(e.dataset.alertFold==="+"),t.addEventListener("click",function(){s(e.dataset.alertFold!=="+")})})}),document.addEventListener("DOMContentLoaded",function(){const e=document.querySelector("#backToTop");e&&(e.addEventListener("click",scrollUp),document.addEventListener("scroll",t=>{window.scrollY>300?(e.classList.remove("hx:opacity-0"),e.removeAttribute("tabindex")):(e.classList.add("hx:opacity-0"),e.setAttribute("tabindex","-1"))}))});function scrollUp(){const e=window.matchMedia("(prefers-reduced-motion: reduce)").matches;window.scroll({top:0,left:0,behavior:e?"auto":"smooth"})}document.addEventListener("DOMContentLoaded",function(){const n=()=>{const e=document.createElementNS("http://www.w3.org/2000/svg","svg");return e.innerHTML=`
<path stroke-linecap="round" stroke-linejoin="round" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" />
`,e.setAttribute("fill","none"),e.setAttribute("viewBox","0 0 24 24"),e.setAttribute("stroke","currentColor"),e.setAttribute("stroke-width","2"),e},s=()=>{const e=document.createElementNS("http://www.w3.org/2000/svg","svg");return e.innerHTML=`
<path stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7" />
`,e.setAttribute("fill","none"),e.setAttribute("viewBox","0 0 24 24"),e.setAttribute("stroke","currentColor"),e.setAttribute("stroke-width","2"),e},t=()=>{document.querySelectorAll(".hextra-code-block pre, .highlight pre").forEach(function(e){e.scrollWidth>e.clientWidth?e.setAttribute("tabindex","0"):e.removeAttribute("tabindex")})};t();let e;window.addEventListener("resize",()=>{e&&cancelAnimationFrame(e),e=requestAnimationFrame(t)}),document.querySelectorAll(".hextra-code-copy-btn").forEach(function(e){e.querySelector(".hextra-copy-icon")?.appendChild(n()),e.querySelector(".hextra-success-icon")?.appendChild(s()),e.addEventListener("click",function(t){t.preventDefault();const s=e.parentElement.previousElementSibling;let n;if(s.tagName==="CODE")n=s;else{const e=s.querySelectorAll("code");n=e[e.length-1]}if(n){let t=n.innerText;"lang"in n.dataset&&(t=t.replace(/\n\n/g,`
`)),navigator.clipboard.writeText(t).then(function(){e.classList.add("copied");var t=e.getAttribute("aria-label"),n=e.dataset.copiedLabel||"Copied!";e.setAttribute("aria-label",n),setTimeout(function(){e.classList.remove("copied"),e.setAttribute("aria-label",t)},1e3)}).catch(function(e){console.error("Failed to copy text: ",e)})}else console.error("Target element not found")})})}),function(){const e=document.getElementById("favicon-svg"),n="true"==="true";if(e&&n){const s="/favicon.svg",o="/favicon-dark.svg",n=window.matchMedia("(prefers-color-scheme: dark)");function t(t){e.href=t.matches?o:s}t(n),n.addEventListener("change",t)}}(),document.addEventListener("DOMContentLoaded",function(){const e=document.querySelectorAll(".hextra-filetree-folder");e.forEach(function(e){e.addEventListener("click",function(){Array.from(e.children).forEach(function(e){e.dataset.state=e.dataset.state==="open"?"closed":"open"});var t=e.nextElementSibling.dataset.state==="open"?"closed":"open";e.nextElementSibling.dataset.state=t,e.setAttribute("aria-expanded",t==="open"?"true":"false")})})}),function(){const e=document.querySelectorAll(".hextra-language-switcher"),t=(e,t=!1)=>{e.dataset.state="closed",e.setAttribute("aria-expanded","false");const n=e.nextElementSibling;n.classList.add("hx:hidden"),t&&e.focus()},n=(e,t="none")=>{e.dataset.state="open",e.setAttribute("aria-expanded","true");const n=e.nextElementSibling;if(n.classList.contains("hx:hidden")?toggleMenu(e):resizeMenu(e),t!=="none"){const e=Array.from(n.querySelectorAll('[role="menuitem"]'));if(e.length>0){const n=t==="last"?e[e.length-1]:e[0];n.focus()}}};e.forEach(e=>{e.addEventListener("click",s=>{s.preventDefault(),e.dataset.state==="open"?t(e):n(e)}),e.addEventListener("keydown",t=>{t.key==="ArrowDown"?(t.preventDefault(),n(e,"first")):t.key==="ArrowUp"&&(t.preventDefault(),n(e,"last"))})}),document.querySelectorAll(".hextra-language-options[role=menu]").forEach(e=>{e.addEventListener("keydown",n=>{const s=Array.from(e.querySelectorAll('[role="menuitem"]'));if(s.length===0)return;const i=s.indexOf(document.activeElement);let o;switch(n.key){case"ArrowDown":n.preventDefault(),o=(i+1)%s.length,s[o].focus();break;case"ArrowUp":n.preventDefault(),o=(i-1+s.length)%s.length,s[o].focus();break;case"Home":n.preventDefault(),s[0].focus();break;case"End":n.preventDefault(),s[s.length-1].focus();break;case"Escape":{n.preventDefault();const s=e.previousElementSibling;s&&t(s,!0);break}}})}),window.addEventListener("resize",()=>e.forEach(resizeMenu)),document.addEventListener("click",n=>{!n.target.closest(".hextra-language-switcher")&&!n.target.closest(".hextra-language-options")&&e.forEach(e=>{t(e)})})}(),document.addEventListener("DOMContentLoaded",function(){const t=document.querySelector(".hextra-hamburger-menu"),e=document.querySelector(".hextra-sidebar-container"),n=window.matchMedia("(max-width: 767px)");function s(){return t.querySelector("svg").classList.contains("open")}function o(){n.matches?e.setAttribute("aria-hidden",s()?"false":"true"):e.removeAttribute("aria-hidden")}o(),n.addEventListener("change",o);function i(n={}){const{focusOnOpen:a=!0}=n;t.querySelector("svg").classList.toggle("open"),e.classList.toggle("hx:max-md:[transform:translate3d(0,-100%,0)]"),e.classList.toggle("hx:max-md:[transform:translate3d(0,0,0)]"),document.body.classList.toggle("hx:overflow-hidden"),document.body.classList.toggle("hx:md:overflow-auto");const i=s();if(t.setAttribute("aria-expanded",i?"true":"false"),o(),i){if(a){const t=e.querySelector('a, button, input, [tabindex="0"]');t&&t.focus()}}else t.focus()}t.addEventListener("click",e=>{e.preventDefault(),i({focusOnOpen:e.detail===0})}),document.addEventListener("keydown",e=>{if(e.key!=="Escape")return;if(document.getElementById("hextra-search-dialog")?.open)return;n.matches&&s()&&i()});const a=e.querySelectorAll("a");a.forEach(e=>{e.addEventListener("click",t=>{e.getAttribute("href")&&e.getAttribute("href").startsWith("#")&&window.innerWidth<768&&i()})})}),function(){const s="hx:hidden",t=document.querySelectorAll(".hextra-nav-menu-toggle"),e=(e,t=!1)=>{e.dataset.state="closed",e.setAttribute("aria-expanded","false");const n=e.nextElementSibling;n.classList.add(s),t&&e.focus()},n=(n,o="none")=>{t.forEach(t=>{t!==n&&e(t)}),n.dataset.state="open",n.setAttribute("aria-expanded","true");const i=n.nextElementSibling;if(i.style.position="absolute",i.style.top="100%",i.style.left="50%",i.style.transform="translateX(-50%)",i.style.zIndex="1000",i.classList.remove(s),o!=="none"){const e=Array.from(i.querySelectorAll('[role="menuitem"]'));if(e.length>0){const t=o==="last"?e[e.length-1]:e[0];t.focus()}}};t.forEach(t=>{t.addEventListener("click",s=>{s.preventDefault(),s.stopPropagation();const o=t.dataset.state==="open";o?e(t):n(t)}),t.addEventListener("keydown",e=>{e.key==="ArrowDown"?(e.preventDefault(),n(t,"first")):e.key==="ArrowUp"&&(e.preventDefault(),n(t,"last"))})}),document.querySelectorAll(".hextra-nav-menu-items[role=menu]").forEac Line truncated