Added public dir
This commit is contained in:
parent
9b39ff7e0e
commit
c3f3670d56
16 changed files with 489 additions and 0 deletions
|
@ -0,0 +1 @@
|
|||
(()=>{var e=!0,t=null,n=!0;function s(){const e=document.getElementById("top-link");document.addEventListener("scroll",()=>{document.body.scrollTop>600||document.documentElement.scrollTop>600?(e.style.visibility="visible",e.style.opacity="1"):(e.style.visibility="hidden",e.style.opacity="0")})}function o(){const e=document.getElementById("theme-toggle");e.addEventListener("click",()=>{document.body.className.includes("dark")?(document.body.classList.remove("dark"),localStorage.setItem("pref-theme","light")):(document.body.classList.add("dark"),localStorage.setItem("pref-theme","dark"))})}function i(){document.querySelectorAll("pre > code").forEach(e=>{const n=e.parentNode.parentNode,t=document.createElement("button");t.classList.add("copy-code"),t.innerHTML="copy";function s(){t.innerHTML="copied!",setTimeout(()=>{t.innerHTML="copy"},2e3)}t.addEventListener("click",t=>{if("clipboard"in navigator){navigator.clipboard.writeText(e.textContent),s();return}const n=document.createRange();n.selectNodeContents(e);const o=window.getSelection();o.removeAllRanges(),o.addRange(n);try{document.execCommand("copy"),s()}catch{}o.removeRange(n)}),n.classList.contains("highlight")?n.appendChild(t):n.parentNode.firstChild==n||(e.parentNode.parentNode.parentNode.parentNode.parentNode.nodeName=="TABLE"?e.parentNode.parentNode.parentNode.parentNode.parentNode.appendChild(t):e.parentNode.appendChild(t))})}function a(){const e=document.getElementById("toc");if(!e)return;window.innerWidth>1500&&window.innerHeight>800&&(e.open=!0)}function r(){const e=document.getElementById("progressBar");if(!e)return;document.addEventListener("scroll",()=>{let t=document.documentElement.scrollTop/(document.documentElement.scrollHeight-window.innerHeight)*100;t>=99&&(t=0),e.style.setProperty("--scrollAmount",t+"%")})}e&&s(),n&&o(),t&&i(),a(),r()})()
|
|
@ -0,0 +1 @@
|
|||
function loadPreferredTheme(){const e=localStorage.getItem("pref-theme"),t=document.body.classList.contains("dark");e==="light"&&t?document.body.classList.remove("dark"):e==="dark"&&!t&&document.body.classList.add("dark")}loadPreferredTheme()
|
Loading…
Add table
Add a link
Reference in a new issue