OpenDataVisualizer/client/src/styles.css
Claudio Schaad 688775e742 Add Thurgau vehicle stock map (#3)
Choropleth of the 80 Thurgau municipalities from the road vehicle stock dataset (djs-stv-17), with population from sk-stat-56 and outlines from swisstopo. Also fixes the broken ENV line in the Dockerfile.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Claudio Schaad <c.schaad@pog.ch>
Co-committed-by: Claudio Schaad <c.schaad@pog.ch>
2026-11-06 21:43:23 +00:00

869 lines
13 KiB
CSS

:root {
--bg: #f8fafc;
--surface: #ffffff;
--border: #e2e8f0;
--text: #0f172a;
--muted: #64748b;
--accent: #2563eb;
--panel-width: 440px;
font-family:
system-ui,
-apple-system,
'Segoe UI',
sans-serif;
color: var(--text);
background: var(--bg);
}
* {
box-sizing: border-box;
}
html,
body,
#root {
height: 100%;
margin: 0;
}
.app {
display: grid;
grid-template-columns: 1fr;
grid-template-rows: auto 1fr auto;
grid-template-areas:
'header'
'map'
'footer';
height: 100%;
}
.app.with-panel {
grid-template-columns: 1fr var(--panel-width);
grid-template-areas:
'header header'
'map panel'
'footer footer';
}
.app-header {
grid-area: header;
display: flex;
justify-content: space-between;
align-items: center;
gap: 16px;
padding: 10px 18px;
background: var(--surface);
border-bottom: 1px solid var(--border);
}
.title h1 {
margin: 0;
font-size: 18px;
letter-spacing: -0.01em;
}
.subtitle {
color: var(--muted);
font-size: 13px;
}
.stats {
display: flex;
gap: 24px;
}
.stats > div {
display: flex;
flex-direction: column;
align-items: flex-end;
}
.stat-value {
font-size: 20px;
font-weight: 600;
font-variant-numeric: tabular-nums;
}
.stat-label {
font-size: 11px;
color: var(--muted);
}
.map-area {
grid-area: map;
position: relative;
min-height: 0;
}
.traffic-map {
position: absolute;
inset: 0;
}
.flow-canvas {
position: absolute;
top: 0;
left: 0;
z-index: 450;
pointer-events: none;
transition: opacity 0.15s;
}
.overlay-bottom {
position: absolute;
left: 12px;
right: 12px;
bottom: 22px;
z-index: 800;
display: flex;
flex-direction: column;
align-items: center;
gap: 6px;
pointer-events: none;
}
.overlay-bottom > * {
pointer-events: auto;
}
.time-controls,
.legend {
background: rgba(255, 255, 255, 0.94);
border: 1px solid var(--border);
border-radius: 10px;
box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12);
}
.time-controls {
display: flex;
align-items: center;
gap: 12px;
padding: 8px 12px;
width: min(820px, 100%);
}
.play-button {
width: 38px;
height: 38px;
border-radius: 50%;
border: none;
background: var(--accent);
color: white;
font-size: 14px;
cursor: pointer;
flex: none;
}
.date-picker {
display: flex;
align-items: center;
gap: 2px;
}
.date-picker button {
border: 1px solid var(--border);
background: white;
border-radius: 6px;
width: 26px;
height: 30px;
cursor: pointer;
}
.date-picker button:disabled {
opacity: 0.4;
cursor: default;
}
select {
height: 30px;
border: 1px solid var(--border);
border-radius: 6px;
background: white;
padding: 0 6px;
font: inherit;
font-size: 13px;
}
.clock {
font-size: 20px;
font-weight: 600;
font-variant-numeric: tabular-nums;
width: 60px;
text-align: center;
}
.time-slider {
flex: 1;
accent-color: var(--accent);
}
.legend {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 14px;
padding: 5px 12px;
font-size: 12px;
}
.legend-item {
display: inline-flex;
align-items: center;
gap: 6px;
}
.legend-dot {
display: inline-block;
border-radius: 50%;
}
.legend-dot.small {
width: 8px;
height: 8px;
margin-right: 6px;
}
.legend-note {
color: var(--muted);
}
.notice {
position: absolute;
top: 12px;
left: 50%;
transform: translateX(-50%);
z-index: 800;
background: white;
border: 1px solid var(--border);
border-radius: 8px;
padding: 8px 14px;
font-size: 13px;
box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12);
}
.error {
color: #b91c1c;
}
.muted {
color: var(--muted);
}
.station-panel {
grid-area: panel;
overflow-y: auto;
background: var(--surface);
border-left: 1px solid var(--border);
padding: 14px 16px 24px;
}
.station-panel-header {
display: flex;
justify-content: space-between;
gap: 8px;
}
.station-panel h2 {
margin: 0 0 4px;
font-size: 16px;
}
.station-panel-header p {
margin: 0;
color: var(--muted);
font-size: 12px;
}
.close-button {
border: none;
background: none;
font-size: 24px;
line-height: 1;
cursor: pointer;
color: var(--muted);
}
.station-panel section {
margin-top: 18px;
}
.station-panel h3 {
font-size: 13px;
margin: 0 0 8px;
color: #334155;
}
.class-table {
width: 100%;
border-collapse: collapse;
font-size: 12px;
font-variant-numeric: tabular-nums;
}
.class-table th,
.class-table td {
padding: 3px 4px;
border-bottom: 1px solid #f1f5f9;
text-align: right;
}
.class-table th:first-child,
.class-table td:first-child {
text-align: left;
}
.class-table .total-row td {
font-weight: 600;
border-top: 1px solid var(--border);
}
.chart {
position: relative;
height: 200px;
}
.chart-tall {
height: 230px;
}
.app-footer {
grid-area: footer;
font-size: 11px;
color: var(--muted);
padding: 4px 18px;
border-top: 1px solid var(--border);
background: var(--surface);
}
.app-footer a {
color: inherit;
}
@media (max-width: 900px) {
.app.with-panel {
grid-template-columns: 1fr;
grid-template-rows: auto 1fr 45% auto;
grid-template-areas:
'header'
'map'
'panel'
'footer';
}
.stats {
display: none;
}
.time-controls {
flex-wrap: wrap;
}
}
.title-row {
display: flex;
align-items: center;
gap: 12px;
}
.back-link {
display: inline-flex;
align-items: center;
justify-content: center;
width: 32px;
height: 32px;
border-radius: 8px;
border: 1px solid var(--border);
color: var(--text);
text-decoration: none;
font-size: 16px;
}
.back-link:hover {
background: var(--bg);
}
.brand-link {
color: inherit;
text-decoration: none;
}
.brand-link:hover {
color: var(--accent);
}
.title-separator {
color: var(--muted);
font-weight: 400;
}
.home {
height: 100%;
overflow-y: auto;
padding: 48px 32px 64px;
}
.home-header {
max-width: 1200px;
margin: 0 auto 32px;
}
.home-header h1 {
margin: 0 0 6px;
font-size: 32px;
letter-spacing: -0.02em;
}
.home-header p {
margin: 0;
color: var(--muted);
font-size: 16px;
}
.home-header a {
color: var(--accent);
}
.map-tiles {
max-width: 1200px;
margin: 0 auto;
display: grid;
grid-template-columns: repeat(auto-fill, minmax(min(100%, 480px), 1fr));
gap: 24px;
}
.map-tile {
display: flex;
flex-direction: column;
background: var(--surface);
border: 1px solid var(--border);
border-radius: 16px;
overflow: hidden;
color: inherit;
text-decoration: none;
box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
transition:
transform 0.15s,
box-shadow 0.15s,
border-color 0.15s;
}
.map-tile:hover,
.map-tile:focus-visible {
transform: translateY(-3px);
border-color: #bfdbfe;
box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
outline: none;
}
.map-tile-preview {
aspect-ratio: 16 / 9;
background: #e3e8e1;
border-bottom: 1px solid var(--border);
}
.map-tile-preview img {
display: block;
width: 100%;
height: 100%;
object-fit: cover;
}
.map-tile-body {
display: flex;
flex-direction: column;
gap: 8px;
padding: 20px 22px 22px;
}
.map-tile-region {
font-size: 12px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.06em;
color: var(--accent);
}
.map-tile h2 {
margin: 0;
font-size: 24px;
letter-spacing: -0.01em;
}
.map-tile p {
margin: 0;
color: #334155;
line-height: 1.5;
}
.map-tile-tags {
display: flex;
flex-wrap: wrap;
gap: 6px;
margin-top: 4px;
}
.tag {
font-size: 12px;
padding: 3px 9px;
border-radius: 999px;
background: #eff6ff;
color: #1d4ed8;
}
.map-tile-source {
font-size: 12px;
color: var(--muted);
}
@media (max-width: 600px) {
.home {
padding: 28px 16px 40px;
}
}
.vessel-marker-anchor {
background: none;
border: none;
}
.vessel-marker {
position: absolute;
transform: translate(-50%, -50%);
cursor: pointer;
border-radius: 50%;
filter: drop-shadow(0 1px 2px rgba(15, 23, 42, 0.35));
transition:
width 0.6s ease,
height 0.6s ease;
}
.vessel-marker svg {
display: block;
width: 100%;
height: 100%;
overflow: visible;
}
.vessel-marker .vessel-segments path {
stroke: #ffffff;
stroke-width: 1.5;
stroke-linejoin: round;
}
.vessel-marker .vessel-hole {
fill: rgba(255, 255, 255, 0.92);
}
.vessel-marker .vessel-empty {
fill: rgba(255, 255, 255, 0.85);
stroke: #64748b;
stroke-width: 8;
}
.vessel-marker text {
fill: var(--text);
font-weight: 600;
font-variant-numeric: tabular-nums;
pointer-events: none;
}
.vessel-marker.selected {
filter: drop-shadow(0 0 0 #0f172a) drop-shadow(0 0 3px rgba(15, 23, 42, 0.9));
outline: 3px solid #0f172a;
outline-offset: 1px;
}
.tooltip-row {
display: flex;
align-items: center;
gap: 2px;
min-width: 180px;
}
.tooltip-value {
margin-left: auto;
padding-left: 12px;
font-weight: 600;
font-variant-numeric: tabular-nums;
}
.year-controls {
width: auto;
max-width: 100%;
}
.play-button:disabled {
opacity: 0.4;
cursor: default;
}
.year-buttons,
.dimension-tabs {
display: flex;
border: 1px solid var(--border);
border-radius: 8px;
overflow: hidden;
}
.year-buttons button,
.dimension-tabs button {
border: none;
border-right: 1px solid var(--border);
background: white;
padding: 0 12px;
height: 32px;
font: inherit;
font-size: 13px;
font-variant-numeric: tabular-nums;
cursor: pointer;
color: var(--text);
}
.dimension-tabs button {
height: 28px;
font-size: 12px;
padding: 0 10px;
}
.year-buttons button:last-child,
.dimension-tabs button:last-child {
border-right: none;
}
.year-buttons button:hover,
.dimension-tabs button:hover {
background: var(--bg);
}
.year-buttons button.active,
.dimension-tabs button.active {
background: var(--accent);
color: white;
font-weight: 600;
}
.year-reference {
font-size: 12px;
color: var(--muted);
white-space: nowrap;
}
.category-legend {
flex-direction: column;
align-items: stretch;
gap: 6px;
padding: 8px 10px;
max-width: min(820px, 100%);
}
.dimension-tabs {
align-self: center;
}
.category-chips {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 4px 6px;
}
.category-chip {
display: inline-flex;
align-items: center;
border: 1px solid transparent;
background: none;
border-radius: 999px;
padding: 2px 8px 2px 6px;
font: inherit;
font-size: 12px;
color: var(--text);
cursor: pointer;
}
.category-chip:hover {
border-color: var(--border);
background: var(--bg);
}
.category-chip.off {
color: var(--muted);
text-decoration: line-through;
}
.category-chip.off .legend-dot {
opacity: 0.25;
}
.chip-count {
margin-left: 6px;
color: var(--muted);
font-variant-numeric: tabular-nums;
}
.link-button {
border: none;
background: none;
color: var(--accent);
font: inherit;
font-size: 12px;
cursor: pointer;
}
.unplaced {
position: absolute;
top: 12px;
left: 56px;
z-index: 800;
display: flex;
flex-direction: column;
gap: 6px;
}
.unplaced button {
display: flex;
flex-direction: column;
align-items: flex-start;
background: rgba(255, 255, 255, 0.94);
border: 1px dashed #94a3b8;
border-radius: 10px;
padding: 6px 12px;
font: inherit;
cursor: pointer;
box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12);
}
.unplaced button.active {
border: 2px solid #0f172a;
}
.unplaced-name {
font-size: 12px;
color: var(--muted);
}
.unplaced-count {
font-size: 15px;
font-weight: 600;
font-variant-numeric: tabular-nums;
}
.stat-tiles {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 8px;
}
.stat-tile {
display: flex;
flex-direction: column;
gap: 2px;
padding: 10px 12px;
border: 1px solid var(--border);
border-radius: 10px;
}
.stat-tile-value {
font-size: 20px;
font-weight: 600;
font-variant-numeric: tabular-nums;
}
.stat-tile-label {
font-size: 11px;
color: var(--muted);
}
.stat-tile-delta {
font-size: 11px;
font-variant-numeric: tabular-nums;
color: var(--muted);
}
.category-table td.share-cell {
position: relative;
width: 38%;
}
.share-bar {
position: absolute;
left: 4px;
top: 50%;
height: 6px;
max-width: calc(100% - 52px);
transform: translateY(-50%);
border-radius: 3px;
opacity: 0.85;
}
.category-table tr.muted td {
color: var(--muted);
}
.chart-small {
height: 170px;
}
.metric-controls .category-chip.selected {
border-color: var(--accent);
background: #e8f1fb;
font-weight: 600;
}
.brand-select {
font: inherit;
font-size: 12px;
border: 1px solid var(--border);
border-radius: 999px;
padding: 2px 8px;
background: white;
color: var(--text);
}
.color-scale {
display: flex;
align-items: center;
justify-content: center;
flex-wrap: wrap;
gap: 4px 10px;
border-top: 1px solid var(--border);
padding-top: 6px;
}
.color-scale-title {
color: var(--muted);
font-size: 11px;
}
.color-scale-steps {
display: flex;
}
.color-scale-step {
display: flex;
flex-direction: column;
align-items: flex-start;
width: 64px;
}
.color-scale-swatch {
width: 100%;
height: 10px;
border-right: 1px solid white;
}
.color-scale-label {
font-size: 10px;
color: var(--muted);
font-variant-numeric: tabular-nums;
white-space: nowrap;
}
.class-table tr.highlight td {
font-weight: 600;
}
.panel-note {
margin: 6px 0 0;
font-size: 11px;
color: var(--muted);
}