Compare commits
5 Commits
086b799158
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 272a6ad97d | |||
| 96ea568e53 | |||
| 9eaacf5eeb | |||
| d7264a758a | |||
| dbc4a477cb |
+1
-1
@@ -49,7 +49,7 @@ services:
|
||||
- traefik.enable=true
|
||||
- traefik.http.routers.artiot.rule=Host(`${ARTIOT_HOST:-artiot.infra.msai.al}`)
|
||||
- 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
|
||||
|
||||
volumes:
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<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="manifest" href="/manifest.json" />
|
||||
<title>Art IoT</title>
|
||||
|
||||
Generated
+5
-5
@@ -8,7 +8,7 @@
|
||||
"name": "charging-station-panel",
|
||||
"version": "1.0.0",
|
||||
"dependencies": {
|
||||
"@fontsource/archivo": "^5.1.0",
|
||||
"@fontsource/chakra-petch": "^5.1.0",
|
||||
"@fontsource/ibm-plex-mono": "^5.1.0",
|
||||
"@tanstack/react-query": "^5.62.0",
|
||||
"react": "^19.0.0",
|
||||
@@ -748,10 +748,10 @@
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@fontsource/archivo": {
|
||||
"version": "5.2.8",
|
||||
"resolved": "https://registry.npmjs.org/@fontsource/archivo/-/archivo-5.2.8.tgz",
|
||||
"integrity": "sha512-Fc4yuMt85MmcYooUVpYHAJRJTymPv2+J9HsMP2f5mxR/0pIWgE2V5XfgNTavPpklX2rJFprdT36iE6Rr8ds9MA==",
|
||||
"node_modules/@fontsource/chakra-petch": {
|
||||
"version": "5.2.7",
|
||||
"resolved": "https://registry.npmjs.org/@fontsource/chakra-petch/-/chakra-petch-5.2.7.tgz",
|
||||
"integrity": "sha512-GLbun5WZJNAEc8FtWxwcgo+4Kurqdwejvf671l+YfIjyQgPvTjyxXYP7Ffg2HAY89NGnp3oOvKQjRzfm/fBECw==",
|
||||
"license": "OFL-1.1",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ayuhito"
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"@fontsource/archivo": "^5.1.0",
|
||||
"@fontsource/chakra-petch": "^5.1.0",
|
||||
"@fontsource/ibm-plex-mono": "^5.1.0",
|
||||
"@tanstack/react-query": "^5.62.0",
|
||||
"react": "^19.0.0",
|
||||
|
||||
@@ -33,7 +33,7 @@ export default function Battery({ soc }: { soc: number | null | undefined }) {
|
||||
<span className="battery__fill" style={{ width: `${pct}%`, background: color }} />
|
||||
</span>
|
||||
<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)}%` : "—"}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -3,10 +3,11 @@ import ReactDOM from "react-dom/client";
|
||||
import { BrowserRouter } from "react-router-dom";
|
||||
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
||||
import App from "./App";
|
||||
import "@fontsource/archivo/400.css";
|
||||
import "@fontsource/archivo/500.css";
|
||||
import "@fontsource/archivo/600.css";
|
||||
import "@fontsource/archivo/700.css";
|
||||
import "@fontsource/chakra-petch/400.css";
|
||||
import "@fontsource/chakra-petch/500.css";
|
||||
import "@fontsource/chakra-petch/600.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/500.css";
|
||||
import "@fontsource/ibm-plex-mono/600.css";
|
||||
|
||||
@@ -12,12 +12,12 @@ function MyPermissions() {
|
||||
|
||||
if (isAdmin(me.scopes)) {
|
||||
return (
|
||||
<section className="panel" style={{ maxWidth: 440 }}>
|
||||
<section className="panel panel--narrow">
|
||||
<header className="panel__head">
|
||||
<h2>Your permissions</h2>
|
||||
</header>
|
||||
<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.
|
||||
</p>
|
||||
</section>
|
||||
@@ -32,12 +32,12 @@ function MyPermissions() {
|
||||
const relays = Object.values(status?.relays ?? {}).map((r) => r.label);
|
||||
|
||||
return (
|
||||
<section className="panel" style={{ maxWidth: 440 }}>
|
||||
<section className="panel panel--narrow">
|
||||
<header className="panel__head">
|
||||
<h2>Your permissions</h2>
|
||||
</header>
|
||||
{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.
|
||||
</p>
|
||||
) : (
|
||||
@@ -54,13 +54,38 @@ function MyPermissions() {
|
||||
))}
|
||||
</ul>
|
||||
)}
|
||||
<p className="dim" style={{ marginTop: 8, fontSize: 13 }}>
|
||||
<p className="panel__note">
|
||||
History shows only your own charging sessions.
|
||||
</p>
|
||||
</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() {
|
||||
const me = useApp((s) => s.me)!;
|
||||
const toast = useApp((s) => s.toast);
|
||||
@@ -91,8 +116,9 @@ export default function Account() {
|
||||
|
||||
return (
|
||||
<>
|
||||
<AppearanceSection />
|
||||
<MyPermissions />
|
||||
<section className="panel" style={{ maxWidth: 440 }}>
|
||||
<section className="panel panel--narrow">
|
||||
<header className="panel__head">
|
||||
<h2>Account</h2>
|
||||
<span className="panel__meta mono">{me.name}</span>
|
||||
|
||||
@@ -225,16 +225,16 @@ function AuthorizedSection() {
|
||||
<tbody>
|
||||
{entries.map(([tag, entry]) => (
|
||||
<tr key={tag}>
|
||||
<td className="mono">{tag}</td>
|
||||
<td className="strong">{entry.name}</td>
|
||||
<td>
|
||||
<td className="mono" data-label="Tag">{tag}</td>
|
||||
<td className="strong" data-label="Name">{entry.name}</td>
|
||||
<td data-label="Type">
|
||||
<span className={`chip chip--${entry.kind === "app" ? "app" : "card"}`}>
|
||||
{entry.kind}
|
||||
</span>
|
||||
</td>
|
||||
<td>{entry.user ?? <span className="dim">unassigned</span>}</td>
|
||||
<td className="dim">{entry.guns?.join(", ") ?? "all guns"}</td>
|
||||
<td className="num">
|
||||
<td data-label="Belongs to">{entry.user ?? <span className="dim">unassigned</span>}</td>
|
||||
<td className="dim" data-label="Guns">{entry.guns?.join(", ") ?? "all guns"}</td>
|
||||
<td className="num table__actions">
|
||||
<button className="btn btn--ghost btn--sm" onClick={() => setEditing(tag)}>
|
||||
Edit
|
||||
</button>
|
||||
|
||||
@@ -132,7 +132,7 @@ function GunBay({ gun, scopes }: { gun: Gun; scopes: string[] }) {
|
||||
<div className="bay__charge">
|
||||
<Battery soc={gun.tx.telemetry?.soc} />
|
||||
<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 / 1000).toFixed(1)
|
||||
: "—"}
|
||||
|
||||
@@ -66,20 +66,20 @@ export default function History() {
|
||||
<tbody>
|
||||
{sessions.map((s) => (
|
||||
<tr key={s.tx}>
|
||||
<td className="strong">{s.who || s.id_tag}</td>
|
||||
<td>
|
||||
<td className="strong" data-label="Who">{s.who || s.id_tag}</td>
|
||||
<td data-label="Via">
|
||||
<MethodChip method={s.method} />
|
||||
</td>
|
||||
<td>{gunLabel(s, status?.chargers ?? {})}</td>
|
||||
<td className="mono">{fmtTime(s.started)}</td>
|
||||
<td>
|
||||
<td data-label="Gun">{gunLabel(s, status?.chargers ?? {})}</td>
|
||||
<td className="mono" data-label="Started">{fmtTime(s.started)}</td>
|
||||
<td data-label="Duration">
|
||||
{s.ended ? (
|
||||
fmtDuration(s.started, s.ended)
|
||||
) : (
|
||||
<span className="chip chip--live">charging</span>
|
||||
)}
|
||||
</td>
|
||||
<td className="num mono strong">{fmtKwh(s.wh)}</td>
|
||||
<td className="num mono strong" data-label="kWh">{fmtKwh(s.wh)}</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
|
||||
@@ -243,7 +243,7 @@ export default function Users() {
|
||||
<tr key={u.name}>
|
||||
<td className="strong">{u.name}</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)}>
|
||||
Edit
|
||||
</button>
|
||||
|
||||
@@ -1,11 +1,29 @@
|
||||
import { create } from "zustand";
|
||||
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. */
|
||||
interface AppState {
|
||||
me: Me | null;
|
||||
authChecked: boolean; // finished the initial /api/me probe
|
||||
setMe: (me: Me | null) => void;
|
||||
theme: Theme;
|
||||
setTheme: (theme: Theme) => void;
|
||||
toasts: { id: number; text: string; tone: "info" | "error" }[];
|
||||
toast: (text: string, tone?: "info" | "error") => void;
|
||||
dismissToast: (id: number) => void;
|
||||
@@ -17,6 +35,12 @@ export const useApp = create<AppState>((set) => ({
|
||||
me: null,
|
||||
authChecked: false,
|
||||
setMe: (me) => set({ me, authChecked: true }),
|
||||
theme: initialTheme,
|
||||
setTheme: (theme) => {
|
||||
localStorage.setItem(THEME_KEY, theme);
|
||||
applyTheme(theme);
|
||||
set({ theme });
|
||||
},
|
||||
toasts: [],
|
||||
toast: (text, tone = "info") => {
|
||||
const id = ++toastId;
|
||||
|
||||
+203
-99
@@ -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,
|
||||
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 {
|
||||
@@ -20,57 +24,63 @@
|
||||
--red: #bf3527;
|
||||
--lamp-off: #c4ccc8;
|
||||
--shadow: 0 1px 2px rgb(29 37 35 / 0.06), 0 4px 16px rgb(29 37 35 / 0.05);
|
||||
--radius: 10px;
|
||||
--font-ui: "Archivo", "Segoe UI", system-ui, sans-serif;
|
||||
--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: "Chakra Petch", "Segoe UI", system-ui, sans-serif;
|
||||
--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) {
|
||||
:root {
|
||||
--paper: #131816;
|
||||
--panel: #1b211f;
|
||||
--panel-inset: #161c1a;
|
||||
--ink: #e4e9e7;
|
||||
--ink-dim: #93a09b;
|
||||
--line: #2c3531;
|
||||
--copper: #d07a3e;
|
||||
--copper-deep: #b25c28;
|
||||
--live: #2fae7c;
|
||||
--blue: #4f8ee8;
|
||||
--amber: #d99a1b;
|
||||
--red: #d8503f;
|
||||
--lamp-off: #39433f;
|
||||
--shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 4px 18px rgb(0 0 0 / 0.35);
|
||||
}
|
||||
/* Dark is opt-in via the Account switch (persisted in localStorage);
|
||||
light is the default regardless of the OS preference. */
|
||||
:root[data-theme="dark"] {
|
||||
--paper: #131816;
|
||||
--panel: #1b211f;
|
||||
--panel-inset: #161c1a;
|
||||
--ink: #e4e9e7;
|
||||
--ink-dim: #93a09b;
|
||||
--line: #2c3531;
|
||||
--copper: #d07a3e;
|
||||
--copper-deep: #b25c28;
|
||||
--live: #2fae7c;
|
||||
--blue: #4f8ee8;
|
||||
--amber: #d99a1b;
|
||||
--red: #d8503f;
|
||||
--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; }
|
||||
|
||||
html { color-scheme: light dark; }
|
||||
html { color-scheme: light; }
|
||||
html[data-theme="dark"] { color-scheme: dark; }
|
||||
|
||||
body {
|
||||
background: var(--paper);
|
||||
color: var(--ink);
|
||||
font-family: var(--font-ui);
|
||||
font-size: 15.5px;
|
||||
font-size: 15px;
|
||||
line-height: 1.5;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
|
||||
button, input, select { font: inherit; color: inherit; }
|
||||
button, input, select { font: inherit; color: inherit; border-radius: 0; }
|
||||
|
||||
:focus-visible {
|
||||
outline: 2px solid var(--copper);
|
||||
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; }
|
||||
.dim { color: var(--ink-dim); }
|
||||
.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 {
|
||||
display: inline-block;
|
||||
width: 11px; height: 11px;
|
||||
@@ -116,45 +126,53 @@ button, input, select { font: inherit; color: inherit; }
|
||||
.shell { min-height: 100dvh; display: flex; flex-direction: column; }
|
||||
|
||||
.topbar {
|
||||
display: flex; align-items: center; gap: 20px;
|
||||
padding: 10px clamp(14px, 4vw, 32px);
|
||||
display: flex; align-items: stretch; gap: 18px;
|
||||
min-height: 54px;
|
||||
padding: 0 clamp(14px, 4vw, 32px);
|
||||
background: var(--panel);
|
||||
border-bottom: 1px solid var(--line);
|
||||
position: sticky; top: 0; z-index: 10;
|
||||
}
|
||||
|
||||
.brand { display: flex; align-items: center; gap: 10px; }
|
||||
.brand__mark { width: 30px; height: 30px; }
|
||||
.brand { display: flex; align-items: center; gap: 10px; align-self: center; }
|
||||
.brand__mark { width: 28px; height: 28px; }
|
||||
.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 {
|
||||
display: block; font-family: var(--font-mono); font-size: 10.5px;
|
||||
text-transform: uppercase; letter-spacing: 0.14em; color: var(--ink-dim);
|
||||
display: block; font: var(--label); font-size: 10px;
|
||||
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 {
|
||||
display: inline-flex; align-items: center; gap: 7px;
|
||||
padding: 7px 13px;
|
||||
border-radius: 8px;
|
||||
padding: 0 14px;
|
||||
color: var(--ink-dim);
|
||||
text-decoration: none;
|
||||
font-weight: 500;
|
||||
font-size: 13px; font-weight: 600;
|
||||
text-transform: uppercase; letter-spacing: 0.07em;
|
||||
white-space: nowrap;
|
||||
box-shadow: inset 0 -2px 0 transparent;
|
||||
}
|
||||
.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 {
|
||||
background: var(--amber); color: #fff;
|
||||
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 {
|
||||
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.active { color: var(--copper-deep); }
|
||||
@@ -164,8 +182,8 @@ button, input, select { font: inherit; color: inherit; }
|
||||
margin: 14px clamp(14px, 4vw, 32px) 0;
|
||||
padding: 11px 16px;
|
||||
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));
|
||||
border-radius: var(--radius);
|
||||
color: var(--ink);
|
||||
text-decoration: none;
|
||||
font-weight: 500;
|
||||
@@ -196,119 +214,133 @@ button, input, select { font: inherit; color: inherit; }
|
||||
width: min(380px, 100%);
|
||||
background: var(--panel);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 14px;
|
||||
box-shadow: var(--shadow);
|
||||
border-top: 3px solid var(--copper);
|
||||
clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%);
|
||||
filter: var(--dropshadow);
|
||||
padding: 30px 28px;
|
||||
display: flex; flex-direction: column; gap: 14px;
|
||||
}
|
||||
.login__head { text-align: center; margin-bottom: 6px; }
|
||||
.login__mark { width: 44px; height: 44px; margin-bottom: 10px; }
|
||||
.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; }
|
||||
|
||||
/* ---------- panels & bays ---------- */
|
||||
.panel {
|
||||
background: var(--panel);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: var(--radius);
|
||||
box-shadow: var(--shadow);
|
||||
padding: 18px 20px;
|
||||
}
|
||||
.panel--attention { border-color: color-mix(in srgb, var(--amber) 50%, var(--line)); }
|
||||
.panel--offline { display: flex; gap: 14px; align-items: center; }
|
||||
.panel--narrow { max-width: 460px; }
|
||||
.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 h2 { font-size: 15px; }
|
||||
|
||||
.panel__head {
|
||||
display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
|
||||
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__note { color: var(--ink-dim); font-size: 13.5px; margin-top: 8px; }
|
||||
.panel__inset {
|
||||
margin-top: 14px; padding: 16px;
|
||||
background: var(--panel-inset);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 8px;
|
||||
}
|
||||
.panel__inset h3 { font-size: 14px; margin-bottom: 10px; }
|
||||
|
||||
.bays {
|
||||
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 {
|
||||
background: var(--panel);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: var(--radius);
|
||||
box-shadow: var(--shadow);
|
||||
border-top: 3px solid var(--copper);
|
||||
clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
|
||||
filter: var(--dropshadow);
|
||||
padding: 18px 20px;
|
||||
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 .lamp { margin-right: 14px; } /* clear of the chamfer */
|
||||
.bay__eyebrow {
|
||||
font-family: var(--font-mono); font-size: 11px;
|
||||
text-transform: uppercase; letter-spacing: 0.14em; color: var(--ink-dim);
|
||||
font: var(--label);
|
||||
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__status { display: flex; align-items: center; gap: 10px; min-height: 26px; }
|
||||
.bay__title { font-size: 21px; font-weight: 700; letter-spacing: 0.01em; }
|
||||
.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__charge {
|
||||
display: flex; align-items: center; justify-content: space-between; gap: 14px;
|
||||
padding: 12px 14px;
|
||||
background: var(--panel-inset);
|
||||
border-radius: 8px;
|
||||
border: 1px solid var(--line);
|
||||
}
|
||||
.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 {
|
||||
font-family: var(--font-mono); font-size: 11px;
|
||||
text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-dim);
|
||||
font: var(--label);
|
||||
text-transform: uppercase; letter-spacing: var(--label-track); color: var(--ink-dim);
|
||||
}
|
||||
|
||||
/* ---------- battery gauge (SoC, red -> blue -> green) ---------- */
|
||||
.battery { display: flex; align-items: center; gap: 2px; }
|
||||
.battery__shell {
|
||||
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);
|
||||
}
|
||||
.battery__fill {
|
||||
display: block; height: 100%; border-radius: 3px;
|
||||
display: block; height: 100%;
|
||||
min-width: 2px;
|
||||
transition: width 0.6s ease, background 0.6s ease;
|
||||
}
|
||||
.battery__cap {
|
||||
width: 3px; height: 10px; border-radius: 0 2px 2px 0;
|
||||
width: 3px; height: 10px;
|
||||
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 {
|
||||
display: flex; flex-wrap: wrap; gap: 10px 22px;
|
||||
padding: 10px 12px;
|
||||
display: grid; grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
|
||||
gap: 10px 18px;
|
||||
padding: 12px 14px;
|
||||
background: var(--panel-inset);
|
||||
border-radius: 8px;
|
||||
border: 1px solid var(--line);
|
||||
}
|
||||
.bay__telemetry dt {
|
||||
font-family: var(--font-mono); font-size: 10.5px;
|
||||
text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-dim);
|
||||
font: var(--label); font-size: 10px;
|
||||
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 ---------- */
|
||||
.chip {
|
||||
display: inline-block;
|
||||
font-family: var(--font-mono); font-size: 11.5px; font-weight: 600;
|
||||
text-transform: uppercase; letter-spacing: 0.07em;
|
||||
padding: 3px 9px; border-radius: 999px;
|
||||
font-size: 11.5px; font-weight: 600;
|
||||
text-transform: uppercase; letter-spacing: 0.08em;
|
||||
padding: 3px 9px;
|
||||
background: var(--panel-inset); color: var(--ink-dim);
|
||||
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--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 ---------- */
|
||||
.btn {
|
||||
border: 1px solid transparent;
|
||||
border-radius: 8px;
|
||||
padding: 9px 18px;
|
||||
font-weight: 600;
|
||||
padding: 10px 18px;
|
||||
font-size: 13px; font-weight: 600;
|
||||
text-transform: uppercase; letter-spacing: 0.06em;
|
||||
cursor: pointer;
|
||||
background: var(--panel-inset);
|
||||
transition: background 0.15s, border-color 0.15s, transform 0.05s;
|
||||
}
|
||||
.btn:active:not(:disabled) { transform: translateY(1px); }
|
||||
.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:hover:not(:disabled) { background: var(--copper-deep); }
|
||||
.btn--danger { background: var(--red); color: #fff; }
|
||||
.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:hover:not(:disabled) { background: var(--panel-inset); }
|
||||
.btn--sm { padding: 5px 12px; font-size: 13.5px; }
|
||||
.btn--ghost:hover:not(:disabled) { background: var(--panel-inset); border-color: var(--ink-dim); }
|
||||
.btn--sm { padding: 6px 12px; font-size: 12px; }
|
||||
.btn--block { width: 100%; }
|
||||
.btn--dangertext { color: var(--red); }
|
||||
|
||||
/* ---------- forms ---------- */
|
||||
.field { display: flex; flex-direction: column; gap: 5px; }
|
||||
.field > span, .field__label {
|
||||
font-family: var(--font-mono); font-size: 11px;
|
||||
text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-dim);
|
||||
font: var(--label);
|
||||
text-transform: uppercase; letter-spacing: var(--label-track); color: var(--ink-dim);
|
||||
}
|
||||
.field input, .field select {
|
||||
background: var(--paper);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 8px;
|
||||
padding: 9px 12px;
|
||||
padding: 10px 12px;
|
||||
width: 100%;
|
||||
}
|
||||
.field input:focus, .field select:focus { border-color: var(--copper); outline: none; }
|
||||
.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 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; }
|
||||
|
||||
.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; }
|
||||
|
||||
@@ -375,18 +437,19 @@ button, input, select { font: inherit; color: inherit; }
|
||||
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
|
||||
.table th {
|
||||
text-align: left; padding: 8px 10px;
|
||||
font-family: var(--font-mono); font-size: 10.5px;
|
||||
text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-dim);
|
||||
font: var(--label); font-size: 10.5px;
|
||||
text-transform: uppercase; letter-spacing: var(--label-track); color: var(--ink-dim);
|
||||
border-bottom: 1px solid var(--line);
|
||||
}
|
||||
.table th.num { text-align: right; }
|
||||
.table td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
|
||||
.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 {
|
||||
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__label { font-weight: 600; flex: 1; min-width: 0; }
|
||||
@@ -406,15 +469,56 @@ button, input, select { font: inherit; color: inherit; }
|
||||
}
|
||||
.toast {
|
||||
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);
|
||||
}
|
||||
.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) {
|
||||
.topbar { flex-wrap: wrap; row-gap: 6px; }
|
||||
.nav { order: 3; width: 100%; }
|
||||
.bay__telemetry { flex-wrap: wrap; gap: 12px 20px; }
|
||||
.content { padding-top: 14px; }
|
||||
.topbar { min-height: 50px; }
|
||||
.brand__mark { width: 24px; height: 24px; }
|
||||
|
||||
/* 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; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user