Perk-a-cola redesign + surface RCON map/gametype/roster/health

Themes the fleet manager around the Electric Cherry perk-a-cola from Mob of
the Dead — cherry-red art-deco label with electric cyan discharge. New
design tokens (Alfa Slab One + Inter + JetBrains Mono, self-hosted), full
redesign of layout/dashboard/cards/detail page, tokens pass on
deployments/betas/pipeline/beta/diff, cherry+lightning favicon.

Lights up server data that RCON was already fetching but the UI dropped.
parsePlayerRoster() extracts num/score/ping/guid/name from both status
dialects. Worker persists last_map/last_gametype/last_roster/last_seen_at/
last_error (new columns with idempotent boot-time ALTERs) and emits them
over SSE. Fleet cards now show health dot, map · gametype, top-3 roster
preview, and last-seen. Detail page adds a sortable full roster with
distinct empty-lobby vs offline states. New health classifier
(online/stale/offline) drives the visual state.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-09-12 08:20:54 -04:00
co-authored by Claude Opus 4.7
parent 854f5532a9
commit 9bff47a9a4
29 changed files with 1636 additions and 356 deletions
+117 -47
View File
@@ -111,7 +111,7 @@
<div class="row"><span class="k">servers</span> {b.servers.join(', ')}</div>
<div class="actions">
<button onclick={() => act(b.slug, 'update')}>update</button>
<button onclick={() => act(b.slug, 'promote')}>promote</button>
<button class="primary" onclick={() => act(b.slug, 'promote')}>promote</button>
<button class="danger" onclick={() => act(b.slug, 'rollback')}>rollback</button>
</div>
</div>
@@ -125,77 +125,147 @@
<style>
.panel {
background: #141414;
border: 1px solid #333;
border-radius: 6px;
padding: 16px;
background: var(--cherry-925);
border: 1px solid var(--cherry-700);
border-radius: var(--r-md);
padding: 20px 22px;
}
h3 {
margin: 0 0 8px;
font-size: 13px;
margin: 0 0 10px;
font-family: var(--font-body);
font-size: 11px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.5px;
color: #aaa;
letter-spacing: 1.5px;
color: var(--ink-300);
}
h3:not(:first-of-type) { margin-top: 20px; }
.empty { color: #666; font-size: 13px; margin: 0; }
.staged { list-style: none; padding: 0; margin: 0 0 12px; }
h3:not(:first-of-type) { margin-top: 24px; }
.empty {
color: var(--ink-500);
font-family: var(--font-mono);
font-size: 12px;
margin: 0;
}
.staged { list-style: none; padding: 0; margin: 0 0 14px; }
.staged li {
display: flex;
justify-content: space-between;
padding: 4px 0;
border-bottom: 1px solid #222;
align-items: center;
padding: 6px 0;
border-bottom: 1px solid var(--cherry-700);
}
.staged code {
color: var(--cream);
font-family: var(--font-mono);
font-size: 12px;
}
.staged code { color: #ddd; font-family: ui-monospace, monospace; font-size: 13px; }
.tag {
font-size: 11px;
padding: 1px 6px;
border-radius: 3px;
font-family: var(--font-mono);
font-size: 10px;
padding: 2px 7px;
border-radius: var(--r-sm);
border: 1px solid transparent;
}
.tag.new {
background: rgba(34, 224, 255, 0.1);
border-color: rgba(34, 224, 255, 0.3);
color: var(--spark-500);
}
.tag.replaces {
background: rgba(242, 230, 200, 0.08);
border-color: rgba(242, 230, 200, 0.25);
color: var(--cream);
}
.tag.ambig {
background: rgba(255, 48, 80, 0.1);
border-color: rgba(255, 48, 80, 0.3);
color: var(--danger-500);
}
.tag.new { background: #2d4a2d; color: #a8e6a8; }
.tag.replaces { background: #2d3a4a; color: #a8c8e6; }
.tag.ambig { background: #4a2d2d; color: #ff8080; }
form {
display: flex;
gap: 6px;
margin-top: 8px;
gap: 8px;
margin-top: 10px;
}
form input {
flex: 1;
background: #000;
color: #ddd;
border: 1px solid #444;
border-radius: 3px;
padding: 6px 8px;
font-family: ui-monospace, monospace;
background: var(--cherry-975);
color: var(--ink-100);
border: 1px solid var(--cherry-700);
border-radius: var(--r-sm);
padding: 8px 10px;
font-family: var(--font-mono);
font-size: 12px;
}
form input:focus {
outline: none;
border-color: var(--spark-500);
box-shadow: var(--spark-glow);
}
button {
background: #ff3030;
color: #fff;
border: 0;
border-radius: 3px;
padding: 6px 12px;
background: var(--cherry-875);
color: var(--ink-100);
border: 1px solid var(--cherry-700);
border-radius: var(--r-sm);
padding: 8px 14px;
font-family: var(--font-body);
font-size: 12px;
font-weight: 500;
cursor: pointer;
transition: border-color 0.15s, box-shadow 0.15s;
}
button:hover:not(:disabled) {
border-color: var(--spark-500);
box-shadow: var(--spark-glow);
}
button:disabled { opacity: 0.4; cursor: default; }
button.primary {
background: linear-gradient(180deg, var(--cherry-500), var(--cherry-600));
border-color: var(--cherry-400);
color: var(--cream);
font-weight: 600;
}
button.danger {
background: var(--cherry-925);
border-color: rgba(255, 48, 80, 0.4);
color: var(--danger-500);
}
button:disabled { opacity: 0.5; cursor: default; }
button.danger { background: #7a2020; }
.beta {
padding: 8px 10px;
margin: 6px 0;
background: #1a1a1a;
border-radius: 4px;
border: 1px solid #2a2a2a;
padding: 12px 14px;
margin: 8px 0;
background: var(--cherry-875);
border-radius: var(--r-sm);
border: 1px solid var(--cherry-700);
}
.head {
display: flex;
justify-content: space-between;
margin-bottom: 4px;
align-items: baseline;
margin-bottom: 6px;
}
.head strong { color: var(--cream); font-weight: 600; }
.rev {
color: var(--ink-500);
font-size: 11px;
font-family: var(--font-mono);
}
.row {
font-size: 12px;
color: var(--ink-300);
margin: 3px 0;
}
.k {
color: var(--ink-500);
margin-right: 8px;
font-family: var(--font-mono);
font-size: 10px;
text-transform: uppercase;
letter-spacing: 0.8px;
}
.actions { display: flex; gap: 6px; margin-top: 10px; }
.flash {
color: var(--danger-500);
font-family: var(--font-mono);
font-size: 12px;
margin: 14px 0 0;
}
.rev { color: #666; font-size: 11px; }
.row { font-size: 12px; color: #bbb; margin: 2px 0; }
.k { color: #666; margin-right: 6px; font-family: ui-monospace, monospace; }
.actions { display: flex; gap: 4px; margin-top: 8px; }
.flash { color: #ff6060; font-size: 12px; margin: 12px 0 0; }
</style>
+37
View File
@@ -0,0 +1,37 @@
<script lang="ts">
interface Props {
size?: 'sm' | 'md' | 'lg';
}
let { size = 'md' }: Props = $props();
</script>
<span class="mark mark-{size}">
<svg class="bolt" viewBox="0 0 12 20" aria-hidden="true">
<path d="M7 0 L1 11 L5 11 L4 20 L11 8 L7 8 Z" />
</svg>
<span class="word">ELECTRIC CHERRY</span>
</span>
<style>
.mark {
display: inline-flex;
align-items: center;
gap: 8px;
font-family: var(--font-display);
color: var(--cream);
letter-spacing: 2px;
line-height: 1;
animation: cherry-fizz 6s ease-in-out infinite;
}
.mark-sm .word { font-size: 12px; letter-spacing: 1.5px; }
.mark-md .word { font-size: 16px; }
.mark-lg .word { font-size: 26px; letter-spacing: 3px; }
.bolt {
fill: var(--spark-500);
filter: drop-shadow(0 0 4px rgba(34, 224, 255, 0.7));
}
.mark-sm .bolt { width: 10px; height: 16px; }
.mark-md .bolt { width: 12px; height: 20px; }
.mark-lg .bolt { width: 18px; height: 30px; }
</style>
+42 -25
View File
@@ -7,9 +7,6 @@
}
let { before, after, verb, relPath }: Props = $props();
// A tiny line-by-line diff. Not LCS — just presence-based. For GSC scripts
// this reads fine; if we want proper Myers diff later, swap in `diff` npm
// package and render the same rows.
interface Row {
kind: 'ctx' | 'add' | 'del';
text: string;
@@ -24,7 +21,6 @@
const bsetBase: Row[] = blines.map((t) => ({ kind: 'add' as const, text: t }));
if (a === null) return bsetBase;
if (b === null) return asetBase;
// interleave shared-prefix / shared-suffix trimming for readability
let i = 0;
while (i < alines.length && i < blines.length && alines[i] === blines[i]) i++;
let j = 0;
@@ -55,41 +51,62 @@
<style>
.diff {
background: #0f0f0f;
border: 1px solid #333;
border-radius: 4px;
background: var(--cherry-975);
border: 1px solid var(--cherry-700);
border-radius: var(--r-sm);
margin: 8px 0;
overflow: hidden;
}
header {
display: flex;
gap: 8px;
padding: 6px 10px;
background: #1a1a1a;
border-bottom: 1px solid #333;
gap: 10px;
padding: 8px 12px;
background: var(--cherry-925);
border-bottom: 1px solid var(--cherry-700);
font-size: 12px;
align-items: center;
}
.verb {
padding: 1px 6px;
border-radius: 3px;
font-family: ui-monospace, monospace;
padding: 2px 8px;
border-radius: var(--r-sm);
font-family: var(--font-mono);
font-size: 10px;
text-transform: uppercase;
letter-spacing: 0.8px;
border: 1px solid transparent;
}
.verb-added { background: #2d4a2d; color: #a8e6a8; }
.verb-updated { background: #2d3a4a; color: #a8c8e6; }
.verb-removed { background: #4a2d2d; color: #ff8080; }
.verb-held { background: #3a2f00; color: #ffcc55; }
.path { color: #ccc; font-family: ui-monospace, monospace; }
.verb-added {
background: rgba(34, 224, 255, 0.1);
border-color: rgba(34, 224, 255, 0.3);
color: var(--spark-500);
}
.verb-updated {
background: rgba(242, 230, 200, 0.08);
border-color: rgba(242, 230, 200, 0.25);
color: var(--cream);
}
.verb-removed {
background: rgba(255, 48, 80, 0.1);
border-color: rgba(255, 48, 80, 0.3);
color: var(--danger-500);
}
.verb-held {
background: rgba(255, 176, 32, 0.1);
border-color: rgba(255, 176, 32, 0.3);
color: var(--amber-500);
}
.path { color: var(--ink-100); font-family: var(--font-mono); font-size: 12px; }
pre {
margin: 0;
padding: 8px 10px;
font-family: ui-monospace, monospace;
padding: 10px 12px;
font-family: var(--font-mono);
font-size: 12px;
line-height: 1.5;
color: #ccc;
line-height: 1.55;
color: var(--ink-300);
max-height: 500px;
overflow: auto;
}
.ln { display: block; }
.ln-add { background: rgba(45, 74, 45, 0.4); color: #a8e6a8; }
.ln-del { background: rgba(74, 45, 45, 0.4); color: #ff8080; }
.ln-add { background: rgba(34, 224, 255, 0.08); color: var(--spark-400); }
.ln-del { background: rgba(255, 48, 80, 0.08); color: #ff8a9a; }
</style>
+62 -38
View File
@@ -8,24 +8,8 @@
.slice(0, 8)
);
function stateColor(state: string): string {
switch (state) {
case 'done': return '#2d4a2d';
case 'failed': return '#4a2d2d';
case 'pending': return '#3a2f00';
case 'manual': return '#333';
default: return '#222';
}
}
function stateFg(state: string): string {
switch (state) {
case 'done': return '#a8e6a8';
case 'failed': return '#ff8080';
case 'pending': return '#ffcc55';
case 'manual': return '#aaa';
default: return '#888';
}
function stateClass(state: string): string {
return `chip chip-${state}`;
}
</script>
@@ -46,8 +30,7 @@
<div class="chips">
{#each [...dep.servers.entries()] as [srv, meta] (srv)}
<span
class="chip"
style="background:{stateColor(meta.state)};color:{stateFg(meta.state)}"
class={stateClass(meta.state)}
title={meta.error ?? (meta.players !== null ? `${meta.players}p` : meta.state)}
>
{srv}{meta.players !== null && meta.players > 0 ? ` ${meta.players}p` : ''}
@@ -62,43 +45,84 @@
<style>
.wrapper {
background: #141414;
border: 1px solid #333;
border-radius: 6px;
padding: 12px;
background: var(--cherry-925);
border: 1px solid var(--cherry-700);
border-radius: var(--r-md);
padding: 14px 16px;
}
header {
display: flex;
justify-content: space-between;
align-items: baseline;
margin-bottom: 8px;
margin-bottom: 10px;
}
h3 {
margin: 0;
font-family: var(--font-body);
font-size: 11px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 1.5px;
color: var(--ink-300);
}
.empty {
color: var(--ink-500);
font-family: var(--font-mono);
font-size: 12px;
margin: 0;
padding: 12px 0;
}
h3 { margin: 0; font-size: 14px; text-transform: uppercase; letter-spacing: 0.5px; color: #aaa; }
.empty { color: #666; font-size: 13px; margin: 0; }
.rows { display: grid; gap: 8px; }
.row {
display: block;
color: #ddd;
color: var(--ink-100);
text-decoration: none;
padding: 8px;
background: #1a1a1a;
border-radius: 4px;
border: 1px solid transparent;
padding: 10px 12px;
background: var(--cherry-875);
border-radius: var(--r-sm);
border: 1px solid var(--cherry-700);
transition: border-color 0.15s;
}
.row:hover { border-color: #444; }
.row:hover { border-color: var(--spark-500); }
.row-head {
display: flex;
justify-content: space-between;
align-items: baseline;
margin-bottom: 6px;
}
.action { font-family: ui-monospace, monospace; font-size: 13px; }
.count { color: #666; font-size: 12px; }
.action { font-family: var(--font-mono); font-size: 12px; color: var(--cream); }
.count { color: var(--ink-500); font-size: 11px; font-family: var(--font-mono); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip {
padding: 2px 6px;
border-radius: 3px;
padding: 2px 7px;
border-radius: var(--r-sm);
font-size: 11px;
font-family: ui-monospace, monospace;
font-family: var(--font-mono);
border: 1px solid transparent;
}
.chip-done {
background: rgba(34, 224, 255, 0.1);
border-color: rgba(34, 224, 255, 0.3);
color: var(--spark-500);
}
.chip-failed {
background: rgba(255, 48, 80, 0.1);
border-color: rgba(255, 48, 80, 0.3);
color: var(--danger-500);
}
.chip-pending {
background: rgba(255, 176, 32, 0.1);
border-color: rgba(255, 176, 32, 0.3);
color: var(--amber-500);
}
.chip-held {
background: rgba(242, 230, 200, 0.08);
border-color: rgba(242, 230, 200, 0.25);
color: var(--cream);
}
.chip-manual {
background: var(--cherry-925);
border-color: var(--cherry-700);
color: var(--ink-500);
}
</style>
+111
View File
@@ -0,0 +1,111 @@
<script lang="ts">
import type { RosterPlayer, Health } from '$ui/stores/servers.js';
interface Props {
roster: RosterPlayer[] | null;
health: Health;
compact?: boolean; // hide guid column, cap rows
limit?: number;
}
let { roster, health, compact = false, limit }: Props = $props();
let sorted = $derived(
(roster ?? [])
.slice()
.sort((a, b) => b.score - a.score)
.slice(0, limit ?? Infinity)
);
function pingClass(ping: number): string {
if (ping < 60) return 'ping-good';
if (ping < 150) return 'ping-ok';
return 'ping-bad';
}
</script>
{#if health === 'offline'}
<div class="state offline">server unreachable</div>
{:else if !roster || roster.length === 0}
<div class="state empty">lobby is empty</div>
{:else}
<table class="roster" class:compact>
<thead>
<tr>
{#if !compact}<th class="col-num">#</th>{/if}
<th class="col-name">player</th>
<th class="col-score">score</th>
<th class="col-ping">ping</th>
{#if !compact}<th class="col-guid">guid</th>{/if}
</tr>
</thead>
<tbody>
{#each sorted as p (p.guid ?? p.name + '-' + p.num)}
<tr>
{#if !compact}<td class="col-num mono">{p.num ?? ''}</td>{/if}
<td class="col-name">{p.name || '—'}</td>
<td class="col-score mono">{p.score}</td>
<td class="col-ping mono {pingClass(p.ping)}">{p.ping}</td>
{#if !compact}<td class="col-guid mono">{p.guid ? p.guid.slice(0, 8) + '…' : '—'}</td>{/if}
</tr>
{/each}
</tbody>
</table>
{/if}
<style>
.state {
font-family: var(--font-mono);
font-size: 12px;
padding: 10px 12px;
border-radius: var(--r-sm);
}
.state.offline {
color: var(--danger-500);
background: rgba(255, 48, 80, 0.08);
border: 1px solid rgba(255, 48, 80, 0.25);
}
.state.empty {
color: var(--ink-500);
background: var(--cherry-925);
border: 1px dashed var(--cherry-700);
}
.roster {
width: 100%;
border-collapse: separate;
border-spacing: 0;
font-family: var(--font-body);
font-size: 13px;
color: var(--ink-100);
}
.roster thead th {
text-align: left;
font-family: var(--font-body);
font-size: 10px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 1.2px;
color: var(--ink-500);
padding: 6px 10px;
border-bottom: 1px solid var(--cherry-700);
}
.roster tbody td {
padding: 8px 10px;
border-bottom: 1px solid rgba(74, 15, 30, 0.4);
}
.roster tbody tr:hover td {
background: rgba(34, 224, 255, 0.04);
}
.roster.compact tbody td { padding: 4px 8px; font-size: 12px; }
.mono { font-family: var(--font-mono); }
.col-num { width: 40px; color: var(--ink-500); }
.col-name { color: var(--cream); font-weight: 500; }
.col-score { width: 90px; color: var(--spark-500); }
.col-ping { width: 80px; }
.col-guid { width: 110px; color: var(--ink-500); }
.ping-good { color: var(--spark-400); }
.ping-ok { color: var(--cream-dim); }
.ping-bad { color: var(--amber-500); }
</style>
+226 -37
View File
@@ -1,4 +1,8 @@
<script lang="ts">
import StatusDot from './StatusDot.svelte';
import type { RosterPlayer, Health } from '$ui/stores/servers.js';
import { gametypeLabel } from '$ui/gametype.js';
interface Held {
target: string;
slug: string;
@@ -6,32 +10,89 @@
interface Props {
name: string;
players?: number | null;
map?: string | null;
gametype?: string | null;
roster?: RosterPlayer[] | null;
health?: Health;
lastSeenAt?: string | null;
lastError?: string | null;
held?: Held[];
lastRestartedAt?: string | null;
restarting?: boolean;
}
let { name, players = null, held = [], lastRestartedAt = null, restarting = false }: Props = $props();
let {
name,
players = null,
map = null,
gametype = null,
roster = null,
health = 'offline',
lastSeenAt = null,
lastError = null,
held = [],
lastRestartedAt = null,
restarting = false
}: Props = $props();
function ago(iso: string | null): string {
if (!iso) return 'never';
const d = Date.now() - new Date(iso).getTime();
if (d < 60_000) return 'just now';
if (d < 60_000) return `${Math.max(1, Math.floor(d / 1000))}s ago`;
if (d < 3_600_000) return `${Math.floor(d / 60_000)}m ago`;
if (d < 86_400_000) return `${Math.floor(d / 3_600_000)}h ago`;
return `${Math.floor(d / 86_400_000)}d ago`;
}
let topRoster = $derived(
(roster ?? [])
.slice()
.sort((a, b) => b.score - a.score)
.slice(0, 3)
);
let showRoster = $derived(health !== 'offline');
let mapLabel = $derived(map ?? '—');
let gtLabel = $derived(gametypeLabel(gametype));
</script>
<a class="card" href="/servers/{name}" class:restarting>
<a class="card" href="/servers/{name}" class:restarting class:offline={health === 'offline'}>
<div class="head">
<strong>{name}</strong>
<span class="players" class:has-players={players !== null && players > 0}>
{players ?? '—'}
</span>
<div class="name-row">
<StatusDot {health} />
<strong class="name">{name}</strong>
</div>
{#if health !== 'offline'}
<span class="players" class:has-players={players !== null && players > 0}>
{players ?? '—'}
</span>
{:else}
<span class="players offline-badge">offline</span>
{/if}
</div>
<div class="meta">
restart: {ago(lastRestartedAt)}
<span class="map">{mapLabel}</span>
{#if gtLabel}
<span class="dot-sep">·</span>
<span class="gt">{gtLabel}</span>
{/if}
</div>
{#if showRoster}
{#if topRoster.length > 0}
<ul class="roster">
{#each topRoster as p (p.guid ?? p.name)}
<li>
<span class="pname">{p.name || '—'}</span>
<span class="pscore">{p.score}</span>
<span class="pping">{p.ping}ms</span>
</li>
{/each}
</ul>
{:else if health !== 'offline'}
<div class="lobby-empty">lobby is empty</div>
{/if}
{/if}
{#if held.length > 0}
<div class="held">
{#each held as h (h.target)}
@@ -39,6 +100,19 @@
{/each}
</div>
{/if}
<div class="foot">
{#if health === 'offline' && lastError}
<span class="err">{lastError}</span>
{:else if lastSeenAt}
<span>last seen {ago(lastSeenAt)}</span>
{:else if lastRestartedAt}
<span>restart {ago(lastRestartedAt)}</span>
{:else}
<span class="dim">no data</span>
{/if}
</div>
{#if restarting}
<div class="restarting-bar" aria-label="restarting"></div>
{/if}
@@ -46,50 +120,165 @@
<style>
.card {
display: block;
background: #1a1a1a;
border: 1px solid #333;
border-radius: 6px;
padding: 12px;
color: #ddd;
display: flex;
flex-direction: column;
gap: 10px;
background:
linear-gradient(180deg, var(--cherry-875) 0%, var(--cherry-925) 100%);
border: 1px solid var(--cherry-700);
border-radius: var(--r-md);
padding: 14px 16px 12px;
color: var(--ink-100);
text-decoration: none;
transition: border-color 0.15s;
transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
box-shadow: var(--shadow-card);
position: relative;
overflow: hidden;
}
.card:hover { border-color: #555; }
.card.restarting { border-color: #ffab00; }
.card::before {
content: '';
position: absolute;
inset: 0 0 auto 0;
height: 2px;
background: linear-gradient(90deg, transparent, var(--cherry-500), transparent);
opacity: 0.5;
}
.card:hover {
border-color: var(--spark-500);
box-shadow: var(--spark-glow), var(--shadow-card);
transform: translateY(-1px);
}
.card.restarting { border-color: var(--amber-500); box-shadow: var(--amber-glow); }
.card.offline { opacity: 0.75; }
.head {
display: flex;
justify-content: space-between;
align-items: baseline;
align-items: center;
gap: 10px;
}
.name-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.name {
font-family: var(--font-body);
font-size: 15px;
font-weight: 600;
letter-spacing: 0.3px;
color: var(--cream);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.players {
background: #222;
padding: 2px 8px;
background: var(--cherry-925);
border: 1px solid var(--cherry-700);
padding: 3px 10px;
border-radius: 999px;
font-family: ui-monospace, monospace;
font-family: var(--font-mono);
font-size: 12px;
color: #888;
font-weight: 500;
color: var(--ink-500);
min-width: 34px;
text-align: center;
}
.players.has-players { background: #2d4a2d; color: #a8e6a8; }
.meta { color: #666; font-size: 12px; margin-top: 4px; }
.held { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.players.has-players {
color: var(--spark-500);
border-color: var(--spark-500);
box-shadow: var(--spark-glow);
}
.players.offline-badge {
color: var(--danger-500);
border-color: rgba(255, 48, 80, 0.4);
font-family: var(--font-body);
font-size: 10px;
letter-spacing: 1px;
text-transform: uppercase;
}
.meta {
display: flex;
align-items: center;
gap: 6px;
font-family: var(--font-mono);
font-size: 12px;
color: var(--ink-300);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.map { color: var(--cream-dim); }
.gt { color: var(--ink-300); }
.dot-sep { color: var(--ink-500); }
.roster {
list-style: none;
padding: 0;
margin: 0;
display: flex;
flex-direction: column;
gap: 2px;
}
.roster li {
display: grid;
grid-template-columns: 1fr auto auto;
gap: 10px;
align-items: center;
padding: 2px 0;
font-size: 12px;
}
.pname {
color: var(--cream);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.pscore {
font-family: var(--font-mono);
color: var(--spark-500);
font-size: 11px;
}
.pping {
font-family: var(--font-mono);
color: var(--ink-300);
font-size: 11px;
min-width: 44px;
text-align: right;
}
.lobby-empty {
font-family: var(--font-mono);
font-size: 11px;
color: var(--ink-500);
padding: 4px 0;
}
.held { display: flex; flex-wrap: wrap; gap: 4px; }
.chip {
background: #3a2f00;
color: #ffcc55;
border: 1px solid #665500;
border-radius: 3px;
background: rgba(242, 230, 200, 0.08);
color: var(--cream);
border: 1px solid rgba(242, 230, 200, 0.25);
border-radius: var(--r-sm);
padding: 1px 6px;
font-size: 11px;
font-family: ui-monospace, monospace;
font-family: var(--font-mono);
}
.foot {
display: flex;
justify-content: space-between;
font-family: var(--font-mono);
font-size: 10.5px;
color: var(--ink-500);
letter-spacing: 0.3px;
margin-top: auto;
padding-top: 4px;
}
.err { color: var(--danger-500); }
.dim { color: var(--ink-700); }
.restarting-bar {
height: 2px;
background: linear-gradient(90deg, transparent, #ffab00, transparent);
margin-top: 8px;
animation: slide 1.2s infinite linear;
}
@keyframes slide {
from { background-position: -100% 0; }
to { background-position: 200% 0; }
background: linear-gradient(90deg, transparent, var(--amber-500), var(--spark-500), transparent);
background-size: 200% 100%;
animation: spark-slide 1.2s infinite linear;
}
</style>
+37
View File
@@ -0,0 +1,37 @@
<script lang="ts">
import type { Health } from '$ui/stores/servers.js';
interface Props {
health: Health;
size?: number;
label?: string | null;
}
let { health, size = 8, label = null }: Props = $props();
</script>
<span
class="dot dot-{health}"
style="width:{size}px;height:{size}px"
aria-label={label ?? `server ${health}`}
title={label ?? health}
></span>
<style>
.dot {
display: inline-block;
border-radius: 999px;
vertical-align: middle;
flex-shrink: 0;
}
.dot-online {
background: var(--spark-500);
animation: electric-pulse 1.6s ease-in-out infinite;
}
.dot-stale {
background: var(--amber-500);
box-shadow: var(--amber-glow);
}
.dot-offline {
background: var(--danger-500);
opacity: 0.6;
}
</style>