1/* Kodachi page share bar, self-contained. 2 Renders into any <div class="kodachi-share"></div> placeholder. 3 Shares the page's own URL + title. Injects its own CSS once. 4 Optional overrides: data-url, data-title on the placeholder. */ 5(function () { 6 'use strict'; 7 8 var SVG = { 9 x: '<svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231 5.45-6.231Zm-1.161 17.52h1.833L7.084 4.126H5.117L17.083 19.77Z"/></svg>', 10 linkedin: '<svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.062 2.062 0 0 1-2.063-2.065 2.064 2.064 0 1 1 2.063 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.225 0z"/></svg>', 11 facebook: '<svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"/></svg>', 12 reddit: '<svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M24 11.779c0-1.459-1.192-2.645-2.657-2.645-.715 0-1.363.286-1.84.746-1.81-1.191-4.259-1.949-6.971-2.046l1.483-4.669 4.061.951-.005.052c0 1.028.838 1.862 1.868 1.862 1.031 0 1.869-.834 1.869-1.862s-.838-1.863-1.869-1.863c-.736 0-1.375.426-1.68 1.044l-4.528-1.061a.563.563 0 0 0-.668.387l-1.654 5.215c-2.752.085-5.243.842-7.073 2.043-.477-.46-1.125-.746-1.84-.746C1.192 9.134 0 10.32 0 11.779c0 1.073.645 1.994 1.567 2.41-.04.267-.061.539-.061.815 0 4.13 4.81 7.49 10.724 7.49s10.724-3.36 10.724-7.49c0-.275-.021-.547-.061-.814.922-.416 1.567-1.337 1.567-2.41zM6.467 13.7c0-1.03.84-1.868 1.869-1.868 1.03 0 1.868.838 1.868 1.868s-.838 1.869-1.868 1.869c-1.029 0-1.869-.839-1.869-1.869zm9.901 4.589c-.972.972-2.836 1.047-3.383 1.047s-2.41-.075-3.383-1.047a.37.37 0 0 1 0-.523.37.37 0 0 1 .523 0c.613.612 1.92.829 2.86.829.94 0 2.248-.217 2.86-.829a.37.37 0 0 1 .523 0 .37.37 0 0 1 0 .523zm-.529-2.72c-1.03 0-1.869-.839-1.869-1.869s.839-1.868 1.869-1.868c1.029 0 1.868.838 1.868 1.868s-.839 1.869-1.868 1.869z"/></svg>', 13 whatsapp: '<svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 0 1-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 0 1-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 0 1 2.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0 0 12.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 0 0 5.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 0 0-3.48-8.413z"/></svg>', 14 telegram: '<svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82
141.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"/></svg>', 15 email: '<svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M1.5 8.67v8.58a3 3 0 0 0 3 3h15a3 3 0 0 0 3-3V8.67l-8.928 5.493a3 3 0 0 1-3.144 0L1.5 8.67Z"/><path d="M22.5 6.908V6.75a3 3 0 0 0-3-3h-15a3 3 0 0 0-3 3v.158l9.714 5.978a1.5 1.5 0 0 0 1.572 0L22.5 6.908Z"/></svg>', 16 instagram: '<svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zM12 0C8.741 0 8.333.014 7.053.072 2.695.272.273 2.69.073 7.052.014 8.333 0 8.741 0 12c0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98C8.333 23.986 8.741 24 12 24c3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98C15.668.014 15.259 0 12 0zm0 5.838a6.162 6.162 0 1 0 0 12.324 6.162 6.162 0 0 0 0-12.324zM12 16a4 4 0 1 1 0-8 4 4 0 0 1 0 8zm6.406-11.845a1.44 1.44 0 1 0 0 2.881 1.44 1.44 0 0 0 0-2.881z"/></svg>', 17 native: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="18" cy="5" r="3"/><circle cx="6" cy="12" r="3"/><circle cx="18" cy="19" r="3"/><line x1="8.59" y1="13.51" x2="15.42" y2="17.49"/><line x1="15.41" y1="6.51" x2="8.59" y2="10.49"/></svg>', 18 copy: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg>' 19 }; 20 21 /* Layout-critical props use !important so host page themes (which can target 22 `.container a`, `button svg`, etc. with higher specificity) cannot break the 23 bar's shape or hide the icons. */ 24 var CSS = '' + 25 '.kodachi-share{display:flex!important;align-items:center;justify-content:center;flex-wrap:wrap;gap:9px;margin:34px auto;padding:16px 18px;max-width:760px;box-sizing:border-box;border:1px solid var(--md-default-fg-color--lightest,rgba(159,239,0,.18));border-radius:14px;background:linear-gradient(135deg,rgba(159,239,0,.05),rgba(159,239,0,.01))}' + 26 '.kodachi-share__label{font-family:"JetBrains Mono",ui-monospace,monospace;font-size:10.5px;letter-spacing:.6px;text-transform:uppercase;color:var(--md-default-fg-color--light,#9a9a9a);margin-right:4px}' + 27 '.kodachi-share .kodachi-share__btn{width:36px!important;height:36px!important;min-width:36px!important;box-sizing:border-box!important;display:inline-flex!important;align-items:center;justify-content:center;border-radius:50%!important;border:1px solid var(--md-default-fg-color--lighter,rgba(159,239,0,.3));background:rgba(0,0,0,.35);color:var(--md-default-fg-color--light,#cfcfcf);cursor:pointer;padding:0!important;text-decoration:none!important;box-shadow:none!important;transition:color .15s,background .15s,border-color .15s,transform .15s}' + 28 '.kodachi-share .kodachi-share__btn svg{width:17px!important;height:17px!important;min-width:17px!important;display:block!important}' + 29 '.kodachi-share .kodachi-share__btn:hover,.kodachi-share .kodachi-share__btn:focus{color:#9FEF00;border-color:#9FEF00;background:rgba(159,239,0,.1);transform:translateY(-2px);text-decoration:none!important}' + 30 '.kodachi-share .kodachi-share__btn.copied{color:#9FEF00;border-color:#9FEF00}'; 31 32 function injectCss() { 33 if (document.getElementById('kodachi-share-css')) return; 34 var st = document.createElement('style');
35 st.id = 'kodachi-share-css'; 36 st.textContent = CSS; 37 document.head.appendChild(st); 38 } 39 40 function copyLink(url, btn) { 41 function done() { 42 btn.classList.add('copied'); 43 setTimeout(function () { btn.classList.remove('copied'); }, 1400); 44 } 45 if (navigator.clipboard && navigator.clipboard.writeText) { 46 navigator.clipboard.writeText(url).then(done, done); 47 } else { 48 var ta = document.createElement('textarea'); 49 ta.value = url; ta.style.cssText = 'position:fixed;top:-9999px;opacity:0'; 50 document.body.appendChild(ta); ta.select(); 51 try { document.execCommand('copy'); } catch (e) {} 52 document.body.removeChild(ta); done(); 53 } 54 } 55 56 function build(el) { 57 var url = el.getAttribute('data-url') || (location.origin + location.pathname); 58 var title = el.getAttribute('data-title') || document.title || 'Kodachi OS'; 59 var e = encodeURIComponent, u = e(url), t = e(title); 60 var links = [ 61 ['x', 'X', 'https://twitter.com/intent/tweet?text=' + t + '&url=' + u], 62 ['linkedin', 'LinkedIn', 'https://www.linkedin.com/sharing/share-offsite/?url=' + u], 63 ['facebook', 'Facebook', 'https://www.facebook.com/sharer/sharer.php?u=' + u], 64 ['reddit', 'Reddit', 'https://www.reddit.com/submit?url=' + u + '&title=' + t], 65 ['whatsapp', 'WhatsApp', 'https://wa.me/?text=' + e(title + ' ' + url)], 66 ['telegram', 'Telegram', 'https://t.me/share/url?url=' + u + '&text=' + t], 67 ['email', 'Email', 'mailto:?subject=' + t + '&body=' + e(title + '\n\n' + url)] 68 ]; 69 var html = '<span class="kodachi-share__label">Share</span>'; 70 if (navigator.share) { 71 html += '<button type="button" class="kodachi-share__btn" data-act="native" title="Share" aria-label="Share">' + SVG.native + '</button>'; 72 } 73 links.forEach(function (n) { 74 html += '<a class="kodachi-share__btn" href="' + n[2] + '" target="_blank" rel="noopener" title="Share on ' + n[1] + '" aria-label="Share on ' + n[1] + '">' + SVG[n[0]] + '</a>'; 75 }); 76 html += '<button type="button" class="kodachi-share__btn" data-act="instagram" title="Instagram has no web share, copies the link" aria-label="Copy link for Instagram">' + SVG.instagram + '</button>'; 77 html += '<button type="button" class="kodachi-share__btn" data-act="copy" title="Copy link" aria-label="Copy link">' + SVG.copy + '</button>'; 78 el.innerHTML = html; 79 80 var nativeBtn = el.querySelector('[data-act="native"]'); 81 if (nativeBtn) nativeBtn.addEventListener('click', function () { 82 navigator.share({ title: title, text: title, url: url }).catch(function () {}); 83 }); 84 el.querySelector('[data-act="instagram"]').addEventListener('click', function () { copyLink(url, this); }); 85 el.querySelector('[data-act="copy"]').addEventListener('click', function () { copyLink(url, this); }); 86 } 87 88 /* When the <body> is a flex/grid centering context (common on the standalone 89 tool pages), a placeholder injected at body level becomes a squished 90 sibling. Move its top-level wrapper into the main content container so it 91 spans the full width. No-op when the body is a normal block (e.g. the wiki). */ 92 function relocate(el) { 93 try { 94 var disp = getComputedStyle(document.body).display; 95 if (disp !== 'flex' && disp !== 'grid') return; 96 var host = document.querySelector('.container, main, .content, .page-wrap'); 97 if (!host || host.contains(el)) return; 98 var node = el; 99 while (node.parentElement && node.parentElement !== document.body) node = node.parentElement; 100 if (node.parentElement !== document.body) return; 101 var footer = host.querySelector('.footer'); 102 if (footer && footer.parentElement === host) host.insertBefore(node, footer); 103 else host.appendChild(node); 104 } catch (e) {} 105 } 106 107 function init() { 108 var nodes = document.querySelectorAll('.kodachi-share:not([data-ready])'); 109 if (!nodes.length) return; 110 injectCss(); 111 Array.prototype.forEach.call(nodes, function (el) { 112 el.setAttribute('data-ready', '1'); 113 relocate(el); 114 build(el); 115 }); 116 } 117 118 if (document.readyState !== 'loading') init(); 119 else document.addEventListener('DOMContentLoaded', init); 120 /* MkDocs Material uses instant navigation; re-init on document$ if present */ 121 if (window.document$ && typeof window.document$.subscribe === 'function') { 122 window.document$.subscribe(function () { setTimeout(init, 0); }); 123 } 124})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.