chore: init

This commit is contained in:
protokey committed 2026-10-05 16:30:27 +04:00
commit fdec2ba441
55 files changed
+11359

No files matched your search

@@ -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"),o="Переключить на темный вид",i="Переключить на светлый вид";updateMeta(),this.updateLogo?.(getTargetAppearance()),updateMermaidTheme();const s=e=>{const s=e==="dark"?i:o;t&&(t.setAttribute("aria-label",s),t.setAttribute("title",s)),n&&(n.setAttribute("aria-label",s),n.setAttribute("title",s))};s(getTargetAppearance()),t&&(t.addEventListener("click",()=>{document.documentElement.classList.toggle("dark");var e=getTargetAppearance();localStorage.setItem("appearance",e),updateMeta(),updateMermaidTheme(),s(e),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(),s(e),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 @@
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"),o="Switch to dark appearance",i="Switch to light appearance";updateMeta(),this.updateLogo?.(getTargetAppearance()),updateMermaidTheme();const s=e=>{const s=e==="dark"?i:o;t&&(t.setAttribute("aria-label",s),t.setAttribute("title",s)),n&&(n.setAttribute("aria-label",s),n.setAttribute("title",s))};s(getTargetAppearance()),t&&(t.addEventListener("click",()=>{document.documentElement.classList.toggle("dark");var e=getTargetAppearance();localStorage.setItem("appearance",e),updateMeta(),updateMermaidTheme(),s(e),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(),s(e),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,14 @@
function scrollToTop(){const e=document.getElementById("scroll-to-top");window.scrollY>window.innerHeight*.5?(e.classList.remove("translate-y-4","opacity-0"),e.classList.add("translate-y-0","opacity-100")):(e.classList.remove("translate-y-0","opacity-100"),e.classList.add("translate-y-4","opacity-0"))}window.addEventListener("scroll",scrollToTop),window.addEventListener("load",scrollToTop);function e(e){return Array.isArray?Array.isArray(e):u(e)===`[object Array]`}function t(e){if(typeof e==`string`)return e;if(typeof e==`bigint`)return e.toString();let t=e+``;return t==`0`&&1/e==-1/0?`-0`:t}function n(e){return e==null?``:t(e)}function r(e){return typeof e==`string`}function i(e){return typeof e==`number`}function a(e){return e===!0||e===!1||s(e)&&u(e)==`[object Boolean]`}function o(e){return typeof e==`object`}function s(e){return o(e)&&e!==null}function c(e){return e!=null}function l(e){return!e.trim().length}function u(e){return e==null?e===0[0]?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}const d=`Invalid doc index: must be a non-negative integer within the bounds of the docs array`,f=e=>`Invalid value for key ${e}`,p=e=>`Pattern length exceeds max of ${e}.`,m=e=>`Missing ${e} property in key`,h=e=>`Property 'weight' in key '${e}' must be a positive integer`,g=Object.prototype.hasOwnProperty;var k,I,se,fe,_e,$,be,fuse,showButton,showButtonMobile,hideButton,wrapper,modal,input,output,first,last,searchVisible,indexed,hasResults,previouslyFocused,_=class{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(e=>{let n=v(e);this._keys.push(n),this._keyMap[n.id]=n,t+=n.weight}),this._keys.forEach(e=>{e.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}};function v(t){let n=null,s=null,o=null,i=1,a=null;if(r(t)||e(t))o=t,n=y(t),s=b(t);else{if(!g.call(t,`name`))throw Error(m(`name`));let e=t.name;if(o=e,g.call(t,`weight`)&&t.weight!==0[0]&&(i=t.weight,i<=0))throw Error(h(b(e)));n=y(e),s=b(e),a=t.getFn??null}return{path:n,id:s,weight:i,src:o,getFn:a}}function y(t){return e(t)?t:t.split(`.`)}function b(t){return e(t)?t.join(`.`):t}function x(t,s){let o=[],d=!1,l=(t,s,u,h)=>{if(c(t))if(s[u]){let m=t[s[u]];if(!c(m))return;if(u===s.length-1&&(r(m)||i(m)||a(m)||typeof m==`bigint`))o.push(h===0[0]?n(m):{v:n(m),i:h});else if(e(m)){d=!0;for(let e=0,t=m.length;e<t;e+=1)l(m[e],s,u+1,e)}else s.length&&l(m,s,u+1,h)}else o.push(h===0[0]?t:{v:t,i:h})};return l(t,r(s)?s.split(`.`):s,0),d?o:o[0]}const S={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},C={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1},w={location:0,threshold:.6,distance:100},T={useExtendedSearch:!1,useTokenSearch:!1,tokenize:0[0],tokenMatch:`any`,getFn:x,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},E=Object.freeze({...C,...S,...w,...T});function D(e){return e>=9&&e<=13||e===32||e===160}function O(e=1,t=3){let n=new Map,s=10**t;return{get(t){let o=0,i=!1;for(let e=0;e<t.length;e++)D(t.charCodeAt(e))?i=!1:i||(o++,i=!0);if(o===0&&(o=1),n.has(o))return n.get(o);let a=Math.round(s/o**(.5*e))/s;return n.set(o,a),a},clear(){n.clear()}}}k=class{constructor({getFn:e=E.getFn,fieldNormWeight:t=E.fieldNormWeight}={}){this.norm=O(t,3),this.getFn=e,this.isCreated=!1,this.docs=[],this.keys=[],this._keysMap={},this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((e,t)=>{this._keysMap[e.id]=t})}create(){if(this.isCreated||!this.docs.length)return;this.isCreated=!0;let e=this.docs.length;this.records=Array(e);let t=0;if(r(this.docs[0]))for(let n=0;n<e;n++){let s=this._createStringRecord(this.docs[n],n);s&&(this.records[t++]=s)}else for(let n=0;n<e;n++)this.records[t++]=this._createObjectRecord(this.docs[n],n);this.records.length=t,this.norm.clear()}add(e,t){if(!Number.isInteger(t)||t<0)throw Error(d);if(r(e)){let n=this._createStringRecord(e,t);return n&&this.records.push(n),n}let n=this._createObjectRecord(e,t);return this.records.push(n),n}removeAt(e){if(!Number.isInteger(e)||e<0)throw Error(d);for(let t=0,n=this.records.length;t<n;t+=1)if(this.records[t].i===e){this.records.splice(t,1);break}for(let t=0,n=this.records.length;t<n;t+=1)this.records[t].i>e&&--this.records[t].i}removeAll(e){let t=new Set;for(let n of e)Number.isInteger(n)&&n>=0&&t.add(n);if(t.size===0)return;this.records=this.records.filter(e=>!t.has(e.i));let n=Array.from(t).sort((e,t)=>e-t);for(let s of this.records){let e=0,t=n.length;for(;e<t;){let o=e+t>>>1;n[o]<s.i?e=o+1:t=o}s.i-=e}}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_createStringRecord(e,t){return!c(e)||l(e)?null:{v:e,i:t,n:this.norm.get(e)}}_createObjectRecord(t,s){let o={i:s,$:{}};for(let i=0,d=this.keys.length;i<d;i++){let a=this.keys[i],s=a.getFn?a.getFn(t):this.getFn(t,a.path);if(c(s))if(e(s)){letLine truncated
<a class="flex items-center px-3 py-2 rounded-md appearance-none bg-neutral-100 dark:bg-neutral-700 focus:bg-primary-100 hover:bg-primary-100 dark:hover:bg-primary-900 dark:focus:bg-primary-900 focus:outline-dotted focus:outline-transparent focus:outline-2"
${i} tabindex="0">
<div class="grow">
<div class="-mb-1 text-lg font-bold">
${o}
</div>
<div class="text-sm text-neutral-500 dark:text-neutral-400">${e.item.section}<span class="px-2 text-primary-500">&middot;</span>${e.item.date?e.item.date:""}</span></div>
<div class="text-sm italic">${e.item.summary}</div>
</div>
<div class="ml-2 ltr:block rtl:hidden text-neutral-500">&rarr;</div>
<div class="mr-2 ltr:hidden rtl:block text-neutral-500">&larr;</div>
</a>
</li>`}),hasResults=!0):(t="",hasResults=!1),output.innerHTML=t,n.length>0&&output.firstChild&&(first=output.firstChild.firstElementChild,last=output.lastChild.firstElementChild)}document.getElementById("katex-render")&&document.getElementById("katex-render").addEventListener("load",()=>{renderMathInElement(document.body)}),function(){"use strict";function e(e){var t=e.checked?"true":"false";document.querySelectorAll('label[role="button"][for="'+e.id+'"]').forEach(function(e){e.setAttribute("aria-expanded",t)})}function n(){var t={};document.querySelectorAll('label[role="button"][for]').forEach(function(n){var s=document.getElementById(n.getAttribute("for"));if(!s||s.type!=="checkbox")return;n.addEventListener("keydown",function(e){(e.key==="Enter"||e.key===" "||e.key==="Spacebar")&&(e.preventDefault(),n.click())}),t[s.id]||(t[s.id]=!0,s.addEventListener("change",function(){e(s)}),e(s))})}function s(){var t=document.getElementById("mobile-menu-toggle");if(!t)return;document.addEventListener("keydown",function(n){if(n.key==="Escape"&&t.checked){t.checked=!1,e(t);var s=document.querySelector('label[role="button"][for="mobile-menu-toggle"]');s&&s.focus()}})}function o(){var t=document.getElementById("mobile-menu-toggle"),n=document.getElementById("mobile-menu-dialog");if(!t||!n)return;document.addEventListener("click",function(s){if(!t.checked||s.target===t)return;if(n.contains(s.target))return;if(s.target.closest('label[for="mobile-menu-toggle"]'))return;t.checked=!1,e(t)})}function i(){document.querySelectorAll(".nested-menu").forEach(function(e){var t,n=e.querySelector("[aria-haspopup]");if(!n)return;t=function(e){n.setAttribute("aria-expanded",e?"true":"false")},e.addEventListener("mouseenter",function(){t(!0)}),e.addEventListener("mouseleave",function(){t(!1)}),e.addEventListener("focusin",function(){t(!0)}),e.addEventListener("focusout",function(n){e.contains(n.relatedTarget)||t(!1)}),e.addEventListener("keydown",function(n){n.key==="Escape"&&(document.activeElement&&e.contains(document.activeElement)&&document.activeElement.blur(),t(!1))})})}function t(){n(),s(),o(),i()}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t):t()}(),function(){"use strict";var e=[];window.addEventListener("beforeprint",function(){for(var n=document.querySelectorAll("details:not([open])"),t=0;t<n.length;t++)n[t].open=!0,e.push(n[t])}),window.addEventListener("afterprint",function(){for(var t=0;t<e.length;t++)e[t].open=!1;e=[]})}(),function(){const e=document.querySelectorAll(".email-link");e.forEach(e=>{let t=atob(e.getAttribute("data-email"));const s=e.getAttribute("data-subject");let n=t.startsWith("mailto:")?t:"mailto:"+t;s&&(n+=(n.includes("?")?"&":"?")+"subject="+encodeURIComponent(s)),e.href=n})}()
@@ -0,0 +1 @@
function scrollToTop(){const e=document.getElementById("scroll-to-top");window.scrollY>window.innerHeight*.5?(e.classList.remove("translate-y-4","opacity-0"),e.classList.add("translate-y-0","opacity-100")):(e.classList.remove("translate-y-0","opacity-100"),e.classList.add("translate-y-4","opacity-0"))}window.addEventListener("scroll",scrollToTop),window.addEventListener("load",scrollToTop),document.getElementById("katex-render")&&document.getElementById("katex-render").addEventListener("load",()=>{renderMathInElement(document.body)}),function(){"use strict";function e(e){var t=e.checked?"true":"false";document.querySelectorAll('label[role="button"][for="'+e.id+'"]').forEach(function(e){e.setAttribute("aria-expanded",t)})}function n(){var t={};document.querySelectorAll('label[role="button"][for]').forEach(function(n){var s=document.getElementById(n.getAttribute("for"));if(!s||s.type!=="checkbox")return;n.addEventListener("keydown",function(e){(e.key==="Enter"||e.key===" "||e.key==="Spacebar")&&(e.preventDefault(),n.click())}),t[s.id]||(t[s.id]=!0,s.addEventListener("change",function(){e(s)}),e(s))})}function s(){var t=document.getElementById("mobile-menu-toggle");if(!t)return;document.addEventListener("keydown",function(n){if(n.key==="Escape"&&t.checked){t.checked=!1,e(t);var s=document.querySelector('label[role="button"][for="mobile-menu-toggle"]');s&&s.focus()}})}function o(){var t=document.getElementById("mobile-menu-toggle"),n=document.getElementById("mobile-menu-dialog");if(!t||!n)return;document.addEventListener("click",function(s){if(!t.checked||s.target===t)return;if(n.contains(s.target))return;if(s.target.closest('label[for="mobile-menu-toggle"]'))return;t.checked=!1,e(t)})}function i(){document.querySelectorAll(".nested-menu").forEach(function(e){var t,n=e.querySelector("[aria-haspopup]");if(!n)return;t=function(e){n.setAttribute("aria-expanded",e?"true":"false")},e.addEventListener("mouseenter",function(){t(!0)}),e.addEventListener("mouseleave",function(){t(!1)}),e.addEventListener("focusin",function(){t(!0)}),e.addEventListener("focusout",function(n){e.contains(n.relatedTarget)||t(!1)}),e.addEventListener("keydown",function(n){n.key==="Escape"&&(document.activeElement&&e.contains(document.activeElement)&&document.activeElement.blur(),t(!1))})})}function t(){n(),s(),o(),i()}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t):t()}(),function(){"use strict";var e=[];window.addEventListener("beforeprint",function(){for(var n=document.querySelectorAll("details:not([open])"),t=0;t<n.length;t++)n[t].open=!0,e.push(n[t])}),window.addEventListener("afterprint",function(){for(var t=0;t<e.length;t++)e[t].open=!1;e=[]})}(),function(){const e=document.querySelectorAll(".email-link");e.forEach(e=>{let t=atob(e.getAttribute("data-email"));const s=e.getAttribute("data-subject");let n=t.startsWith("mailto:")?t:"mailto:"+t;s&&(n+=(n.includes("?")?"&":"?")+"subject="+encodeURIComponent(s)),e.href=n})}()
@@ -0,0 +1,5 @@
mediumZoom(document.querySelectorAll("img:not(.nozoom)"), {
margin: 24,
background: "rgba(0,0,0,0.5)",
scrollOffset: 0,
});