mirror of
https://github.com/falsycat/ar.falsy.cat.git
synced 2025-09-25 13:21:05 +00:00
deploy: e5e9a644c7
This commit is contained in:
@@ -4,6 +4,6 @@ function htmlToElement(e){const t=document.createElement("template");return e=e.
|
||||
<p class="meta">${new Date(n.lastmodified).toLocaleDateString()}</p>
|
||||
</div>`;s=htmlToElement(o)}else{const o=e[t.dataset.src.replace(/\/$/g,"").replace(n,"")];if(o){let n=t.href.split("#"),e=removeMarkdown(o.content);if(n.length>1){let t=decodeURIComponent(n[1]).replace(/-/g," "),s=e.toLowerCase().indexOf("<b>"+t+"</b>");e=e.substring(s,e.length)}const i=`<div class="popover">
|
||||
<h3>${o.title}</h3>
|
||||
<p>${e.split(" ",20).join(" ")}...</p>
|
||||
<p>${e.split("\n",5).join(" | ")}...</p>
|
||||
<p class="meta">${new Date(o.lastmodified).toLocaleDateString()}</p>
|
||||
</div>`;s=htmlToElement(i)}}s&&(t.appendChild(s),LATEX_ENABLED&&renderMathInElement(s,{delimiters:[{left:"$$",right:"$$",display:!1},{left:"$",right:"$",display:!1}],throwOnError:!1}),t.addEventListener("mouseover",()=>{window.FloatingUIDOM.computePosition(t,s,{middleware:[window.FloatingUIDOM.offset(10),window.FloatingUIDOM.inline(),window.FloatingUIDOM.shift()]}).then(({x:e,y:t})=>{Object.assign(s.style,{left:`${e}px`,top:`${t}px`})}),s.classList.add("visible"),plausible("Popover Hover",{props:{href:t.dataset.src}})}),t.addEventListener("mouseout",()=>{s.classList.remove("visible")}))})})}
|
Reference in New Issue
Block a user