agahi
Version:
Client-side engine that renders Markdown files as a docs site in the browser—no build step.
2 lines (1 loc) • 2.38 kB
JavaScript
!function(){"use strict";const n={name:"Agahi.js",repo:"teneplaysofficial/agahi",el:"app",edit:!0,editPath:"https://github.com/teneplaysofficial/agahi/edit/main/docs",editLabel:"Edit this page",showFooter:!0,showSearch:!0,searchPlaceholder:"Search...",defaultRoute:"",tocHeadings:["h2","h3"],tocLabel:"Table of Contents",scrollThreshold:300,..."undefined"!=typeof window&&window.$agahi||{}};!function(n,e){void 0===e&&(e={});var t=e.insertAt;if("undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===t&&o.firstChild?o.insertBefore(r,o.firstChild):o.appendChild(r),r.styleSheet?r.styleSheet.cssText=n:r.appendChild(document.createTextNode(n))}}("#back-to-top {\n position: fixed;\n bottom: 2%;\n right: 1%;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: 0.6rem 1rem;\n background-color: var(--background);\n color: var(--text-color);\n border: 2px solid var(--border-color);\n border-radius: 15px;\n cursor: pointer;\n z-index: 1000;\n opacity: 0;\n visibility: hidden;\n transform: translateY(100px);\n transition: all 0.2s ease;\n}\n\n#back-to-top:hover {\n background-color: var(--background-hover);\n color: var(--text-strong);\n border-color: var(--border-color-strong);\n}\n\n#back-to-top.show {\n opacity: 1;\n visibility: visible;\n transform: translateY(0);\n}\n\n@media (max-width: 740px) {\n #back-to-top {\n bottom: 4%;\n right: 4%;\n padding: 0.75rem 0.9rem;\n font-size: 1rem;\n border-radius: 12px;\n }\n}\n");const e=document.createElement("div");e.innerHTML='<button id="back-to-top" title="Back to top" aria-label="Back to top">\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n fill="none"\n stroke="currentColor"\n stroke-width="2"\n stroke-linecap="round"\n stroke-linejoin="round"\n class="lucide lucide-arrow-up-icon lucide-arrow-up"\n >\n <path d="m5 12 7-7 7 7" />\n <path d="M12 19V5" />\n </svg>\n</button>\n',document.body.appendChild(e.firstElementChild);const t=document.getElementById("back-to-top"),o=n.scrollThreshold;window.addEventListener("scroll",(()=>{window.scrollY>o?t.classList.add("show"):t.classList.remove("show")})),t.onclick=()=>{window.scrollTo({top:0,behavior:"smooth"})}}();