navbar: rebuild mock header from the Next implementation (source of truth)

- markup: lang + theme moved into .mu-topbar-tools (theme first, then lang),
  same order as web-at-transit: brand, nav, menu, tools, CTA
- CSS: replaced mock's .mu-lang-*/.mu-theme-* buttons with the Next rules
  (.mu-pop / .mu-pop-btn / .mu-pop-btn-lang / .mu-pop-panel / .mu-pop-item,
  40px tall, radius 8px, surface bg, 44px on coarse pointers)
- lang button keeps short label + 12px chevron; menu items use
  .mu-pop-item-th/.mu-pop-item-en and data-active for the selected row
- nav 0.95rem (was .92rem), header border -> var(--c-border)
- theme.js was never included in the shell (regex missed the versioned src) —
  added after i18n.js + precached with theme.css; that was why the theme menu
  did not open in the previous build
- VERSION 2026.09.27.120
This commit is contained in:
Bkk1234 committed 2026-11-04 01:37:50 +07:00
1 parent 5800a61da3
commit eabcff197c
7 files changed
+134 -102

No files matched your search

+68 -45
View File
@@ -406,85 +406,108 @@ body:has(.mu-site-footer) .mu-footer { display: none; }
padding: 10px 12px 10px 38px;
}
/* ---------- ปุ่มสลับภาษา (dropdown เดียว — ไทย / English) ---------- */
.mu-lang-switch {
position: relative;
display: inline-flex;
/* ============================================================
ปุ่มเครื่องมือในแถบนำทาง — พอร์ตจาก web-at-transit (ต้นทางความจริง)
ธีม 1 ปุ่ม · ภาษา 1 ปุ่ม · แต่ละปุ่มมีเมนูของตัวเอง
radius 8px · สูง 40px (44px บนจอสัมผัส)
============================================================ */
.mu-topbar-tools {
display: flex;
align-items: center;
gap: 8px; /* WCAG 2.5.8 — เว้นระหว่างเป้ากด ≥ 8px */
flex-shrink: 0;
}
.mu-lang-btn {
.mu-pop { position: relative; display: inline-flex; }
.mu-pop-btn {
display: inline-flex;
align-items: center;
gap: 6px;
min-height: 34px;
padding: 6px 12px;
border: 1px solid #e4dcf2;
border-radius: 999px;
background: var(--c-surface-3);
justify-content: center;
gap: 4px;
min-width: 40px;
height: 40px;
padding: 0 8px;
border: 1px solid var(--c-border);
border-radius: var(--radius);
background: var(--c-surface);
color: var(--c-brand-ink);
font-family: inherit;
font-size: .78rem;
font-weight: 700;
font-size: .76rem;
line-height: 1;
cursor: pointer;
transition: background .15s ease, color .15s ease, border-color .15s ease;
transition: border-color .15s ease, background .15s ease;
}
.mu-lang-btn:hover { color: var(--c-brand-ink); border-color: var(--c-border); }
.mu-lang-btn[aria-expanded="true"] { background: var(--c-surface); border-color: #cbb8ea; }
.mu-lang-btn .ic { width: 15px; height: 15px; }
.mu-lang-caret {
width: 0 !important;
height: 0 !important;
margin-left: 1px;
border: 4px solid transparent;
border-top-color: currentColor;
transition: transform .18s ease;
.mu-pop-btn-lang { min-width: 56px; padding: 0 10px; }
.mu-pop-btn:hover { border-color: #d8c9f2; background: var(--c-surface-2); }
.mu-pop-btn:active { transform: translateY(1px); }
.mu-pop-btn:focus-visible {
outline: 2px solid var(--c-focus);
outline-offset: 2px;
}
.mu-lang-btn[aria-expanded="true"] .mu-lang-caret { transform: rotate(180deg); }
.mu-lang-menu {
.mu-pop-btn[aria-expanded="true"] {
border-color: var(--c-brand-ink);
background: var(--c-surface-2);
}
.mu-pop-btn .ic { width: 18px; height: 18px; }
/* เมนูที่กางออก */
.mu-pop-panel {
position: absolute;
top: calc(100% + 6px);
right: 0;
z-index: 1200;
min-width: 168px;
padding: 6px;
background: var(--c-surface);
border: 1px solid var(--c-border);
border-radius: 12px;
box-shadow: 0 10px 28px rgba(15, 23, 42, .14);
border-radius: var(--radius);
background: var(--c-surface);
box-shadow: 0 10px 24px var(--c-shadow);
}
.mu-lang-menu[hidden] { display: none; }
.mu-lang-menu button {
.mu-pop-panel[hidden] { display: none; }
.mu-pop-item {
display: flex;
align-items: center;
gap: 8px;
width: 100%;
min-height: 38px;
min-height: 40px;
padding: 8px 10px;
border: 0;
border-radius: 8px;
border-radius: var(--radius-sm);
background: transparent;
color: var(--c-ink);
font-family: inherit;
font-size: .84rem;
font-size: .85rem;
font-weight: 600;
text-align: left;
text-align: start;
cursor: pointer;
}
.mu-lang-menu button:hover { background: #f6f2ff; }
.mu-lang-menu button[aria-checked="true"] { color: var(--c-brand-ink); font-weight: 800; background: var(--c-brand-soft); }
.mu-lang-menu button .mu-lang-code {
margin-left: auto;
font-family: ui-monospace, "IBM Plex Mono", monospace;
font-size: .72rem;
color: var(--c-ink-3);
.mu-pop-item:hover { background: var(--c-surface-2); }
.mu-pop-item:focus-visible {
outline: 2px solid var(--c-focus);
outline-offset: -2px;
}
.mu-pop-item[data-active="1"] {
background: var(--c-tint-purple);
color: var(--c-brand-ink);
font-weight: 700;
}
.mu-pop-item-th { flex: 1 1 auto; }
.mu-pop-item-en {
flex: 0 0 auto;
font-size: .72rem;
font-weight: 600;
color: var(--c-ink-2);
letter-spacing: .04em;
}
.mu-pop-item[data-active="1"] .mu-pop-item-en { color: var(--c-brand-ink); }
/* ---------- ปุ่มธีม (dropdown 3 โหมด — สว่าง / มืด / ตามอุปกรณ์) ---------- */
.mu-theme-btn { padding: 6px 9px; }
.mu-theme-icon { display: inline-flex; }
.mu-theme-icon svg { width: 16px; height: 16px; }
@media (pointer: coarse) {
.mu-pop-btn { min-width: 44px; height: 44px; }
.mu-pop-btn-lang { min-width: 60px; }
}
/* ============================================================
ปุ่ม + ฟอร์มคอนโทรล (shared — ทุกหน้าใช้ร่วมกัน)