graphene update

This commit is contained in:
anarsec 2024-04-17 17:52:08 +00:00
parent af1bc7fc97
commit 49f323d16c
No known key found for this signature in database
4 changed files with 54 additions and 35 deletions

View file

@ -30,6 +30,14 @@
const elemAbsBottom = elemRect.bottom - bodyRect.top;
const h = (window.innerHeight || document.documentElement.clientHeight);
document.querySelector(".menu").style = "position: sticky; top: 48px;";
const minScroll = tocIndex.offsetTop - document.querySelector(".menu").clientHeight + tocIndex.offsetHeight + 50;
const maxScroll = tocIndex.offsetTop - tocIndex.offsetHeight - 50;
if(document.querySelector(".menu").scrollTop < minScroll){
document.querySelector(".menu").scrollTop = minScroll;
}
else if(document.querySelector(".menu").scrollTop > maxScroll){
document.querySelector(".menu").scrollTop = maxScroll;
}
}
function activateIfVisible() {