Compare commits

...

5 Commits

Author SHA1 Message Date
julian 272a6ad97d feat(frontend): user-switchable light/dark theme
Build Art IoT image / build-and-publish (push) Successful in 21s
- dark tokens move from prefers-color-scheme to :root[data-theme="dark"];
  light is the default for everyone regardless of OS preference
- choice persisted in localStorage (artiot-theme), applied to <html> at
  module load so the login screen themes before first paint
- Account page gains an Appearance section with a squared slide switch;
  meta theme-color follows the active theme
2026-07-18 10:00:12 +02:00
julian 96ea568e53 style(frontend): Chakra Petch instrument-panel restyle + real mobile layout
Build Art IoT image / build-and-publish (push) Successful in 43s
- Chakra Petch replaces Archivo for all UI type (Plex Mono demoted to data:
  ids, timestamps, tabular numbers); brand set in 700 italic caps
- every corner squared; signature chamfer cut (echoing the typeface) on gun
  bays, login plate and solid buttons; lamps stay round (physical lamps)
- phones: nav becomes a fixed bottom tab bar with safe-area padding, tables
  collapse into labeled stacked rows (data-label), bigger touch targets
- desktop nav as underline tabs; inline styles in Account moved to classes
2026-07-18 09:05:12 +02:00
julian 9eaacf5eeb fix(deploy): update Traefik cert resolver from 'acme' to 'le' in compose.yaml
Build Art IoT image / build-and-publish (push) Successful in 14s
2026-07-17 19:52:31 +02:00
julian d7264a758a fix(deploy): correct formatting of Traefik cert resolver in compose.yaml
Build Art IoT image / build-and-publish (push) Successful in 14s
2026-07-17 19:50:58 +02:00
julian dbc4a477cb fix(deploy): update Traefik cert resolver to use 'acme' for TLS configuration
Build Art IoT image / build-and-publish (push) Successful in 14s
2026-07-17 19:49:07 +02:00
13 changed files with 287 additions and 132 deletions
+1 -1
View File
@@ -49,7 +49,7 @@ services:
- traefik.enable=true - traefik.enable=true
- traefik.http.routers.artiot.rule=Host(`${ARTIOT_HOST:-artiot.infra.msai.al}`) - traefik.http.routers.artiot.rule=Host(`${ARTIOT_HOST:-artiot.infra.msai.al}`)
- traefik.http.routers.artiot.entrypoints=${ARTIOT_ENTRYPOINT:-websecure} - traefik.http.routers.artiot.entrypoints=${ARTIOT_ENTRYPOINT:-websecure}
- traefik.http.routers.artiot.tls.certresolver=${ARTIOT_CERTRESOLVER:-letsencrypt} - traefik.http.routers.artiot.tls.certresolver=le
- traefik.http.services.artiot.loadbalancer.server.port=9000 - traefik.http.services.artiot.loadbalancer.server.port=9000
volumes: volumes:
+1 -1
View File
@@ -3,7 +3,7 @@
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" /> <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
<meta name="theme-color" content="#171d1b" /> <meta name="theme-color" content="#f9faf9" />
<link rel="icon" href="/icon.svg" type="image/svg+xml" /> <link rel="icon" href="/icon.svg" type="image/svg+xml" />
<link rel="manifest" href="/manifest.json" /> <link rel="manifest" href="/manifest.json" />
<title>Art IoT</title> <title>Art IoT</title>
+5 -5
View File
@@ -8,7 +8,7 @@
"name": "charging-station-panel", "name": "charging-station-panel",
"version": "1.0.0", "version": "1.0.0",
"dependencies": { "dependencies": {
"@fontsource/archivo": "^5.1.0", "@fontsource/chakra-petch": "^5.1.0",
"@fontsource/ibm-plex-mono": "^5.1.0", "@fontsource/ibm-plex-mono": "^5.1.0",
"@tanstack/react-query": "^5.62.0", "@tanstack/react-query": "^5.62.0",
"react": "^19.0.0", "react": "^19.0.0",
@@ -748,10 +748,10 @@
"node": ">=18" "node": ">=18"
} }
}, },
"node_modules/@fontsource/archivo": { "node_modules/@fontsource/chakra-petch": {
"version": "5.2.8", "version": "5.2.7",
"resolved": "https://registry.npmjs.org/@fontsource/archivo/-/archivo-5.2.8.tgz", "resolved": "https://registry.npmjs.org/@fontsource/chakra-petch/-/chakra-petch-5.2.7.tgz",
"integrity": "sha512-Fc4yuMt85MmcYooUVpYHAJRJTymPv2+J9HsMP2f5mxR/0pIWgE2V5XfgNTavPpklX2rJFprdT36iE6Rr8ds9MA==", "integrity": "sha512-GLbun5WZJNAEc8FtWxwcgo+4Kurqdwejvf671l+YfIjyQgPvTjyxXYP7Ffg2HAY89NGnp3oOvKQjRzfm/fBECw==",
"license": "OFL-1.1", "license": "OFL-1.1",
"funding": { "funding": {
"url": "https://github.com/sponsors/ayuhito" "url": "https://github.com/sponsors/ayuhito"
+1 -1
View File
@@ -9,7 +9,7 @@
"preview": "vite preview" "preview": "vite preview"
}, },
"dependencies": { "dependencies": {
"@fontsource/archivo": "^5.1.0", "@fontsource/chakra-petch": "^5.1.0",
"@fontsource/ibm-plex-mono": "^5.1.0", "@fontsource/ibm-plex-mono": "^5.1.0",
"@tanstack/react-query": "^5.62.0", "@tanstack/react-query": "^5.62.0",
"react": "^19.0.0", "react": "^19.0.0",
+1 -1
View File
@@ -33,7 +33,7 @@ export default function Battery({ soc }: { soc: number | null | undefined }) {
<span className="battery__fill" style={{ width: `${pct}%`, background: color }} /> <span className="battery__fill" style={{ width: `${pct}%`, background: color }} />
</span> </span>
<span className="battery__cap" /> <span className="battery__cap" />
<span className="battery__pct mono" style={known ? { color: socColor(pct) } : undefined}> <span className="battery__pct" style={known ? { color: socColor(pct) } : undefined}>
{known ? `${Math.round(pct)}%` : "—"} {known ? `${Math.round(pct)}%` : "—"}
</span> </span>
</div> </div>
+5 -4
View File
@@ -3,10 +3,11 @@ import ReactDOM from "react-dom/client";
import { BrowserRouter } from "react-router-dom"; import { BrowserRouter } from "react-router-dom";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import App from "./App"; import App from "./App";
import "@fontsource/archivo/400.css"; import "@fontsource/chakra-petch/400.css";
import "@fontsource/archivo/500.css"; import "@fontsource/chakra-petch/500.css";
import "@fontsource/archivo/600.css"; import "@fontsource/chakra-petch/600.css";
import "@fontsource/archivo/700.css"; import "@fontsource/chakra-petch/700.css";
import "@fontsource/chakra-petch/700-italic.css";
import "@fontsource/ibm-plex-mono/400.css"; import "@fontsource/ibm-plex-mono/400.css";
import "@fontsource/ibm-plex-mono/500.css"; import "@fontsource/ibm-plex-mono/500.css";
import "@fontsource/ibm-plex-mono/600.css"; import "@fontsource/ibm-plex-mono/600.css";
+32 -6
View File
@@ -12,12 +12,12 @@ function MyPermissions() {
if (isAdmin(me.scopes)) { if (isAdmin(me.scopes)) {
return ( return (
<section className="panel" style={{ maxWidth: 440 }}> <section className="panel panel--narrow">
<header className="panel__head"> <header className="panel__head">
<h2>Your permissions</h2> <h2>Your permissions</h2>
</header> </header>
<span className="chip chip--card">Administrator</span> <span className="chip chip--card">Administrator</span>
<p className="dim" style={{ marginTop: 8, fontSize: 14 }}> <p className="panel__note">
Full access: both guns, all relays, cards, users and history of everyone. Full access: both guns, all relays, cards, users and history of everyone.
</p> </p>
</section> </section>
@@ -32,12 +32,12 @@ function MyPermissions() {
const relays = Object.values(status?.relays ?? {}).map((r) => r.label); const relays = Object.values(status?.relays ?? {}).map((r) => r.label);
return ( return (
<section className="panel" style={{ maxWidth: 440 }}> <section className="panel panel--narrow">
<header className="panel__head"> <header className="panel__head">
<h2>Your permissions</h2> <h2>Your permissions</h2>
</header> </header>
{guns.length + relays.length === 0 ? ( {guns.length + relays.length === 0 ? (
<p className="dim" style={{ fontSize: 14 }}> <p className="panel__note">
No device permissions yet — ask an admin to grant you a gun or a relay. No device permissions yet — ask an admin to grant you a gun or a relay.
</p> </p>
) : ( ) : (
@@ -54,13 +54,38 @@ function MyPermissions() {
))} ))}
</ul> </ul>
)} )}
<p className="dim" style={{ marginTop: 8, fontSize: 13 }}> <p className="panel__note">
History shows only your own charging sessions. History shows only your own charging sessions.
</p> </p>
</section> </section>
); );
} }
function AppearanceSection() {
const theme = useApp((s) => s.theme);
const setTheme = useApp((s) => s.setTheme);
return (
<section className="panel panel--narrow">
<header className="panel__head">
<h2>Appearance</h2>
</header>
<label className="switch">
<span className="switch__label">Dark theme</span>
<input
type="checkbox"
role="switch"
checked={theme === "dark"}
onChange={(e) => setTheme(e.target.checked ? "dark" : "light")}
/>
<span className="switch__track" aria-hidden>
<span className="switch__thumb" />
</span>
</label>
<p className="panel__note">Saved on this device.</p>
</section>
);
}
export default function Account() { export default function Account() {
const me = useApp((s) => s.me)!; const me = useApp((s) => s.me)!;
const toast = useApp((s) => s.toast); const toast = useApp((s) => s.toast);
@@ -91,8 +116,9 @@ export default function Account() {
return ( return (
<> <>
<AppearanceSection />
<MyPermissions /> <MyPermissions />
<section className="panel" style={{ maxWidth: 440 }}> <section className="panel panel--narrow">
<header className="panel__head"> <header className="panel__head">
<h2>Account</h2> <h2>Account</h2>
<span className="panel__meta mono">{me.name}</span> <span className="panel__meta mono">{me.name}</span>
+6 -6
View File
@@ -225,16 +225,16 @@ function AuthorizedSection() {
<tbody> <tbody>
{entries.map(([tag, entry]) => ( {entries.map(([tag, entry]) => (
<tr key={tag}> <tr key={tag}>
<td className="mono">{tag}</td> <td className="mono" data-label="Tag">{tag}</td>
<td className="strong">{entry.name}</td> <td className="strong" data-label="Name">{entry.name}</td>
<td> <td data-label="Type">
<span className={`chip chip--${entry.kind === "app" ? "app" : "card"}`}> <span className={`chip chip--${entry.kind === "app" ? "app" : "card"}`}>
{entry.kind} {entry.kind}
</span> </span>
</td> </td>
<td>{entry.user ?? <span className="dim">unassigned</span>}</td> <td data-label="Belongs to">{entry.user ?? <span className="dim">unassigned</span>}</td>
<td className="dim">{entry.guns?.join(", ") ?? "all guns"}</td> <td className="dim" data-label="Guns">{entry.guns?.join(", ") ?? "all guns"}</td>
<td className="num"> <td className="num table__actions">
<button className="btn btn--ghost btn--sm" onClick={() => setEditing(tag)}> <button className="btn btn--ghost btn--sm" onClick={() => setEditing(tag)}>
Edit Edit
</button> </button>
+1 -1
View File
@@ -132,7 +132,7 @@ function GunBay({ gun, scopes }: { gun: Gun; scopes: string[] }) {
<div className="bay__charge"> <div className="bay__charge">
<Battery soc={gun.tx.telemetry?.soc} /> <Battery soc={gun.tx.telemetry?.soc} />
<div className="bay__kw"> <div className="bay__kw">
<span className="bay__kw-num mono"> <span className="bay__kw-num">
{gun.tx.telemetry?.power_w != null {gun.tx.telemetry?.power_w != null
? (gun.tx.telemetry.power_w / 1000).toFixed(1) ? (gun.tx.telemetry.power_w / 1000).toFixed(1)
: "—"} : "—"}
+6 -6
View File
@@ -66,20 +66,20 @@ export default function History() {
<tbody> <tbody>
{sessions.map((s) => ( {sessions.map((s) => (
<tr key={s.tx}> <tr key={s.tx}>
<td className="strong">{s.who || s.id_tag}</td> <td className="strong" data-label="Who">{s.who || s.id_tag}</td>
<td> <td data-label="Via">
<MethodChip method={s.method} /> <MethodChip method={s.method} />
</td> </td>
<td>{gunLabel(s, status?.chargers ?? {})}</td> <td data-label="Gun">{gunLabel(s, status?.chargers ?? {})}</td>
<td className="mono">{fmtTime(s.started)}</td> <td className="mono" data-label="Started">{fmtTime(s.started)}</td>
<td> <td data-label="Duration">
{s.ended ? ( {s.ended ? (
fmtDuration(s.started, s.ended) fmtDuration(s.started, s.ended)
) : ( ) : (
<span className="chip chip--live">charging</span> <span className="chip chip--live">charging</span>
)} )}
</td> </td>
<td className="num mono strong">{fmtKwh(s.wh)}</td> <td className="num mono strong" data-label="kWh">{fmtKwh(s.wh)}</td>
</tr> </tr>
))} ))}
</tbody> </tbody>
+1 -1
View File
@@ -243,7 +243,7 @@ export default function Users() {
<tr key={u.name}> <tr key={u.name}>
<td className="strong">{u.name}</td> <td className="strong">{u.name}</td>
<td className="dim">{describeScopes(u.scopes, catalog)}</td> <td className="dim">{describeScopes(u.scopes, catalog)}</td>
<td className="num"> <td className="num table__actions">
<button className="btn btn--ghost btn--sm" onClick={() => setEditing(u)}> <button className="btn btn--ghost btn--sm" onClick={() => setEditing(u)}>
Edit Edit
</button> </button>
+24
View File
@@ -1,11 +1,29 @@
import { create } from "zustand"; import { create } from "zustand";
import type { Me } from "./types"; import type { Me } from "./types";
export type Theme = "light" | "dark";
const THEME_KEY = "artiot-theme";
function applyTheme(theme: Theme) {
document.documentElement.dataset.theme = theme;
document
.querySelector('meta[name="theme-color"]')
?.setAttribute("content", theme === "dark" ? "#1b211f" : "#f9faf9");
}
// Light unless the user chose dark before; applied at module load, before
// the first render, so the login screen is themed too.
const initialTheme: Theme = localStorage.getItem(THEME_KEY) === "dark" ? "dark" : "light";
applyTheme(initialTheme);
/** Auth + app-shell state (zustand). Server data lives in TanStack Query. */ /** Auth + app-shell state (zustand). Server data lives in TanStack Query. */
interface AppState { interface AppState {
me: Me | null; me: Me | null;
authChecked: boolean; // finished the initial /api/me probe authChecked: boolean; // finished the initial /api/me probe
setMe: (me: Me | null) => void; setMe: (me: Me | null) => void;
theme: Theme;
setTheme: (theme: Theme) => void;
toasts: { id: number; text: string; tone: "info" | "error" }[]; toasts: { id: number; text: string; tone: "info" | "error" }[];
toast: (text: string, tone?: "info" | "error") => void; toast: (text: string, tone?: "info" | "error") => void;
dismissToast: (id: number) => void; dismissToast: (id: number) => void;
@@ -17,6 +35,12 @@ export const useApp = create<AppState>((set) => ({
me: null, me: null,
authChecked: false, authChecked: false,
setMe: (me) => set({ me, authChecked: true }), setMe: (me) => set({ me, authChecked: true }),
theme: initialTheme,
setTheme: (theme) => {
localStorage.setItem(THEME_KEY, theme);
applyTheme(theme);
set({ theme });
},
toasts: [], toasts: [],
toast: (text, tone = "info") => { toast: (text, tone = "info") => {
const id = ++toastId; const id = ++toastId;
+203 -99
View File
@@ -1,8 +1,12 @@
/* ============================================================ /* ============================================================
Art IoT — instrument-panel design system Art IoT — instrument-panel design system, mk II
Surfaces like enameled switchgear, copper-busbar accent, Surfaces like enameled switchgear, copper-busbar accent,
indicator lamps as the signature element. indicator lamps as the signature element.
Type: Archivo (UI) + IBM Plex Mono (telemetry & identifiers). Type: Chakra Petch (all UI — its chamfered glyphs set the
geometry of the whole panel) + IBM Plex Mono (data only:
identifiers, timestamps, tabular numbers).
Corners: square. The only diagonal is the chamfer cut on
bays, the login plate and solid buttons — echoing the face.
============================================================ */ ============================================================ */
:root { :root {
@@ -20,57 +24,63 @@
--red: #bf3527; --red: #bf3527;
--lamp-off: #c4ccc8; --lamp-off: #c4ccc8;
--shadow: 0 1px 2px rgb(29 37 35 / 0.06), 0 4px 16px rgb(29 37 35 / 0.05); --shadow: 0 1px 2px rgb(29 37 35 / 0.06), 0 4px 16px rgb(29 37 35 / 0.05);
--radius: 10px; --dropshadow: drop-shadow(0 1px 2px rgb(29 37 35 / 0.07)) drop-shadow(0 4px 10px rgb(29 37 35 / 0.06));
--font-ui: "Archivo", "Segoe UI", system-ui, sans-serif; --font-ui: "Chakra Petch", "Segoe UI", system-ui, sans-serif;
--font-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace; --font-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
/* label: the recurring small-caps utility voice */
--label: 600 11px/1.4 var(--font-ui);
--label-track: 0.11em;
} }
@media (prefers-color-scheme: dark) { /* Dark is opt-in via the Account switch (persisted in localStorage);
:root { light is the default regardless of the OS preference. */
--paper: #131816; :root[data-theme="dark"] {
--panel: #1b211f; --paper: #131816;
--panel-inset: #161c1a; --panel: #1b211f;
--ink: #e4e9e7; --panel-inset: #161c1a;
--ink-dim: #93a09b; --ink: #e4e9e7;
--line: #2c3531; --ink-dim: #93a09b;
--copper: #d07a3e; --line: #2c3531;
--copper-deep: #b25c28; --copper: #d07a3e;
--live: #2fae7c; --copper-deep: #b25c28;
--blue: #4f8ee8; --live: #2fae7c;
--amber: #d99a1b; --blue: #4f8ee8;
--red: #d8503f; --amber: #d99a1b;
--lamp-off: #39433f; --red: #d8503f;
--shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 4px 18px rgb(0 0 0 / 0.35); --lamp-off: #39433f;
} --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 4px 18px rgb(0 0 0 / 0.35);
--dropshadow: drop-shadow(0 1px 2px rgb(0 0 0 / 0.45)) drop-shadow(0 4px 10px rgb(0 0 0 / 0.35));
} }
* { box-sizing: border-box; margin: 0; } * { box-sizing: border-box; margin: 0; }
html { color-scheme: light dark; } html { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }
body { body {
background: var(--paper); background: var(--paper);
color: var(--ink); color: var(--ink);
font-family: var(--font-ui); font-family: var(--font-ui);
font-size: 15.5px; font-size: 15px;
line-height: 1.5; line-height: 1.5;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
} }
button, input, select { font: inherit; color: inherit; } button, input, select { font: inherit; color: inherit; border-radius: 0; }
:focus-visible { :focus-visible {
outline: 2px solid var(--copper); outline: 2px solid var(--copper);
outline-offset: 2px; outline-offset: 2px;
border-radius: 4px;
} }
.mono { font-family: var(--font-mono); font-size: 0.92em; } .mono { font-family: var(--font-mono); font-size: 0.93em; }
.strong { font-weight: 600; } .strong { font-weight: 600; }
.dim { color: var(--ink-dim); } .dim { color: var(--ink-dim); }
.num { text-align: right; } .num { text-align: right; }
/* ---------- indicator lamp (signature element) ---------- */ /* ---------- indicator lamp (signature element) ----------
Deliberately round in a square world: it is a physical lamp
on the cabinet face, not UI chrome. */
.lamp { .lamp {
display: inline-block; display: inline-block;
width: 11px; height: 11px; width: 11px; height: 11px;
@@ -116,45 +126,53 @@ button, input, select { font: inherit; color: inherit; }
.shell { min-height: 100dvh; display: flex; flex-direction: column; } .shell { min-height: 100dvh; display: flex; flex-direction: column; }
.topbar { .topbar {
display: flex; align-items: center; gap: 20px; display: flex; align-items: stretch; gap: 18px;
padding: 10px clamp(14px, 4vw, 32px); min-height: 54px;
padding: 0 clamp(14px, 4vw, 32px);
background: var(--panel); background: var(--panel);
border-bottom: 1px solid var(--line); border-bottom: 1px solid var(--line);
position: sticky; top: 0; z-index: 10; position: sticky; top: 0; z-index: 10;
} }
.brand { display: flex; align-items: center; gap: 10px; } .brand { display: flex; align-items: center; gap: 10px; align-self: center; }
.brand__mark { width: 30px; height: 30px; } .brand__mark { width: 28px; height: 28px; }
.brand__mark path { fill: var(--copper); } .brand__mark path { fill: var(--copper); }
.brand__name { display: block; font-weight: 700; letter-spacing: 0.01em; line-height: 1.15; } .brand__name {
display: block;
font-weight: 700; font-style: italic;
text-transform: uppercase; letter-spacing: 0.05em;
line-height: 1.15;
}
.brand__sub { .brand__sub {
display: block; font-family: var(--font-mono); font-size: 10.5px; display: block; font: var(--label); font-size: 10px;
text-transform: uppercase; letter-spacing: 0.14em; color: var(--ink-dim); text-transform: uppercase; letter-spacing: 0.16em; color: var(--ink-dim);
} }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; } /* Desktop nav: underline tabs riding the topbar rule. */
.nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; }
.nav__link { .nav__link {
display: inline-flex; align-items: center; gap: 7px; display: inline-flex; align-items: center; gap: 7px;
padding: 7px 13px; padding: 0 14px;
border-radius: 8px;
color: var(--ink-dim); color: var(--ink-dim);
text-decoration: none; text-decoration: none;
font-weight: 500; font-size: 13px; font-weight: 600;
text-transform: uppercase; letter-spacing: 0.07em;
white-space: nowrap; white-space: nowrap;
box-shadow: inset 0 -2px 0 transparent;
} }
.nav__link:hover { color: var(--ink); background: var(--panel-inset); } .nav__link:hover { color: var(--ink); background: var(--panel-inset); }
.nav__link.active { color: var(--copper-deep); background: color-mix(in srgb, var(--copper) 12%, transparent); font-weight: 600; } .nav__link.active { color: var(--copper-deep); box-shadow: inset 0 -2px 0 var(--copper); }
.badge { .badge {
background: var(--amber); color: #fff; background: var(--amber); color: #fff;
font-family: var(--font-mono); font-size: 11px; font-weight: 600; font-family: var(--font-mono); font-size: 11px; font-weight: 600;
border-radius: 999px; padding: 1px 7px; padding: 1px 6px;
} }
.topbar__user { display: flex; align-items: center; gap: 10px; } .topbar__user { display: flex; align-items: center; gap: 10px; align-self: center; margin-left: auto; }
.topbar__who { .topbar__who {
font-family: var(--font-mono); font-size: 13px; color: var(--ink-dim); font-family: var(--font-mono); font-size: 13px; color: var(--ink-dim);
text-decoration: none; padding: 4px 8px; border-radius: 6px; text-decoration: none; padding: 4px 8px;
} }
.topbar__who:hover { color: var(--ink); background: var(--panel-inset); } .topbar__who:hover { color: var(--ink); background: var(--panel-inset); }
.topbar__who.active { color: var(--copper-deep); } .topbar__who.active { color: var(--copper-deep); }
@@ -164,8 +182,8 @@ button, input, select { font: inherit; color: inherit; }
margin: 14px clamp(14px, 4vw, 32px) 0; margin: 14px clamp(14px, 4vw, 32px) 0;
padding: 11px 16px; padding: 11px 16px;
border: 1px solid color-mix(in srgb, var(--amber) 45%, var(--line)); border: 1px solid color-mix(in srgb, var(--amber) 45%, var(--line));
border-left: 3px solid var(--amber);
background: color-mix(in srgb, var(--amber) 9%, var(--panel)); background: color-mix(in srgb, var(--amber) 9%, var(--panel));
border-radius: var(--radius);
color: var(--ink); color: var(--ink);
text-decoration: none; text-decoration: none;
font-weight: 500; font-weight: 500;
@@ -196,119 +214,133 @@ button, input, select { font: inherit; color: inherit; }
width: min(380px, 100%); width: min(380px, 100%);
background: var(--panel); background: var(--panel);
border: 1px solid var(--line); border: 1px solid var(--line);
border-radius: 14px; border-top: 3px solid var(--copper);
box-shadow: var(--shadow); clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%);
filter: var(--dropshadow);
padding: 30px 28px; padding: 30px 28px;
display: flex; flex-direction: column; gap: 14px; display: flex; flex-direction: column; gap: 14px;
} }
.login__head { text-align: center; margin-bottom: 6px; } .login__head { text-align: center; margin-bottom: 6px; }
.login__mark { width: 44px; height: 44px; margin-bottom: 10px; } .login__mark { width: 44px; height: 44px; margin-bottom: 10px; }
.login__mark path { fill: var(--copper); } .login__mark path { fill: var(--copper); }
.login__head h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; } .login__head h1 {
font-size: 24px; font-weight: 700; font-style: italic;
text-transform: uppercase; letter-spacing: 0.05em;
}
.login__head p { color: var(--ink-dim); font-size: 13.5px; margin-top: 4px; } .login__head p { color: var(--ink-dim); font-size: 13.5px; margin-top: 4px; }
/* ---------- panels & bays ---------- */ /* ---------- panels & bays ---------- */
.panel { .panel {
background: var(--panel); background: var(--panel);
border: 1px solid var(--line); border: 1px solid var(--line);
border-radius: var(--radius);
box-shadow: var(--shadow); box-shadow: var(--shadow);
padding: 18px 20px; padding: 18px 20px;
} }
.panel--attention { border-color: color-mix(in srgb, var(--amber) 50%, var(--line)); } .panel--narrow { max-width: 460px; }
.panel--offline { display: flex; gap: 14px; align-items: center; } .panel--attention { border-color: color-mix(in srgb, var(--amber) 50%, var(--line)); border-left: 3px solid var(--amber); }
.panel--offline { display: flex; gap: 14px; align-items: center; border-left: 3px solid var(--red); }
.panel--offline p { color: var(--ink-dim); font-size: 14px; } .panel--offline p { color: var(--ink-dim); font-size: 14px; }
.panel--offline h2 { font-size: 15px; }
.panel__head { .panel__head {
display: flex; align-items: baseline; justify-content: space-between; gap: 12px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
margin-bottom: 12px; flex-wrap: wrap; margin-bottom: 12px; flex-wrap: wrap;
} }
.panel__head h2 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 9px; } .panel__head h2 {
font-size: 14px; font-weight: 700;
text-transform: uppercase; letter-spacing: 0.09em;
display: flex; align-items: center; gap: 9px;
}
.panel__meta { color: var(--ink-dim); font-size: 13px; } .panel__meta { color: var(--ink-dim); font-size: 13px; }
.panel__note { color: var(--ink-dim); font-size: 13.5px; margin-top: 8px; }
.panel__inset { .panel__inset {
margin-top: 14px; padding: 16px; margin-top: 14px; padding: 16px;
background: var(--panel-inset); background: var(--panel-inset);
border: 1px solid var(--line); border: 1px solid var(--line);
border-radius: 8px;
} }
.panel__inset h3 { font-size: 14px; margin-bottom: 10px; } .panel__inset h3 { font-size: 14px; margin-bottom: 10px; }
.bays { .bays {
display: grid; gap: 18px; display: grid; gap: 18px;
grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
} }
/* Gun bay: the primary instrument. Chamfered top-right corner —
the same cut Chakra Petch makes on its letterforms. */
.bay { .bay {
background: var(--panel); background: var(--panel);
border: 1px solid var(--line); border: 1px solid var(--line);
border-radius: var(--radius); border-top: 3px solid var(--copper);
box-shadow: var(--shadow); clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
filter: var(--dropshadow);
padding: 18px 20px; padding: 18px 20px;
display: flex; flex-direction: column; gap: 10px; display: flex; flex-direction: column; gap: 10px;
border-top: 3px solid var(--copper);
} }
.bay__head { display: flex; justify-content: space-between; align-items: center; } .bay__head { display: flex; justify-content: space-between; align-items: center; }
.bay__head .lamp { margin-right: 14px; } /* clear of the chamfer */
.bay__eyebrow { .bay__eyebrow {
font-family: var(--font-mono); font-size: 11px; font: var(--label);
text-transform: uppercase; letter-spacing: 0.14em; color: var(--ink-dim); text-transform: uppercase; letter-spacing: var(--label-track); color: var(--ink-dim);
} }
.bay__title { font-size: 21px; font-weight: 700; letter-spacing: -0.01em; } .bay__title { font-size: 21px; font-weight: 700; letter-spacing: 0.01em; }
.bay__status { display: flex; align-items: center; gap: 10px; min-height: 26px; } .bay__status { display: flex; align-items: center; gap: 10px; min-height: 26px; flex-wrap: wrap; }
.bay__hint { color: var(--ink-dim); font-size: 13px; } .bay__hint { color: var(--ink-dim); font-size: 13px; }
.bay__charge { .bay__charge {
display: flex; align-items: center; justify-content: space-between; gap: 14px; display: flex; align-items: center; justify-content: space-between; gap: 14px;
padding: 12px 14px; padding: 12px 14px;
background: var(--panel-inset); background: var(--panel-inset);
border-radius: 8px; border: 1px solid var(--line);
} }
.bay__kw { display: flex; align-items: baseline; gap: 5px; } .bay__kw { display: flex; align-items: baseline; gap: 5px; }
.bay__kw-num { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; } .bay__kw-num { font-size: 28px; font-weight: 600; letter-spacing: 0.01em; font-variant-numeric: tabular-nums; }
.bay__kw-unit { .bay__kw-unit {
font-family: var(--font-mono); font-size: 11px; font: var(--label);
text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-dim); text-transform: uppercase; letter-spacing: var(--label-track); color: var(--ink-dim);
} }
/* ---------- battery gauge (SoC, red -> blue -> green) ---------- */ /* ---------- battery gauge (SoC, red -> blue -> green) ---------- */
.battery { display: flex; align-items: center; gap: 2px; } .battery { display: flex; align-items: center; gap: 2px; }
.battery__shell { .battery__shell {
display: inline-block; width: 52px; height: 22px; display: inline-block; width: 52px; height: 22px;
border: 2px solid var(--ink-dim); border-radius: 6px; border: 2px solid var(--ink-dim);
padding: 2px; background: var(--panel); padding: 2px; background: var(--panel);
} }
.battery__fill { .battery__fill {
display: block; height: 100%; border-radius: 3px; display: block; height: 100%;
min-width: 2px; min-width: 2px;
transition: width 0.6s ease, background 0.6s ease; transition: width 0.6s ease, background 0.6s ease;
} }
.battery__cap { .battery__cap {
width: 3px; height: 10px; border-radius: 0 2px 2px 0; width: 3px; height: 10px;
background: var(--ink-dim); background: var(--ink-dim);
} }
.battery__pct { font-size: 15px; font-weight: 600; margin-left: 8px; } .battery__pct { font-size: 16px; font-weight: 600; margin-left: 8px; font-variant-numeric: tabular-nums; }
.bay__telemetry { .bay__telemetry {
display: flex; flex-wrap: wrap; gap: 10px 22px; display: grid; grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
padding: 10px 12px; gap: 10px 18px;
padding: 12px 14px;
background: var(--panel-inset); background: var(--panel-inset);
border-radius: 8px; border: 1px solid var(--line);
} }
.bay__telemetry dt { .bay__telemetry dt {
font-family: var(--font-mono); font-size: 10.5px; font: var(--label); font-size: 10px;
text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-dim); text-transform: uppercase; letter-spacing: var(--label-track); color: var(--ink-dim);
} }
.bay__telemetry dd { font-weight: 600; font-size: 14px; } .bay__telemetry dd { font-weight: 600; font-size: 14px; white-space: nowrap; }
.bay__actions { display: flex; align-items: center; gap: 12px; margin-top: 2px; } .bay__actions { display: flex; align-items: center; gap: 12px; margin-top: 2px; flex-wrap: wrap; }
/* ---------- chips ---------- */ /* ---------- chips ---------- */
.chip { .chip {
display: inline-block; display: inline-block;
font-family: var(--font-mono); font-size: 11.5px; font-weight: 600; font-size: 11.5px; font-weight: 600;
text-transform: uppercase; letter-spacing: 0.07em; text-transform: uppercase; letter-spacing: 0.08em;
padding: 3px 9px; border-radius: 999px; padding: 3px 9px;
background: var(--panel-inset); color: var(--ink-dim); background: var(--panel-inset); color: var(--ink-dim);
border: 1px solid var(--line); border: 1px solid var(--line);
white-space: nowrap;
} }
.chip--live, .chip--charging { background: color-mix(in srgb, var(--live) 14%, transparent); color: var(--live); border-color: color-mix(in srgb, var(--live) 40%, transparent); } .chip--live, .chip--charging { background: color-mix(in srgb, var(--live) 14%, transparent); color: var(--live); border-color: color-mix(in srgb, var(--live) 40%, transparent); }
.chip--plugged { background: color-mix(in srgb, var(--blue) 13%, transparent); color: var(--blue); border-color: color-mix(in srgb, var(--blue) 40%, transparent); } .chip--plugged { background: color-mix(in srgb, var(--blue) 13%, transparent); color: var(--blue); border-color: color-mix(in srgb, var(--blue) 40%, transparent); }
@@ -320,49 +352,79 @@ button, input, select { font: inherit; color: inherit; }
/* ---------- buttons ---------- */ /* ---------- buttons ---------- */
.btn { .btn {
border: 1px solid transparent; border: 1px solid transparent;
border-radius: 8px; padding: 10px 18px;
padding: 9px 18px; font-size: 13px; font-weight: 600;
font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
cursor: pointer; cursor: pointer;
background: var(--panel-inset); background: var(--panel-inset);
transition: background 0.15s, border-color 0.15s, transform 0.05s; transition: background 0.15s, border-color 0.15s, transform 0.05s;
} }
.btn:active:not(:disabled) { transform: translateY(1px); } .btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: default; } .btn:disabled { opacity: 0.45; cursor: default; }
/* Solid (load-bearing) buttons carry the chamfer cut. */
.btn--primary, .btn--danger {
clip-path: polygon(0 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%);
}
.btn--primary { background: var(--copper); color: #fff; } .btn--primary { background: var(--copper); color: #fff; }
.btn--primary:hover:not(:disabled) { background: var(--copper-deep); } .btn--primary:hover:not(:disabled) { background: var(--copper-deep); }
.btn--danger { background: var(--red); color: #fff; } .btn--danger { background: var(--red); color: #fff; }
.btn--danger:hover:not(:disabled) { background: color-mix(in srgb, var(--red) 85%, black); } .btn--danger:hover:not(:disabled) { background: color-mix(in srgb, var(--red) 85%, black); }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--ink); } .btn--ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn--ghost:hover:not(:disabled) { background: var(--panel-inset); } .btn--ghost:hover:not(:disabled) { background: var(--panel-inset); border-color: var(--ink-dim); }
.btn--sm { padding: 5px 12px; font-size: 13.5px; } .btn--sm { padding: 6px 12px; font-size: 12px; }
.btn--block { width: 100%; } .btn--block { width: 100%; }
.btn--dangertext { color: var(--red); } .btn--dangertext { color: var(--red); }
/* ---------- forms ---------- */ /* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 5px; } .field { display: flex; flex-direction: column; gap: 5px; }
.field > span, .field__label { .field > span, .field__label {
font-family: var(--font-mono); font-size: 11px; font: var(--label);
text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-dim); text-transform: uppercase; letter-spacing: var(--label-track); color: var(--ink-dim);
} }
.field input, .field select { .field input, .field select {
background: var(--paper); background: var(--paper);
border: 1px solid var(--line); border: 1px solid var(--line);
border-radius: 8px; padding: 10px 12px;
padding: 9px 12px;
width: 100%; width: 100%;
} }
.field input:focus, .field select:focus { border-color: var(--copper); outline: none; } .field input:focus, .field select:focus { border-color: var(--copper); outline: none; }
.field-error { color: var(--red); font-size: 13.5px; } .field-error { color: var(--red); font-size: 13.5px; }
.formrow { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 12px; } .formrow { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); margin-bottom: 12px; }
/* Slide switch, squared like everything else — a slider on the panel face. */
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; cursor: pointer; }
.switch__label { font-weight: 500; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track {
width: 42px; height: 22px; flex: none;
border: 1px solid var(--line);
background: var(--panel-inset);
padding: 2px;
display: inline-flex;
transition: background 0.15s, border-color 0.15s;
}
.switch__thumb {
width: 16px; height: 16px;
background: var(--ink-dim);
transition: transform 0.15s, background 0.15s;
}
.switch input:checked + .switch__track {
background: color-mix(in srgb, var(--copper) 15%, transparent);
border-color: var(--copper);
}
.switch input:checked + .switch__track .switch__thumb {
transform: translateX(20px);
background: var(--copper);
}
.switch input:focus-visible + .switch__track { outline: 2px solid var(--copper); outline-offset: 2px; }
.check { display: flex; align-items: center; gap: 9px; padding: 4px 0; cursor: pointer; } .check { display: flex; align-items: center; gap: 9px; padding: 4px 0; cursor: pointer; }
.check input { accent-color: var(--copper); width: 16px; height: 16px; } .check input { accent-color: var(--copper); width: 16px; height: 16px; flex: none; }
.check--strong { font-weight: 600; } .check--strong { font-weight: 600; }
.cardform { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; } .cardform { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.cardform__actions { display: flex; gap: 10px; } .cardform__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.gunpicker, .matrix { display: flex; flex-direction: column; gap: 6px; } .gunpicker, .matrix { display: flex; flex-direction: column; gap: 6px; }
@@ -375,18 +437,19 @@ button, input, select { font: inherit; color: inherit; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; } .table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { .table th {
text-align: left; padding: 8px 10px; text-align: left; padding: 8px 10px;
font-family: var(--font-mono); font-size: 10.5px; font: var(--label); font-size: 10.5px;
text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-dim); text-transform: uppercase; letter-spacing: var(--label-track); color: var(--ink-dim);
border-bottom: 1px solid var(--line); border-bottom: 1px solid var(--line);
} }
.table th.num { text-align: right; } .table th.num { text-align: right; }
.table td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; } .table td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; } .table tr:last-child td { border-bottom: none; }
.table .btn + .btn { margin-left: 8px; }
.relay-list, .pending-list { list-style: none; padding: 0; display: flex; flex-direction: column; } .relay-list, .pending-list { list-style: none; padding: 0; display: flex; flex-direction: column; }
.relay { .relay {
display: flex; align-items: center; gap: 12px; display: flex; align-items: center; gap: 12px;
padding: 10px 2px; border-bottom: 1px solid var(--line); padding: 12px 2px; border-bottom: 1px solid var(--line);
} }
.relay:last-child { border-bottom: none; } .relay:last-child { border-bottom: none; }
.relay__label { font-weight: 600; flex: 1; min-width: 0; } .relay__label { font-weight: 600; flex: 1; min-width: 0; }
@@ -406,15 +469,56 @@ button, input, select { font: inherit; color: inherit; }
} }
.toast { .toast {
background: var(--ink); color: var(--paper); background: var(--ink); color: var(--paper);
border-radius: 9px; padding: 11px 16px; border-left: 3px solid var(--copper);
padding: 11px 16px;
font-size: 14px; box-shadow: var(--shadow); font-size: 14px; box-shadow: var(--shadow);
} }
.toast--error { background: var(--red); color: #fff; } .toast--error { background: var(--red); border-left-color: color-mix(in srgb, var(--red) 55%, black); color: #fff; }
/* ---------- responsive ---------- */ /* ---------- responsive: the phone is the primary panel ---------- */
@media (max-width: 640px) { @media (max-width: 640px) {
.topbar { flex-wrap: wrap; row-gap: 6px; } .topbar { min-height: 50px; }
.nav { order: 3; width: 100%; } .brand__mark { width: 24px; height: 24px; }
.bay__telemetry { flex-wrap: wrap; gap: 12px 20px; }
.content { padding-top: 14px; } /* Nav becomes a fixed bottom tab bar — thumb reach beats a crammed topbar. */
.nav {
position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
background: var(--panel);
border-top: 1px solid var(--line);
padding: 0 max(4px, env(safe-area-inset-left)) env(safe-area-inset-bottom) max(4px, env(safe-area-inset-right));
overflow-x: visible;
}
.nav__link {
flex: 1; justify-content: center;
padding: 14px 4px;
font-size: 12px;
box-shadow: inset 0 2px 0 transparent; /* accent flips to the top edge */
}
.nav__link.active { box-shadow: inset 0 2px 0 var(--copper); background: var(--panel-inset); }
.content { padding-top: 14px; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.toasts { bottom: calc(64px + env(safe-area-inset-bottom)); }
/* Bigger touch targets */
.btn { padding: 12px 18px; }
.btn--sm { padding: 9px 14px; }
/* Tables collapse into labeled stacked rows — no sideways scrolling. */
.table thead { display: none; }
.table, .table tbody { display: block; }
.table tr { display: block; border-bottom: 1px solid var(--line); padding: 10px 0; }
.table tr:last-child { border-bottom: none; }
.table td {
display: flex; justify-content: space-between; align-items: center; gap: 12px;
border: none; padding: 3px 0;
}
.table td.num { text-align: left; }
.table td[data-label]::before {
content: attr(data-label);
font: var(--label); font-size: 10.5px;
text-transform: uppercase; letter-spacing: var(--label-track);
color: var(--ink-dim);
flex: none;
}
.table td.table__actions { justify-content: flex-end; padding-top: 8px; }
} }