Compare commits

..

4 commits

View file

@ -19,10 +19,7 @@ entrySpans.forEach((span, index) => {
const id = `entry-${slugify(term)}`;
span.setAttribute("id", id);
span.classList.add("entry-title");
/** @type {HTMLElement} */ (span).style.setProperty(
"--entry-delay",
`${Math.min(index * 0.01, 0.4)}s`,
);
span.style.setProperty("--entry-delay", `${Math.min(index * 0.01, 0.4)}s`);
entryMap.set(term, id);
});
@ -57,8 +54,7 @@ Array.from(firstByLetter.entries())
const searchInput = document.getElementById("toc-search");
searchInput?.addEventListener("input", (event) => {
const target = /** @type {HTMLInputElement} */ (event.target);
const query = target.value.trim().toLowerCase();
const query = event.target.value.trim().toLowerCase();
Array.from(tocList?.querySelectorAll("li") ?? []).forEach((item) => {
const text = item.textContent.toLowerCase();
item.style.display = text.includes(query) ? "" : "none";