Bkk1234 750b4a2ea8 mock: three search tabs - stop code, place name, near me
- busStop.html: added the third tab (data-mode=near) and its own panel with
  the location button, hint and result area; removed the near button from the
  toolbar and deleted the old on-screen numpad markup
- busStop.search.js: MODE_NEAR in setMode, disables the other panels, hides
  the stop list while ranked results are shown, skips filtering in that mode,
  and removed the dead initNumpad code
- security gate: the tab is revealed only when isSecureContext and
  navigator.geolocation exist; otherwise it stays hidden and the mode is
  refused
- map.js: re-enable the button after a successful lookup
- i18n: stops.modeNear / nearCta / nearHint
- bump SW version to 2026.09.27.98

Verified on localhost:8090 - three tabs, near mode shows a map with 8 ranked
stops, button re-enables and works again, switching back restores the list;
with isSecureContext forced false the tab is hidden and unselectable.
2026-10-24 00:11:56 +07:00
2026-08-22 17:15:30 +07:00
add
2026-09-23 00:53:04 +07:00
add
2026-09-23 00:53:04 +07:00
add
2026-09-23 00:53:04 +07:00

web-at-transit-mock

Static HTML mockup / ดีไซน์ต้นแบบเว็บข้อมูลการเดินรถ — สถานีขนส่งผู้โดยสารจังหวัดอ่างทอง (Atroute)

repo นี้เป็น static HTML + vanilla JS (ไม่มี backend / framework / build step) ส่วน implementation จริง (Next.js) อยู่ที่ web-at-transit

โครงสร้าง

web-at-transit-mock/
├── maintheme.png               ← ภาพธีม/ดีไซน์ต้นแบบ
├── Makefile                    ← คำสั่งรวม (make setup / pack / serve)
├── ui/                         ← Single-page app (hash router)
│   ├── index.html                  shell หน้าเดียว
│   ├── router.js / i18n.js / pwa.js / sw.js
│   ├── _shared.css / responsive.css
│   └── partials/                   view ละ 1 ไฟล์ (router fetch + inject)
├── resource/
│   ├── data/                   ← ข้อมูล mock: routes.json, schedules.json, stations.json, ...
│   └── images.zip              ← ★ รูปทั้งหมด (บีบไว้ — แตกด้วย make setup)
└── .image/                     ← รูปทั้งหมด (hidden — เกิดหลัง make setup, ไม่ commit)

วิธี run

cd web-at-transit-mock
make setup                      # 1. แตก resource/images.zip → .image/ (ครั้งเดียว)
make serve                      # 2. รัน static server (Ctrl+C เพื่อหยุด)

แล้วเปิดเบราว์เซอร์ที่:

http://localhost:8090/ui/index.html

ดูคำสั่งทั้งหมด: make help

เงื่อนไขสำคัญ

  1. ต้องรัน make setup ก่อน — ไม่งั้นรูปพังทั้งหน้า (relative path ../.image/... หาไฟล์ไม่เจอ)
  2. ต้อง serve จาก root ของ repo (ไม่ใช่จาก ui/) — รูปและข้อมูลอ้างอิงด้วย relative path
  3. ห้ามเปิด file:// — fetch JSON + relative path จะใช้ไม่ได้ ต้องผ่าน static server เสมอ
  4. เปลี่ยน port ได้ด้วย make serve PORT=8080

การจัดการรูปภาพ (images)

รูปทั้งหมด (~31MB) อยู่ใน folder hidden .image/ (ถูก .gitignore → ไม่ push ขึ้น git) โดยแจกผ่านไฟล์เดียว resource/images.zip:

  • แตกไฟล์ (ครั้งแรกหลัง clone): make setup

  • เพิ่ม/เปลี่ยนรูป: แก้ไฟล์ใน .image/ แล้ว re-zip:

    make pack
    

    แล้ว commit resource/images.zip

  • ห้าม commit ไฟล์ใน .image/ — อยู่ใน .gitignore แล้ว

หมายเหตุ (ไม่ต้องแก้)

  • ui/index.html อ้าง ../../frontend-web-transit/web-transit/css/main-theme.css — ไฟล์นี้ไม่อยู่ใน repo (ดู AGENTS.md ข้อ 12) จะขึ้น 404 ใน DevTools แต่ไม่กระทบ การแสดงผล เพราะสไตล์จริงอยู่ที่ _shared.css
  • Google Fonts (fonts.googleapis.com) ต้องต่อเน็ต — ถ้า offline ฟอนต์จะ fallback เป็น system font แต่หน้าไม่พัง
  • รายละเอียดกฎการแก้โค้ดฉบับเต็ม ดูใน AGENTS.md และ DESIGN.md
S
Description
No description provided
Readme
167 MiB
0 Stars 1 Watchers 0 Forks
Languages
JavaScript 43.8%
HTML 37.5%
Python 11.2%
CSS 7.2%
Shell 0.2%
Other 0.1%