diff --git a/sites/events/src/main.js b/sites/events/src/main.js
index 1fdc067..c1f6e88 100644
--- a/sites/events/src/main.js
+++ b/sites/events/src/main.js
@@ -221,12 +221,23 @@ function passesFilter(ev) {
return activeFormats.has(formatOf(ev)) && (scope === null || activeScopes.has(scope));
}
+// Filter buttons use the same color as the badge they control (warning
+// for Format, info for Scope) when active, so it's obvious at a glance
+// which is which — and switch to a dimmed outline when off, since
+// btn-outline alone reads too similarly to its own active state in dark
+// mode to tell the two apart at a glance.
+const FILTER_GROUP_COLOR = { format: "btn-warning", scope: "btn-info" };
+
function setupFilters() {
document.querySelectorAll("#filters button[data-filter-group]").forEach(btn => {
+ const group = btn.dataset.filterGroup;
+ const onClass = FILTER_GROUP_COLOR[group];
btn.addEventListener("click", () => {
- const set = btn.dataset.filterGroup === "format" ? activeFormats : activeScopes;
- const nowActive = !btn.classList.contains("btn-active");
- btn.classList.toggle("btn-active", nowActive);
+ const set = group === "format" ? activeFormats : activeScopes;
+ const nowActive = !btn.classList.contains(onClass);
+ btn.classList.toggle(onClass, nowActive);
+ btn.classList.toggle("btn-outline", !nowActive);
+ btn.classList.toggle("opacity-40", !nowActive);
if (nowActive) set.add(btn.dataset.filterValue);
else set.delete(btn.dataset.filterValue);
renderCircuits();