- theme.css: semantic tokens (bg, surface, ink, border, brand, tints, status, glass) - ThemeSwitch.tsx: radiogroup with light/dark/auto, persisted in localStorage - auto mode follows device time (06:00-18:00 light), rechecks every minute and on visibilitychange - inline pre-paint script in layout.tsx prevents flash of wrong theme - remapped ~250 hardcoded hex declarations across styles to tokens - fixed --c-ink-2 contrast 4.25 -> 5.36 (WCAG AA) in light mode - 0 contrast failures below 4.5:1 across 8 pages in both themes - DESIGN.md: documented theme system
414 lines
17 KiB
CSS
414 lines
17 KiB
CSS
/* Ported from stopDetail.html <style> block */
|
|
.mu-other-stops { margin: 16px 0 6px; }
|
|
.mu-other-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
|
|
.mu-other-item { display: block; padding: 10px 12px; background: var(--c-surface);
|
|
border: 1px solid #eef0f6; border-radius: 12px; min-width: 0; }
|
|
.mu-other-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
|
|
.mu-other-item .mu-time-grid { margin-top: 8px; }
|
|
.mu-other-item .mu-est-note { margin-top: 4px; }
|
|
.mu-other-idx { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%; background: var(--c-tint-purple);
|
|
color: var(--c-brand-ink); font-size: .78rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
|
|
.mu-other-txt { flex: 1; min-width: 0; }
|
|
.mu-other-txt strong { display: block; color: var(--c-ink); font-size: .94rem; }
|
|
.mu-other-txt span { display: block; color: var(--c-ink-2); font-size: .8rem; }
|
|
.mu-other-item .mu-chip { flex: 0 0 auto; font-family: ui-monospace, Consolas, monospace; font-size: .72rem; }
|
|
.mu-other-item .mu-chip.warn { background: var(--c-tint-amber); color: var(--c-warn); border-color: #f2d9a8; }
|
|
:root {
|
|
--mu-accent: #7a4cc0;
|
|
--mu-accent-soft: #f3eafe;
|
|
--mu-ink: var(--c-ink);
|
|
--mu-muted: var(--c-ink-2);
|
|
--mu-border: #ecd7e6;
|
|
--mu-surface: var(--c-surface);
|
|
--mu-rose: #ec4899;
|
|
--mu-sky: #3071b8;
|
|
--mu-mint: #1f8765;
|
|
}
|
|
.mu-page {
|
|
background:
|
|
radial-gradient(circle at 8% 10%, rgba(122, 76, 192, 0.09), transparent 30%),
|
|
radial-gradient(circle at 100% 0%, rgba(48, 113, 184, 0.10), transparent 28%),
|
|
linear-gradient(180deg, var(--c-surface-2) 0%, var(--c-tint-purple) 100%);
|
|
}
|
|
.mu-stop-hero {
|
|
position: relative;
|
|
overflow: hidden;
|
|
border: 1px solid rgba(231, 224, 246, 0.95);
|
|
border-radius: 22px;
|
|
background: linear-gradient(135deg, var(--c-tint-purple) 0%, var(--c-tint-purple) 45%, var(--c-tint-green) 100%);
|
|
box-shadow: 0 16px 34px rgba(122, 76, 192, 0.12);
|
|
padding: 18px;
|
|
margin-bottom: 14px;
|
|
display: grid;
|
|
grid-template-columns: 1.2fr .8fr;
|
|
gap: 16px;
|
|
align-items: stretch;
|
|
}
|
|
.mu-stop-hero::before,
|
|
.mu-stop-hero::after {
|
|
content: "";
|
|
position: absolute;
|
|
border-radius: 999px;
|
|
pointer-events: none;
|
|
opacity: .48;
|
|
}
|
|
.mu-stop-hero::before {
|
|
width: 220px;
|
|
height: 220px;
|
|
top: -120px;
|
|
right: -70px;
|
|
background: radial-gradient(circle, #f472b6 0%, rgba(244, 114, 182, 0) 72%);
|
|
}
|
|
.mu-stop-hero::after {
|
|
width: 200px;
|
|
height: 200px;
|
|
left: -70px;
|
|
bottom: -115px;
|
|
background: radial-gradient(circle, #60a5fa 0%, rgba(96, 165, 250, 0) 72%);
|
|
}
|
|
.mu-stop-hero > * {
|
|
position: relative;
|
|
z-index: 1;
|
|
min-width: 0; /* กัน grid track บวมตาม min-content (ไม่งั้นเนื้อหาถูก overflow:hidden ตัดที่จอแคบ) */
|
|
}
|
|
.mu-stop-hero-title {
|
|
overflow-wrap: anywhere;
|
|
margin: 0;
|
|
font-size: 1.72rem;
|
|
color: var(--mu-ink);
|
|
line-height: 1.2;
|
|
}
|
|
.mu-stop-hero-sub {
|
|
margin: 8px 0 0;
|
|
color: var(--mu-muted);
|
|
font-size: .9rem;
|
|
}
|
|
.mu-meta-row { display:flex; flex-wrap:wrap; gap:8px; margin: 12px 0 0; }
|
|
.mu-meta-pill { max-width: 100%; overflow-wrap: anywhere; background:linear-gradient(135deg, var(--c-surface), var(--c-tint-purple)); border:1px solid rgba(231, 224, 246, 0.9); color:var(--c-brand-ink); padding:6px 14px; border-radius:999px; font-size:.85rem; font-weight:600; box-shadow: 0 4px 10px rgba(122, 76, 192, 0.08); }
|
|
.mu-meta-pill.purple { background:linear-gradient(135deg, var(--c-tint-purple), var(--c-tint-purple)); color:var(--c-brand-ink); border-color:#e8d9f0; }
|
|
.mu-meta-pill.sky { background:linear-gradient(135deg, var(--c-tint-cyan), var(--c-tint-cyan)); color:var(--c-info); border-color:#d7e7fb; }
|
|
.mu-meta-pill.mint { background:linear-gradient(135deg, var(--c-tint-green), var(--c-tint-cyan)); color:var(--c-ok); border-color:#d1efdf; }
|
|
.mu-direction-tag { background:var(--c-brand); color:#fff; border-radius:999px; padding:2px 10px; font-size:.78rem; margin-left:8px; }
|
|
.mu-schedule-note { color:var(--c-danger); font-size:.8rem; margin-top:8px; padding:8px 12px; background:var(--c-tint-pink); border-left:3px solid #bb3a78; border-radius:4px; }
|
|
.mu-hero-metric-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
gap: 8px;
|
|
margin-top: 12px;
|
|
}
|
|
.mu-hero-metric {
|
|
border: 1px solid rgba(231, 224, 246, 0.9);
|
|
border-radius: 12px;
|
|
padding: 10px;
|
|
background: var(--c-surface);
|
|
box-shadow: 0 6px 14px rgba(122, 76, 192, 0.08);
|
|
min-width: 0;
|
|
overflow-wrap: anywhere;
|
|
}
|
|
.mu-hero-metric:nth-child(1) { background: linear-gradient(135deg, var(--c-tint-purple), var(--c-tint-pink)); }
|
|
.mu-hero-metric:nth-child(2) { background: linear-gradient(135deg, var(--c-tint-cyan), var(--c-tint-cyan)); }
|
|
.mu-hero-metric:nth-child(3) { background: linear-gradient(135deg, var(--c-tint-pink), var(--c-tint-amber)); }
|
|
.mu-hero-metric:nth-child(4) { background: linear-gradient(135deg, var(--c-tint-green), var(--c-tint-green)); }
|
|
.mu-hero-metric-label {
|
|
margin: 0;
|
|
color: var(--mu-muted);
|
|
font-size: .76rem;
|
|
font-weight: 700;
|
|
text-transform: uppercase;
|
|
letter-spacing: .03em;
|
|
}
|
|
.mu-hero-metric-value {
|
|
margin: 4px 0 0;
|
|
color: var(--mu-ink);
|
|
font-size: 1.06rem;
|
|
font-weight: 800;
|
|
line-height: 1.2;
|
|
}
|
|
.mu-stop-summary-main { order: 2; flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
|
|
.mu-stop-summary-main strong { font-size: .95rem; line-height: 1.3; }
|
|
.mu-stop-summary-main .mu-stop-summary-meta { color: var(--c-ink-2); font-size: .78rem; }
|
|
.mu-route-type-badge { display: inline-flex; align-items: center; gap: 5px; order: 3; flex: none; background: linear-gradient(135deg, var(--c-tint-purple), var(--c-tint-purple)); color: var(--c-brand-ink); padding: 4px 8px; border-radius: 8px; font-size: .8rem; font-weight: 700; border: 1px solid #e8d9f0; white-space: nowrap; }
|
|
.mu-stop-summary-rail { order: 4; flex: none; margin-left: auto; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
|
|
.mu-route-chip { display: inline-flex; align-items: center; justify-content: center; flex: none; min-width: 38px; padding: 5px 9px; border-radius: 8px; background: linear-gradient(135deg, var(--c-brand), #b07ce0); color: #fff; font-family: "IBM Plex Mono", ui-monospace, monospace; font-weight: 700; font-size: .92rem; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
|
|
.mu-stop-chevron { display: inline-block; color: var(--c-brand-ink); font-size: .9rem; line-height: 1; transition: transform .2s ease; }
|
|
.mu-stop-expander[open] .mu-stop-chevron { transform: rotate(180deg); }
|
|
.mu-live-clock-card {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
gap: 14px;
|
|
margin: 6px 0 14px;
|
|
padding: 12px 14px;
|
|
border: 1px solid rgba(240, 191, 224, 0.9);
|
|
border-radius: 14px;
|
|
background: linear-gradient(135deg, var(--c-tint-purple) 0%, var(--c-tint-purple) 50%, var(--c-tint-cyan) 100%);
|
|
box-shadow: 0 8px 20px rgba(122, 76, 192, 0.10);
|
|
}
|
|
.mu-live-clock-title {
|
|
margin: 0;
|
|
color: var(--c-ink-2);
|
|
font-size: .78rem;
|
|
font-weight: 700;
|
|
letter-spacing: .04em;
|
|
text-transform: uppercase;
|
|
}
|
|
.mu-live-clock-time {
|
|
margin: 2px 0 0;
|
|
font-size: 1.65rem;
|
|
line-height: 1;
|
|
color: var(--c-ink);
|
|
font-weight: 800;
|
|
font-family: "K2D", "Prompt", "Noto Sans Thai", sans-serif;
|
|
}
|
|
.mu-live-clock-note {
|
|
margin: 0;
|
|
padding: 6px 10px;
|
|
border-radius: 999px;
|
|
background: linear-gradient(135deg, var(--c-surface), var(--c-tint-pink));
|
|
border: 1px solid #eec7df;
|
|
color: var(--c-brand-ink);
|
|
font-size: .78rem;
|
|
font-weight: 600;
|
|
white-space: nowrap;
|
|
}
|
|
.mu-live-dot {
|
|
display: inline-block;
|
|
width: 10px;
|
|
height: 10px;
|
|
border-radius: 999px;
|
|
background: #ec4899;
|
|
margin-right: 6px;
|
|
animation: muPulse 1.6s infinite;
|
|
vertical-align: middle;
|
|
}
|
|
.mu-next-arrival {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
background: var(--c-surface);
|
|
border: 1px solid #f0d6e6;
|
|
color: var(--c-danger);
|
|
border-radius: 999px;
|
|
padding: 3px 10px;
|
|
font-size: .76rem;
|
|
font-weight: 700;
|
|
line-height: 1;
|
|
}
|
|
.mu-next-arrival::before {
|
|
content: "⏱";
|
|
font-size: .85rem;
|
|
line-height: 1;
|
|
}
|
|
.mu-time-chip.next-live {
|
|
background: linear-gradient(135deg, #ec4899, #8b5cf6);
|
|
border-color: transparent;
|
|
color: #fff;
|
|
box-shadow: 0 6px 14px rgba(139, 92, 246, 0.28);
|
|
transform: translateY(-1px);
|
|
}
|
|
.mu-panel {
|
|
border: 1px solid rgba(231, 224, 246, 0.95);
|
|
border-radius: 18px;
|
|
background: linear-gradient(180deg, var(--c-surface), var(--c-tint-purple));
|
|
box-shadow: 0 10px 24px rgba(122, 76, 192, 0.09);
|
|
}
|
|
|
|
.mu-info-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(4, minmax(140px, 1fr));
|
|
gap: 10px;
|
|
margin: 16px 0 18px;
|
|
}
|
|
.mu-info-card {
|
|
border-radius: 14px;
|
|
padding: 12px 14px;
|
|
border: 1px solid #e9e2fb;
|
|
box-shadow: 0 8px 24px rgba(67, 56, 202, 0.08);
|
|
}
|
|
.mu-info-card .label { font-size: .78rem; color:var(--c-ink-2); margin:0; font-weight:700; }
|
|
.mu-info-card .value { margin:4px 0 0; font-size:1rem; font-weight:700; color:var(--c-ink); }
|
|
|
|
.mu-layout-grid {
|
|
display: grid;
|
|
grid-template-columns: 1.35fr .9fr;
|
|
gap: 16px;
|
|
align-items: start;
|
|
}
|
|
|
|
.mu-card-panel {
|
|
background: var(--c-surface);
|
|
border: 1px solid var(--c-border-2);
|
|
border-radius: 16px;
|
|
padding: 18px;
|
|
box-shadow: 0 8px 24px rgba(67, 56, 202, 0.08);
|
|
}
|
|
.mu-card-panel h2,
|
|
.mu-card-panel h3 { margin-top:0; }
|
|
|
|
.mu-chip {
|
|
display:inline-flex;
|
|
align-items:center;
|
|
gap:6px;
|
|
padding:6px 10px;
|
|
border-radius:999px;
|
|
font-size:.8rem;
|
|
font-weight:700;
|
|
}
|
|
|
|
@media (max-width: 980px) {
|
|
.mu-info-grid { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
|
|
.mu-layout-grid { grid-template-columns: 1fr; }
|
|
}
|
|
.mu-panel h2 {
|
|
position: relative;
|
|
padding-left: 14px;
|
|
margin-bottom: 14px;
|
|
}
|
|
.mu-panel h2::before {
|
|
content: "";
|
|
position: absolute;
|
|
left: 0;
|
|
top: 4px;
|
|
width: 6px;
|
|
height: 24px;
|
|
border-radius: 999px;
|
|
background: linear-gradient(180deg, #ec4899, #8b5cf6);
|
|
}
|
|
.mu-route-tools {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
margin: 0 0 12px;
|
|
flex-wrap: wrap;
|
|
}
|
|
.mu-route-filter {
|
|
flex: 1;
|
|
min-width: 240px;
|
|
border: 1px solid rgba(214, 199, 226, 0.9);
|
|
border-radius: 12px;
|
|
padding: 10px 12px;
|
|
font-size: .9rem;
|
|
color: var(--mu-ink);
|
|
background: linear-gradient(180deg, var(--c-surface), var(--c-tint-purple));
|
|
outline: none;
|
|
box-shadow: 0 2px 4px rgba(0,0,0,.02);
|
|
}
|
|
.mu-route-filter:focus {
|
|
border-color: #c9a9eb;
|
|
box-shadow: 0 0 0 3px rgba(122, 76, 192, 0.12);
|
|
}
|
|
.mu-route-count {
|
|
border: 1px solid rgba(233, 200, 251, 0.9);
|
|
background: linear-gradient(135deg, var(--c-tint-purple), var(--c-tint-pink));
|
|
color: var(--c-brand-ink);
|
|
border-radius: 999px;
|
|
padding: 8px 12px;
|
|
font-size: .8rem;
|
|
font-weight: 700;
|
|
}
|
|
.mu-stop-expander {
|
|
border: 1px solid rgba(243, 228, 238, 0.95);
|
|
border-radius: 14px;
|
|
margin-bottom: 8px;
|
|
overflow: hidden;
|
|
background: linear-gradient(180deg, var(--c-surface), var(--c-tint-purple));
|
|
}
|
|
.mu-stop-expander[open] {
|
|
border-color: rgba(226, 201, 245, 0.95);
|
|
box-shadow: 0 8px 18px rgba(122, 76, 192, 0.10);
|
|
}
|
|
.mu-stop-expander > summary {
|
|
background: linear-gradient(180deg, var(--c-surface), var(--c-tint-purple));
|
|
padding: 14px;
|
|
/* flex + wrap: จอกว้างเรียงบรรทัดเดียว / จอแคบพับลงมา ไม่ทับกัน */
|
|
display: flex;
|
|
align-items: center;
|
|
flex-wrap: wrap;
|
|
gap: 8px;
|
|
cursor: pointer;
|
|
list-style: none;
|
|
}
|
|
.mu-stop-expander > summary::-webkit-details-marker { display: none; }
|
|
.mu-stop-list > li:nth-child(4n + 1) .mu-stop-expander > summary { border-left: 4px solid #8b5cf6; }
|
|
.mu-stop-list > li:nth-child(4n + 2) .mu-stop-expander > summary { border-left: 4px solid #38bdf8; }
|
|
.mu-stop-list > li:nth-child(4n + 3) .mu-stop-expander > summary { border-left: 4px solid #f472b6; }
|
|
.mu-stop-list > li:nth-child(4n + 4) .mu-stop-expander > summary { border-left: 4px solid #34d399; }
|
|
.mu-stop-expander-body {
|
|
background: linear-gradient(180deg, var(--c-tint-purple), var(--c-tint-pink));
|
|
padding-left: 58px;
|
|
border-top: 1px solid #f6eaf2;
|
|
}
|
|
.mu-toolbar {
|
|
margin-top: 10px;
|
|
margin-bottom: 12px;
|
|
background: rgba(255,255,255,.8);
|
|
backdrop-filter: blur(8px);
|
|
border: 1px solid rgba(231, 224, 246, 0.9);
|
|
border-radius: 14px;
|
|
padding: 10px;
|
|
}
|
|
@media (max-width: 980px) {
|
|
.mu-stop-hero {
|
|
grid-template-columns: 1fr;
|
|
}
|
|
.mu-hero-metric-grid {
|
|
grid-template-columns: 1fr 1fr;
|
|
}
|
|
}
|
|
@media (max-width: 640px) {
|
|
.mu-hero-metric-grid { grid-template-columns: 1fr; }
|
|
.mu-hero-metric { min-width: 0; overflow-wrap: anywhere; }
|
|
.mu-stop-summary-rail {
|
|
gap: 6px;
|
|
}
|
|
/* จอแคบ: จัด summary เป็น 3 แถวอ่านง่าย — chip+badge / ชื่อสาย / รอบ+ลูกศร */
|
|
.mu-stop-expander > summary {
|
|
row-gap: 9px;
|
|
align-items: flex-start;
|
|
}
|
|
.mu-stop-summary-main { flex: 1 1 100%; order: 5; }
|
|
.mu-stop-summary-rail {
|
|
flex: 1 1 100%;
|
|
order: 6;
|
|
margin-left: 0;
|
|
justify-content: space-between;
|
|
}
|
|
.mu-next-arrival {
|
|
font-size: .72rem;
|
|
}
|
|
.mu-stop-expander-body {
|
|
padding-left: 14px;
|
|
}
|
|
.mu-route-filter {
|
|
min-width: 100%;
|
|
}
|
|
}
|
|
@keyframes muPulse {
|
|
0% { box-shadow: 0 0 0 0 rgba(236, 72, 153, 0.38); }
|
|
70% { box-shadow: 0 0 0 8px rgba(236, 72, 153, 0); }
|
|
100% { box-shadow: 0 0 0 0 rgba(236, 72, 153, 0); }
|
|
}
|
|
|
|
/* === Modern image polish === */
|
|
.mu-logo-img { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; box-shadow: 0 4px 12px rgba(0,0,0,.12); }
|
|
.mu-stop-hero-photo { width: 100%; height: 220px; object-fit: cover; border-radius: 16px; display: block; margin-bottom: 12px; box-shadow: 0 10px 24px rgba(63,43,94,.16); }
|
|
/* รูปสำรอง (สถานียังไม่มีรูป) — เป็นไอคอนโปร่งใส จึงใช้ contain + พื้นอ่อน ไม่ให้ยืด/ตัด */
|
|
.mu-stop-hero-photo.is-fallback {
|
|
object-fit: contain; padding: 22px; box-sizing: border-box;
|
|
background: var(--c-surface-2); box-shadow: none; border: 1px solid #e8e4f2;
|
|
}
|
|
.mu-nearby {
|
|
background: var(--c-surface); border: 1px solid var(--mu-border); border-radius: 20px;
|
|
padding: 18px; margin: 14px 0; box-shadow: 0 10px 24px rgba(63,43,94,.06);
|
|
}
|
|
.mu-nearby h2 { margin: 0 0 4px; font-size: 1.15rem; color: var(--mu-ink); }
|
|
.mu-nearby p.sub { margin: 0 0 14px; color: var(--mu-muted); font-size: .85rem; }
|
|
.mu-nearby-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
|
|
.mu-nearby-card { position: relative; border-radius: 14px; overflow: hidden; aspect-ratio: 4/3; box-shadow: 0 6px 14px rgba(63,43,94,.10); cursor: pointer; transition: transform .2s ease; }
|
|
.mu-nearby-card:hover { transform: translateY(-3px); }
|
|
.mu-nearby-card img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
|
|
.mu-nearby-card:hover img { transform: scale(1.06); }
|
|
.mu-nearby-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(15,23,42,0) 50%, rgba(15,23,42,.65) 100%); }
|
|
.mu-nearby-card .cap { position: absolute; left: 12px; right: 12px; bottom: 10px; color: #fff; z-index: 1; font-weight: 700; font-size: .92rem; text-shadow: 0 1px 3px rgba(0,0,0,.4); }
|
|
.mu-nearby-card .cap small { display: block; font-weight: 500; opacity: .85; font-size: .76rem; }
|