diff --git a/vue/src/views/home/Home.vue b/vue/src/views/home/Home.vue index 3e129d4..a84e18a 100644 --- a/vue/src/views/home/Home.vue +++ b/vue/src/views/home/Home.vue @@ -7,6 +7,13 @@ * class and the three breakpoints below (desktop / <=1360px tablet / <=700px * phone) re-draw the whole area map rather than moving elements around. * + * Below 1360px there is no room for the sidebars, so their widgets collapse + * into a single tabbed panel under the sheet. That is done purely in CSS — the + * tab bar only sets `data-tab` on the wrapper and the media query hides the + * other widgets — so every widget stays mounted exactly once at every width + * (Chat holds a WebSocket, Steam a rotation timer) and resizing across the + * breakpoint loses no state. + * * The widgets do not fetch individually — they all read stores/homeData.js, which * issues one GraphQL query for the whole page. * @@ -30,11 +37,36 @@ import Gym2 from "./Gym2.vue"; import Consumption from "./Consumption.vue"; import Steam from "./Steam.vue"; import Bookmarks from "./Bookmarks.vue"; + +import { ref } from "vue"; + +// Small-screen tab bar. `id` matches the [data-tab] selectors in the tablet +// media query below. +const TABS = [ + { id: "chat", label: "Chat" }, + { id: "bookmarks", label: "Bookmarks" }, + { id: "commits", label: "Commits" }, + { id: "steam", label: "Steam" }, +]; +const activeTab = ref("chat");