Polish map & UI into a command-center war-room; rewire live LLM endpoint
Map (WorldMap): - Keep the near-black OpenFreeMap `dark` basemap (verified HTTP 200; the suggested dark-matter / dark-outdoors / liberty-dark variants 404 on that host) so the choropleth nation colors pop - Stable per-nation fills at 0.8 opacity, thin subtle borders, and a brighter thicker amber border for the player nation so "this is me" is always obvious - Hover brightens a region and shows a color-chipped owner + key stats popup; click opens a full dossier popup and focuses the left panel on that nation - Transient, self-cleaning flash (pulsing amber outline) over regions whose ownership changed this turn - Bottom-left legend auto-generated from the region map; per-scenario initial camera (Europe for the WWII scenarios, wider for Cold War / Modern / Aegis) Command-center UI: - New header bar: scenario title, prominent turn + date, the player nation (name + color chip), and a live Idle / "Simulating…" status indicator - 3-column operations-console grid: nation dossier (left) / dominant map (center) / command deck + event feed (right); stacks map-first on mobile - EventFeed: one card per event with a category icon, a colored outcome badge (success/failure/partial/neutral), a nation-colored accent edge, and the turn + date; new events slide in and flash at the top - NationPanel: value-colored animated stat bars (red → green), territory as color-coded region chips, and diplomacy as a list with a colored indicator per relation (ally/rival/war/neutral) - ActionPanel: a "Your move" composer with one prominent Send button and a spinner + "turns can take a few seconds" hint while a turn resolves - sonner error toasts: a 502 / model-down surfaces as "AI temporarily unavailable — try again" Live LLM rewire (server, previously uncommitted): - Default endpoint https://ai.kkhost.pl/v1 (vLLM, no API key); reasoning model qwen3.8-27b; always send a generous max_tokens (4000) so it finishes its chain-of-thought before emitting content; read only `content`, ignore `reasoning`. docker-compose + AGENTS.md updated to match. Tests: the deterministic Playwright e2e gains assertions for the dossier stat bars, the map legend (all nations), and the event-card type icon + outcome badge; it stays fully deterministic under LLM_STUB=1.
This commit is contained in:
+116
@@ -100,3 +100,119 @@
|
||||
background-color: var(--background);
|
||||
}
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
/* Map popups (MapLibre renders these in the DOM, so style them here). */
|
||||
/* ------------------------------------------------------------------ */
|
||||
.maplibregl-popup-content {
|
||||
background: var(--popover);
|
||||
color: var(--popover-foreground);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius);
|
||||
padding: 9px 11px;
|
||||
box-shadow: 0 10px 30px -10px rgb(0 0 0 / 0.7);
|
||||
font-size: 12px;
|
||||
line-height: 1.35;
|
||||
max-width: 230px;
|
||||
}
|
||||
.maplibregl-popup-tip {
|
||||
border-color: var(--popover) var(--popover) var(--border) var(--border);
|
||||
}
|
||||
.maplibregl-popup-close-button {
|
||||
color: var(--muted-foreground);
|
||||
font-size: 18px;
|
||||
padding: 0 6px;
|
||||
}
|
||||
.hm-popup-title {
|
||||
font-weight: 600;
|
||||
font-size: 13px;
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
.hm-popup-sub {
|
||||
color: var(--muted-foreground);
|
||||
font-size: 11px;
|
||||
margin-top: 2px;
|
||||
}
|
||||
.hm-popup-owner {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
margin-top: 5px;
|
||||
}
|
||||
.hm-popup-owner-big {
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
}
|
||||
.hm-chip {
|
||||
display: inline-block;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
border-radius: 3px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.hm-stats {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 4px 12px;
|
||||
margin-top: 7px;
|
||||
}
|
||||
.hm-stat {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 8px;
|
||||
}
|
||||
.hm-stat-k {
|
||||
color: var(--muted-foreground);
|
||||
font-size: 10px;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.05em;
|
||||
}
|
||||
.hm-stat-v {
|
||||
font-weight: 600;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
/* Micro-interactions: event cards slide in + flash on arrival; the */
|
||||
/* "simulating" dot pulses. Kept here (map/feed-specific animation CSS).*/
|
||||
/* ------------------------------------------------------------------ */
|
||||
@keyframes hm-event-slide {
|
||||
0% {
|
||||
opacity: 0;
|
||||
transform: translateY(-7px);
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
@keyframes hm-event-flash {
|
||||
0% {
|
||||
box-shadow: 0 0 0 1px var(--primary), 0 0 22px -4px var(--primary);
|
||||
}
|
||||
100% {
|
||||
box-shadow: 0 0 0 0 transparent;
|
||||
}
|
||||
}
|
||||
.event-new {
|
||||
animation:
|
||||
hm-event-slide 0.35s ease-out,
|
||||
hm-event-flash 1.1s ease-out;
|
||||
}
|
||||
@keyframes hm-sim-pulse {
|
||||
0%,
|
||||
100% {
|
||||
opacity: 1;
|
||||
transform: scale(1);
|
||||
}
|
||||
50% {
|
||||
opacity: 0.35;
|
||||
transform: scale(0.7);
|
||||
}
|
||||
}
|
||||
.sim-pulse {
|
||||
animation: hm-sim-pulse 1.1s ease-in-out infinite;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user