Fix copy, thread count, and the light-theme hardware card.

FAQ data now matches the page, filters announce the active chip, and the mobile menu closes when you click outside it.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
pepaskopec-blip 2026-10-18 23:16:54 +02:00
commit a1db8ae3e4
7 changed files with 66 additions and 25 deletions

View file

@ -57,6 +57,12 @@
document.addEventListener("keydown", (event) => {
if (event.key === "Escape") setOpen(false);
});
document.addEventListener("click", (event) => {
if (!nav.classList.contains("is-open")) return;
if (nav.contains(event.target) || toggle.contains(event.target)) return;
setOpen(false);
});
}
const radar = document.querySelector("[data-radar]");
@ -157,9 +163,14 @@
const projectCards = document.querySelectorAll(".project-card[data-category]");
if (filterChips.length && projectCards.length) {
filterChips.forEach((chip) => {
chip.setAttribute("aria-pressed", chip.classList.contains("is-active") ? "true" : "false");
chip.addEventListener("click", () => {
const filter = chip.dataset.filter;
filterChips.forEach((c) => c.classList.toggle("is-active", c === chip));
filterChips.forEach((c) => {
const on = c === chip;
c.classList.toggle("is-active", on);
c.setAttribute("aria-pressed", on ? "true" : "false");
});
projectCards.forEach((card) => {
const match = filter === "all" || card.dataset.category === filter;
card.hidden = !match;
@ -172,9 +183,14 @@
const hwCards = document.querySelectorAll(".hw-card[data-hw-category]");
if (hwChips.length && hwCards.length) {
hwChips.forEach((chip) => {
chip.setAttribute("aria-pressed", chip.classList.contains("is-active") ? "true" : "false");
chip.addEventListener("click", () => {
const filter = chip.dataset.hwFilter;
hwChips.forEach((c) => c.classList.toggle("is-active", c === chip));
hwChips.forEach((c) => {
const on = c === chip;
c.classList.toggle("is-active", on);
c.setAttribute("aria-pressed", on ? "true" : "false");
});
hwCards.forEach((card) => {
const match = filter === "all" || card.dataset.hwCategory === filter;
card.hidden = !match;