start work on client side explorer

This commit is contained in:
Jacky Zhao
2025-03-06 22:35:24 -08:00
parent a201105442
commit 08717394ff
20 changed files with 681 additions and 593 deletions

View File

@@ -1,4 +1,3 @@
const bufferPx = 150
const observer = new IntersectionObserver((entries) => {
for (const entry of entries) {
const slug = entry.target.id
@@ -28,7 +27,6 @@ function toggleToc(this: HTMLElement) {
function setupToc() {
const toc = document.getElementById("toc")
if (toc) {
const collapsed = toc.classList.contains("collapsed")
const content = toc.nextElementSibling as HTMLElement | undefined
if (!content) return
toc.addEventListener("click", toggleToc)