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.
This commit is contained in:
19
tests/unit/nav-bar-hue.test.ts
Normal file
19
tests/unit/nav-bar-hue.test.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { hueTier } from '@/composables/useNavBarSignals';
|
||||
|
||||
describe('nav bar hue tier', () => {
|
||||
it('comes on at 80, 88 and 95 % of the dial', () => {
|
||||
expect(hueTier(0, 0.79)).toBe(0);
|
||||
expect(hueTier(0, 0.8)).toBe(1);
|
||||
expect(hueTier(0, 0.88)).toBe(2);
|
||||
expect(hueTier(0, 1)).toBe(3);
|
||||
});
|
||||
|
||||
it('holds a tier until the speed falls below its own floor', () => {
|
||||
expect(hueTier(1, 0.77)).toBe(1);
|
||||
expect(hueTier(1, 0.75)).toBe(0);
|
||||
expect(hueTier(3, 0.93)).toBe(3);
|
||||
expect(hueTier(3, 0.9)).toBe(2);
|
||||
expect(hueTier(3, 0.4)).toBe(0);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user