Playtime from PlaytimeHistory's database (SAW_PT_DSN)
A public Playtime tab and player-drawer playtime, and staff-only figures (who's on, staff activity, disconnect reasons, countries, names, sessions) for @css/generic on the staff panel and on the public site when signed in. Hidden unless SAW_PT_DSN is set and its tables are there.
This commit is contained in:
parent
daa7ec2dbc
commit
6d0fc6e463
18 changed files with 2238 additions and 12 deletions
|
|
@ -1082,3 +1082,120 @@ a.btn { text-decoration: none; }
|
|||
background: var(--accent-soft);
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
/* ---------- Playtime (PlaytimeHistory) ---------- */
|
||||
|
||||
:root {
|
||||
--t: #e3b353;
|
||||
--ct: #6fa3e8;
|
||||
--spec: #4b5162;
|
||||
/* The heatmap's one-hue ramp, from the surface up to the accent. */
|
||||
--heat-0: #23262e;
|
||||
--heat-1: #3a1f29;
|
||||
--heat-2: #5e1c2f;
|
||||
--heat-3: #8f1934;
|
||||
--heat-4: #c41438;
|
||||
--heat-5: #fe113d;
|
||||
}
|
||||
|
||||
.pt-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
|
||||
.pt-tile { display: grid; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
|
||||
.pt-tile small { color: var(--muted); font-size: 13px; }
|
||||
.pt-tile b { font: 600 30px/1 var(--display); }
|
||||
.pt-tile .delta { font-size: 13px; color: var(--muted); }
|
||||
.pt-tile .delta.up { color: var(--green); }
|
||||
|
||||
.pt-hbar { display: flex; align-items: center; gap: 10px; min-width: 140px; }
|
||||
.pt-hbar .track { flex: 1; height: 8px; border-radius: 4px; background: var(--line-soft); overflow: hidden; }
|
||||
.pt-hbar .fill { height: 100%; border-radius: 0 4px 4px 0; background: var(--fill, var(--accent)); }
|
||||
.pt-hbar span { min-width: 3.5em; text-align: right; font-size: 14px; }
|
||||
|
||||
/* T / CT / spectating as one stacked bar, 2px surface gaps between the parts. */
|
||||
.pt-split { display: flex; gap: 2px; height: 14px; margin: 4px 0 10px; }
|
||||
.pt-split i { display: block; height: 100%; }
|
||||
.pt-split i:first-child { border-radius: 4px 0 0 4px; }
|
||||
.pt-split i:last-child { border-radius: 0 4px 4px 0; }
|
||||
.pt-split i:only-child { border-radius: 4px; }
|
||||
.pt-split .t { background: var(--t); }
|
||||
.pt-split .ct { background: var(--ct); }
|
||||
.pt-split .spec { background: var(--spec); }
|
||||
.pt-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; padding: 0; list-style: none; font-size: 14px; }
|
||||
.pt-legend li { display: flex; align-items: center; gap: 6px; }
|
||||
.pt-legend i { width: 10px; height: 10px; border-radius: 2px; background: var(--c); }
|
||||
.pt-legend span { color: var(--muted); }
|
||||
|
||||
.pt-cols { padding: 18px 18px 12px; }
|
||||
.pt-cols .plot {
|
||||
position: relative;
|
||||
display: grid;
|
||||
grid-auto-flow: column;
|
||||
grid-auto-columns: minmax(0, 1fr);
|
||||
align-items: end;
|
||||
gap: 2px;
|
||||
height: 140px;
|
||||
border-bottom: 1px solid var(--line);
|
||||
}
|
||||
.pt-cols .grid { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--line-soft); pointer-events: none; }
|
||||
.pt-cols .grid span { position: absolute; right: 0; top: -17px; font-size: 11px; color: var(--faint); }
|
||||
.pt-cols .bar { position: relative; height: 100%; display: flex; align-items: end; justify-content: center; }
|
||||
.pt-cols .bar i { display: block; width: 100%; max-width: 24px; border-radius: 4px 4px 0 0; background: var(--fill, var(--accent)); opacity: 0.85; }
|
||||
.pt-cols .bar:hover i, .pt-cols .bar:focus i { opacity: 1; outline: 1px solid var(--text); outline-offset: 1px; }
|
||||
.pt-cols .ticks { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; margin-top: 6px; font-size: 11px; color: var(--faint); text-align: center; }
|
||||
.pt-cols .note { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
|
||||
|
||||
.pt-heat { padding: 18px; overflow-x: auto; }
|
||||
.pt-heat table { border-collapse: separate; border-spacing: 2px; width: auto; min-width: 100%; }
|
||||
.pt-heat th, .pt-heat td { padding: 0; border: 0; background: none; }
|
||||
.pt-heat th { font: 500 11px/1 var(--body); color: var(--faint); text-transform: none; letter-spacing: 0; }
|
||||
.pt-heat th[scope="row"] { padding-right: 8px; text-align: right; font-size: 12px; color: var(--muted); }
|
||||
.pt-heat td i { display: block; height: 22px; min-width: 16px; border-radius: 3px; background: var(--heat-0); }
|
||||
.pt-heat td i:hover { outline: 1px solid var(--text); outline-offset: 1px; }
|
||||
.pt-heat .scale { display: flex; align-items: center; gap: 4px; margin-top: 12px; font-size: 12px; color: var(--muted); }
|
||||
.pt-heat .scale i { width: 18px; height: 10px; border-radius: 2px; }
|
||||
|
||||
.pt-place { display: inline-block; width: 2ch; font: 700 20px/1 var(--display); color: var(--faint); }
|
||||
tr:nth-child(1) .pt-place { color: #f5c542; }
|
||||
tr:nth-child(2) .pt-place { color: #c9ced8; }
|
||||
tr:nth-child(3) .pt-place { color: #d08a52; }
|
||||
.pt-who .rank { margin-left: 6px; }
|
||||
|
||||
.pt-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
|
||||
.pt-stats div { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg); }
|
||||
.pt-stats b { font: 600 22px/1 var(--display); }
|
||||
.pt-stats small { color: var(--muted); font-size: 12px; }
|
||||
.pt-spark { display: flex; align-items: end; gap: 2px; height: 48px; margin-top: 4px; }
|
||||
.pt-spark i { flex: 1; max-width: 12px; min-height: 2px; border-radius: 3px 3px 0 0; background: var(--accent); opacity: 0.85; }
|
||||
.pt-spark i.zero { background: var(--line); opacity: 1; }
|
||||
.pt-maps { display: grid; gap: 8px; }
|
||||
.pt-maps div { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 10px; font-size: 14px; }
|
||||
.pt-names { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
|
||||
.pt-names li { display: flex; justify-content: space-between; gap: 12px; }
|
||||
.pt-sessions { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
|
||||
.pt-sessions li { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg); font-size: 14px; }
|
||||
.pt-sessions .top { display: flex; justify-content: space-between; gap: 10px; }
|
||||
.pt-credit { margin: 0; padding: 12px 18px; border-top: 1px solid var(--line); font-size: 12px; color: var(--faint); }
|
||||
.pt-credit a { color: var(--muted); }
|
||||
.drawer .pt-credit { border-top: 0; padding: 14px 22px; }
|
||||
.pt-lines { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 14px; }
|
||||
.pt-stack > *, .pt-grid > * { min-width: 0; }
|
||||
.pt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
|
||||
|
||||
#pt-tip {
|
||||
position: fixed;
|
||||
z-index: 50;
|
||||
padding: 6px 10px;
|
||||
border: 1px solid var(--line);
|
||||
border-radius: var(--r-sm);
|
||||
background: var(--raised);
|
||||
font-size: 13px;
|
||||
white-space: nowrap;
|
||||
pointer-events: none;
|
||||
box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
|
||||
}
|
||||
#pt-tip[hidden] { display: none; }
|
||||
|
||||
@media (max-width: 820px) {
|
||||
.pt-tiles, .pt-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
||||
.pt-grid { grid-template-columns: minmax(0, 1fr); }
|
||||
.pt-cols .ticks span:nth-child(even) { visibility: hidden; }
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue