Deploy from Gitea Actions
This commit is contained in:
@@ -0,0 +1 @@
|
||||
const sitePreference=document.documentElement.getAttribute("data-default-appearance"),userPreference=localStorage.getItem("appearance");(sitePreference==="dark"&&userPreference===null||userPreference==="dark")&&document.documentElement.classList.add("dark"),document.documentElement.getAttribute("data-auto-appearance")==="true"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches&&userPreference!=="light"&&document.documentElement.classList.add("dark"),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",e=>{e.matches?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")}));var updateMeta,getTargetAppearance,updateMermaidTheme=()=>{if(typeof mermaid!="undefined"){const e=document.documentElement.classList.contains("dark"),t=document.querySelectorAll("pre.mermaid");t.forEach(e=>{e.getAttribute("data-processed")?(e.removeAttribute("data-processed"),e.innerHTML=e.getAttribute("data-graph")):e.setAttribute("data-graph",e.textContent)}),e?(initMermaidDark(),mermaid.run()):(initMermaidLight(),mermaid.run())}};window.addEventListener("DOMContentLoaded",e=>{const t=document.getElementById("appearance-switcher"),n=document.getElementById("appearance-switcher-mobile");updateMeta(),this.updateLogo?.(getTargetAppearance()),updateMermaidTheme(),t&&(t.addEventListener("click",()=>{document.documentElement.classList.toggle("dark");var e=getTargetAppearance();localStorage.setItem("appearance",e),updateMeta(),updateMermaidTheme(),this.updateLogo?.(e)}),t.addEventListener("contextmenu",e=>{e.preventDefault(),localStorage.removeItem("appearance")})),n&&(n.addEventListener("click",()=>{document.documentElement.classList.toggle("dark");var e=getTargetAppearance();localStorage.setItem("appearance",e),updateMeta(),updateMermaidTheme(),this.updateLogo?.(e)}),n.addEventListener("contextmenu",e=>{e.preventDefault(),localStorage.removeItem("appearance")}))}),updateMeta=()=>{var e=document.querySelector("body"),t=getComputedStyle(e);document.querySelector('meta[name="theme-color"]').setAttribute("content",t.backgroundColor)},getTargetAppearance=()=>document.documentElement.classList.contains("dark")?"dark":"light",window.addEventListener("DOMContentLoaded",e=>{const t=document.getElementById("top-scroller"),n=document.getElementById("site-footer");t&&n&&t.getBoundingClientRect().top>n.getBoundingClientRect().top&&(t.hidden=!0)})
|
||||
@@ -0,0 +1 @@
|
||||
function setBackgroundBlur(e,t=300,n=!1,s=!1){if(!e){console.error("data-blur-id is null");return}const o=document.getElementById(e);if(!o)return;n?(o.setAttribute("aria-hidden","true"),s?o.style.display="":(o.style.display="none",o.style.opacity="0")):(o.style.display="",o.removeAttribute("aria-hidden"));const i=()=>{if(!n||s){const e=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;o.style.opacity=e/t}};o.setAttribute("role","presentation"),o.setAttribute("tabindex","-1"),window.addEventListener("scroll",i),i()}document.querySelectorAll("script[data-blur-id]").forEach(e=>{const t=e.getAttribute("data-blur-id"),n=Number(e.getAttribute("data-scroll-divisor")||300),s=t==="menu-blur",o=JSON.parse(localStorage.getItem("a11ySettings")||"{}"),i=o.disableBlur;setBackgroundBlur(t,n,i,s)})
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user