Compare commits
4 commits
df3e997f36
...
77ddefc3d1
| Author | SHA1 | Date | |
|---|---|---|---|
| 77ddefc3d1 | |||
| 3b41d48b9b | |||
| b76a359e15 | |||
| 2b242229e9 |
1 changed files with 2 additions and 6 deletions
|
|
@ -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";
|
||||
|
|
|
|||
Loading…
Reference in a new issue