theme: dark mode + theme tokens (parity with web-at-transit)

- ui/theme.css: token set copied value-for-value from the Next app
  (--c-surface/-ink/-border/-brand/-tint/-glass + radius), light and dark blocks
- ui/theme.js: 3-mode switch (light / dark / auto=prefers-color-scheme) with a
  header dropdown, aria-haspopup/menu, Esc/outside close, live matchMedia listener
- index.html: pre-paint theme script (no flash), theme.css link before _shared.css
- remapped ~290 literal colours in _shared.css/index.html/partials to var(--c-*)
  so both projects render from the same tokens; dark patch block covers the
  remaining decorative gradients
- DESIGN.md: new section 3.2 (theme tokens + where to add colours)
- VERSION 2026.09.27.114
This commit is contained in:
Bkk1234 committed 2026-11-04 01:29:37 +07:00
1 parent bea8f0773e
commit cdfd77ffff
18 files changed
+742 -329

No files matched your search

+44 -44
View File
@@ -1,11 +1,11 @@
<style>
.mu-page {
background:
linear-gradient(180deg, #ffffff 0%, #faf7ff 55%, #f4f0fd 100%);
linear-gradient(180deg, var(--c-surface) 0%, #faf7ff 55%, #f4f0fd 100%);
}
.mu-hero-panel {
background: #ffffff;
background: var(--c-surface);
border: 1px solid #1f2a44;
border-radius: 8px;
padding: 18px;
@@ -15,8 +15,8 @@
gap: 16px;
align-items: stretch;
}
.mu-hero-title { margin: 0; font-size: 1.6rem; line-height: 1.2; color: #1f2a44; }
.mu-hero-subtitle { margin: 8px 0 0; color: #66728f; font-size: .95rem; max-width: 48rem; }
.mu-hero-title { margin: 0; font-size: 1.6rem; line-height: 1.2; color: var(--c-ink); }
.mu-hero-subtitle { margin: 8px 0 0; color: var(--c-ink-2); font-size: .95rem; max-width: 48rem; }
.mu-kpi-grid { display:grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.mu-kpi {
border: 1px solid #d9c9f2;
@@ -24,10 +24,10 @@
padding: 12px;
background: linear-gradient(135deg, #f0e7fc, #e6d8f8);
}
.mu-kpi .label { margin: 0; color:#6b5b8a; font-size:.76rem; font-weight:700; letter-spacing:.03em; text-transform: uppercase; }
.mu-kpi .value { margin:4px 0 0; color:#2b1f4d; font-size:1.03rem; font-weight:800; font-variant-numeric: tabular-nums; }
.mu-kpi .label { margin: 0; color:var(--c-ink-3); font-size:.76rem; font-weight:700; letter-spacing:.03em; text-transform: uppercase; }
.mu-kpi .value { margin:4px 0 0; color:var(--c-ink); font-size:1.03rem; font-weight:800; font-variant-numeric: tabular-nums; }
.mu-hero-map {
border: 1px solid #e7e0f6;
border: 1px solid var(--c-border);
border-radius: 8px;
padding: 14px;
display:flex;
@@ -35,7 +35,7 @@
gap: 10px;
justify-content:space-between;
}
.mu-hero-map-title { margin:0; font-size:1rem; font-weight:800; color:#2c3e50; }
.mu-hero-map-title { margin:0; font-size:1rem; font-weight:800; color:var(--c-ink); }
.mu-hero-map-box {
flex:1;
min-height: 160px;
@@ -45,7 +45,7 @@
display:flex;
align-items:center;
justify-content:center;
color:#66728f;
color:var(--c-ink-2);
font-weight:700;
text-align:center;
padding: 18px;
@@ -53,7 +53,7 @@
/* ===== Search toolbar: 2 โหมด ===== */
.mu-toolbar {
background: #ffffff;
background: var(--c-surface);
border: 1px solid #d9c9f2;
border-radius: 8px;
padding: 14px;
@@ -76,8 +76,8 @@
padding: 10px 18px;
border: none;
border-right: 1px solid #d5c3f0;
background: #fff;
color: #5b3b71;
background: var(--c-surface);
color: var(--c-ink-2);
cursor: pointer;
display: inline-flex;
align-items: center;
@@ -100,7 +100,7 @@
gap: 10px;
border: 1px solid #d5c3f0;
border-radius: 8px;
background: #fff;
background: var(--c-surface);
padding: 0 12px;
min-height: 48px;
transition: border-color .15s ease;
@@ -116,10 +116,10 @@
font-family: inherit;
font-size: 1rem;
font-weight: 600;
color: #1f2a44;
color: var(--c-ink);
padding: 12px 0;
}
.mu-search-field input::placeholder { color: #6f7b95; font-weight: 500; opacity: .8; }
.mu-search-field input::placeholder { color: var(--c-ink-2); font-weight: 500; opacity: .8; }
/* ===== ช่องรหัสป้าย 6 ช่อง: [x] + [x][x][x][x] ===== */
.mu-code-boxes {
@@ -135,8 +135,8 @@
font-size: 1.35rem;
font-weight: 700;
font-variant-numeric: tabular-nums;
color: #1f2a44;
background: #fff;
color: var(--c-ink);
background: var(--c-surface);
border: 2px solid #e0d6f5;
border-radius: 8px;
outline: none;
@@ -149,7 +149,7 @@
.mu-code-cell::placeholder { color: #7a6a9e; font-weight: 600; opacity: 1; }
.mu-code-cell:focus {
border-color: #a855f7;
background: #faf7ff;
background: var(--c-surface-2);
}
.mu-code-cell:disabled { opacity: .45; }
/* 2 หลักหน้า (ก่อน +) — เน้นให้เห็นว่าเป็นหัวของรหัส */
@@ -167,7 +167,7 @@
font-family: "IBM Plex Mono", ui-monospace, monospace;
font-size: 1.5rem;
font-weight: 700;
color: #7a4cc0;
color: var(--c-brand-ink);
line-height: 1;
padding: 0 2px;
}
@@ -176,10 +176,10 @@
font-family: "IBM Plex Mono", ui-monospace, monospace;
font-size: .9rem;
font-weight: 700;
color: #6d28d9;
color: var(--c-brand-ink);
font-variant-numeric: tabular-nums;
}
.mu-search-hint { margin: 8px 0 0; font-size: .85rem; color: #5f6b83; }
.mu-search-hint { margin: 8px 0 0; font-size: .85rem; color: var(--c-ink-2); }
/* numpad — โชว์เฉพาะจอเล็ก */
.mu-numpad { display: none; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; max-width: 320px; }
@@ -190,8 +190,8 @@
padding: 14px 0;
border: 1px solid #e0d6f5;
border-radius: 8px;
background: #fff;
color: #1f2a44;
background: var(--c-surface);
color: var(--c-ink);
cursor: pointer;
font-variant-numeric: tabular-nums;
transition: background .12s ease, border-color .12s ease;
@@ -205,7 +205,7 @@
border-radius: 8px;
margin-top: 8px;
overflow: hidden;
background: #fff;
background: var(--c-surface);
max-height: 260px;
overflow-y: auto;
}
@@ -218,15 +218,15 @@
padding: 11px 14px;
border: none;
border-bottom: 1px solid #f1edfa;
background: #fff;
background: var(--c-surface);
font-family: inherit;
font-size: .9rem;
text-align: left;
cursor: pointer;
color: #1f2a44;
color: var(--c-ink);
}
.mu-suggest-item:last-child { border-bottom: none; }
.mu-suggest-item:hover { background: #faf7ff; }
.mu-suggest-item:hover { background: var(--c-surface-2); }
.mu-suggest-code {
font-family: "IBM Plex Mono", ui-monospace, monospace;
font-size: .85rem;
@@ -244,8 +244,8 @@
.mu-show-more .mu-btn { min-width: 220px; }
.mu-stop-card.is-stub { min-height: 120px; background: #faf8ff; border: 1px dashed #ddd2f2; box-shadow: none; }
.mu-toolbar-count { margin: 10px 0 0; font-size: .84rem; color: #6f7b95; }
.mu-toolbar-count b { color: #7a4cc0; font-variant-numeric: tabular-nums; }
.mu-toolbar-count { margin: 10px 0 0; font-size: .84rem; color: var(--c-ink-2); }
.mu-toolbar-count b { color: var(--c-brand-ink); font-variant-numeric: tabular-nums; }
/* ===== การ์ดป้าย ===== */
.mu-stop-grid[hidden] { display: none; }
@@ -260,15 +260,15 @@
margin: 0;
border-radius: 8px;
overflow: hidden;
border: 1px solid #e7e0f6;
background: #fff;
border: 1px solid var(--c-border);
background: var(--c-surface);
transition: border-color .15s ease, transform .15s ease;
}
.mu-stop-grid li:hover { border-color: #a855f7; transform: translateY(-1px); }
.mu-stop-card {
height: 100%;
padding: 16px;
background: #fff;
background: var(--c-surface);
display:flex;
flex-direction:column;
gap: 12px;
@@ -283,9 +283,9 @@
font-weight:800;
letter-spacing:.01em;
}
.mu-type-pill.local { background: #f3ecff; color: #6d28d9; }
.mu-stop-title { margin:6px 0 0; font-size:1.05rem; line-height:1.3; color:#1f2a44; }
.mu-loc { color:#6f7b95; font-size:.85rem; margin-top:4px; }
.mu-type-pill.local { background: #f3ecff; color: var(--c-brand-ink); }
.mu-stop-title { margin:6px 0 0; font-size:1.05rem; line-height:1.3; color:var(--c-ink); }
.mu-loc { color:var(--c-ink-2); font-size:.85rem; margin-top:4px; }
.mu-chip-row { display:flex; flex-wrap:wrap; gap:8px; }
.mu-chip {
display:inline-flex;
@@ -293,13 +293,13 @@
gap:6px;
padding:5px 10px;
border-radius: 4px;
background: #faf7ff;
border: 1px solid #e7e0f6;
color:#5b3b71;
background: var(--c-surface-2);
border: 1px solid var(--c-border);
color:var(--c-ink-2);
font-size:.8rem;
font-weight:700;
}
.mu-chip.route { background: #f3ecff; color:#6d28d9; border-color: #e0d6f5; }
.mu-chip.route { background: #f3ecff; color:var(--c-brand-ink); border-color: #e0d6f5; }
/* ชิปสายที่เป็นลิงก์ → ไปหน้าเช็กเวลาของสายนั้น (หน้าตาเหมือนชิปเดิม + มี hover/focus) */
a.mu-chip.route { text-decoration: none; cursor: pointer; }
a.mu-chip.route:hover { background:#e9dcff; border-color:#cdb5f2; }
@@ -318,15 +318,15 @@
padding: 7px 11px;
}
.mu-stop-action { margin-top:auto; display:flex; justify-content:space-between; align-items:center; gap:12px; }
.mu-stop-note { color:#6f7b95; font-size:.8rem; margin:0; }
.mu-stop-note { color:var(--c-ink-2); font-size:.8rem; margin:0; }
.mu-stop-thumb {
display: block;
width: 100%;
height: 180px;
object-fit: cover;
background: #f7f9fd;
border-bottom: 1px solid #e7e0f6;
background: var(--c-bg);
border-bottom: 1px solid var(--c-border);
}
/* รูป placeholder — ย่อและจัดกลาง ไม่ให้ครอปโลโก้ */
.mu-stop-thumb.is-placeholder {
@@ -340,10 +340,10 @@
list-style: none;
padding: 40px 16px;
text-align: center;
color: #6f7b95;
color: var(--c-ink-2);
border: 1px dashed #e0d6f5;
border-radius: 8px;
background: #fff;
background: var(--c-surface);
}
@media (max-width: 980px) {