mirror of
https://github.com/AmanTahiliani/box-box.git
synced 2026-08-07 19:56:18 -04:00
Add championship hub with derived stats and progression views
New /api/v1/championship/hub endpoint aggregates official standings with wins, podiums, poles, recent form, teammate head-to-head, and per-round cumulative points. ChampionshipPage renders drivers, constructors, and progression views. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -3200,3 +3200,513 @@ a { color: inherit; text-decoration: none; }
|
||||
background: var(--surface-h);
|
||||
border-color: var(--border-2);
|
||||
}
|
||||
|
||||
/* ══════════════════════ Championship Hub ══════════════════════ */
|
||||
.champ-page {
|
||||
max-width: 1040px;
|
||||
margin: 0 auto;
|
||||
padding: var(--s5) var(--s6) 56px;
|
||||
}
|
||||
|
||||
/* header */
|
||||
.champ-header {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--s3);
|
||||
padding-bottom: var(--s4);
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
.champ-title-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--s4);
|
||||
}
|
||||
.champ-accent {
|
||||
width: 3px;
|
||||
height: 22px;
|
||||
background: var(--red);
|
||||
border-radius: 1px;
|
||||
}
|
||||
.champ-title {
|
||||
font-size: 22px;
|
||||
font-weight: 700;
|
||||
line-height: 1;
|
||||
letter-spacing: -0.01em;
|
||||
}
|
||||
.champ-season {
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
color: var(--bg);
|
||||
background: var(--red);
|
||||
padding: 2px 6px;
|
||||
border-radius: 2px;
|
||||
letter-spacing: 0.04em;
|
||||
}
|
||||
.champ-sub {
|
||||
font-size: 13px;
|
||||
color: var(--text-2);
|
||||
}
|
||||
.champ-tabs {
|
||||
display: flex;
|
||||
gap: 2px;
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 3px;
|
||||
padding: 2px;
|
||||
align-self: flex-start;
|
||||
}
|
||||
.champ-tab {
|
||||
padding: 5px 14px;
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
font-family: var(--f-ui);
|
||||
border: none;
|
||||
border-radius: 2px;
|
||||
cursor: pointer;
|
||||
background: transparent;
|
||||
color: var(--text-2);
|
||||
}
|
||||
.champ-tab:hover {
|
||||
color: var(--text);
|
||||
}
|
||||
.champ-tab.is-active {
|
||||
background: var(--red);
|
||||
color: #fff;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
/* stat rail */
|
||||
.champ-stat-rail {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
gap: 1px;
|
||||
background: var(--border);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 3px;
|
||||
overflow: hidden;
|
||||
margin-top: var(--s5);
|
||||
}
|
||||
.champ-stat {
|
||||
background: var(--surface);
|
||||
padding: 12px 14px;
|
||||
}
|
||||
.champ-stat-label {
|
||||
font-size: 10px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.1em;
|
||||
text-transform: uppercase;
|
||||
color: var(--text-3);
|
||||
}
|
||||
.champ-stat-value {
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
margin-top: 4px;
|
||||
line-height: 1;
|
||||
}
|
||||
.champ-stat-sub {
|
||||
font-size: 11px;
|
||||
color: var(--text-2);
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
/* podium hero cards */
|
||||
.champ-podium {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 10px;
|
||||
margin-top: 20px;
|
||||
}
|
||||
.champ-podium-card {
|
||||
position: relative;
|
||||
background: linear-gradient(160deg, #161616, #101010);
|
||||
border: 1px solid var(--border);
|
||||
border-top: 2px solid var(--text-2);
|
||||
border-radius: 3px;
|
||||
padding: 16px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.champ-podium-ghost {
|
||||
position: absolute;
|
||||
top: -18px;
|
||||
right: -6px;
|
||||
font-size: 84px;
|
||||
font-weight: 800;
|
||||
line-height: 1;
|
||||
pointer-events: none;
|
||||
}
|
||||
.champ-podium-inner {
|
||||
position: relative;
|
||||
}
|
||||
.champ-podium-top {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
font-size: 13px;
|
||||
}
|
||||
.champ-podium-team {
|
||||
font-size: 10px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.1em;
|
||||
text-transform: uppercase;
|
||||
color: var(--text-3);
|
||||
}
|
||||
.champ-podium-id {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
gap: 8px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.champ-podium-bar {
|
||||
width: 4px;
|
||||
height: 30px;
|
||||
border-radius: 1px;
|
||||
align-self: center;
|
||||
}
|
||||
.champ-podium-code {
|
||||
font-size: 30px;
|
||||
font-weight: 800;
|
||||
color: #fff;
|
||||
letter-spacing: -0.02em;
|
||||
line-height: 1;
|
||||
}
|
||||
.champ-podium-team-name {
|
||||
font-size: 19px;
|
||||
font-weight: 700;
|
||||
color: #fff;
|
||||
letter-spacing: -0.01em;
|
||||
}
|
||||
.champ-podium-name {
|
||||
font-size: 13px;
|
||||
color: #b8b8b8;
|
||||
margin-top: 6px;
|
||||
}
|
||||
.champ-podium-pts {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
gap: 6px;
|
||||
margin-top: 14px;
|
||||
}
|
||||
.champ-podium-pts-num {
|
||||
font-size: 26px;
|
||||
font-weight: 800;
|
||||
color: var(--text);
|
||||
line-height: 1;
|
||||
}
|
||||
.champ-podium-pts-unit {
|
||||
font-size: 11px;
|
||||
color: var(--text-3);
|
||||
}
|
||||
.champ-podium-gap {
|
||||
margin-left: auto;
|
||||
font-size: 12px;
|
||||
}
|
||||
.champ-podium-stats {
|
||||
display: flex;
|
||||
gap: 14px;
|
||||
margin-top: 12px;
|
||||
padding-top: 12px;
|
||||
border-top: 1px solid var(--border);
|
||||
}
|
||||
.champ-podium-stat-num {
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
color: var(--text);
|
||||
}
|
||||
.champ-podium-stat-label {
|
||||
font-size: 10px;
|
||||
color: var(--text-3);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.08em;
|
||||
}
|
||||
|
||||
/* contribution split */
|
||||
.champ-contrib {
|
||||
margin-top: 14px;
|
||||
padding-top: 12px;
|
||||
border-top: 1px solid var(--border);
|
||||
}
|
||||
.champ-contrib-bar {
|
||||
display: flex;
|
||||
height: 6px;
|
||||
border-radius: 3px;
|
||||
overflow: hidden;
|
||||
background: var(--bg);
|
||||
}
|
||||
.champ-contrib-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
.champ-contrib-row .champ-contrib-bar {
|
||||
flex: 1;
|
||||
max-width: 160px;
|
||||
}
|
||||
.champ-contrib-legend {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-top: 6px;
|
||||
font-size: 11px;
|
||||
color: #b8b8b8;
|
||||
}
|
||||
.champ-contrib-legend em {
|
||||
color: var(--text-3);
|
||||
font-style: normal;
|
||||
}
|
||||
.champ-contrib-names {
|
||||
font-size: 11px;
|
||||
color: var(--text-2);
|
||||
}
|
||||
.champ-contrib-names em {
|
||||
color: var(--text-3);
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
/* title math */
|
||||
.champ-titlemath {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 12px;
|
||||
margin-top: 14px;
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--border);
|
||||
border-left: 2px solid var(--red);
|
||||
border-radius: 3px;
|
||||
padding: 12px 16px;
|
||||
}
|
||||
.champ-titlemath-tag {
|
||||
font-size: 10px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.1em;
|
||||
text-transform: uppercase;
|
||||
color: var(--red);
|
||||
padding-top: 2px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.champ-titlemath-text {
|
||||
font-size: 13px;
|
||||
color: #b8b8b8;
|
||||
}
|
||||
|
||||
/* tables */
|
||||
.champ-scroll {
|
||||
margin-top: var(--s5);
|
||||
overflow-x: auto;
|
||||
}
|
||||
.champ-scroll::-webkit-scrollbar {
|
||||
height: 8px;
|
||||
}
|
||||
.champ-scroll::-webkit-scrollbar-thumb {
|
||||
background: var(--border);
|
||||
border-radius: 4px;
|
||||
}
|
||||
.champ-table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
font-size: 12px;
|
||||
}
|
||||
.champ-table-drivers {
|
||||
min-width: 760px;
|
||||
}
|
||||
.champ-table-teams {
|
||||
min-width: 680px;
|
||||
}
|
||||
.champ-table th {
|
||||
padding: 6px 8px;
|
||||
font-size: 10px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
color: var(--text-3);
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
.champ-table th.l,
|
||||
.champ-table td.l {
|
||||
text-align: left;
|
||||
}
|
||||
.champ-table th.r,
|
||||
.champ-table td.r {
|
||||
text-align: right;
|
||||
}
|
||||
.champ-table th.c,
|
||||
.champ-table td.c {
|
||||
text-align: center;
|
||||
}
|
||||
.champ-table td {
|
||||
padding: 7px 8px;
|
||||
border-bottom: 1px solid #1c1c1c;
|
||||
}
|
||||
.champ-table tbody tr:hover {
|
||||
background: var(--surface-h);
|
||||
}
|
||||
.champ-td-pts {
|
||||
font-weight: 700;
|
||||
color: var(--text);
|
||||
}
|
||||
.champ-td-muted {
|
||||
color: var(--text-2);
|
||||
}
|
||||
.champ-td-dim {
|
||||
color: var(--text-3);
|
||||
}
|
||||
.champ-td-team {
|
||||
font-size: 11px;
|
||||
color: var(--text-2);
|
||||
}
|
||||
.champ-drv {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
}
|
||||
.champ-drv-bar {
|
||||
width: 3px;
|
||||
height: 18px;
|
||||
border-radius: 1px;
|
||||
}
|
||||
.champ-drv-code {
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
color: var(--text);
|
||||
min-width: 34px;
|
||||
}
|
||||
.champ-drv-name {
|
||||
font-size: 12px;
|
||||
color: var(--text-2);
|
||||
}
|
||||
.champ-drv-num {
|
||||
font-size: 10px;
|
||||
color: var(--text-3);
|
||||
}
|
||||
.champ-team-name {
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
color: var(--text);
|
||||
}
|
||||
.champ-spark {
|
||||
display: block;
|
||||
}
|
||||
.champ-alive {
|
||||
font-size: 10px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.06em;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
/* progression chart */
|
||||
.champ-progression {
|
||||
margin-top: 20px;
|
||||
}
|
||||
.champ-chart-head {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
}
|
||||
.champ-chart-title {
|
||||
font-size: 10px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.1em;
|
||||
text-transform: uppercase;
|
||||
color: var(--text-3);
|
||||
}
|
||||
.champ-chart-meta {
|
||||
font-size: 11px;
|
||||
color: var(--text-2);
|
||||
}
|
||||
.champ-chart {
|
||||
background: #101010;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 3px;
|
||||
padding: 14px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.champ-chart-svg {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
display: block;
|
||||
}
|
||||
.champ-chart-axis {
|
||||
fill: var(--text-3);
|
||||
font-family: var(--f-mono);
|
||||
font-size: 11px;
|
||||
}
|
||||
.champ-chart-label {
|
||||
font-family: var(--f-mono);
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
}
|
||||
.champ-chart-empty {
|
||||
margin-top: 20px;
|
||||
padding: 40px;
|
||||
text-align: center;
|
||||
font-size: 13px;
|
||||
color: var(--text-2);
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 3px;
|
||||
}
|
||||
.champ-legend {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 14px;
|
||||
margin-top: 12px;
|
||||
}
|
||||
.champ-legend-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
}
|
||||
.champ-legend-swatch {
|
||||
width: 14px;
|
||||
height: 2px;
|
||||
border-radius: 1px;
|
||||
}
|
||||
.champ-legend-code {
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
color: var(--text);
|
||||
}
|
||||
.champ-legend-name {
|
||||
font-size: 11px;
|
||||
color: var(--text-2);
|
||||
}
|
||||
.champ-legend-total {
|
||||
font-size: 11px;
|
||||
color: var(--text-3);
|
||||
}
|
||||
|
||||
/* empty state */
|
||||
.champ-empty {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: calc(100vh - var(--nav-h) - 80px);
|
||||
text-align: center;
|
||||
}
|
||||
.champ-empty-eyebrow {
|
||||
font-size: 11px;
|
||||
letter-spacing: 0.1em;
|
||||
text-transform: uppercase;
|
||||
color: var(--text-3);
|
||||
}
|
||||
.champ-empty-title {
|
||||
font-size: 22px;
|
||||
font-weight: 700;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.champ-empty-sub {
|
||||
font-size: 13px;
|
||||
color: var(--text-2);
|
||||
margin-top: 8px;
|
||||
max-width: 460px;
|
||||
}
|
||||
|
||||
@media (max-width: 720px) {
|
||||
.champ-stat-rail {
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
}
|
||||
.champ-podium {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user