Files
wh40k-points-comparator/site/style.css
root 38bffa491c Initial commit: WH40K Points Comparator
- React + MUI DataGrid app with faction filter, search, change filter
- Biggest movers cards (drops/rises) scoped to current filter view
- Historical points graph modal (5 MFM versions: 1.14 → current)
- URL state sync (faction, dir, q params — shareable URLs)
- Grimdark favicon + OG embed image (Google Imagen)
- Multi-stage Dockerfile (node build → nginx serve)
- docker-compose.yml with Traefik + Cloudflare TLS
- Data pipeline: build_deduped_data.py merges PDF + live scrape
- Ynnari merged into Aeldari (shared codex)
- Mobile responsive: flex columns, no fixed pixel widths
- Color semantics: green=cheaper, red=costlier (consistent everywhere)
- 1,449 units across 31 factions
2026-06-18 02:42:29 +00:00

538 lines
13 KiB
CSS

/* ── WH40K Points Comparator — clean, sharp, effective ── */
:root {
--bg: #0a0e14;
--bg-alt: #0d1117;
--panel: #11161e;
--panel-2: #161c26;
--panel-3: #1c2330;
--border: #232b38;
--border-2: #2d3744;
--text: #e6edf3;
--text-dim: #adbac7;
--muted: #7d8590;
--accent: #3b82f6;
--accent-2: #60a5fa;
--green: #3fb950;
--red: #f85149;
--grey: #6e7681;
--gold: #e3b341;
--green-bg: rgba(63, 185, 80, 0.12);
--red-bg: rgba(248, 81, 73, 0.12);
--gold-bg: rgba(227, 179, 65, 0.10);
--radius: 10px;
--radius-sm: 6px;
--sticky-top: 0px;
--font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
--mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html, body { overflow-x: hidden; }
body {
font-family: var(--font);
background: var(--bg);
color: var(--text);
font-size: 14px;
line-height: 1.5;
-webkit-font-smoothing: antialiased;
}
/* ── Header ── */
header {
background: var(--panel);
border-bottom: 1px solid var(--border);
}
.header-inner {
max-width: 1400px;
margin: 0 auto;
padding: 18px 24px;
display: flex;
align-items: baseline;
justify-content: space-between;
gap: 16px;
}
h1 {
font-size: 1.3rem;
font-weight: 700;
letter-spacing: -0.02em;
margin: 0;
}
.subtitle {
color: var(--muted);
font-size: 0.8rem;
margin: 2px 0 0;
}
.meta {
font-size: 0.75rem;
color: var(--muted);
white-space: nowrap;
}
/* ── Controls (sticky) ── */
.controls-wrap {
position: sticky;
top: 0;
z-index: 20;
background: rgba(10, 14, 20, 0.92);
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
border-bottom: 1px solid var(--border);
}
.controls {
max-width: 1400px;
margin: 0 auto;
display: grid;
grid-template-columns: 2fr 1fr 1fr 1fr 0.7fr;
gap: 10px;
padding: 12px 24px;
}
.control { display: flex; flex-direction: column; gap: 4px; }
.control label {
font-size: 0.65rem;
text-transform: uppercase;
letter-spacing: 0.06em;
color: var(--muted);
font-weight: 600;
}
.control input, .control select {
background: var(--panel-2);
color: var(--text);
border: 1px solid var(--border-2);
border-radius: var(--radius-sm);
padding: 8px 12px;
font-size: 0.9rem;
font-family: var(--font);
min-height: 38px;
transition: border-color 0.15s, box-shadow 0.15s;
width: 100%;
cursor: pointer;
}
.control input {
cursor: text;
}
.control input:focus, .control select:focus {
outline: none;
border-color: var(--accent);
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.control select {
appearance: none;
-webkit-appearance: none;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%237d8590'%3E%3Cpath d='M6 9L1 4h10z'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: right 10px center;
padding-right: 30px;
}
/* ── Movers ── */
main {
max-width: 1400px;
margin: 0 auto;
padding: 20px 24px 40px;
}
.movers {
background: var(--panel);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 16px 18px;
margin-bottom: 20px;
}
.movers-header h2 {
font-size: 0.95rem;
font-weight: 700;
letter-spacing: -0.01em;
margin: 0;
}
.movers-header p {
font-size: 0.75rem;
color: var(--muted);
margin: 2px 0 14px;
}
.movers-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 14px;
}
.movers-col { display: flex; flex-direction: column; gap: 5px; }
.movers-col.drops .mover-row {
border-left: 3px solid var(--red);
}
.movers-col.rises .mover-row {
border-left: 3px solid var(--green);
}
.mover-row {
display: grid;
grid-template-columns: 1fr auto auto;
gap: 10px;
align-items: center;
padding: 8px 12px;
border-radius: var(--radius-sm);
font-size: 0.82rem;
cursor: pointer;
background: var(--panel-2);
border: 1px solid var(--border);
transition: border-color 0.15s, background 0.15s;
}
.mover-row:hover { border-color: var(--border-2); background: var(--panel-3); }
.mover-name { font-weight: 600; }
.mover-meta { color: var(--muted); font-size: 0.72rem; margin-top: 1px; }
.mover-costs {
font-family: var(--mono);
font-size: 0.8rem;
color: var(--text-dim);
white-space: nowrap;
}
.mover-delta {
font-family: var(--mono);
font-weight: 700;
font-size: 0.85rem;
white-space: nowrap;
}
.mover-delta.drop { color: var(--red); }
.mover-delta.rise { color: var(--green); }
/* ── Count ── */
.count {
color: var(--muted);
font-size: 0.82rem;
margin-bottom: 10px;
}
.count b { color: var(--text); font-weight: 600; }
/* ── Table ── */
.row-table {
width: 100%;
border-collapse: collapse;
background: var(--panel);
border: 1px solid var(--border);
border-radius: var(--radius);
overflow: hidden;
}
.row-table thead { position: sticky; top: var(--sticky-top); z-index: 5; }
.row-table th {
background: var(--panel-3);
color: var(--muted);
font-size: 0.68rem;
text-transform: uppercase;
letter-spacing: 0.05em;
font-weight: 600;
padding: 10px 12px;
text-align: left;
border-bottom: 1px solid var(--border-2);
cursor: pointer;
user-select: none;
white-space: nowrap;
}
.row-table th:hover { color: var(--text); }
.row-table th.num { text-align: right; }
.row-table td {
padding: 8px 12px;
border-bottom: 1px solid var(--border);
font-size: 0.85rem;
}
.row-table tr:last-child td { border-bottom: none; }
.row-table tbody tr {
cursor: pointer;
transition: background 0.1s;
}
.row-table tbody tr:hover { background: rgba(59, 130, 246, 0.04); }
.row-table .col-faction { color: var(--text-dim); font-size: 0.8rem; }
.row-table .col-unit { font-weight: 600; }
.row-table .col-size { white-space: nowrap; }
.row-table .col-status { white-space: nowrap; }
.num {
text-align: right;
font-family: var(--mono);
font-variant-numeric: tabular-nums;
}
.muted { color: var(--muted); }
/* ── Pills ── */
.pill {
display: inline-block;
padding: 2px 8px;
border-radius: 20px;
font-size: 0.68rem;
font-weight: 700;
letter-spacing: 0.02em;
white-space: nowrap;
}
.pill.up { background: var(--green-bg); color: var(--green); }
.pill.down { background: var(--red-bg); color: var(--red); }
.pill.same { background: rgba(110,118,129,0.12); color: var(--grey); }
.pill.new { background: rgba(59,130,246,0.15); color: var(--accent-2); }
.pill.gone { background: rgba(110,118,129,0.12); color: var(--muted); }
.pill.none { background: transparent; color: var(--muted); }
/* ── Size toggle ── */
.size-btn {
background: rgba(59, 130, 246, 0.12);
color: var(--accent-2);
border: 1px solid rgba(59, 130, 246, 0.3);
border-radius: var(--radius-sm);
padding: 4px 10px 4px 8px;
font-size: 0.78rem;
font-weight: 600;
cursor: pointer;
font-family: var(--font);
white-space: nowrap;
display: inline-flex;
align-items: center;
gap: 4px;
transition: all 0.15s;
}
.size-btn:hover {
background: rgba(59, 130, 246, 0.22);
border-color: var(--accent-2);
}
.size-btn:active { transform: scale(0.96); }
.size-btn-badge {
background: rgba(59, 130, 246, 0.3);
color: var(--accent-2);
border-radius: 8px;
padding: 0 5px;
font-size: 0.65rem;
font-weight: 700;
min-width: 16px;
text-align: center;
}
.size-static {
color: var(--muted);
font-size: 0.8rem;
}
/* ── Compact mode ── */
.compact-row {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px 14px;
background: var(--panel);
border: 1px solid var(--border);
border-radius: var(--radius-sm);
margin-bottom: 6px;
cursor: pointer;
transition: border-color 0.15s;
}
.compact-row:hover { border-color: var(--accent); }
.compact-main { flex: 1; min-width: 0; }
.compact-name { font-weight: 600; font-size: 0.9rem; }
.compact-sub { color: var(--muted); font-size: 0.75rem; margin-top: 2px;
display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.compact-nums {
display: flex;
align-items: center;
gap: 8px;
font-family: var(--mono);
font-size: 0.82rem;
white-space: nowrap;
margin-left: 12px;
}
.compact-orig { color: var(--muted); }
.compact-arrow { color: var(--muted); }
.compact-new { font-weight: 600; }
/* ── Empty ── */
.empty {
text-align: center;
padding: 48px 20px;
color: var(--muted);
font-size: 0.9rem;
}
/* ── Footer ── */
footer {
border-top: 1px solid var(--border);
color: var(--muted);
font-size: 0.78rem;
padding: 20px 24px;
}
footer code {
color: var(--accent-2);
background: var(--panel-2);
padding: 1px 6px;
border-radius: 4px;
font-size: 0.78rem;
}
/* ── Modal ── */
.modal-backdrop {
position: fixed; inset: 0;
background: rgba(0, 0, 0, 0.7);
backdrop-filter: blur(4px);
display: flex; align-items: center; justify-content: center;
z-index: 100;
padding: 20px;
}
.modal {
background: var(--panel);
border: 1px solid var(--border-2);
border-radius: var(--radius);
max-width: 560px;
width: 100%;
max-height: 80vh;
overflow: auto;
padding: 24px;
position: relative;
}
.modal-title {
font-size: 1.15rem;
font-weight: 700;
letter-spacing: -0.01em;
}
.modal-faction {
color: var(--muted);
font-size: 0.85rem;
margin: 2px 0 16px;
}
.modal-sizes-label {
font-size: 0.7rem;
text-transform: uppercase;
letter-spacing: 0.05em;
color: var(--muted);
font-weight: 600;
margin-bottom: 8px;
}
.modal-close {
position: absolute;
top: 16px; right: 16px;
background: var(--panel-2);
border: 1px solid var(--border-2);
color: var(--muted);
border-radius: var(--radius-sm);
width: 32px; height: 32px;
cursor: pointer;
font-size: 0.85rem;
display: flex; align-items: center; justify-content: center;
transition: all 0.15s;
}
.modal-close:hover { color: var(--text); border-color: var(--text); }
.variant-row {
display: grid;
grid-template-columns: 1fr auto auto;
gap: 12px;
align-items: center;
padding: 10px 12px;
border-radius: var(--radius-sm);
border: 1px solid var(--border);
margin-bottom: 6px;
background: var(--panel-2);
}
.variant-row.active {
border-color: var(--accent);
background: rgba(59, 130, 246, 0.06);
}
.variant-size { font-weight: 500; font-size: 0.88rem; }
.variant-current { color: var(--accent-2); font-size: 0.7rem; margin-left: 4px; }
.variant-nums {
font-family: var(--mono);
font-size: 0.82rem;
display: flex;
align-items: center;
gap: 6px;
}
.variant-orig { color: var(--muted); }
.variant-arrow { color: var(--muted); }
.variant-new { font-weight: 600; }
.variant-delta { white-space: nowrap; }
/* ── Responsive: tablet ── */
@media (max-width: 1000px) {
.controls { grid-template-columns: 2fr 1fr 1fr 1fr; }
.control-view { display: none; }
.movers-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
.controls { grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 16px; }
.control-search { grid-column: 1 / -1; }
main { padding: 16px 16px 32px; }
.header-inner { padding: 14px 16px; }
h1 { font-size: 1.1rem; }
.meta { display: none; }
.mover-row { grid-template-columns: 1fr auto; }
.mover-costs { display: none; }
}
/* ── Responsive: phone ── */
@media (max-width: 600px) {
body { font-size: 15px; }
/* Controls: single column */
.controls {
grid-template-columns: 1fr;
gap: 6px;
padding: 10px 14px;
}
.control input, .control select {
min-height: 44px;
font-size: 1rem;
padding: 10px 14px;
}
.control select { padding-right: 34px; }
/* Table → card layout */
.row-table thead { display: none; }
.row-table, .row-table tbody, .row-table tr, .row-table td {
display: block;
width: 100%;
}
.row-table { border: none; background: transparent; }
.row-table tbody tr {
background: var(--panel);
border: 1px solid var(--border);
border-radius: var(--radius-sm);
margin-bottom: 8px;
padding: 4px 0;
}
.row-table td {
display: flex;
justify-content: space-between;
align-items: center;
padding: 6px 14px;
border-bottom: 1px solid var(--border);
font-size: 0.88rem;
text-align: right;
}
.row-table td:last-child { border-bottom: none; }
.row-table td::before {
content: attr(data-label);
color: var(--muted);
font-size: 0.65rem;
text-transform: uppercase;
letter-spacing: 0.05em;
font-weight: 600;
}
.row-table td.col-unit::before { display: none; }
.row-table td.col-unit {
font-size: 1rem;
font-weight: 700;
padding-top: 12px;
border-bottom: 1px solid var(--border-2);
}
.row-table td.col-faction::before { display: none; }
.row-table td.col-faction {
color: var(--accent-2);
font-size: 0.75rem;
padding-top: 8px;
padding-bottom: 2px;
border-bottom: none;
}
/* Compact mode: stack */
.compact-row { flex-direction: column; align-items: flex-start; gap: 6px; }
.compact-nums { margin-left: 0; flex-wrap: wrap; }
/* Modal: full screen */
.modal-backdrop { padding: 0; }
.modal {
max-width: 100%;
max-height: 100vh;
height: 100vh;
border-radius: 0;
padding: 16px;
}
}