Move colour mode and Discord controls into the mobile menu

This commit is contained in:
2026-11-17 15:05:02 +01:00
parent 514c6ac924
commit f4ff1e00fb
4 changed files with 26 additions and 1 deletions
@@ -65,7 +65,10 @@
if (event.key !== "ArrowLeft" && event.key !== "ArrowRight") return;
event.preventDefault();
const buttons = Array.from(document.querySelectorAll("[data-phx-theme]"));
// Each breakpoint renders its own copy of the switch, so only the visible
// group takes part in arrow-key navigation.
const buttons = Array.from(document.querySelectorAll("[data-phx-theme]"))
.filter((button) => button.offsetParent !== null);
const offset = event.key === "ArrowRight" ? 1 : -1;
const index = (buttons.indexOf(button) + offset + buttons.length) % buttons.length;
const next = buttons[index];