1
0
mirror of https://github.com/Pomax/BezierInfo-2.git synced 2025-08-26 17:54:52 +02:00

some polish

This commit is contained in:
Pomax
2020-09-11 16:30:05 -07:00
parent ebe69a732a
commit 046b1024fa
371 changed files with 17445 additions and 58625 deletions

32
docs/js/site/disqus.js Normal file
View File

@@ -0,0 +1,32 @@
const comments = document.getElementById(`disqus_thread`);
document.addEventListener("scroll", scrollHandler, { passive: true });
function scrollHandler() {
var bbox = comments.getBoundingClientRect();
var top = bbox.top;
var limit = window.innerHeight;
if (top < limit) {
loadDisqus();
}
}
let loadDisqus = () => {
console.log(`loading Disqus comments`);
globalThis.disqus_config = function () {
this.page.url = "https://pomax.github.io/bezierinfo";
this.page.identifier = "bezierinfo";
};
const script = document.createElement("script");
script.src = "https://bezierinfo.disqus.com/embed.js";
script.async = true;
script.setAttribute("data-timestamp", Date.now());
document.head.appendChild(script);
loadDisqus = () => {};
document.removeEventListener("scroll", scrollHandler);
};
scrollHandler();