From 69893dc18c672806f1711ab202b4f7551d0ed6bb Mon Sep 17 00:00:00 2001 From: "adamlui@protonmail.com" Date: Fri, 2 Aug 2024 23:41:03 -0700 Subject: [PATCH] Added blur to parallax --- docs/assets/js/min/onload-hacks.min.js | 4 ++-- docs/assets/js/src/onload-hacks.js | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/assets/js/min/onload-hacks.min.js b/docs/assets/js/min/onload-hacks.min.js index ee22aa70c..c708bb3a6 100644 --- a/docs/assets/js/min/onload-hacks.min.js +++ b/docs/assets/js/min/onload-hacks.min.js @@ -1,3 +1,3 @@ -const 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 }";const 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"));const 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")?"":"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; 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)}),[]),featureListDiv=[],fadeLeftElements=[],introDiv=(introDiv.push(...document.querySelectorAll(".cover-main img, .cover-main a,h2, h3, p, pre, main li,div#partners-collage, #copyright-footer")),introDiv.forEach(element=>{element.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")?"":"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; 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)}),[]),featureListDiv=[],fadeLeftElements=[],introDiv=(introDiv.push(...document.querySelectorAll(".cover-main img, .cover-main a,h2, h3, p, pre, main li,div#partners-collage, #copyright-footer")),introDiv.forEach(element=>{element.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(element=>{element.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(element=>{element.classList.add("content-fadeleft")}),[...introDiv,...featureListDiv,...fadeLeftElements]);const 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(element=>{fadeObserver.observe(element)});featureListDiv=document.querySelector('a[href$="stargazers"]'),fadeLeftElements=featureListDiv.getAttribute("href");featureListDiv.setAttribute("href",fadeLeftElements.replace("/stargazers",""));const triggerElements=[],triggerPoints=[],partnersCollage=(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(element=>{var elementPos=element.getBoundingClientRect().top,element=element.id.includes("⚡")?1.5:"IMG"===element.tagName?.8:8.8;triggerPoints.push(elementPos-window.innerHeight/element)}),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);const 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.getElementById("partners-collage")),emailFooter=document.createElement("div");fetch("assets/html/footer.html").then(response=>response.text()).then(html=>{emailFooter.innerHTML=html,partnersCollage.insertAdjacentElement("afterend",emailFooter)});introDiv=[...document.querySelectorAll("a")].find(link=>link.textContent.includes("↑"));introDiv?.previousSibling.remove(),introDiv?.remove(),setTimeout(()=>{const 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),parallaxOffset=-.55*topGap,topGap=-285{for(const lang of document.querySelectorAll("h5 a"))lang.href=lang.href.replace(/(.*\/\/.*?\/)((\w{2}(-\w{2})?\/)?.*)\.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;const frame=target===document.body&&document.documentElement?document.documentElement:target;function scrolled(e){e.preventDefault();e=function(e){return 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.iniDelayfinalDelay&&(randomizeCase.iniDelay=finalDelay),setTimeout(()=>{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)]}}const languageMenu=document.getElementById("language-menu"),languageSelector=document.getElementById("language-selector");languageMenu.style.display="none";let hideTimeout,fromUnhashedURL=(languageSelector.addEventListener("mouseenter",()=>{clearTimeout(hideTimeout),languageMenu.style.display="block"}),languageSelector.addEventListener("mouseleave",()=>{hideTimeout=setTimeout(()=>{languageMenu.style.display="none"},55)}),languageMenu.addEventListener("mouseenter",()=>{clearTimeout(hideTimeout),languageMenu.style.display="block"}),languageMenu.addEventListener("mouseleave",()=>{clearTimeout(hideTimeout),hideTimeout=setTimeout(()=>{languageMenu.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",()=>{languageMenu.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(element=>{element.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(element=>{fadeObserver.observe(element)});featureListDiv=document.querySelector('a[href$="stargazers"]'),fadeLeftElements=featureListDiv.getAttribute("href");featureListDiv.setAttribute("href",fadeLeftElements.replace("/stargazers",""));let triggerElements=[],triggerPoints=[],partnersCollage=(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(element=>{var elementPos=element.getBoundingClientRect().top,element=element.id.includes("⚡")?1.5:"IMG"===element.tagName?.8:8.8;triggerPoints.push(elementPos-window.innerHeight/element)}),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.getElementById("partners-collage")),emailFooter=document.createElement("div");fetch("assets/html/footer.html").then(response=>response.text()).then(html=>{emailFooter.innerHTML=html,partnersCollage.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(/(.*\/\/.*?\/)((\w{2}(-\w{2})?\/)?.*)\.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=function(e){return 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.iniDelayfinalDelay&&(randomizeCase.iniDelay=finalDelay),setTimeout(()=>{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 languageMenu=document.getElementById("language-menu"),languageSelector=document.getElementById("language-selector");languageMenu.style.display="none";let hideTimeout,fromUnhashedURL=(languageSelector.addEventListener("mouseenter",()=>{clearTimeout(hideTimeout),languageMenu.style.display="block"}),languageSelector.addEventListener("mouseleave",()=>{hideTimeout=setTimeout(()=>{languageMenu.style.display="none"},55)}),languageMenu.addEventListener("mouseenter",()=>{clearTimeout(hideTimeout),languageMenu.style.display="block"}),languageMenu.addEventListener("mouseleave",()=>{clearTimeout(hideTimeout),hideTimeout=setTimeout(()=>{languageMenu.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",()=>{languageMenu.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/onload-hacks.js b/docs/assets/js/src/onload-hacks.js index adc0a5e04..f67c4aefe 100644 --- a/docs/assets/js/src/onload-hacks.js +++ b/docs/assets/js/src/onload-hacks.js @@ -340,17 +340,20 @@ const onLoadObserver = new MutationObserver(() => { } } - // Apply transparency + translate to siblings + // Apply transparency + blur + translate to siblings prevElems.forEach(elem => { const topGap = trigger.y - window.scrollY, newOpacity = 1 - Math.abs(topGap) / ( window.innerHeight - 5), + maxBlur = 4.5, blurAmount = Math.min(maxBlur, Math.abs(topGap) / (window.innerHeight / maxBlur)), parallaxOffset = topGap * -0.55, scaleDelay = 285, // px from trigger.y to delay scaling scaleFactor = topGap > -scaleDelay ? 1 : 1 - Math.abs(topGap + scaleDelay) / 5 / window.innerHeight; + try { elem.classList.remove('content-fadeup'); } catch (err) {} elem.style.opacity = newOpacity; - elem.style.transform = `translateY(${ parallaxOffset }px) scale(${ scaleFactor })`; + elem.style.transform = `translateY(${parallaxOffset}px) scale(${scaleFactor})`; + elem.style.filter = `blur(${blurAmount}px)`; }); }});});}, 100);