Files
colony/colony/core/roles/webview/static/style.css
T
2026-09-26 18:13:02 +02:00

258 lines
14 KiB
CSS

:root {
--bg: #f4f5f7;
--card: #ffffff;
--text: #1c2430;
--muted: #6b7686;
--line: #d3d9e1;
--down: #98a2b3;
--track: #dde2ea;
--panel: rgba(255, 255, 255, 0.92);
--warn: #c67a08;
--crit: #d64545;
--n0: #2f6fdb;
--n1: #0e8a8a;
--n2: #7a4fd0;
--n3: #c03a8e;
--n4: #9a6510;
--n5: #4b8a2c;
}
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) {
color-scheme: dark;
--bg: #12161c;
--card: #1b2129;
--text: #e6eaf0;
--muted: #93a0b3;
--line: #313a47;
--down: #6b7686;
--track: #2a3340;
--panel: rgba(27, 33, 41, 0.92);
--warn: #ffb04a;
--crit: #ff6b6b;
--n0: #6c9cff;
--n1: #3cc7c7;
--n2: #ab8cff;
--n3: #ff7cc8;
--n4: #e0b04a;
--n5: #8fd06a;
}
}
:root[data-theme="dark"] {
color-scheme: dark;
--bg: #12161c;
--card: #1b2129;
--text: #e6eaf0;
--muted: #93a0b3;
--line: #313a47;
--down: #6b7686;
--track: #2a3340;
--panel: rgba(27, 33, 41, 0.92);
--warn: #ffb04a;
--crit: #ff6b6b;
--n0: #6c9cff;
--n1: #3cc7c7;
--n2: #ab8cff;
--n3: #ff7cc8;
--n4: #e0b04a;
--n5: #8fd06a;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
height: 100dvh;
background: var(--bg);
color: var(--text);
font: 15px/1.45 system-ui, sans-serif;
}
[hidden] { display: none !important; }
::selection { background: color-mix(in srgb, var(--n0) 35%, transparent); }
header { padding: 0 16px 6px; }
h1 { margin: 10px 0 0; font-size: 22px; }
.headline { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 14px; }
p { margin: 4px 0; }
.summary { color: var(--muted); }
.muted { color: var(--muted); font-size: 13px; }
.error { color: var(--crit); font-weight: 600; }
.alerts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.alerts:empty { display: none; }
.alert { padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; border: 1.5px solid; }
.alert.bad { color: var(--crit); border-color: var(--crit); }
.alert.warn { color: var(--warn); border-color: var(--warn); }
.alert.info { color: var(--muted); border-color: var(--line); }
.route-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 10px 0 0; font-size: 14px; }
.route-line:empty { display: none; }
.route-line .hint { font-size: 12.5px; }
.route { padding: 1px 9px; border-radius: 999px; border: 1.5px solid var(--line); font-size: 13px; font-weight: 600; }
.route.direct { border-color: var(--muted); }
.route.via { border-color: var(--net); background: color-mix(in srgb, var(--net) 16%, transparent); }
.route.none { border-color: var(--muted); border-style: dashed; color: var(--muted); }
.route.unknown { color: var(--muted); border-style: dashed; }
#stage { position: relative; flex: 1; min-height: 260px; overflow: hidden; border-top: 1px solid var(--line); background: var(--bg); }
#map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
#map:active { cursor: grabbing; }
#map:focus { outline: none; }
#world { transform-origin: 0 0; }
.n0 { --net: var(--n0); }
.n1 { --net: var(--n1); }
.n2 { --net: var(--n2); }
.n3 { --net: var(--n3); }
.n4 { --net: var(--n4); }
.n5 { --net: var(--n5); }
.region { transition: opacity 0.2s; }
.region-box { fill: color-mix(in srgb, var(--net) 9%, var(--bg)); stroke: var(--net); stroke-width: 2; vector-effect: non-scaling-stroke; }
.region.selected .region-box { stroke-width: 3.5; }
.region.dim { opacity: 0.4; }
.region-grab { fill: transparent; cursor: move; }
.region-dot { fill: var(--net); pointer-events: none; }
.region-title { fill: var(--text); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; pointer-events: none; }
.region-count { fill: var(--muted); font-size: 11.5px; font-weight: 400; }
.spoke { fill: none; stroke: var(--net); stroke-width: 2.5; opacity: 0.45; vector-effect: non-scaling-stroke; }
.spoke.hidden { opacity: 0; }
.spoke.lit { opacity: 0.95; stroke-width: 3.5; }
.spoke-end { fill: var(--net); opacity: 0.6; }
.spoke-end.used { opacity: 1; }
.flow { fill: none; stroke: var(--net); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; pointer-events: none; }
.arrow path { fill: var(--net); }
.node { cursor: pointer; outline: none; }
.disc { fill: var(--card); stroke: var(--net); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.dot { fill: var(--net); }
.halo { fill: none; stroke: none; }
.node.down { opacity: 0.65; }
.node.down .disc { stroke-dasharray: 4 3; }
.node.down .dot { fill: var(--down); }
.node.gateway .disc { stroke-width: 4; }
/* The door on the network's edge and its link to the gateway node inside. */
.port { fill: var(--card); stroke: var(--net); stroke-width: 3.5; vector-effect: non-scaling-stroke; pointer-events: none; }
.port-link { stroke: var(--net); stroke-width: 3; stroke-linecap: round; vector-effect: non-scaling-stroke; pointer-events: none; }
.foot-rule { stroke: color-mix(in srgb, var(--net) 40%, transparent); stroke-width: 1; vector-effect: non-scaling-stroke; }
.foot .st-text { font-weight: 600; }
.node.none .halo, .node.unknown .halo { stroke: var(--muted); stroke-width: 2; stroke-dasharray: 4 3; }
.node.reached .halo { stroke: var(--net); stroke-width: 2; }
.node:hover .halo { stroke: var(--muted); stroke-dasharray: none; }
.node.origin .halo, .node.selected .halo { stroke: var(--text); stroke-width: 2.5; stroke-dasharray: none; }
.node:focus-visible .halo { stroke: var(--text); stroke-width: 3.5; stroke-dasharray: none; }
.node.dragging { cursor: grabbing; opacity: 0.85; }
.node.dim { opacity: 0.35; }
.l-name, .l-roles, .l-caption { paint-order: stroke; stroke: color-mix(in srgb, var(--net) 9%, var(--bg)); stroke-width: 3px; stroke-linejoin: round; pointer-events: none; }
.l-name { fill: var(--text); font-size: 13px; font-weight: 600; }
.l-roles { fill: var(--muted); font-size: 11px; }
.l-caption { fill: var(--net); font-size: 11px; font-weight: 600; }
.st-text, .st-foot { paint-order: stroke; stroke: color-mix(in srgb, var(--net) 9%, var(--bg)); stroke-width: 3px; stroke-linejoin: round; pointer-events: none; font-size: 11px; font-variant-numeric: tabular-nums; }
.st-name { fill: var(--muted); }
.st-value { fill: var(--text); }
.st-foot { fill: var(--muted); }
.st-track { fill: color-mix(in srgb, var(--text) 13%, transparent); }
.st-fill { fill: var(--net); }
.st-fill.warn { fill: var(--warn); }
.st-fill.crit { fill: var(--crit); }
.node.none .l-caption, .node.unknown .l-caption { fill: var(--muted); }
/* Level of detail: one class on the root, decided by the zoom. */
.lod0 .l-name, .lod0 .l-roles, .lod0 .l-caption { display: none; }
.lod0 .region-title { font-size: 38px; }
.lod0 .region-count { font-size: 24px; }
.lod0 .region-dot { r: 12px; }
.lod1 .l-roles { display: none; }
.lod0 .stats { display: none; }
.lod1 .st-text, .lod1 .st-foot { display: none; }
.lod0 .node.full .l-name, .lod0 .node.full .l-roles, .lod0 .node.full .l-caption, .lod1 .node.full .l-roles { display: inline; }
.lod0 .node.full .stats { display: inline; }
.lod1 .node.full .st-text, .lod1 .node.full .st-foot { display: inline; }
.lod0 .l-caption { display: none; }
.flow { stroke-dasharray: none; }
@media (prefers-reduced-motion: no-preference) {
.flow { stroke-dasharray: 9 7; animation: flow 0.9s linear infinite; }
.node { transition: transform 0.25s ease-out; }
.node.dragging { transition: none; }
.region { transition: opacity 0.2s, transform 0.25s ease-out; }
}
@keyframes flow { to { stroke-dashoffset: -16; } }
.controls { position: absolute; right: 12px; bottom: 12px; display: flex; gap: 6px; align-items: center; }
.controls button, .legend-open, .legend > button { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); font: inherit; cursor: pointer; }
.controls button.text { padding: 0 12px; font-size: 13px; }
.controls button:hover, .legend-open:hover, .legend > button:hover { border-color: var(--muted); }
.controls button:focus-visible, .legend-open:focus-visible, .legend > button:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.controls button.on svg { stroke: var(--n0); }
.controls svg, .legend > button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (pointer: coarse) { .controls button, .legend-open, .legend > button { min-width: 44px; height: 44px; } }
.legend { position: absolute; left: 12px; bottom: 12px; max-width: min(360px, calc(100% - 24px)); padding: 10px 12px 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); font-size: 12.5px; color: var(--muted); }
.legend > button { position: absolute; top: 4px; right: 4px; min-width: 28px; height: 28px; border: 0; background: transparent; }
.legend ul { list-style: none; margin: 0 24px 6px 0; padding: 0; display: grid; gap: 3px; }
.legend p { margin: 0; }
.legend-open { position: absolute; left: 12px; bottom: 12px; font-weight: 700; }
.stamp { position: absolute; left: 14px; top: 8px; margin: 0; pointer-events: none; }
.swatch { display: inline-block; width: 11px; height: 11px; margin-right: 8px; border-radius: 50%; vertical-align: -1px; }
.swatch.network { border-radius: 4px; background: color-mix(in srgb, var(--n0) 14%, transparent); border: 2px solid var(--n0); }
.swatch.node { background: var(--card); border: 2.5px solid var(--n1); }
.swatch.gateway { width: 14px; height: 14px; border-radius: 4px; background: var(--card); border: 4px solid var(--n2); vertical-align: -2px; }
.swatch.flow { width: 20px; height: 0; border-radius: 0; border: 0; border-top: 3.5px dashed var(--text); vertical-align: 3px; }
.swatch.none { background: transparent; border: 2px dashed var(--muted); }
.chat { position: absolute; top: 12px; right: 12px; bottom: 12px; width: min(340px, calc(100% - 24px)); display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; background: var(--card); box-shadow: 0 6px 24px color-mix(in srgb, var(--text) 12%, transparent); }
.chat-head { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 14px; border-bottom: 1px solid var(--line); }
.chat-head h2 { flex: 1; margin: 0; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-head button { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--text); cursor: pointer; }
.chat-head button:hover { background: color-mix(in srgb, var(--text) 8%, transparent); }
.chat-head svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.chat-status { margin: 0; padding: 8px 14px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.chat-log { flex: 1; min-height: 0; overflow-y: auto; margin: 0; padding: 12px; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.chat-log:focus-visible { outline: 2px solid var(--text); outline-offset: -2px; }
.chat-empty { margin: 0; padding: 0 14px 12px; text-align: center; }
.chat-error { margin: 0; padding: 6px 14px; font-size: 13px; }
.msg { max-width: 85%; padding: 6px 10px; border-radius: 12px; overflow-wrap: anywhere; }
.msg.in { align-self: flex-start; background: var(--bg); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.out { align-self: flex-end; background: color-mix(in srgb, var(--n0) 16%, var(--card)); border: 1px solid color-mix(in srgb, var(--n0) 40%, transparent); border-bottom-right-radius: 4px; }
.msg-text { margin: 0; white-space: pre-wrap; }
.msg-time { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.msg.out .msg-time { text-align: right; }
.chat-form { display: flex; gap: 6px; padding: 10px; border-top: 1px solid var(--line); }
.chat-form input { flex: 1; min-width: 0; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); font: inherit; }
.chat-form input:focus-visible { outline: 2px solid var(--n0); outline-offset: 0; border-color: transparent; }
.chat-form button { height: 36px; padding: 0 14px; border: 0; border-radius: 8px; background: var(--n0); color: var(--card); font: inherit; font-weight: 600; cursor: pointer; }
.chat-form button:disabled, .chat-form input:disabled { opacity: 0.6; cursor: default; }
.chat-form button:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
#stage.chatting .controls { right: 364px; }
@media (pointer: coarse) { .chat-form input, .chat-form button, .chat-head button { min-height: 44px; } .chat-head button { min-width: 44px; } }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* Phones: the desktop sizes are small on a 400px screen, so the page text and touch targets grow. */
@media (max-width: 600px) {
body { font-size: 16px; }
header { padding: 0 12px 6px; }
h1 { font-size: 24px; }
.alert, .route, .muted, .legend { font-size: 14px; }
.legend { max-width: calc(100% - 24px); }
.legend, .legend-open { bottom: 64px; }
.chat { top: auto; left: 0; right: 0; bottom: 0; width: auto; height: min(70%, 520px); border-radius: 14px 14px 0 0; border-bottom: 0; }
#stage.chatting .controls, #stage.chatting .legend, #stage.chatting .legend-open { display: none; }
}