From a505a31f3191f790cc545148c36822eb07e2f0ec Mon Sep 17 00:00:00 2001 From: LucaP Date: Tue, 13 Oct 2026 06:48:33 +0300 Subject: [PATCH] feat: make the edge-lit LCD the site's nav bar nav-bar.css (after gantry.css) draws the bargraph, caret, indicator, chapter drop and ripple, route glints, brake, self-test and shimmer in LCD pixels under gantry's mask, and masks the wave to the lower bezel. Rules hang off html:root, the same weight the preview attribute had, so they still beat gantry.css. useNavBarSignals mirrors the speedometer, drive controls and chapter onto the bar, writing only on change; the per-frame speed pair goes on the LCD and wave rather than the nav, which keeps the per-frame restyle small. SiteNavigation renders just the parts the bar uses. --- src/App.vue | 1 + src/components/SiteNavigation.vue | 12 + src/composables/useNavBarSignals.ts | 208 ++++++++++++ src/styles/nav-bar.css | 471 ++++++++++++++++++++++++++++ tests/unit/nav-bar-hue.test.ts | 19 ++ 5 files changed, 711 insertions(+) create mode 100644 src/composables/useNavBarSignals.ts create mode 100644 src/styles/nav-bar.css create mode 100644 tests/unit/nav-bar-hue.test.ts diff --git a/src/App.vue b/src/App.vue index c6a01a9..1210378 100644 --- a/src/App.vue +++ b/src/App.vue @@ -13,6 +13,7 @@ import './styles/title-navigation.css'; import './styles/wayfinding.css'; import './styles/route.css'; import './styles/gantry.css'; +import './styles/nav-bar.css'; import './styles/cards.css'; import './styles/maintenance.css'; import './styles/print.css'; diff --git a/src/components/SiteNavigation.vue b/src/components/SiteNavigation.vue index e825372..9a56ba2 100644 --- a/src/components/SiteNavigation.vue +++ b/src/components/SiteNavigation.vue @@ -7,6 +7,7 @@ import type { BeamSample } from "@/journey/headlight-beam"; import type { JourneySectionsBinding } from "@/composables/useJourneySections"; import { useSpeedometer } from "@/composables/useSpeedometer"; import { SIGN_ACCENTS } from "@/journey/sign-routes"; +import { useNavBarSignals } from "@/composables/useNavBarSignals"; const props = defineProps<{ items: ReadonlyArray<{ id: SectionId; label: string }>; @@ -25,6 +26,14 @@ const props = defineProps<{ animated?: boolean; }>(); +/** The bar's LCD layers (styles/nav-bar.css), in paint order: layers on the + * same z-index stack in this order. */ +const LCD_PARTS = [ + "fill-l", "fill-r", "unlit-l", "unlit-r", "ghost", + "glint", "glint-2", "fibre-glint", "fibre-glint-2", + "caret", "indicator", "test", "brake", "shimmer", "drop", +] as const; + const navigationLabels: Readonly> = { start: "Start", profile: "Profile", @@ -159,6 +168,7 @@ const speedometer = useSpeedometer({ return `${route} \u00b7 ${exit} \u00b7 ${ahead}`; }, }); +useNavBarSignals(speedo, activeIndex); const speedoLabel = computed(() => (speedometer.units.value === "mph" ? "Speedometer in miles per hour. Switch to kilometres per hour" : "Speedometer in kilometres per hour. Switch to miles per hour")); @@ -172,6 +182,8 @@ const navigate = (event: MouseEvent): void => {