Home has a hero for the focused game (wide art as a cross-fading backdrop, logo, hours, Play) over shelves of covers. Library is a cover grid that adapts to the window, or a dense table, with filter, sort and search. Unfiltered is a grouped list with the detection reasons. Every game has a page with stats, launch profile and reasons. Settings are saved to ui.toml. Keyboard navigation with a focus ring throughout. Lists only create the rows on screen and covers are decoded to thumbnails on a worker thread when a card first appears. Play is real for Steam (steam://rungameid, steam://install), Lutris and hand-added entries (through summit run); pin and unpin write state.json. Change artwork and per-game settings are marked Soon. Normal runs use the OpenGL renderer (FemtoVG) with the software renderer as fallback; SUMMIT_SHOT renders any view headless to a PNG.
72 lines
4.4 KiB
Plaintext
72 lines
4.4 KiB
Plaintext
// Themes, motion and the type scale. To add a theme, append one Palette to `Theme.palettes`:
|
|
// the settings page, SUMMIT_THEME and ui.toml (which stores `key`) pick it up without other changes.
|
|
|
|
export struct Palette {
|
|
key: string, // stored in ui.toml
|
|
name: string, // shown in settings
|
|
dark: bool, // false for light themes (dark text on light surfaces)
|
|
bg: color, // window background, top
|
|
bg2: color, // window background, bottom
|
|
surface: color, // panels, rows, cards
|
|
raised: color, // hover, chips, inputs
|
|
border: color,
|
|
border-w: length, // 1px normally, thicker for high contrast
|
|
text: color,
|
|
dim: color, // secondary text
|
|
faint: color, // tertiary text, disabled
|
|
accent: color,
|
|
accent2: color, // end of the accent gradient
|
|
on-accent: color, // text on accent
|
|
focus: color, // focus ring
|
|
glow: color, // soft shadow around the focused item
|
|
ok: color, // "installed"
|
|
scrim: float, // how strongly art is darkened behind text (0..1)
|
|
}
|
|
|
|
export global Theme {
|
|
in property <[Palette]> palettes: [
|
|
{ key: "midnight", name: "Midnight", dark: true, bg: #0a0c11, bg2: #0d1017, surface: #141821, raised: #1d2330, border: #272e3d, border-w: 1px,
|
|
text: #eef1f7, dim: #9aa3b5, faint: #5f687a, accent: #ffb02e, accent2: #ff7a3d, on-accent: #1a1200, focus: #ffc65c, glow: #ffb02e, ok: #4ade80, scrim: 0.92 },
|
|
{ key: "steam", name: "Steam blue", dark: true, bg: #171a21, bg2: #1b2838, surface: #202c3c, raised: #2a3f55, border: #34506a, border-w: 1px,
|
|
text: #e9f1f7, dim: #94a3b3, faint: #66788a, accent: #66c0f4, accent2: #1a9fff, on-accent: #06131f, focus: #a5e0ff, glow: #1a9fff, ok: #a4d007, scrim: 0.9 },
|
|
{ key: "daylight", name: "Daylight", dark: false, bg: #f4f6fa, bg2: #e8ecf3, surface: #ffffff, raised: #edf0f6, border: #d5dae5, border-w: 1px,
|
|
text: #131722, dim: #566074, faint: #8d96a8, accent: #2563eb, accent2: #5b4be8, on-accent: #ffffff, focus: #2563eb, glow: #2563eb, ok: #15803d, scrim: 0.94 },
|
|
{ key: "violet", name: "Violet", dark: true, bg: #0f0a1b, bg2: #1a1030, surface: #1c1433, raised: #2a1e4a, border: #3b2b64, border-w: 1px,
|
|
text: #f2edff, dim: #a99dca, faint: #716694, accent: #b68cff, accent2: #f06bd6, on-accent: #1a0b33, focus: #d6beff, glow: #a56bff, ok: #5eead4, scrim: 0.9 },
|
|
{ key: "contrast", name: "High contrast", dark: true, bg: #000000, bg2: #000000, surface: #000000, raised: #1c1c1c, border: #ffffff, border-w: 2px,
|
|
text: #ffffff, dim: #e6e6e6, faint: #bdbdbd, accent: #ffe600, accent2: #ffe600, on-accent: #000000, focus: #00e5ff, glow: #00e5ff, ok: #3dff8a, scrim: 1.0 },
|
|
{ key: "oled", name: "OLED black", dark: true, bg: #000000, bg2: #000000, surface: #0b0b0c, raised: #161617, border: #222224, border-w: 1px,
|
|
text: #f3f3f4, dim: #8e8e93, faint: #5c5c61, accent: #ff4d67, accent2: #ff8a5c, on-accent: #ffffff, focus: #ff7a8e, glow: #ff4d67, ok: #34d399, scrim: 0.96 },
|
|
];
|
|
in-out property <int> id: 0;
|
|
out property <Palette> p: root.palettes[Math.max(0, Math.min(root.id, root.palettes.length - 1))];
|
|
|
|
// 0 Big picture, 1 Grid, 2 List
|
|
in-out property <int> layout: 0;
|
|
out property <bool> big: root.layout == 0;
|
|
out property <length> pad: root.big ? 56px : 32px;
|
|
|
|
// ---- motion: speed 0 = off, 1 = default, 2 = twice as fast. style 0 smooth, 1 snappy, 2 bouncy ----
|
|
in-out property <float> speed: 1.0;
|
|
in-out property <int> style: 0;
|
|
in property <bool> still: false; // headless renders: jump straight to the settled state
|
|
out property <bool> motion: root.speed > 0.01 && !root.still;
|
|
out property <easing> ease: root.style == 1 ? Easing.ease-out-expo : root.style == 2 ? Easing.ease-out-back : Easing.ease-out-quart;
|
|
pure public function ms(base: int) -> duration {
|
|
return root.motion ? (base * (root.style == 1 ? 0.65 : root.style == 2 ? 1.25 : 1.0) / root.speed) * 1ms : 0ms;
|
|
}
|
|
|
|
// ---- type scale ----
|
|
out property <length> t-xs: 11px;
|
|
out property <length> t-sm: 13px;
|
|
out property <length> t-md: 15px;
|
|
out property <length> t-lg: 18px;
|
|
out property <length> t-xl: 24px;
|
|
out property <length> t-2xl: 34px;
|
|
out property <length> t-3xl: 48px;
|
|
// ---- radii (spacing is on an 8px grid throughout) ----
|
|
out property <length> r-sm: 6px;
|
|
out property <length> r-md: 10px;
|
|
out property <length> r-lg: 16px;
|
|
}
|