UNPKG

qdrant-page-search

Version:

Add markup for the search modal popup:

1 lines 558 B
document.addEventListener("DOMContentLoaded",(()=>{const e=new URLSearchParams(window.location.search).get("selector");if(e){const o=document.querySelector(window.atob(e)),t=250,n=o.getBoundingClientRect().top+window.scrollY-t;window.scrollTo({top:n,behavior:"smooth"});const r=setTimeout((()=>{o.style.backgroundColor="rgba(255,246,188,0.73)",clearTimeout(r)}),1500),c=setTimeout((()=>{o.style.removeProperty("background-color");const e=new URL(window.location);e.searchParams.delete("selector"),history.replaceState(null,null,e),clearTimeout(c)}),3e3)}}));