Declutter navbar: one button per tool (theme, language)
The topbar carried five small buttons in a row (3 theme + 2 language). Replaced with two single buttons that open their own popover menu: - ThemeSwitch: single icon button showing the active mode, menu with light/dark/auto as menuitemradio - LangSwitch: new component showing the active code (ไทย / EN), menu keeps the existing [data-i18n-switch] mechanism from i18n.ts - .mu-topbar-tools wrapper, 8px gap (WCAG 2.5.8), 40px buttons / 44px on touch - popovers close on select, outside click and Escape (focus returns to button) Also fixed two bugs found on /stops: - .mu-btn.outline had no CSS rule, so the browser painted a light grey background that ignored the dark theme - deleted the unused StopSearch component which still carried the old number pad and its delete key, plus the now-unused stops.padDelete key Verified at 375px: no horizontal overflow, buttons 40x40 and 59x40, 8px gap; menus open/close correctly in both themes.
This commit is contained in:
1 parent
bf42076b52
commit
cb4905a12d
11 files changed
+338
-283
No files matched your search
@@ -267,6 +267,24 @@ subset thai/latin/latin-ext · ~218 KB) + ไฟล์ `.woff2` 18 ไฟล์
|
||||
- active menu = เส้นใต้ `--purple`
|
||||
- CTA "เช็กเวลาเดินรถ" = พื้น `--grad-brand` ตัวอักษรขาวหนา
|
||||
|
||||
#### เครื่องมือในแถบนำทาง — "ปุ่มละเรื่อง" (`.mu-topbar-tools`)
|
||||
**ห้ามวางกลุ่มปุ่มเรียงเป็นแถว** (เช่น ปุ่มธีม 3 ปุ่ม + ปุ่มภาษา 2 ปุ่ม = 5 ปุ่ม) เพราะทำให้แถบนำทางแน่นและล้นบนจอเล็ก
|
||||
|
||||
| ปุ่ม | แสดง | กดแล้ว |
|
||||
|---|---|---|
|
||||
| ธีม (`.mu-pop-btn`) | ไอคอนของโหมดที่ใช้อยู่ (สว่าง/มืด/ตามเวลา) | เปิดเมนู 3 ตัวเลือก `role="menuitemradio"` |
|
||||
| ภาษา (`.mu-pop-btn-lang`) | รหัสภาษาที่ใช้อยู่ (`ไทย` / `EN`) + chevron | เปิดเมนู 2 ภาษา |
|
||||
|
||||
- ปุ่มกลมเหลี่ยม `height 40px` · `radius 8px` · ขอบ `--c-border` · ตัวอักษร `--c-brand-ink`
|
||||
- จอสัมผัส → `44px`
|
||||
- ระยะห่างระหว่างปุ่ม **≥ 8px** (WCAG 2.5.8)
|
||||
- เมนู `.mu-pop-panel` ชิดขวา `z-index: 1200` (เหนือ topbar 1100 · ใต้ visitor dialog 3000)
|
||||
- ปิดเมนูด้วย: เลือกแล้ว · คลิกนอก · `Esc` (คืนโฟกัสที่ปุ่ม)
|
||||
- ข้อความในเมนูมีทั้งไทยและอังกฤษกำกับ (`.mu-pop-item-th` / `.mu-pop-item-en`)
|
||||
|
||||
#### ปุ่มขอบ (`.mu-btn.outline`)
|
||||
พื้นโปร่งใส + ขอบและตัวอักษร `--c-brand-ink` — **ต้องมีกฎนี้เสมอ** ถ้าไม่มี เบราว์เซอร์จะใส่พื้นเทาอ่อนเองและหลุดธีมในโหมดมืด
|
||||
|
||||
### ฟอร์มค้นหา
|
||||
- พื้น `--paper` ขอบ `--line`, โฟกัส = ขอบ `--purple-300` — ไม่มี glow
|
||||
- ช่องกรอกแบบแบ่งกล่อง (รหัสป้าย) ใช้ mono + กล่องละ 1 หลัก
|
||||
|
||||
Reference in new issue
Block a user