From cb1f51c29f8565b76ec067a3f21db3b696362ca1 Mon Sep 17 00:00:00 2001 From: "adamlui@protonmail.com" Date: Sat, 21 Dec 2024 02:10:48 -0800 Subject: [PATCH] Stripped unneeded quotes from CSS selectors --- chatgpt.js | 34 +++++++++++----------- docs/assets/js/min/copy-code-button.min.js | 2 +- docs/assets/js/min/onload-hacks.min.js | 4 +-- docs/assets/js/src/copy-code-button.js | 2 +- docs/assets/js/src/onload-hacks.js | 10 +++---- 5 files changed, 26 insertions(+), 26 deletions(-) diff --git a/chatgpt.js b/chatgpt.js index 845e8c770..72c9e5d86 100644 --- a/chatgpt.js +++ b/chatgpt.js @@ -193,12 +193,12 @@ const chatgpt = { + '.chatgpt-modal .checkbox-group label {' + 'font-size: .7rem ; margin: -.04rem 0 0px .3rem ;' + `color: ${ scheme == 'dark' ? '#e1e1e1' : '#1e1e1e' }}` - + '.chatgpt-modal input[type="checkbox"] { transform: scale(0.7) ;' + + '.chatgpt-modal input[type=checkbox] { transform: scale(0.7) ;' + `border: 1px solid ${ scheme == 'dark' ? 'white' : 'black' }}` - + '.chatgpt-modal input[type="checkbox"]:checked {' + + '.chatgpt-modal input[type=checkbox]:checked {' + `border: 1px solid ${ scheme == 'dark' ? 'white' : 'black' } ;` + 'background-color: black ; position: inherit }' - + '.chatgpt-modal input[type="checkbox"]:focus { outline: none ; box-shadow: none }' + + '.chatgpt-modal input[type=checkbox]:focus { outline: none ; box-shadow: none }' ); } @@ -455,7 +455,7 @@ const chatgpt = { async isIdle(timeout = null) { const obsConfig = { childList: true, subtree: true }, selectors = { msgDiv: 'div[data-message-author-role]', - replyDiv: 'div[data-message-author-role="assistant"]' }; + replyDiv: 'div[data-message-author-role=assistant]' }; // Create promises const timeoutPromise = timeout ? new Promise(resolve => setTimeout(() => resolve(false), timeout)) : null; @@ -620,7 +620,7 @@ const chatgpt = { filename = `${ parsedHtml.querySelector('title').textContent || 'ChatGPT conversation' }.html`; // Convert relative CSS paths to absolute ones - const cssLinks = parsedHtml.querySelectorAll('link[rel="stylesheet"]'); + const cssLinks = parsedHtml.querySelectorAll('link[rel=stylesheet]'); cssLinks.forEach(link => { const href = link.getAttribute('href'); if (href?.startsWith('/')) link.setAttribute('href', 'https://chat.openai.com' + href); @@ -932,7 +932,7 @@ const chatgpt = { getLastResponse() { return chatgpt.getChatData('active', 'msg', 'chatgpt', 'latest'); }, getNewChatButton() { - return document.querySelector('button[data-testid*="new-chat-button"], button:has([d^="M15.6729"])'); }, + return document.querySelector('button[data-testid*=new-chat-button], button:has([d^="M15.6729"])'); }, getNewChatLink() { return document.querySelector('nav a[href="/"]'); }, getRegenerateButton() { return document.querySelector('button:has([d^="M3.06957"])'); }, @@ -949,8 +949,8 @@ const chatgpt = { getResponseFromAPI(chatToGet, responseToGet) { return chatgpt.response.getFromAPI(chatToGet, responseToGet); }, getResponseFromDOM(pos) { return chatgpt.response.getFromDOM(pos); }, getScrollToBottomButton() { return document.querySelector('button:has([d^="M12 21C11.7348"])'); }, - getSendButton() { return document.querySelector('[data-testid="send-button"]'); }, - getStopButton() { return document.querySelector('button[data-testid="stop-button"]'); }, + getSendButton() { return document.querySelector('[data-testid=send-button]'); }, + getStopButton() { return document.querySelector('button[data-testid=stop-button]'); }, getUserLanguage() { return navigator.languages[0] || navigator.language || navigator.browserLanguage || @@ -1211,7 +1211,7 @@ const chatgpt = { } const addElementsToMenu = () => { - const optionButtons = document.querySelectorAll('a[role="menuitem"]'); + const optionButtons = document.querySelectorAll('a[role=menuitem]'); let cssClasses; for (const navLink of optionButtons) @@ -1230,7 +1230,7 @@ const chatgpt = { }; this.elements.push(newElement); - const menuBtn = document.querySelector('nav button[id*="headless"]'); + const menuBtn = document.querySelector('nav button[id*=headless]'); if (!this.addedEvent) { // to prevent adding more than one event menuBtn?.addEventListener('click', () => { setTimeout(addElementsToMenu, 25); }); this.addedEvent = true; } @@ -1239,12 +1239,12 @@ const chatgpt = { }, close() { - try { document.querySelector('nav [id*="menu-button"][aria-expanded="true"]').click(); } + try { document.querySelector('nav [id*=menu-button][aria-expanded=true]').click(); } catch (err) { console.error(err.message); } }, open() { - try { document.querySelector('nav [id*="menu-button"][aria-expanded="false"]').click(); } + try { document.querySelector('nav [id*=menu-button][aria-expanded=false]').click(); } catch (err) { console.error(err.message); } } }, @@ -1518,7 +1518,7 @@ const chatgpt = { }, getFromDOM(pos) { - const responseDivs = document.querySelectorAll('div[data-message-author-role="assistant"]'), + const responseDivs = document.querySelectorAll('div[data-message-author-role=assistant]'), strPos = pos.toString().toLowerCase(); let response = ''; if (!responseDivs.length) return console.error('No conversation found!'); @@ -1825,7 +1825,7 @@ const chatgpt = { isOff() { return !this.isOn(); }, isOn() { const sidebar = (() => { - return chatgpt.sidebar.exists() ? document.querySelector('[class*="sidebar"]') : null; })(); + return chatgpt.sidebar.exists() ? document.querySelector('[class*=sidebar]') : null; })(); if (!sidebar) { console.error('Sidebar element not found!'); return false; } else return chatgpt.browser.isMobile() ? document.documentElement.style.overflow == 'hidden' @@ -1833,7 +1833,7 @@ const chatgpt = { }, toggle() { - const sidebarToggle = document.querySelector('button[data-testid*="sidebar-button"]'); + const sidebarToggle = document.querySelector('button[data-testid*=sidebar-button]'); if (!sidebarToggle) console.error('Sidebar toggle not found!'); sidebarToggle.click(); }, @@ -1943,8 +1943,8 @@ const cjsBtnActions = ['click', 'get'], cjsTargetTypes = [ 'button', 'link', 'di for (const btnAction of cjsBtnActions) { chatgpt[btnAction + 'Button'] = function handleButton(buttonIdentifier) { const button = /^[.#]/.test(buttonIdentifier) ? document.querySelector(buttonIdentifier) - : /send/i.test(buttonIdentifier) ? document.querySelector('form button[class*="bottom"]') - : /scroll/i.test(buttonIdentifier) ? document.querySelector('button[class*="cursor"]') + : /send/i.test(buttonIdentifier) ? document.querySelector('form button[class*=bottom]') + : /scroll/i.test(buttonIdentifier) ? document.querySelector('button[class*=cursor]') : (function() { // get via text content for (const button of document.querySelectorAll('button')) { // try buttons if (button.textContent.toLowerCase().includes(buttonIdentifier.toLowerCase())) { diff --git a/docs/assets/js/min/copy-code-button.min.js b/docs/assets/js/min/copy-code-button.min.js index 1bd1e3110..0ac82a8e5 100644 --- a/docs/assets/js/min/copy-code-button.min.js +++ b/docs/assets/js/min/copy-code-button.min.js @@ -1 +1 @@ -(()=>{function s(o){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o})(o)}var o,e,n,c;o=".docsify-copy-code-button,.docsify-copy-code-button span{cursor:pointer}.docsify-copy-code-button{position:absolute;z-index:1;top:0;right:0;overflow:visible;padding:.65em .8em;border:0;border-radius:0;outline:0;font-size:1em;background:grey;background:var(--theme-color,grey);color:#fff;opacity:1}.docsify-copy-code-button span{border-radius:3px;background:inherit;pointer-events:none}.docsify-copy-code-button .error,.docsify-copy-code-button .success{position:absolute;z-index:1000;top:24px;left:12px;padding:.5em .65em;font-size:.825em;opacity:0;transform:translateX(-88%)translateY(-50%)}.docsify-copy-code-button.error .error,.docsify-copy-code-button.success .success{left:12px;top:24px;opacity:1;,pre:hover .docsify-copy-code-button{opacity:1}",e=(e=void 0===e?{}:e).insertAt,"undefined"!=typeof document&&(n=document.head||document.getElementsByTagName("head")[0],(c=document.createElement("style")).type="text/css","top"===e&&n.firstChild?n.insertBefore(c,n.firstChild):n.append(c),c.styleSheet?c.styleSheet.cssText=o:c.append(document.createTextNode(o))),document.querySelector('link[href*="docsify-copy-code"]')&&console.warn("[Deprecation] Link to external docsify-copy-code stylesheet is no longer necessary."),window.DocsifyCopyCodePlugin={init:function(){return function(o,e){o.ready(function(){console.warn("[Deprecation] Manually initializing docsify-copy-code using window.DocsifyCopyCodePlugin.init() is no longer necessary.")})}}},window.$docsify=window.$docsify||{},window.$docsify.plugins=[function(o,r){o.doneEach(function(){var o=Array.apply(null,document.querySelectorAll("pre[data-lang]")),c={buttonText:"<> Copy code",errorText:"Error",successText:"Code copied!"},e=(r.config.copyCode&&Object.keys(c).forEach(function(t){var n=r.config.copyCode[t];"string"==typeof n?c[t]=n:"object"===s(n)&&Object.keys(n).some(function(o){var e=-1',''.concat(c.buttonText,""),''.concat(c.errorText,""),''.concat(c.successText,""),""].join(""));o.forEach(function(o){o.insertAdjacentHTML("beforeend",e)})}),o.mounted(function(){document.querySelector(".content").addEventListener("click",function(o){if(o.target.classList.contains("docsify-copy-code-button")){var e="BUTTON"===o.target.tagName?o.target:o.target.parentNode,t=document.createRange(),n=e.parentNode.querySelector("code"),c=window.getSelection();t.selectNode(n),c.removeAllRanges(),c.addRange(t);try{document.execCommand("copy")&&(e.classList.add("success"),e.querySelector(".label").style.display="none",setTimeout(function(){e.classList.remove("success"),e.querySelector(".label").style.display="inline"},2e3))}catch(o){console.error("docsify-copy-code: ".concat(o)),e.classList.add("error"),setTimeout(function(){e.classList.remove("error")},2e3)}"function"==typeof(c=window.getSelection()).removeRange?c.removeRange(t):"function"==typeof c.removeAllRanges&&c.removeAllRanges()}})})}].concat(window.$docsify.plugins||[])})(); \ No newline at end of file +(()=>{function s(o){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o})(o)}var o,e,n,c;o=".docsify-copy-code-button,.docsify-copy-code-button span{cursor:pointer}.docsify-copy-code-button{position:absolute;z-index:1;top:0;right:0;overflow:visible;padding:.65em .8em;border:0;border-radius:0;outline:0;font-size:1em;background:grey;background:var(--theme-color,grey);color:#fff;opacity:1}.docsify-copy-code-button span{border-radius:3px;background:inherit;pointer-events:none}.docsify-copy-code-button .error,.docsify-copy-code-button .success{position:absolute;z-index:1000;top:24px;left:12px;padding:.5em .65em;font-size:.825em;opacity:0;transform:translateX(-88%)translateY(-50%)}.docsify-copy-code-button.error .error,.docsify-copy-code-button.success .success{left:12px;top:24px;opacity:1;,pre:hover .docsify-copy-code-button{opacity:1}",e=(e=void 0===e?{}:e).insertAt,"undefined"!=typeof document&&(n=document.head||document.getElementsByTagName("head")[0],(c=document.createElement("style")).type="text/css","top"===e&&n.firstChild?n.insertBefore(c,n.firstChild):n.append(c),c.styleSheet?c.styleSheet.cssText=o:c.append(document.createTextNode(o))),document.querySelector("link[href*=docsify-copy-code]")&&console.warn("[Deprecation] Link to external docsify-copy-code stylesheet is no longer necessary."),window.DocsifyCopyCodePlugin={init:function(){return function(o,e){o.ready(function(){console.warn("[Deprecation] Manually initializing docsify-copy-code using window.DocsifyCopyCodePlugin.init() is no longer necessary.")})}}},window.$docsify=window.$docsify||{},window.$docsify.plugins=[function(o,r){o.doneEach(function(){var o=Array.apply(null,document.querySelectorAll("pre[data-lang]")),c={buttonText:"<> Copy code",errorText:"Error",successText:"Code copied!"},e=(r.config.copyCode&&Object.keys(c).forEach(function(t){var n=r.config.copyCode[t];"string"==typeof n?c[t]=n:"object"===s(n)&&Object.keys(n).some(function(o){var e=-1',''.concat(c.buttonText,""),''.concat(c.errorText,""),''.concat(c.successText,""),""].join(""));o.forEach(function(o){o.insertAdjacentHTML("beforeend",e)})}),o.mounted(function(){document.querySelector(".content").addEventListener("click",function(o){if(o.target.classList.contains("docsify-copy-code-button")){var e="BUTTON"===o.target.tagName?o.target:o.target.parentNode,t=document.createRange(),n=e.parentNode.querySelector("code"),c=window.getSelection();t.selectNode(n),c.removeAllRanges(),c.addRange(t);try{document.execCommand("copy")&&(e.classList.add("success"),e.querySelector(".label").style.display="none",setTimeout(function(){e.classList.remove("success"),e.querySelector(".label").style.display="inline"},2e3))}catch(o){console.error("docsify-copy-code: ".concat(o)),e.classList.add("error"),setTimeout(function(){e.classList.remove("error")},2e3)}"function"==typeof(c=window.getSelection()).removeRange?c.removeRange(t):"function"==typeof c.removeAllRanges&&c.removeAllRanges()}})})}].concat(window.$docsify.plugins||[])})(); \ No newline at end of file diff --git a/docs/assets/js/min/onload-hacks.min.js b/docs/assets/js/min/onload-hacks.min.js index ce5c697a7..2f1cdf12c 100644 --- a/docs/assets/js/min/onload-hacks.min.js +++ b/docs/assets/js/min/onload-hacks.min.js @@ -1,3 +1,3 @@ -let taglineWords=[],features=[">> Feature-rich",">> Object-oriented",">> Easy-to-use",">> Lightweight (yet optimally performant)"],visibilityMap=[],sectionColors=["#64ffff","#f9ee16","lime","orange","#b981f9","#f581f9","#81f9c3"],iniStarZvelocity=window.starVelocity.z,warpDuration=1600,hiWarpDuration=1400,starResetDelay=15,mdLoaded=new Promise(resolve=>{new MutationObserver((mutationsList,observer)=>{document.querySelector("#shields")&&(observer.disconnect(),resolve())}).observe(document.body,{childList:!0,subtree:!0})}),iObserver=new IntersectionObserver(entries=>entries.forEach(entry=>{var key=entry.target.id||entry.target.className;if(visibilityMap[key]=entry.isIntersecting,"cover-main"===entry.target.className)if(entry.isIntersecting){document.querySelector("#kudoai a").style.color="white",window.starColor="white",(document.querySelector("#scrollbar-style")||{}).innerText=":root { scrollbar-color: rgb(210,210,210) #1a1a1a }body::-webkit-scrollbar-thumb { background-color: white }";let kudo=document.querySelector(".kudo");kudo.classList.add("hover"),setTimeout(()=>{kudo.classList.remove("hover")},955),Array.from(document.querySelectorAll('span[id^="tagline"]')).forEach(span=>{span.textContent=""}),scrambleText([taglineWords[0]],document.querySelector("#tagline-pre-adj")),scrambleText(taglineWords[1],document.querySelector("#tagline-adj"),750),scrambleText([taglineWords[2]],document.querySelector("#tagline-post-adj")),randomizeCase(document.querySelector("#tagline-pre-adj")),randomizeCase(document.querySelector("#tagline-post-adj")),window.starVelocity.z<=iniStarZvelocity&&(window.starVelocity.z+=.024,setTimeout(()=>{window.starVelocity.z-=.02},1155),setTimeout(()=>{window.starVelocity.z=iniStarZvelocity},1355))}else clearTimeout(scrambleText.timeoutID);else"feature-list"===entry.target.id&&(entry.isIntersecting?typeText(features,entry.target,20):(entry.target.innerHTML="",clearTimeout(typeText.timeoutID)))})),onLoadObserver=new MutationObserver(()=>{if(document.querySelector(".cover-main blockquote p")){if(smoothScroll(document,155,9),/#\/(?:\w{2}(?:-\w{2})?\/)?$/.test(location.hash)){isMobileDevice()||(document.body.className="ready close");var taglineSpans=Array.from(document.querySelectorAll('span[id^="tagline"]'));taglineSpans.map(span=>taglineWords.push(/pre|post/.exec(span.id)?span.textContent:span.textContent.split("|"))),taglineSpans.forEach(span=>span.textContent=""),iObserver.observe(document.querySelector(".cover-main"));let cover=document.querySelector(".cover"),topGradient=document.createElement("div");function updateTGvisibility(){topGradient.style.display=window.scrollY>.85*cover.offsetHeight?"":"none"}topGradient.classList.add("top-gradient"),document.body.append(topGradient),updateTGvisibility(),mdLoaded.then(()=>{navigator.userAgent.includes("Chrome")&&window.scrollBy(0,200),setTimeout(()=>window.scrollBy(0,-200),600),document.querySelector(".search").style.display="none",document.querySelector(".sidebar-nav").style.paddingTop="102px";var featureListDiv=document.querySelector("#feature-list")||document.createElement("div"),introDiv=(featureListDiv.parentElement||(featureListDiv.setAttribute("id","feature-list"),(introDiv=document.querySelector("#intro")).parentElement.insertBefore(featureListDiv,introDiv.nextElementSibling.nextElementSibling)),iObserver.observe(featureListDiv),document.querySelector("article")),featureListDiv=document.createElement("div"),introDiv=(featureListDiv.id="copyright-footer",featureListDiv.innerHTML='Copyright © 2023–'+(new Date).getFullYear()+' KudoAI.
Designed by Adam Lui / Powered by Docsify / Hosted by GitHub',introDiv.append(featureListDiv),document.querySelector('a[href*="/assets/10906554/f53c740f-d5e0-49b6-ae02-3b3140b0f8a4"]')),featureListDiv=document.createElement("iframe"),introDiv=(featureListDiv.setAttribute("width","855"),featureListDiv.setAttribute("height","455"),featureListDiv.setAttribute("src","https://www.youtube.com/embed/yG8DtsEo0PM?rel=0"),featureListDiv.allow="web-share;"+(navigator.userAgent.includes("Firefox")?"":"autoplay; clipboard-write; encrypted-media; picture-in-picture; web-share"),featureListDiv.setAttribute("allowfullscreen",""),featureListDiv.style.minWidth="fit-content",featureListDiv.style.width="855px",featureListDiv.style.marginBottom="30px",introDiv.parentNode.replaceChild(featureListDiv,introDiv),featureListDiv.parentNode.style.textAlign="center",document.querySelectorAll("blockquote").forEach(blockquote=>{var parent=blockquote.parentNode,content=blockquote.innerHTML;parent.replaceChild(document.createRange().createContextualFragment(content),blockquote)}),document.querySelectorAll("img[src], source[srcset]").forEach(elem=>{var srcAttrType=elem.hasAttribute("src")?"src":"srcset",srcAttrVal=elem[srcAttrType];srcAttrVal.includes("weserv.nl")&&(elem[srcAttrType]=/[^=]+\?url=([^&?]+)[&?][^&?]+/.exec(srcAttrVal)?.[1]||srcAttrVal)}),[]),featureListDiv=[],fadeLeftElements=[],introDiv=(introDiv.push(...document.querySelectorAll(".cover-main img, .cover-main a,h2, h3, p, pre, main li,#copyright-footer")),introDiv.forEach(elem=>elem.classList.add("content-fadeup")),introDiv.push(document.querySelector("#language-menu")),introDiv[introDiv.length-1].classList.add("menu-fadeup"),featureListDiv.push(...document.querySelectorAll(`#showcase ~ h3:nth-of-type(odd):not(#contributors ~ *), +let taglineWords=[],features=[">> Feature-rich",">> Object-oriented",">> Easy-to-use",">> Lightweight (yet optimally performant)"],visibilityMap=[],sectionColors=["#64ffff","#f9ee16","lime","orange","#b981f9","#f581f9","#81f9c3"],iniStarZvelocity=window.starVelocity.z,warpDuration=1600,hiWarpDuration=1400,starResetDelay=15,mdLoaded=new Promise(resolve=>{new MutationObserver((mutationsList,observer)=>{document.querySelector("#shields")&&(observer.disconnect(),resolve())}).observe(document.body,{childList:!0,subtree:!0})}),iObserver=new IntersectionObserver(entries=>entries.forEach(entry=>{var key=entry.target.id||entry.target.className;if(visibilityMap[key]=entry.isIntersecting,"cover-main"===entry.target.className)if(entry.isIntersecting){document.querySelector("#kudoai a").style.color="white",window.starColor="white",(document.querySelector("#scrollbar-style")||{}).innerText=":root { scrollbar-color: rgb(210,210,210) #1a1a1a }body::-webkit-scrollbar-thumb { background-color: white }";let kudo=document.querySelector(".kudo");kudo.classList.add("hover"),setTimeout(()=>{kudo.classList.remove("hover")},955),Array.from(document.querySelectorAll("span[id^=tagline]")).forEach(span=>{span.textContent=""}),scrambleText([taglineWords[0]],document.querySelector("#tagline-pre-adj")),scrambleText(taglineWords[1],document.querySelector("#tagline-adj"),750),scrambleText([taglineWords[2]],document.querySelector("#tagline-post-adj")),randomizeCase(document.querySelector("#tagline-pre-adj")),randomizeCase(document.querySelector("#tagline-post-adj")),window.starVelocity.z<=iniStarZvelocity&&(window.starVelocity.z+=.024,setTimeout(()=>{window.starVelocity.z-=.02},1155),setTimeout(()=>{window.starVelocity.z=iniStarZvelocity},1355))}else clearTimeout(scrambleText.timeoutID);else"feature-list"===entry.target.id&&(entry.isIntersecting?typeText(features,entry.target,20):(entry.target.innerHTML="",clearTimeout(typeText.timeoutID)))})),onLoadObserver=new MutationObserver(()=>{if(document.querySelector(".cover-main blockquote p")){if(smoothScroll(document,155,9),/#\/(?:\w{2}(?:-\w{2})?\/)?$/.test(location.hash)){isMobileDevice()||(document.body.className="ready close");var taglineSpans=Array.from(document.querySelectorAll("span[id^=tagline]"));taglineSpans.map(span=>taglineWords.push(/pre|post/.exec(span.id)?span.textContent:span.textContent.split("|"))),taglineSpans.forEach(span=>span.textContent=""),iObserver.observe(document.querySelector(".cover-main"));let cover=document.querySelector(".cover"),topGradient=document.createElement("div");function updateTGvisibility(){topGradient.style.display=window.scrollY>.85*cover.offsetHeight?"":"none"}topGradient.classList.add("top-gradient"),document.body.append(topGradient),updateTGvisibility(),mdLoaded.then(()=>{navigator.userAgent.includes("Chrome")&&window.scrollBy(0,200),setTimeout(()=>window.scrollBy(0,-200),600),document.querySelector(".search").style.display="none",document.querySelector(".sidebar-nav").style.paddingTop="102px";var featureListDiv=document.querySelector("#feature-list")||document.createElement("div"),introDiv=(featureListDiv.parentElement||(featureListDiv.setAttribute("id","feature-list"),(introDiv=document.querySelector("#intro")).parentElement.insertBefore(featureListDiv,introDiv.nextElementSibling.nextElementSibling)),iObserver.observe(featureListDiv),document.querySelector("article")),featureListDiv=document.createElement("div"),introDiv=(featureListDiv.id="copyright-footer",featureListDiv.innerHTML='Copyright © 2023–'+(new Date).getFullYear()+' KudoAI.
Designed by Adam Lui / Powered by Docsify / Hosted by GitHub',introDiv.append(featureListDiv),document.querySelector('a[href*="/assets/10906554/f53c740f-d5e0-49b6-ae02-3b3140b0f8a4"]')),featureListDiv=document.createElement("iframe"),introDiv=(featureListDiv.setAttribute("width","855"),featureListDiv.setAttribute("height","455"),featureListDiv.setAttribute("src","https://www.youtube.com/embed/yG8DtsEo0PM?rel=0"),featureListDiv.allow="web-share;"+(navigator.userAgent.includes("Firefox")?"":"autoplay; clipboard-write; encrypted-media; picture-in-picture; web-share"),featureListDiv.setAttribute("allowfullscreen",""),featureListDiv.style.minWidth="fit-content",featureListDiv.style.width="855px",featureListDiv.style.marginBottom="30px",introDiv.parentNode.replaceChild(featureListDiv,introDiv),featureListDiv.parentNode.style.textAlign="center",document.querySelectorAll("blockquote").forEach(blockquote=>{var parent=blockquote.parentNode,content=blockquote.innerHTML;parent.replaceChild(document.createRange().createContextualFragment(content),blockquote)}),document.querySelectorAll("img[src], source[srcset]").forEach(elem=>{var srcAttrType=elem.hasAttribute("src")?"src":"srcset",srcAttrVal=elem[srcAttrType];srcAttrVal.includes("weserv.nl")&&(elem[srcAttrType]=/[^=]+\?url=([^&?]+)[&?][^&?]+/.exec(srcAttrVal)?.[1]||srcAttrVal)}),[]),featureListDiv=[],fadeLeftElements=[],introDiv=(introDiv.push(...document.querySelectorAll(".cover-main img, .cover-main a,h2, h3, p, pre, main li,#copyright-footer")),introDiv.forEach(elem=>elem.classList.add("content-fadeup")),introDiv.push(document.querySelector("#language-menu")),introDiv[introDiv.length-1].classList.add("menu-fadeup"),featureListDiv.push(...document.querySelectorAll(`#showcase ~ h3:nth-of-type(odd):not(#contributors ~ *), #showcase ~ h3 + p:nth-of-type(odd):not(#contributors ~ *`)),featureListDiv.forEach(elem=>elem.classList.add("content-faderight")),fadeLeftElements.push(...document.querySelectorAll(`#showcase ~ h3:nth-of-type(even):not(#contributors ~ *), - #showcase ~ h3 + p:nth-of-type(even):not(#contributors ~ *`)),fadeLeftElements.forEach(elem=>elem.classList.add("content-fadeleft")),[...introDiv,...featureListDiv,...fadeLeftElements]);let sideNavItems=[...document.querySelectorAll(".sidebar-nav li")],fadeObserver=new IntersectionObserver(entries=>entries.forEach(entry=>{var headingText;entry.isIntersecting?(entry.target.classList.add("visible"),entry.target.tagName.startsWith("H")&&(headingText=entry.target.querySelector("a").textContent,headingText=(document.querySelector(`a[title="${headingText}"]`)||{}).parentElement)&&(sideNavItems.forEach(item=>item.classList.remove("nav-active")),headingText.classList.add("nav-active"))):entry.target.classList.remove("visible")}),{root:null,threshold:.02});introDiv.forEach(elem=>fadeObserver.observe(elem));featureListDiv=document.querySelector('a[href$="stargazers"]'),fadeLeftElements=featureListDiv.getAttribute("href");featureListDiv.setAttribute("href",fadeLeftElements.replace("/stargazers",""));let triggerElements=[],triggerPoints=[],emailFooter=(triggerElements.push(...document.querySelectorAll("h2")),triggerElements.push(document.querySelector("h3#-greasemonkey")),triggerElements.push(document.querySelector("h3#-chrome")),triggerElements.push(document.querySelector('img[src*="chatgpt-infinity"]')),triggerElements.forEach(elem=>{var elementPos=elem.getBoundingClientRect().top,elem=elem.id.includes("⚡")?1.5:"IMG"===elem.tagName?.8:8.8;triggerPoints.push(elementPos-window.innerHeight/elem)}),triggerPoints.sort((a,b)=>a-b),window.addEventListener("scroll",()=>{if(!visibilityMap["cover-main"]&&!visibilityMap["feature-list"]){let currentSection=0;for(;window.scrollY>triggerPoints[currentSection]&¤tSection{window.starVelocity.z<=iniStarZvelocity&&(window.starColor="white")},warpDuration+starResetDelay),window.starVelocity.z+=.0045,setTimeout(()=>{window.starVelocity.z=Math.max(iniStarZvelocity,window.starVelocity.z-.0025)},hiWarpDuration),setTimeout(()=>{window.starVelocity.z=Math.max(iniStarZvelocity,window.starVelocity.z-.002)},warpDuration);let kudoAIlogo=document.querySelector("#kudoai a"),kudo=document.querySelector(".kudo"),scrollbarStyle=(kudoAIlogo.style.color=sectionColor,kudo.classList.add("hover"),setTimeout(()=>{window.starVelocity.z<=iniStarZvelocity&&(kudoAIlogo.style.color="white",kudo.classList.remove("hover"))},warpDuration+5),document.querySelector("#scrollbar-style")||document.createElement("style"));scrollbarStyle.parentElement||(scrollbarStyle.setAttribute("id","scrollbar-style"),document.head.append(scrollbarStyle)),scrollbarStyle.innerText=`:root { scrollbar-color: ${sectionColor} #1a1a1a }`+`body::-webkit-scrollbar-thumb { background-color: ${sectionColor} }`,setTimeout(()=>{window.starVelocity.z<=iniStarZvelocity&&(scrollbarStyle.innerText=":root { scrollbar-color: rgb(210,210,210) #1a1a1a }body::-webkit-scrollbar-thumb { background-color: white }")},warpDuration+5)}}}),document.querySelectorAll("picture").forEach(picture=>{var srcSet=picture.querySelector("source").getAttribute("srcset"),imgElement=document.createElement("img");imgElement.setAttribute("src",srcSet),picture.parentNode.replaceChild(imgElement,picture)}),document.createElement("div"));fetch("assets/html/footer.html").then(resp=>resp.text()).then(html=>{emailFooter.innerHTML=html,document.querySelector('a[href*="microsoft.com"]').parentNode.insertAdjacentElement("afterend",emailFooter)});introDiv=[...document.querySelectorAll("a")].find(link=>link.textContent.includes("↑"));introDiv?.previousSibling.remove(),introDiv?.remove(),setTimeout(()=>{let parallaxTriggers=[];document.querySelectorAll('#main, h2:not([id="about"])').forEach(trigger=>{var y=trigger.getBoundingClientRect().top-window.innerHeight/1.2,trigger="H2"===trigger.tagName?trigger.parentElement:trigger;parallaxTriggers.push({element:trigger,y:y})}),window.addEventListener("scroll",()=>{updateTGvisibility(),parallaxTriggers.forEach(trigger=>{if(window.scrollY>=trigger.y&&window.scrollY{var topGap=trigger.y-window.scrollY,newOpacity=1-Math.abs(topGap)/(window.innerHeight-5),blurAmount=Math.min(4.5,Math.abs(topGap)/(window.innerHeight/4.5)),parallaxOffset=-.55*topGap,topGap=-285{var lang;for(lang of document.querySelectorAll("h5 a"))lang.href=lang.href.replace(/(https?:\/\/[^/]+\/)([^.]+)\.md/,"$1#/$2")})),onLoadObserver.disconnect()}});function isMobileDevice(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}function validateIntArg(arg,name,defaultVal){if(void 0===arg)return defaultVal;if(Number.isInteger(arg)||/^\d+$/.test(arg))return parseInt(arg,10);throw new Error(name+" must be an integer.")}function smoothScroll(target,speed,smooth){target===document&&(target=document.scrollingElement||document.documentElement||document.body.parentNode||document.body);let moving=!1,pos=target.scrollTop,frame=target===document.body&&document.documentElement?document.documentElement:target;function scrolled(e){e.preventDefault();e=(e=>e.detail?e.wheelDelta?e.wheelDelta/e.detail/40*(0{delayBetweenWords&&visibilityMap["cover-main"]&&(scrambleText.timeoutID=setTimeout(()=>{scrambleText(text,destination,delayBetweenWords,(textIdx+1)%text.length)},delayBetweenWords))})}function randomizeCase(targetNode,iniDelay,finalDelay,incrementA,incrementB,inflectionPt){if(!targetNode?.nodeName)throw new Error("Target node (1st arg) must be a DOM element");iniDelay=validateIntArg(iniDelay,"Initial delay",5),finalDelay=validateIntArg(finalDelay,"Final delay",1e3),incrementA=validateIntArg(incrementA,"Increment A",10),incrementB=validateIntArg(incrementB,"Increment B",111),inflectionPt=validateIntArg(inflectionPt,"Inflection point",265),targetNode.textContent=targetNode.textContent.split("").map(letter=>Math.random()<.5?letter.toUpperCase():letter.toLowerCase()).join(""),randomizeCase.iniDelay=randomizeCase.iniDelay||iniDelay,randomizeCase.iniDelay+=randomizeCase.iniDelay{randomizeCase(targetNode,iniDelay,finalDelay,incrementA,incrementB,inflectionPt)},randomizeCase.iniDelay)}function typeText(txtToType,destination,typeDelay,iniTxtToType,iniTxtPos,linesToScrollAt){if("string"==typeof txtToType&&(txtToType=[txtToType]),!destination?.nodeName)throw new Error("Destination must be a DOM element");typeDelay=validateIntArg(typeDelay,"Typing delay",30),iniTxtToType=validateIntArg(iniTxtToType,"Initial text array index",0),iniTxtPos=validateIntArg(iniTxtPos,"Initial text string position",3),linesToScrollAt=validateIntArg(linesToScrollAt,"Lines to scroll at",5);let typeContent=" ",iniRow=Math.max(0,iniTxtToType-linesToScrollAt);for(;iniRow
";destination.innerHTML=typeContent+txtToType[iniTxtToType].substring(0,iniTxtPos)+"_",iniTxtPos++==txtToType[iniTxtToType].length?(iniTxtPos=0,++iniTxtToType!=txtToType.length&&(typeText.timeoutID=setTimeout(()=>{typeText(txtToType,destination,typeDelay,iniTxtToType,iniTxtPos)},88))):typeText.timeoutID=setTimeout(()=>{typeText(txtToType,destination,typeDelay,iniTxtToType,iniTxtPos)},typeDelay+220*Math.random()-110)}class Scramble{constructor(el){this.el=el,this.chars="!<>-_\\/[]{}—=+*^?#________",this.update=this.update.bind(this)}setText(newText){var oldText=this.el.innerText,length=Math.max(oldText.length,newText.length),promise=new Promise(resolve=>this.resolve=resolve);this.queue=[];for(let i=0;i=end?(complete++,output+=to):this.frame>=start?((!char||Math.random()<.28)&&(char=this.randomChar(),this.queue[i].char=char),output+=`${char}`):output+=from}this.el.innerHTML=output,complete===this.queue.length?this.resolve():(this.frameRequest=requestAnimationFrame(this.update),this.frame++)}randomChar(){return this.chars[Math.floor(Math.random()*this.chars.length)]}}let langMenu=document.getElementById("language-menu"),langSelector=document.getElementById("language-selector"),hideTimeout,fromUnhashedURL=(langSelector.onmouseover=langSelector.onmouseout=langMenu.onmouseover=langMenu.onmouseout=event=>{clearTimeout(hideTimeout),"mouseover"==event.type?langMenu.style.display="block":"mouseout"==event.type&&(hideTimeout=setTimeout(()=>langMenu.style.display="none",55))},document.querySelectorAll("#language-selector a").forEach(link=>{link.addEventListener("mouseenter",()=>{link.removeAttribute("title")})}),document.querySelectorAll(".dropdown-link").forEach(link=>{link.addEventListener("click",()=>langMenu.style.display="none")}),onLoadObserver.observe(document.body,{childList:!0,subtree:!0}),window.location.href.includes("#"));window.addEventListener("hashchange",()=>{fromUnhashedURL?(fromUnhashedURL,onLoadObserver.observe(document.body,{childList:!0,subtree:!0})):fromUnhashedURL=!0}); \ No newline at end of file + #showcase ~ h3 + p:nth-of-type(even):not(#contributors ~ *`)),fadeLeftElements.forEach(elem=>elem.classList.add("content-fadeleft")),[...introDiv,...featureListDiv,...fadeLeftElements]);let sideNavItems=[...document.querySelectorAll(".sidebar-nav li")],fadeObserver=new IntersectionObserver(entries=>entries.forEach(entry=>{var headingText;entry.isIntersecting?(entry.target.classList.add("visible"),entry.target.tagName.startsWith("H")&&(headingText=entry.target.querySelector("a").textContent,headingText=(document.querySelector(`a[title="${headingText}"]`)||{}).parentElement)&&(sideNavItems.forEach(item=>item.classList.remove("nav-active")),headingText.classList.add("nav-active"))):entry.target.classList.remove("visible")}),{root:null,threshold:.02});introDiv.forEach(elem=>fadeObserver.observe(elem));featureListDiv=document.querySelector("a[href$=stargazers]"),fadeLeftElements=featureListDiv.getAttribute("href");featureListDiv.setAttribute("href",fadeLeftElements.replace("/stargazers",""));let triggerElements=[],triggerPoints=[],emailFooter=(triggerElements.push(...document.querySelectorAll("h2")),triggerElements.push(document.querySelector("h3#-greasemonkey")),triggerElements.push(document.querySelector("h3#-chrome")),triggerElements.push(document.querySelector("img[src*=chatgpt-infinity]")),triggerElements.forEach(elem=>{var elementPos=elem.getBoundingClientRect().top,elem=elem.id.includes("⚡")?1.5:"IMG"===elem.tagName?.8:8.8;triggerPoints.push(elementPos-window.innerHeight/elem)}),triggerPoints.sort((a,b)=>a-b),window.addEventListener("scroll",()=>{if(!visibilityMap["cover-main"]&&!visibilityMap["feature-list"]){let currentSection=0;for(;window.scrollY>triggerPoints[currentSection]&¤tSection{window.starVelocity.z<=iniStarZvelocity&&(window.starColor="white")},warpDuration+starResetDelay),window.starVelocity.z+=.0045,setTimeout(()=>{window.starVelocity.z=Math.max(iniStarZvelocity,window.starVelocity.z-.0025)},hiWarpDuration),setTimeout(()=>{window.starVelocity.z=Math.max(iniStarZvelocity,window.starVelocity.z-.002)},warpDuration);let kudoAIlogo=document.querySelector("#kudoai a"),kudo=document.querySelector(".kudo"),scrollbarStyle=(kudoAIlogo.style.color=sectionColor,kudo.classList.add("hover"),setTimeout(()=>{window.starVelocity.z<=iniStarZvelocity&&(kudoAIlogo.style.color="white",kudo.classList.remove("hover"))},warpDuration+5),document.querySelector("#scrollbar-style")||document.createElement("style"));scrollbarStyle.parentElement||(scrollbarStyle.setAttribute("id","scrollbar-style"),document.head.append(scrollbarStyle)),scrollbarStyle.innerText=`:root { scrollbar-color: ${sectionColor} #1a1a1a }`+`body::-webkit-scrollbar-thumb { background-color: ${sectionColor} }`,setTimeout(()=>{window.starVelocity.z<=iniStarZvelocity&&(scrollbarStyle.innerText=":root { scrollbar-color: rgb(210,210,210) #1a1a1a }body::-webkit-scrollbar-thumb { background-color: white }")},warpDuration+5)}}}),document.querySelectorAll("picture").forEach(picture=>{var srcSet=picture.querySelector("source").getAttribute("srcset"),imgElement=document.createElement("img");imgElement.setAttribute("src",srcSet),picture.parentNode.replaceChild(imgElement,picture)}),document.createElement("div"));fetch("assets/html/footer.html").then(resp=>resp.text()).then(html=>{emailFooter.innerHTML=html,document.querySelector('a[href*="microsoft.com"]').parentNode.insertAdjacentElement("afterend",emailFooter)});introDiv=[...document.querySelectorAll("a")].find(link=>link.textContent.includes("↑"));introDiv?.previousSibling.remove(),introDiv?.remove(),setTimeout(()=>{let parallaxTriggers=[];document.querySelectorAll("#main, h2:not([id=about])").forEach(trigger=>{var y=trigger.getBoundingClientRect().top-window.innerHeight/1.2,trigger="H2"===trigger.tagName?trigger.parentElement:trigger;parallaxTriggers.push({element:trigger,y:y})}),window.addEventListener("scroll",()=>{updateTGvisibility(),parallaxTriggers.forEach(trigger=>{if(window.scrollY>=trigger.y&&window.scrollY{var topGap=trigger.y-window.scrollY,newOpacity=1-Math.abs(topGap)/(window.innerHeight-5),blurAmount=Math.min(4.5,Math.abs(topGap)/(window.innerHeight/4.5)),parallaxOffset=-.55*topGap,topGap=-285{var lang;for(lang of document.querySelectorAll("h5 a"))lang.href=lang.href.replace(/(https?:\/\/[^/]+\/)([^.]+)\.md/,"$1#/$2")})),onLoadObserver.disconnect()}});function isMobileDevice(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}function validateIntArg(arg,name,defaultVal){if(void 0===arg)return defaultVal;if(Number.isInteger(arg)||/^\d+$/.test(arg))return parseInt(arg,10);throw new Error(name+" must be an integer.")}function smoothScroll(target,speed,smooth){target===document&&(target=document.scrollingElement||document.documentElement||document.body.parentNode||document.body);let moving=!1,pos=target.scrollTop,frame=target===document.body&&document.documentElement?document.documentElement:target;function scrolled(e){e.preventDefault();e=(e=>e.detail?e.wheelDelta?e.wheelDelta/e.detail/40*(0{delayBetweenWords&&visibilityMap["cover-main"]&&(scrambleText.timeoutID=setTimeout(()=>{scrambleText(text,destination,delayBetweenWords,(textIdx+1)%text.length)},delayBetweenWords))})}function randomizeCase(targetNode,iniDelay,finalDelay,incrementA,incrementB,inflectionPt){if(!targetNode?.nodeName)throw new Error("Target node (1st arg) must be a DOM element");iniDelay=validateIntArg(iniDelay,"Initial delay",5),finalDelay=validateIntArg(finalDelay,"Final delay",1e3),incrementA=validateIntArg(incrementA,"Increment A",10),incrementB=validateIntArg(incrementB,"Increment B",111),inflectionPt=validateIntArg(inflectionPt,"Inflection point",265),targetNode.textContent=targetNode.textContent.split("").map(letter=>Math.random()<.5?letter.toUpperCase():letter.toLowerCase()).join(""),randomizeCase.iniDelay=randomizeCase.iniDelay||iniDelay,randomizeCase.iniDelay+=randomizeCase.iniDelay{randomizeCase(targetNode,iniDelay,finalDelay,incrementA,incrementB,inflectionPt)},randomizeCase.iniDelay)}function typeText(txtToType,destination,typeDelay,iniTxtToType,iniTxtPos,linesToScrollAt){if("string"==typeof txtToType&&(txtToType=[txtToType]),!destination?.nodeName)throw new Error("Destination must be a DOM element");typeDelay=validateIntArg(typeDelay,"Typing delay",30),iniTxtToType=validateIntArg(iniTxtToType,"Initial text array index",0),iniTxtPos=validateIntArg(iniTxtPos,"Initial text string position",3),linesToScrollAt=validateIntArg(linesToScrollAt,"Lines to scroll at",5);let typeContent=" ",iniRow=Math.max(0,iniTxtToType-linesToScrollAt);for(;iniRow
";destination.innerHTML=typeContent+txtToType[iniTxtToType].substring(0,iniTxtPos)+"_",iniTxtPos++==txtToType[iniTxtToType].length?(iniTxtPos=0,++iniTxtToType!=txtToType.length&&(typeText.timeoutID=setTimeout(()=>{typeText(txtToType,destination,typeDelay,iniTxtToType,iniTxtPos)},88))):typeText.timeoutID=setTimeout(()=>{typeText(txtToType,destination,typeDelay,iniTxtToType,iniTxtPos)},typeDelay+220*Math.random()-110)}class Scramble{constructor(el){this.el=el,this.chars="!<>-_\\/[]{}—=+*^?#________",this.update=this.update.bind(this)}setText(newText){var oldText=this.el.innerText,length=Math.max(oldText.length,newText.length),promise=new Promise(resolve=>this.resolve=resolve);this.queue=[];for(let i=0;i=end?(complete++,output+=to):this.frame>=start?((!char||Math.random()<.28)&&(char=this.randomChar(),this.queue[i].char=char),output+=`${char}`):output+=from}this.el.innerHTML=output,complete===this.queue.length?this.resolve():(this.frameRequest=requestAnimationFrame(this.update),this.frame++)}randomChar(){return this.chars[Math.floor(Math.random()*this.chars.length)]}}let langMenu=document.getElementById("language-menu"),langSelector=document.getElementById("language-selector"),hideTimeout,fromUnhashedURL=(langSelector.onmouseover=langSelector.onmouseout=langMenu.onmouseover=langMenu.onmouseout=event=>{clearTimeout(hideTimeout),"mouseover"==event.type?langMenu.style.display="block":"mouseout"==event.type&&(hideTimeout=setTimeout(()=>langMenu.style.display="none",55))},document.querySelectorAll("#language-selector a").forEach(link=>{link.addEventListener("mouseenter",()=>{link.removeAttribute("title")})}),document.querySelectorAll(".dropdown-link").forEach(link=>{link.addEventListener("click",()=>langMenu.style.display="none")}),onLoadObserver.observe(document.body,{childList:!0,subtree:!0}),window.location.href.includes("#"));window.addEventListener("hashchange",()=>{fromUnhashedURL?(fromUnhashedURL,onLoadObserver.observe(document.body,{childList:!0,subtree:!0})):fromUnhashedURL=!0}); \ No newline at end of file diff --git a/docs/assets/js/src/copy-code-button.js b/docs/assets/js/src/copy-code-button.js index 4162312c7..e5f49b4f8 100644 --- a/docs/assets/js/src/copy-code-button.js +++ b/docs/assets/js/src/copy-code-button.js @@ -22,7 +22,7 @@ })( ".docsify-copy-code-button,.docsify-copy-code-button span{cursor:pointer}.docsify-copy-code-button{position:absolute;z-index:1;top:0;right:0;overflow:visible;padding:.65em .8em;border:0;border-radius:0;outline:0;font-size:1em;background:grey;background:var(--theme-color,grey);color:#fff;opacity:1}.docsify-copy-code-button span{border-radius:3px;background:inherit;pointer-events:none}.docsify-copy-code-button .error,.docsify-copy-code-button .success{position:absolute;z-index:1000;top:24px;left:12px;padding:.5em .65em;font-size:.825em;opacity:0;transform:translateX(-88%)translateY(-50%)}.docsify-copy-code-button.error .error,.docsify-copy-code-button.success .success{left:12px;top:24px;opacity:1;,pre:hover .docsify-copy-code-button{opacity:1}" ), - document.querySelector('link[href*="docsify-copy-code"]') && console.warn("[Deprecation] Link to external docsify-copy-code stylesheet is no longer necessary."), + document.querySelector('link[href*=docsify-copy-code]') && console.warn("[Deprecation] Link to external docsify-copy-code stylesheet is no longer necessary."), (window.DocsifyCopyCodePlugin = { init: function () { return function (o, e) { diff --git a/docs/assets/js/src/onload-hacks.js b/docs/assets/js/src/onload-hacks.js index cd5bbce36..b720d4e98 100644 --- a/docs/assets/js/src/onload-hacks.js +++ b/docs/assets/js/src/onload-hacks.js @@ -48,7 +48,7 @@ const iObserver = new IntersectionObserver(entries => entries.forEach(entry => { // Scramble entire tagline + add case randomization layer Array.from( // clear tagline spans to maintain grow effect - document.querySelectorAll('span[id^="tagline"]')) + document.querySelectorAll('span[id^=tagline]')) .forEach(span => { span.textContent = '' }) scrambleText([taglineWords[0]], document.querySelector('#tagline-pre-adj')) scrambleText(taglineWords[1], document.querySelector('#tagline-adj'), 750) @@ -91,7 +91,7 @@ const onLoadObserver = new MutationObserver(() => { if (!isMobileDevice()) document.body.className = 'ready close' // Populate [taglineWords] for iObserver's scrambleText() + randomizeCase() - const taglineSpans = Array.from(document.querySelectorAll('span[id^="tagline"]')) + const taglineSpans = Array.from(document.querySelectorAll('span[id^=tagline]')) taglineSpans.map(span => taglineWords.push( /pre|post/.exec(span.id) ? span.textContent : span.textContent.split('|'))) taglineSpans.forEach(span => span.textContent = '') // clear them out @@ -214,7 +214,7 @@ const onLoadObserver = new MutationObserver(() => { fadeElements.forEach(elem => fadeObserver.observe(elem)) // Change stars shield link to repo - const starsShieldLink = document.querySelector('a[href$="stargazers"]'), + const starsShieldLink = document.querySelector('a[href$=stargazers]'), href = starsShieldLink.getAttribute('href') starsShieldLink.setAttribute('href', href.replace('/stargazers', '')) @@ -224,7 +224,7 @@ const onLoadObserver = new MutationObserver(() => { triggerElements.push(document.querySelector('h3#-greasemonkey')) triggerElements.push(document.querySelector('h3#-chrome')) triggerElements.push( // 1st showcase tile - document.querySelector('img[src*="chatgpt-infinity"]')) + document.querySelector('img[src*=chatgpt-infinity]')) triggerElements.forEach(elem => { const elementPos = elem.getBoundingClientRect().top const vOffsetDivisor = ( // higher = lower pos @@ -321,7 +321,7 @@ const onLoadObserver = new MutationObserver(() => { // Target TRIGGERS const parallaxTriggers = [] - document.querySelectorAll('#main, h2:not([id="about"])').forEach(trigger => { + document.querySelectorAll('#main, h2:not([id=about])').forEach(trigger => { const y = trigger.getBoundingClientRect().top - window.innerHeight / 1.2 const triggerElem = trigger.tagName === 'H2' ? trigger.parentElement : trigger parallaxTriggers.push({ element: triggerElem, y })