Web-demo styling

This commit is contained in:
2026-06-05 06:13:33 -04:00
parent d6304f1ef3
commit fb9674fcdb
4 changed files with 125 additions and 85 deletions
+12
View File
@@ -690,6 +690,16 @@ async function predict() {
}
/** Initialize collapsible cards: clicking the h2 toggles the .collapsed class. */
function initCollapsibleCards() {
document.querySelectorAll(".card.collapsible > h2").forEach((heading) => {
const card = heading.parentElement;
heading.addEventListener("click", () => {
card.classList.toggle("collapsed");
});
});
}
/** Attach a listener only when optional markup exists. */
function addListenerIfPresent(id, eventName, handler) {
const element = $(id);
@@ -717,6 +727,8 @@ async function init() {
await setBoardBackground("tb2");
syncAngleSelectors(40);
initCollapsibleCards();
addListenerIfPresent("gen-board", "change", async (e) => {
syncBoardSelectors(e.target.value);
await setBoardBackground(e.target.value);