happytrain / static /css /app.css
DavidRambeau's picture
Deploy from GitHub Actions β€” e23b140b2a3172996813a3c050a9655acf9c384e
91b729c verified
Raw History Blame Contribute Delete
19.1 kB
/* ═══════════════════════════════════════════════════════════
SNCF GTFS — Thème "Tableau d'Affichage Ferroviaire"
Dark industrial, typographie mΓ©canique, ambiance gare
═══════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Barlow+Condensed:wght@300;400;600;700;900&family=Barlow:wght@300;400;500&display=swap');
/* ── Variables ─────────────────────────────────────────── */
:root {
--bg: #0a0c0f;
--bg2: #111418;
--bg3: #181d24;
--border: #1e2530;
--border2: #2a3445;
--text: #c8d4e0;
--text-dim: #5a6a7e;
--text-muted: #3a4858;
--accent: #e8b84b; /* Ambre β€” signalΓ©tique ferroviaire */
--accent2: #4b9fe8; /* Bleu TGV */
--accent3: #e84b4b; /* Rouge alerte */
--green: #4be878;
--mono: 'Share Tech Mono', monospace;
--sans: 'Barlow Condensed', sans-serif;
--body: 'Barlow', sans-serif;
--radius: 2px;
--shadow: 0 4px 24px rgba(0,0,0,0.6);
}
/* ── Reset & Base ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
background: var(--bg);
color: var(--text);
font-family: var(--body);
font-size: 15px;
line-height: 1.6;
min-height: 100vh;
/* Bruit de fond subtil */
background-image:
radial-gradient(ellipse 80% 50% at 50% -20%, rgba(72,120,180,0.08) 0%, transparent 60%);
}
/* Grille de fond style tableau Γ©lectronique */
body::before {
content: '';
position: fixed;
inset: 0;
background-image:
linear-gradient(rgba(30,37,48,0.4) 1px, transparent 1px),
linear-gradient(90deg, rgba(30,37,48,0.4) 1px, transparent 1px);
background-size: 40px 40px;
pointer-events: none;
z-index: 0;
}
main, header, footer { position: relative; z-index: 1; }
/* ── Navigation ────────────────────────────────────────── */
.navbar {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 2rem;
height: 60px;
background: var(--bg2);
border-bottom: 1px solid var(--border);
position: sticky;
top: 0;
z-index: 100;
}
.navbar-brand {
display: flex;
align-items: center;
gap: 0.75rem;
text-decoration: none;
}
.brand-icon {
width: 32px;
height: 32px;
background: var(--accent);
border-radius: var(--radius);
display: flex;
align-items: center;
justify-content: center;
font-size: 18px;
}
.brand-name {
font-family: var(--sans);
font-weight: 700;
font-size: 1.2rem;
letter-spacing: 0.12em;
text-transform: uppercase;
color: #fff;
}
.brand-sub {
font-family: var(--mono);
font-size: 0.6rem;
color: var(--text-dim);
letter-spacing: 0.2em;
text-transform: uppercase;
}
.nav-links {
display: flex;
gap: 0.25rem;
list-style: none;
}
.nav-links a {
display: flex;
align-items: center;
gap: 0.4rem;
padding: 0.4rem 0.9rem;
color: var(--text-dim);
text-decoration: none;
font-family: var(--sans);
font-size: 0.85rem;
font-weight: 600;
letter-spacing: 0.1em;
text-transform: uppercase;
border-radius: var(--radius);
transition: all 0.15s;
border: 1px solid transparent;
}
.nav-links a:hover, .nav-links a.active {
color: var(--accent);
background: rgba(232,184,75,0.07);
border-color: rgba(232,184,75,0.2);
}
/* ── Clock ─────────────────────────────────────────────── */
.live-clock {
font-family: var(--mono);
font-size: 1.1rem;
color: var(--accent);
letter-spacing: 0.1em;
}
/* ── Layout ────────────────────────────────────────────── */
.container {
max-width: 1280px;
margin: 0 auto;
padding: 0 2rem;
}
.page-header {
padding: 2.5rem 0 1.5rem;
border-bottom: 1px solid var(--border);
margin-bottom: 2rem;
}
.page-title {
font-family: var(--sans);
font-size: 2.2rem;
font-weight: 900;
letter-spacing: 0.05em;
text-transform: uppercase;
color: #fff;
line-height: 1;
}
.page-title span { color: var(--accent); }
.page-subtitle {
font-family: var(--mono);
font-size: 0.75rem;
color: var(--text-dim);
letter-spacing: 0.2em;
text-transform: uppercase;
margin-top: 0.4rem;
}
/* ── Cards ─────────────────────────────────────────────── */
.card {
background: var(--bg2);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 1.5rem;
}
.card-title {
font-family: var(--sans);
font-size: 0.75rem;
font-weight: 700;
letter-spacing: 0.25em;
text-transform: uppercase;
color: var(--text-dim);
margin-bottom: 1rem;
padding-bottom: 0.75rem;
border-bottom: 1px solid var(--border);
}
/* ── Formulaires ───────────────────────────────────────── */
.form-group {
display: flex;
flex-direction: column;
gap: 0.4rem;
}
.form-label {
font-family: var(--mono);
font-size: 0.7rem;
color: var(--text-dim);
letter-spacing: 0.2em;
text-transform: uppercase;
}
.form-control {
background: var(--bg3);
border: 1px solid var(--border2);
border-radius: var(--radius);
color: var(--text);
font-family: var(--mono);
font-size: 0.9rem;
padding: 0.65rem 0.9rem;
outline: none;
transition: border-color 0.15s, box-shadow 0.15s;
width: 100%;
}
.form-control:focus {
border-color: var(--accent);
box-shadow: 0 0 0 2px rgba(232,184,75,0.15);
}
.form-control::placeholder { color: var(--text-muted); }
/* Autocomplete dropdown */
.autocomplete-wrapper { position: relative; }
.autocomplete-list {
position: absolute;
top: 100%;
left: 0; right: 0;
background: var(--bg3);
border: 1px solid var(--accent);
border-top: none;
border-radius: 0 0 var(--radius) var(--radius);
max-height: 280px;
overflow-y: auto;
z-index: 200;
display: none;
}
.autocomplete-list.open { display: block; }
.autocomplete-item {
padding: 0.6rem 0.9rem;
cursor: pointer;
font-family: var(--mono);
font-size: 0.8rem;
border-bottom: 1px solid var(--border);
display: flex;
flex-direction: column;
gap: 0.1rem;
transition: background 0.1s;
}
.autocomplete-item:hover, .autocomplete-item.selected {
background: rgba(232,184,75,0.08);
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-name { color: var(--text); }
.autocomplete-id { color: var(--text-dim); font-size: 0.68rem; }
/* ── Boutons ────────────────────────────────────────────── */
.btn {
display: inline-flex;
align-items: center;
gap: 0.5rem;
padding: 0.65rem 1.4rem;
font-family: var(--sans);
font-size: 0.85rem;
font-weight: 700;
letter-spacing: 0.12em;
text-transform: uppercase;
border: 1px solid transparent;
border-radius: var(--radius);
cursor: pointer;
text-decoration: none;
transition: all 0.15s;
white-space: nowrap;
}
.btn-primary {
background: var(--accent);
color: #0a0c0f;
border-color: var(--accent);
}
.btn-primary:hover {
background: #f0c45a;
box-shadow: 0 0 16px rgba(232,184,75,0.3);
}
.btn-ghost {
background: transparent;
color: var(--text-dim);
border-color: var(--border2);
}
.btn-ghost:hover {
color: var(--text);
border-color: var(--text-dim);
background: var(--bg3);
}
/* ── Tableau Horaires ───────────────────────────────────── */
.departures-board {
background: var(--bg2);
border: 1px solid var(--border);
border-radius: var(--radius);
overflow: hidden;
}
.board-header {
display: grid;
grid-template-columns: 90px 90px 1fr 130px 80px 100px;
gap: 0;
padding: 0.6rem 1rem;
background: var(--bg3);
border-bottom: 2px solid var(--border2);
font-family: var(--mono);
font-size: 0.65rem;
color: var(--text-dim);
letter-spacing: 0.2em;
text-transform: uppercase;
}
.board-row {
display: grid;
grid-template-columns: 90px 90px 1fr 130px 80px 100px;
gap: 0;
padding: 0.75rem 1rem;
border-bottom: 1px solid var(--border);
align-items: center;
transition: background 0.15s;
animation: rowSlideIn 0.3s ease both;
}
.board-row:hover { background: rgba(255,255,255,0.02); }
.board-row:last-child { border-bottom: none; }
@keyframes rowSlideIn {
from { opacity: 0; transform: translateY(-4px); }
to { opacity: 1; transform: translateY(0); }
}
.board-row:nth-child(1) { animation-delay: 0.05s }
.board-row:nth-child(2) { animation-delay: 0.10s }
.board-row:nth-child(3) { animation-delay: 0.15s }
.board-row:nth-child(4) { animation-delay: 0.20s }
.board-row:nth-child(5) { animation-delay: 0.25s }
.board-row:nth-child(6) { animation-delay: 0.30s }
.board-row:nth-child(7) { animation-delay: 0.35s }
.board-row:nth-child(8) { animation-delay: 0.40s }
.board-row:nth-child(9) { animation-delay: 0.45s }
.board-row:nth-child(10) { animation-delay: 0.50s }
.time-cell {
font-family: var(--mono);
font-size: 1.2rem;
font-weight: 400;
color: var(--accent);
letter-spacing: 0.05em;
}
.arr-cell {
font-family: var(--mono);
font-size: 0.85rem;
color: var(--text-dim);
}
.dest-cell {
font-family: var(--sans);
font-size: 1rem;
font-weight: 600;
color: #fff;
letter-spacing: 0.03em;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.ligne-badge {
display: inline-flex;
align-items: center;
padding: 0.2rem 0.5rem;
border-radius: var(--radius);
font-family: var(--mono);
font-size: 0.7rem;
font-weight: 700;
letter-spacing: 0.1em;
text-transform: uppercase;
background: var(--bg3);
border: 1px solid var(--border2);
color: var(--text-dim);
white-space: nowrap;
}
.type-cell { color: var(--text-dim); font-size: 0.8rem; }
.op-cell { color: var(--text-dim); font-size: 0.75rem; font-family: var(--mono); }
/* ── Badges type de train ───────────────────────────────── */
.train-type {
display: inline-block;
padding: 0.15rem 0.45rem;
border-radius: var(--radius);
font-family: var(--mono);
font-size: 0.65rem;
font-weight: 700;
letter-spacing: 0.1em;
text-transform: uppercase;
}
.type-tgv { background: #1a3a6e; color: #6ab0f5; border: 1px solid #2a4a8e; }
.type-ter { background: #1a4a2e; color: #4be878; border: 1px solid #2a6a3e; }
.type-ic { background: #3a1a2e; color: #d86af5; border: 1px solid #5a2a4e; }
.type-ouigo { background: #1a2e4a; color: #e84b6a; border: 1px solid #2a3e6a; }
.type-other { background: var(--bg3); color: var(--text-dim); border: 1px solid var(--border2); }
/* ── Stats bar ──────────────────────────────────────────── */
.stats-bar {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 1px;
background: var(--border);
border: 1px solid var(--border);
border-radius: var(--radius);
overflow: hidden;
margin-bottom: 2rem;
}
.stat-item {
background: var(--bg2);
padding: 1rem 1.5rem;
display: flex;
flex-direction: column;
gap: 0.25rem;
}
.stat-value {
font-family: var(--mono);
font-size: 1.8rem;
color: var(--accent);
line-height: 1;
}
.stat-label {
font-family: var(--mono);
font-size: 0.65rem;
color: var(--text-dim);
letter-spacing: 0.2em;
text-transform: uppercase;
}
/* ── Search panel ───────────────────────────────────────── */
.search-panel {
display: grid;
grid-template-columns: 1fr 1fr auto auto;
gap: 1rem;
align-items: end;
padding: 1.5rem;
background: var(--bg2);
border: 1px solid var(--border);
border-radius: var(--radius);
margin-bottom: 1.5rem;
}
.journey-panel {
display: grid;
grid-template-columns: 1fr auto 1fr auto auto;
gap: 1rem;
align-items: end;
padding: 1.5rem;
background: var(--bg2);
border: 1px solid var(--border);
border-radius: var(--radius);
margin-bottom: 1.5rem;
}
.swap-btn {
display: flex;
align-items: center;
justify-content: center;
width: 36px;
height: 36px;
background: var(--bg3);
border: 1px solid var(--border2);
border-radius: var(--radius);
color: var(--text-dim);
cursor: pointer;
font-size: 1.1rem;
transition: all 0.15s;
margin-bottom: 0;
align-self: end;
padding-bottom: 0.1rem;
}
.swap-btn:hover { color: var(--accent); border-color: var(--accent); }
/* ── Journey cards ──────────────────────────────────────── */
.journey-list { display: flex; flex-direction: column; gap: 0.75rem; }
.journey-card {
background: var(--bg2);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 1.25rem 1.5rem;
display: grid;
grid-template-columns: 100px 1fr 100px 120px;
gap: 1rem;
align-items: center;
transition: border-color 0.15s, background 0.15s;
animation: rowSlideIn 0.3s ease both;
}
.journey-card:hover {
border-color: var(--accent);
background: rgba(232,184,75,0.03);
}
.journey-time { font-family: var(--mono); font-size: 1.4rem; color: var(--accent); }
.journey-arrow { color: var(--text-muted); text-align: center; }
.journey-duration {
font-family: var(--mono);
font-size: 0.8rem;
color: var(--accent2);
text-align: center;
}
.journey-info { display: flex; flex-direction: column; gap: 0.3rem; }
.journey-dest { font-family: var(--sans); font-size: 1.1rem; font-weight: 600; color: #fff; }
.journey-details { font-family: var(--mono); font-size: 0.72rem; color: var(--text-dim); }
/* ── Map ────────────────────────────────────────────────── */
#map-container {
height: calc(100vh - 200px);
min-height: 500px;
border: 1px solid var(--border);
border-radius: var(--radius);
overflow: hidden;
}
/* Override Leaflet pour le thème dark */
.leaflet-container { background: #0d1117 !important; }
.leaflet-popup-content-wrapper {
background: var(--bg2) !important;
border: 1px solid var(--border2) !important;
color: var(--text) !important;
border-radius: var(--radius) !important;
box-shadow: var(--shadow) !important;
}
.leaflet-popup-tip { background: var(--bg2) !important; }
.leaflet-popup-content { margin: 12px 16px !important; }
/* ── Empty / Error states ───────────────────────────────── */
.empty-state {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 4rem 2rem;
color: var(--text-muted);
gap: 1rem;
}
.empty-icon { font-size: 3rem; opacity: 0.4; }
.empty-text { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.15em; text-transform: uppercase; }
.error-banner {
padding: 0.75rem 1rem;
background: rgba(232,75,75,0.1);
border: 1px solid rgba(232,75,75,0.3);
border-radius: var(--radius);
color: var(--accent3);
font-family: var(--mono);
font-size: 0.8rem;
margin-bottom: 1rem;
}
/* ── Loading animation ──────────────────────────────────── */
.loading-dots::after {
content: '...';
animation: dots 1.2s infinite;
}
@keyframes dots {
0%, 20% { content: '.'; }
40% { content: '..'; }
60% { content: '...'; }
80%,100% { content: ''; }
}
/* ── Ticker dΓ©filant (accueil) ──────────────────────────── */
.ticker-wrap {
overflow: hidden;
background: var(--accent);
padding: 0.4rem 0;
position: relative;
}
.ticker {
display: flex;
gap: 4rem;
white-space: nowrap;
animation: ticker 30s linear infinite;
}
.ticker-item {
font-family: var(--mono);
font-size: 0.75rem;
color: #0a0c0f;
letter-spacing: 0.1em;
text-transform: uppercase;
flex-shrink: 0;
}
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
/* ── Hero accueil ───────────────────────────────────────── */
.hero {
padding: 4rem 0 3rem;
text-align: center;
position: relative;
}
.hero-title {
font-family: var(--sans);
font-size: clamp(3rem, 8vw, 6rem);
font-weight: 900;
line-height: 0.95;
letter-spacing: -0.02em;
text-transform: uppercase;
color: #fff;
margin-bottom: 1rem;
}
.hero-title .accent { color: var(--accent); }
.hero-subtitle {
font-family: var(--mono);
font-size: 0.8rem;
color: var(--text-dim);
letter-spacing: 0.3em;
text-transform: uppercase;
margin-bottom: 3rem;
}
.hero-search {
max-width: 700px;
margin: 0 auto;
display: grid;
grid-template-columns: 1fr auto;
gap: 0.75rem;
}
/* ── Result count ───────────────────────────────────────── */
.result-meta {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 1rem;
padding: 0.6rem 1rem;
background: var(--bg2);
border: 1px solid var(--border);
border-radius: var(--radius);
font-family: var(--mono);
font-size: 0.72rem;
color: var(--text-dim);
letter-spacing: 0.1em;
text-transform: uppercase;
}
.result-count { color: var(--accent); font-size: 1rem; }
/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
.board-header, .board-row {
grid-template-columns: 80px 1fr 120px;
}
.board-header > *:nth-child(2),
.board-row > *:nth-child(2),
.board-header > *:nth-child(5),
.board-row > *:nth-child(5),
.board-header > *:nth-child(6),
.board-row > *:nth-child(6) {
display: none;
}
.search-panel { grid-template-columns: 1fr; }
.journey-panel { grid-template-columns: 1fr; }
.stats-bar { grid-template-columns: 1fr 1fr; }
.journey-card { grid-template-columns: 80px 1fr; }
}
@media (max-width: 600px) {
.navbar { padding: 0 1rem; }
.container { padding: 0 1rem; }
.hero-search { grid-template-columns: 1fr; }
}