Commit Graph
4 Commits
Author SHA1 Message Date
Bkk1234 cb4905a12d 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.
2026-10-23 23:37:44 +07:00
Bkk1234 bf42076b52 Align share button and all component scales with DESIGN.md
Share button was themed only in pages/home.css, so /stops, /routes and
/check rendered an unstyled button. Moved to _shared.css and rebuilt as a
ghost variant of .mu-btn:
- radius 12px -> var(--radius) 8px, min-height 44px (48px on touch)
- focus ring #2b2f42 (near-black) -> var(--c-focus)
- LINE link green -> brand purple (DESIGN.md is single-accent)
- hover/active/transition states added

Global scale cleanup (DESIGN.md allows 4px/8px radii only):
- 16 distinct border-radius values -> var(--radius-sm) / var(--radius) / var(--radius-pill)
- 39 distinct font-sizes -> 13-step scale
- outline-offset 1px/2px/3px -> 2px everywhere
- radius and type scale documented in DESIGN.md as enforced tokens

Verified across 4 pages x 2 themes: identical 44x158 button, radius 8px,
contrast 5.80 light / 7.37 dark, no horizontal overflow.
2026-10-23 23:32:37 +07:00
Bkk1234 7ac7bf5878 Add 3-mode theme system (light / dark / auto by device clock) and tokenize colors
- 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
2026-10-23 23:01:06 +07:00
itmeadmin 138a3d15d8 พอร์ต UI จาก web-at-transit-mock เข้า Next.js + data sync เข้า Postgres/SeaweedFS
- 8 หน้า (home/stops/routes/stop/check/blog/about/credits) แปลง partials → React component ตรง mock
- ตรรกะพอร์ตเป็น src/lib/ui/*.ts (mount()) + runtime/PageRuntime
- CSS: base + pages/*.css import ต่อ route (คงลำดับ cascade ของ mock)
- asset/content: public/{image,resource/data,content,locales,vendor}
- แก้ path รูปไทล์พาร์ทเนอร์ (.image → /image) + fallback absolute
- ลบ UI เดิมที่ไม่ตรง mock (expanded/stops details/old components/globals.css)
- script/sync_data_to_postgres.mjs + sync_images_to_storage.mjs (dry-run/--apply, backup)
- docs/UI-PORT.md + DESIGN.md + README
2026-10-23 15:50:00 +07:00