feat: minibus passenger info landing (Vue 3 + Node/JSON API)
- route Ang Thong - Pa Mok - Chum Thang Phachi, hourly 05:00-17:00 both directions - timetable, stops, fares, on-board service, notices, FAQ, operator contact - light green/white flat design tokens with measured contrast; K2D font - zero-dependency Node server: /api/overview, /api/next, static dist
This commit is contained in:
commit
7db9adc6de
32 files changed
+3899
No files matched your search
@@ -0,0 +1,4 @@
|
||||
node_modules/
|
||||
dist/
|
||||
.DS_Store
|
||||
*.log
|
||||
@@ -0,0 +1,52 @@
|
||||
# AGENTS.md — กติกาสำหรับ agent/นักพัฒนาที่แก้โปรเจกต์นี้
|
||||
|
||||
## หลักการ
|
||||
|
||||
1. **ข้อมูลอยู่ใน `data/*.json` เท่านั้น** — component ห้าม hardcode เวลา ราคา ชื่อจุดจอด หรือเบอร์โทร
|
||||
2. **backend เป็น JS ล้วน** (`server/server.mjs`) ไม่เพิ่ม dependency เว้นแต่จำเป็นจริง
|
||||
3. **สัญญา API ห้ามแตก** — เพิ่มคีย์ใหม่ได้ แต่ห้ามเปลี่ยน/ลบชื่อคีย์เดิม (`direction_id`, `departure_time`, `stop_id`, `zone_id` ...) เพราะ frontend อ่านตรง ๆ
|
||||
4. เปลี่ยนชื่อคีย์ = ต้องแก้พร้อมกันทั้ง `data/`, `server/`, `src/` และอัปเดต README
|
||||
5. แก้คำ/ค่าที่ผู้ใช้เห็น → อัปเดต `DESIGN.md` และ README ให้ตรงกัน
|
||||
|
||||
## ขั้นตอนทำงาน
|
||||
|
||||
```bash
|
||||
npm run api # ตรวจ API: curl http://localhost:8090/api/health
|
||||
npm run dev # ตรวจ UI: http://localhost:5173
|
||||
npm run build && npm start # ตรวจของจริงที่ 8090
|
||||
node --check server/server.mjs
|
||||
```
|
||||
|
||||
- ก่อน commit: `npm run build` ต้องผ่าน (dist/ ไม่เข้า git)
|
||||
- หลังแก้ CSS/JS แล้วรีเฟรชไม่เห็นผล → เติม `?v=N` ตอนเปิด URL
|
||||
- ตรวจ layout จริงด้วยการวัด: `document.documentElement.scrollWidth === window.innerWidth`
|
||||
|
||||
## โครงสร้างข้อมูลที่ห้ามรื้อ
|
||||
|
||||
```
|
||||
route.json stops[] (stop_id ต้องตรงกับ fare zones + directions.stop_ids)
|
||||
directions[] (direction_id: outbound | inbound)
|
||||
timetable.json days[] → directions[] → departures[{departure_time, arrival_time, seats_total, ...}]
|
||||
fares.json zones[] + fare_matrix[] (อ้าง zone_id) + discounts + payment_methods
|
||||
service.json vehicle / luggage / accessibility / boarding_steps / operating_rules
|
||||
notices.json notices[] (type: info | warning, effective_date ISO)
|
||||
faq.json faq[{question, answer}]
|
||||
operator.json contact + channels[]
|
||||
```
|
||||
|
||||
เวลาในตารางเป็น `HH:mm` 24 ชั่วโมง ตรงเวลาไทยเสมอ (ห้ามเก็บ timezone ในแต่ละแถว)
|
||||
|
||||
## สิ่งที่ห้ามทำ
|
||||
|
||||
- ห้ามใส่ shadow / gradient / emoji (ดู `DESIGN.md`)
|
||||
- ห้ามย้ายข้อมูลไปฝังใน component เพื่อ "ให้ง่าย"
|
||||
- ห้ามลบ `aria-*`, `scope` ของตาราง, หรือปุ่ม `aria-pressed` ในแท็บทิศทาง
|
||||
- ห้าม commit `node_modules/`, `dist/`, ไฟล์ `.log`
|
||||
- ห้ามใช้ `git push --force` กับ branch `main`
|
||||
|
||||
## งานที่ทำค้างไว้ / ต่อยอดได้
|
||||
|
||||
- ตัวเลือกวัน (จันทร์–ศุกร์ vs เสาร์–อาทิตย์) — ปัจจุบัน `timetable.days` มีชุดเดียว `all_days`
|
||||
- ที่นั่งคงเหลือรายเที่ยว (ต้องมีระบบจอง/คนขับอัปเดต)
|
||||
- หน้าภาษาอังกฤษ (`route_name_en` มีอยู่แล้วใน `route.json`)
|
||||
- PWA + offline timetable (แคช `/api/timetable`)
|
||||
@@ -0,0 +1,81 @@
|
||||
# DESIGN.md — IdealRoute (รัฐธรรมนูญการออกแบบ)
|
||||
|
||||
ใช้กับทุกหน้าจอของโปรเจกต์นี้ ถ้าจะเปลี่ยนค่าตัวอย่างใด ให้แก้ที่ `src/style.css` **และ** ไฟล์นี้พร้อมกัน
|
||||
|
||||
## 1. แนวคิด
|
||||
|
||||
- **Flat design**: ไม่มีเงา (box-shadow) ไม่มีไล่สี (gradient) ไม่มี 3D
|
||||
- **เขียวอ่อน–ขาว**: พื้นหลังเขียวอ่อน คอนเทนต์ขาว เขียวเข้มเป็นสีแบรนด์ ตัวอักษรเข้มเกือบดำ
|
||||
- **อ่านจากมือถือก่อน** ผู้โดยสารส่วนใหญ่เปิดหน้านี้บนมือถือตอนยืนรอรถ
|
||||
- **ข้อมูลนำการออกแบบ**: ทุก section ต้องตอบคำถามผู้โดยสารได้ 1 ข้อ (กี่โมง/เท่าไร/ขึ้นที่ไหน/ติดต่อใคร)
|
||||
- **ห้ามใช้ emoji แทนไอคอน** ใช้ SVG จาก `AppIcon.vue` (ชุด Lucide)
|
||||
|
||||
## 2. สี (วัดคอนทราสต์จริงแล้ว)
|
||||
|
||||
| Token | ค่า | ใช้กับ | คอนทราสต์ |
|
||||
|---|---|---|---|
|
||||
| `--bg` | `#F5FBF7` | พื้นหลังหน้า | ตัวอักษรหลัก 14.03:1 |
|
||||
| `--surface` | `#FFFFFF` | การ์ด ตาราง | 14.71:1 |
|
||||
| `--surface-alt` | `#EAF7EF` | section สลับ, หัวตาราง | ข้อความรอง 6.09:1 |
|
||||
| `--fg` | `#0E2E1D` | ตัวอักษรหลัก | — |
|
||||
| `--muted` | `#4A6154` | คำอธิบาย ข้อความรอง | 6.71:1 บนขาว |
|
||||
| `--primary` | `#17804E` | ปุ่มหลัก, แท็บ active | ขาวบนเขียว 4.96:1 |
|
||||
| `--primary-strong` | `#0F6B41` | หัวข้อ, ลิงก์, ขอบโฟกัส | 6.56:1 (ขาวบนเขียว) |
|
||||
| `--primary-soft` | `#E4F5EA` | ชิป, แถวไฮไลต์ | เขียวเข้มบนชิป 5.80:1 |
|
||||
| `--warn` | `#8A6A00` | ประกาศผลกระทบการเดินทาง | 4.69:1 บน `#FFF6DA` |
|
||||
| `--danger` | `#B3261E` | รายการที่ไม่อนุญาต | ใช้เฉพาะข้อความสั้น |
|
||||
|
||||
กติกา: เพิ่มสีใหม่ต้องคำนวณคอนทราสต์ ≥ 4.5:1 สำหรับข้อความปกติ และ ≥ 3:1 สำหรับตัวอักษรใหญ่/ขอบของส่วนประกอบ
|
||||
|
||||
## 3. ตัวอักษร
|
||||
|
||||
| บทบาท | ค่า |
|
||||
|---|---|
|
||||
| ฟอนต์ | `K2D` (ฝังผ่าน `@fontsource/k2d`, subset ไทย+ละติน) น้ำหนัก 400/500/600/700 |
|
||||
| เนื้อหา | 16px / line-height 1.6 |
|
||||
| h1 | `clamp(2rem, 4.6vw, 3.1rem)` น้ำหนัก 700 |
|
||||
| h2 | `clamp(1.5rem, 3vw, 2rem)` |
|
||||
| h3 การ์ด | 1rem–1.0625rem |
|
||||
| ตัวเลขเวลา | `font-variant-numeric: tabular-nums` (`.num`) |
|
||||
|
||||
## 4. ระยะและเลย์เอาต์
|
||||
|
||||
- สเกล: 4 / 8 / 12 / 16 / 24 / 32 / 48 / 64 px (`--space-1..8`)
|
||||
- คอนเทนเนอร์กว้างสุด 1140px, padding ข้าง 20px
|
||||
- เบรกพอยต์: 900px (สองคอลัมน์ → คอลัมน์เดียว), 620/520/460/420px (ปรับการ์ด/ตาราง)
|
||||
- ตารางกว้างเกินจอ → `.table-wrap { overflow-x: auto }` ห้ามให้หน้าเลื่อนแนวนอน
|
||||
- ระยะกดขั้นต่ำ 44×44px (ปุ่ม/แท็บใช้ `min-height: 44px`)
|
||||
- `html { scroll-padding-top: 76px }` เพราะ header เป็น sticky
|
||||
|
||||
## 5. องค์ประกอบหลัก
|
||||
|
||||
| องค์ประกอบ | กติกา |
|
||||
|---|---|
|
||||
| `.card` | ขอบ 1px `--border` มุม 12px ไม่มีเงา |
|
||||
| `.btn--primary` | พื้นเขียว ขาว ตัวอักษร 600 สูง ≥44px |
|
||||
| `.chip` | แคปซูล พื้น `--primary-soft` ตัวอักษร `--primary-strong` |
|
||||
| ตาราง `table.data` | หัวตารางพื้น `--surface-alt` เส้นคั่นล่าง 1px แถว "เที่ยวถัดไป" พื้น `--primary-soft` |
|
||||
| แถบ timeline | เส้นแนวตั้ง `--border-strong` จุดปลายทางเป็นวงกลมทึบ |
|
||||
| ประกาศ | ขอบซ้าย 4px เขียว (ปกติ) / `--warn` (ผลกระทบการเดินทาง) |
|
||||
|
||||
## 6. การเคลื่อนไหว
|
||||
|
||||
- transition 150–200ms เฉพาะสี/พื้นหลัง/transform
|
||||
- ห้าม animate width/height
|
||||
- `prefers-reduced-motion: reduce` → ปิด transition/animation ทั้งหมด (มีใน `style.css` แล้ว)
|
||||
- ฟอร์ม/ปุ่มต้องมี `:focus-visible` กรอบ 2px `--primary-strong` offset 2px
|
||||
|
||||
## 7. คำที่ใช้ (ภาษาไทย)
|
||||
|
||||
- เรียกจุดในสายว่า **ต้นทาง / กลางทาง / ปลายทาง** (ไม่ใช้ "จุดเปลี่ยน")
|
||||
- หลีกเลี่ยงคำอังกฤษลอยบนหน้าไทย ยกเว้นชื่อเฉพาะ (Google Maps, พร้อมเพย์ QR, LINE, CCTV, USB)
|
||||
- เวลาเขียนแบบ 24 ชั่วโมง มี "น." ต่อท้ายเมื่ออยู่ในประโยค: `05:00 น.`
|
||||
|
||||
## 8. Checklist ก่อนส่งงาน
|
||||
|
||||
- [ ] คอนทราสต์ข้อความ ≥ 4.5:1 (วัดจาก computed style ไม่ใช่เดา)
|
||||
- [ ] ไม่มี emoji, ไม่มีเงา, ไม่มี gradient
|
||||
- [ ] 375px ไม่มี horizontal scroll (`scrollWidth === innerWidth`)
|
||||
- [ ] ปุ่ม/แท็บ ≥ 44px สูง
|
||||
- [ ] แก้ข้อมูลแล้วหน้าเว็บเปลี่ยนโดยไม่ต้องแก้ component
|
||||
- [ ] `npm run build` ผ่าน และ `node --check server/server.mjs` ผ่าน
|
||||
@@ -0,0 +1,72 @@
|
||||
# IdealRoute — หน้าเว็บข้อมูลเดินรถ มินิบัส อ่างทอง–ป่าโมก–ชุมทางภาชี
|
||||
|
||||
ต้นแบบ landing page สำหรับ **ผู้ประกอบการรถโดยสารประจำทาง** ที่ต้องการให้ผู้โดยสารหาข้อมูลเดินรถได้เอง
|
||||
โดยไม่ต้องโทรถาม — sample route: อ่างทอง → ป่าโมก → สถานีรถไฟฟ้าสายสีแดง ชุมทางภาชี
|
||||
ให้บริการด้วย **มินิบัสปรับอากาศล้วน** ออกทุกชั่วโมง 05:00–17:00 ทั้ง 2 ทิศทาง
|
||||
|
||||
- Frontend: Vue 3 (SFC) + Vite
|
||||
- Backend: Node.js ล้วน (ไม่มี dependency) อ่าน/ส่งไฟล์ JSON ใน `data/`
|
||||
- ธีม: เขียวอ่อน–ขาว, flat (ไม่มีเงา/ไล่สี), ฟอนต์ K2D
|
||||
|
||||
## รันในเครื่อง
|
||||
|
||||
```bash
|
||||
npm install
|
||||
npm run api # backend http://localhost:8090
|
||||
npm run dev # frontend http://localhost:5173 (proxy /api → 8090)
|
||||
```
|
||||
|
||||
โหมด production (เสิร์ฟทั้ง API และไฟล์ frontend จากพอร์ตเดียว):
|
||||
|
||||
```bash
|
||||
npm run build
|
||||
npm start # http://localhost:8090
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
| Endpoint | ข้อมูล |
|
||||
|---|---|
|
||||
| `GET /api/overview` | รวมทุกไฟล์ + เที่ยวถัดไป 2 ทิศทาง (หน้าเว็บเรียกตัวนี้ครั้งเดียว) |
|
||||
| `GET /api/route` | เส้นทาง จุดจอด พิกัด ระยะทาง เวลาบริการ |
|
||||
| `GET /api/timetable` | ตารางเดินรถ `days[] → directions[] → departures[]` |
|
||||
| `GET /api/fares` | โซนค่าโดยสาร ตารางค่าโดยสาร ส่วนลด วิธีชำระเงิน |
|
||||
| `GET /api/service` | ประเภทรถ สัมภาระ กฎการโดยสาร ขั้นตอนขึ้นรถ |
|
||||
| `GET /api/notices` | ประกาศ/แจ้งเปลี่ยนแปลงเส้นทาง |
|
||||
| `GET /api/faq` | คำถามที่พบบ่อย |
|
||||
| `GET /api/operator` | ข้อมูลผู้ประกอบการ ช่องทางติดต่อ/ร้องเรียน |
|
||||
| `GET /api/next?direction_id=outbound&at=14:20&count=3` | คำนวณเที่ยวถัดไป (ถ้าไม่ส่ง `at` ใช้เวลาปัจจุบันเขต Asia/Bangkok) |
|
||||
| `GET /api/health` | health check |
|
||||
|
||||
ไฟล์ JSON ถูกอ่านใหม่เมื่อ `mtime` เปลี่ยน → แก้ข้อมูลแล้วไม่ต้องรีสตาร์ตเซิร์ฟเวอร์
|
||||
|
||||
## ข้อมูลที่ผู้โดยสารต้องรู้ (โครงที่ใส่ไว้แล้ว)
|
||||
|
||||
| กลุ่มข้อมูล | ไฟล์ | ตัวอย่างที่แสดงบนหน้า |
|
||||
|---|---|---|
|
||||
| เที่ยวถัดไปแบบสด | `/api/next` | การ์ด hero: ออกกี่โมง อีกกี่นาที ถึงปลายทางกี่โมง |
|
||||
| ตารางเดินรถ 2 ทิศทาง | `timetable.json` | 13 เที่ยว/ทิศทาง ไฮไลต์เที่ยวถัดไป |
|
||||
| จุดจอด + แลนด์มาร์ก | `route.json` | timeline 6 จุดจอด + ลิงก์ Google Maps |
|
||||
| ค่าโดยสาร/ส่วนลด/ชำระเงิน | `fares.json` | ตารางโซน 15–40 บาท, ส่วนลด 2 บาท, พร้อมเพย์ QR |
|
||||
| ประเภทรถและบริการ | `service.json` | 14 ที่นั่ง ไม่รับยืน, สัมภาระ, ผู้สูงอายุ/รถเข็น |
|
||||
| ขั้นตอนขึ้นรถ | `service.json` | 4 ขั้นตอน ตั้งแต่ดูป้ายจนกดออด |
|
||||
| ประกาศ/ทางอ้อม/วันหยุด | `notices.json` | การ์ดประกาศ + วันที่เริ่มมีผล |
|
||||
| คำถามที่พบบ่อย | `faq.json` | 6 ข้อ (รถเต็มทำอย่างไร, เด็กเล็ก, ของหาย) |
|
||||
| ผู้ประกอบการ + ร้องเรียน | `operator.json` | สายด่วน, LINE, ของหาย 30 วัน, SLA 7 วัน |
|
||||
|
||||
## โครงสร้างโปรเจกต์
|
||||
|
||||
```
|
||||
data/ ← ข้อมูลทั้งหมด (แก้ที่นี่ ไม่ต้องแตะ Vue)
|
||||
server/server.mjs ← API + static server (Node ล้วน)
|
||||
src/App.vue ← โหลดข้อมูล + ประกอบ section
|
||||
src/components/ ← SiteHeader, HeroSection, RouteStops, TimetableSection,
|
||||
FaresSection, ServiceSection, NoticesSection,
|
||||
FaqSection, ContactSection, SiteFooter, AppIcon
|
||||
src/style.css ← design tokens (สี/ระยะ/ตัวอักษร) — ดู DESIGN.md
|
||||
```
|
||||
|
||||
## หมายเหตุ
|
||||
|
||||
ข้อมูลผู้ประกอบการ ค่าโดยสาร และพิกัดจุดจอดเป็น **ข้อมูลตัวอย่างสำหรับต้นแบบ**
|
||||
ไม่ได้อ้างอิงผู้ให้บริการจริง ตัวอักษร K2D (SIL OFL) · ไอคอนจากชุด Lucide (ISC)
|
||||
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"faq": [
|
||||
{
|
||||
"question": "รถออกทุกกี่นาที และเที่ยวสุดท้ายกี่โมง",
|
||||
"answer": "ออกทุกชั่วโมงตรงเวลา (05:00, 06:00 … 17:00) ทั้ง 2 ทิศทาง เที่ยวสุดท้าย 17:00 ถึงปลายทางประมาณ 17:55"
|
||||
},
|
||||
{
|
||||
"question": "ถ้ารถเต็มต้องรอนานแค่ไหน",
|
||||
"answer": "รอบถัดไปอีก 60 นาที · มินิบัสไม่มีที่ยืนจึงไม่ขายตั๋วเกิน 14 ที่นั่ง"
|
||||
},
|
||||
{
|
||||
"question": "จ่ายค่าโดยสารอย่างไรได้บ้าง",
|
||||
"answer": "เงินสด (ไม่มีเงินทอน), พร้อมเพย์ QR และบัตรรายเดือน 40 เที่ยว 1,200 บาท"
|
||||
},
|
||||
{
|
||||
"question": "จากสถานีชุมทางภาชี เดินต่อไปรถไฟฟ้าสายสีแดงอย่างไร",
|
||||
"answer": "จุดจอดอยู่ทางออกที่ 2 ระยะเดิน 120 เมตรถึงชานชาลา มีทางเดินมีหลังคาตลอด"
|
||||
},
|
||||
{
|
||||
"question": "เด็กเล็กคิดค่าโดยสารไหม",
|
||||
"answer": "เด็กอายุต่ำกว่า 5 ปี หรือสูงไม่เกิน 100 ซม. นั่งตักผู้ปกครอง ไม่คิดค่าโดยสาร 1 คน/ผู้ใหญ่ 1 คน"
|
||||
},
|
||||
{
|
||||
"question": "ลืมของไว้บนรถ ทำอย่างไร",
|
||||
"answer": "โทรสายด่วน 081-234-5678 ภายใน 24 ชั่วโมง แจ้งเวลาเที่ยวและที่นั่ง ของจะเก็บไว้ที่ต้นทางอ่างทอง 30 วัน"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
{
|
||||
"currency": "THB",
|
||||
"zones": [
|
||||
{
|
||||
"zone_id": "zone_angthong",
|
||||
"name": "ในเมืองอ่างทอง",
|
||||
"stop_ids": [
|
||||
"stop_angthong_bus_terminal",
|
||||
"stop_angthong_hospital"
|
||||
]
|
||||
},
|
||||
{
|
||||
"zone_id": "zone_pamok",
|
||||
"name": "บ้านอิฐ – ป่าโมก",
|
||||
"stop_ids": [
|
||||
"stop_ban_ith_market",
|
||||
"stop_pamok_market",
|
||||
"stop_wat_pamok"
|
||||
]
|
||||
},
|
||||
{
|
||||
"zone_id": "zone_phachi",
|
||||
"name": "ชุมทางภาชี",
|
||||
"stop_ids": [
|
||||
"stop_phachi_redline"
|
||||
]
|
||||
}
|
||||
],
|
||||
"fare_matrix": [
|
||||
{
|
||||
"from_zone_id": "zone_angthong",
|
||||
"to_zone_id": "zone_angthong",
|
||||
"fare": 15,
|
||||
"examples": "สถานีขนส่ง ↔ โรงพยาบาลอ่างทอง"
|
||||
},
|
||||
{
|
||||
"from_zone_id": "zone_angthong",
|
||||
"to_zone_id": "zone_pamok",
|
||||
"fare": 25,
|
||||
"examples": "สถานีขนส่ง ↔ ตลาดป่าโมก, วัดป่าโมก"
|
||||
},
|
||||
{
|
||||
"from_zone_id": "zone_angthong",
|
||||
"to_zone_id": "zone_phachi",
|
||||
"fare": 40,
|
||||
"examples": "สถานีขนส่ง ↔ สถานีชุมทางภาชี (ตลอดสาย)"
|
||||
},
|
||||
{
|
||||
"from_zone_id": "zone_pamok",
|
||||
"to_zone_id": "zone_pamok",
|
||||
"fare": 15,
|
||||
"examples": "ตลาดป่าโมก ↔ วัดป่าโมก"
|
||||
},
|
||||
{
|
||||
"from_zone_id": "zone_pamok",
|
||||
"to_zone_id": "zone_phachi",
|
||||
"fare": 25,
|
||||
"examples": "ตลาดป่าโมก ↔ สถานีชุมทางภาชี"
|
||||
}
|
||||
],
|
||||
"discounts": [
|
||||
{
|
||||
"group": "นักเรียน นักศึกษา",
|
||||
"discount_baht": 2,
|
||||
"condition": "แสดงบัตรนักเรียน/นักศึกษาตัวจริงทุกครั้งที่ขึ้นรถ"
|
||||
},
|
||||
{
|
||||
"group": "ผู้สูงอายุ 60 ปีขึ้นไป",
|
||||
"discount_baht": 2,
|
||||
"condition": "แสดงบัตรประชาชน"
|
||||
},
|
||||
{
|
||||
"group": "พระภิกษุ สามเณร",
|
||||
"discount_baht": 2,
|
||||
"condition": "แสดงบัตรประจำตัว"
|
||||
}
|
||||
],
|
||||
"payment_methods": [
|
||||
{
|
||||
"method": "เงินสด",
|
||||
"detail": "จ่ายกับพนักงานเก็บค่าโดยสารบนรถ · ไม่มีเงินทอน แนะนำเตรียมเงินให้พอดี"
|
||||
},
|
||||
{
|
||||
"method": "พร้อมเพย์ QR",
|
||||
"detail": "สแกนที่จุดเก็บค่าโดยสาร · พร้อมเพย์ 084-xxx-xxxx"
|
||||
},
|
||||
{
|
||||
"method": "บัตรโดยสารรายเดือน",
|
||||
"detail": "40 เที่ยว 1,200 บาท ใช้ได้ทั้ง 2 ทิศทาง ติดต่อที่ต้นทาง"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"notices": [
|
||||
{
|
||||
"notice_id": "n-2026-11-01",
|
||||
"type": "info",
|
||||
"title": "เปิดเดินรถเที่ยวเช้า 05:00 เพิ่มฝั่งภาชี",
|
||||
"body": "ตั้งแต่ 1 พ.ย. 2569 เที่ยว 05:00 ขากลับ (ภาชี → อ่างทอง) เปิดให้บริการตามกำหนดเดิม พร้อมรถสำรอง 1 คัน เผื่อผู้โดยสารเต็ม",
|
||||
"effective_date": "2026-11-01",
|
||||
"pinned": true
|
||||
},
|
||||
{
|
||||
"notice_id": "n-2026-11-12",
|
||||
"type": "warning",
|
||||
"title": "เส้นทางอ้อมช่วงเทศกาล ตลาดป่าโมก",
|
||||
"body": "ช่วงงานประจำปีวัดป่าโมก (12–18 พ.ย.) รถไม่เข้าจุดจอดหน้าตลาดป่าโมก ให้ขึ้น–ลงที่ ป้อมตำรวจป่าโมกแทน ระยะทางเดินประมาณ 150 เมตร",
|
||||
"effective_date": "2026-11-12",
|
||||
"pinned": true
|
||||
},
|
||||
{
|
||||
"notice_id": "n-2026-10-20",
|
||||
"type": "info",
|
||||
"title": "รับชำระด้วยพร้อมเพย์ QR ทุกคัน",
|
||||
"body": "ติดตั้ง QR พร้อมเพย์ครบทั้ง 6 คันแล้ว สแกนจ่ายได้ไม่ต้องเตรียมเงินสด",
|
||||
"effective_date": "2026-10-20",
|
||||
"pinned": false
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"operator_name": "บริษัท อ่างทอง–ป่าโมก–ภาชี มินิบัส จำกัด",
|
||||
"operator_short_name": "มินิบัส อ่างทอง–ภาชี",
|
||||
"license_number": "ใบอนุญาตประกอบการขนส่งประจำทาง อย. 41/2569 (ข้อมูลตัวอย่าง)",
|
||||
"fleet_size": 6,
|
||||
"founded_year": 2564,
|
||||
"contact": {
|
||||
"hotline": "081-234-5678",
|
||||
"hotline_hours": "05:00–18:00 ทุกวัน",
|
||||
"line_id": "@atpcmbus",
|
||||
"email": "[email protected]",
|
||||
"address": "199/9 ถ.เทศบาล 2 ต.ตลาดหลวง อ.เมืองอ่างทอง จ.อ่างทอง 14000"
|
||||
},
|
||||
"channels": [
|
||||
{
|
||||
"purpose": "สอบถามเที่ยวรถ / รถล่าช้า",
|
||||
"channel": "สายด่วน 081-234-5678"
|
||||
},
|
||||
{
|
||||
"purpose": "ของหาย / ลืมของบนรถ",
|
||||
"channel": "สายด่วน 081-234-5678 ต่อ 2 · เก็บของ 30 วัน"
|
||||
},
|
||||
{
|
||||
"purpose": "ร้องเรียนการให้บริการ",
|
||||
"channel": "แบบฟอร์มร้องเรียนที่ต้นทาง หรือ LINE @atpcmbus · ตอบกลับภายใน 7 วันทำการ"
|
||||
}
|
||||
]
|
||||
}
|
||||
+107
@@ -0,0 +1,107 @@
|
||||
{
|
||||
"route_id": "angthong-pamok-phachi",
|
||||
"route_name": "อ่างทอง – ป่าโมก – ชุมทางภาชี",
|
||||
"route_name_en": "Ang Thong – Pa Mok – Chum Thang Phachi",
|
||||
"service_model": "มินิบัสล้วนทุกเที่ยว (ไม่มีรถโดยสารขนาดใหญ่)",
|
||||
"service_hours": {
|
||||
"first_departure": "05:00",
|
||||
"last_departure": "17:00",
|
||||
"headway_minutes": 60,
|
||||
"trips_per_direction_per_day": 13,
|
||||
"trips_per_day_total": 26,
|
||||
"service_days": "ทุกวัน รวมวันหยุดนักขัตฤกษ์"
|
||||
},
|
||||
"journey": {
|
||||
"distance_km": 30.5,
|
||||
"duration_minutes": 55,
|
||||
"note": "เวลาเดินทางอาจคลาดเคลื่อน 5–10 นาทีตามสภาพจราจร"
|
||||
},
|
||||
"stops": [
|
||||
{
|
||||
"stop_id": "stop_angthong_bus_terminal",
|
||||
"name": "สถานีขนส่งผู้โดยสารจังหวัดอ่างทอง",
|
||||
"landmark": "จุดจอดหลัก ต้นทาง อยู่ชานชาลาที่ 3",
|
||||
"zone_id": "zone_angthong",
|
||||
"distance_from_origin_km": 0.0,
|
||||
"latitude": 14.5892,
|
||||
"longitude": 100.4548
|
||||
},
|
||||
{
|
||||
"stop_id": "stop_angthong_hospital",
|
||||
"name": "โรงพยาบาลอ่างทอง",
|
||||
"landmark": "หน้าประตูทางเข้า ผู้ป่วยนอก",
|
||||
"zone_id": "zone_angthong",
|
||||
"distance_from_origin_km": 1.2,
|
||||
"latitude": 14.5941,
|
||||
"longitude": 100.462
|
||||
},
|
||||
{
|
||||
"stop_id": "stop_ban_ith_market",
|
||||
"name": "ตลาดบ้านอิฐ",
|
||||
"landmark": "ฝั่งเดียวกับป้อมตำรวจบ้านอิฐ",
|
||||
"zone_id": "zone_pamok",
|
||||
"distance_from_origin_km": 6.0,
|
||||
"latitude": 14.556,
|
||||
"longitude": 100.462
|
||||
},
|
||||
{
|
||||
"stop_id": "stop_pamok_market",
|
||||
"name": "ตลาดป่าโมก",
|
||||
"landmark": "หน้าโรงพยาบาลป่าโมก",
|
||||
"zone_id": "zone_pamok",
|
||||
"distance_from_origin_km": 11.5,
|
||||
"latitude": 14.4903,
|
||||
"longitude": 100.4492
|
||||
},
|
||||
{
|
||||
"stop_id": "stop_wat_pamok",
|
||||
"name": "วัดป่าโมกวรวิหาร",
|
||||
"landmark": "ประตูทางเข้าวัด ฝั่งแม่น้ำน้อย",
|
||||
"zone_id": "zone_pamok",
|
||||
"distance_from_origin_km": 13.0,
|
||||
"latitude": 14.4836,
|
||||
"longitude": 100.4426
|
||||
},
|
||||
{
|
||||
"stop_id": "stop_phachi_redline",
|
||||
"name": "สถานีรถไฟฟ้าสายสีแดง ชุมทางภาชี",
|
||||
"landmark": "ทางออกที่ 2 ฝั่งลานจอดรถ ปลายทาง",
|
||||
"zone_id": "zone_phachi",
|
||||
"distance_from_origin_km": 30.5,
|
||||
"latitude": 14.4494,
|
||||
"longitude": 100.5753
|
||||
}
|
||||
],
|
||||
"directions": [
|
||||
{
|
||||
"direction_id": "outbound",
|
||||
"name": "อ่างทอง → ชุมทางภาชี",
|
||||
"name_short": "ขาไป ภาชี",
|
||||
"origin_stop_id": "stop_angthong_bus_terminal",
|
||||
"destination_stop_id": "stop_phachi_redline",
|
||||
"stop_ids": [
|
||||
"stop_angthong_bus_terminal",
|
||||
"stop_angthong_hospital",
|
||||
"stop_ban_ith_market",
|
||||
"stop_pamok_market",
|
||||
"stop_wat_pamok",
|
||||
"stop_phachi_redline"
|
||||
]
|
||||
},
|
||||
{
|
||||
"direction_id": "inbound",
|
||||
"name": "ชุมทางภาชี → อ่างทอง",
|
||||
"name_short": "ขากลับ อ่างทอง",
|
||||
"origin_stop_id": "stop_phachi_redline",
|
||||
"destination_stop_id": "stop_angthong_bus_terminal",
|
||||
"stop_ids": [
|
||||
"stop_phachi_redline",
|
||||
"stop_wat_pamok",
|
||||
"stop_pamok_market",
|
||||
"stop_ban_ith_market",
|
||||
"stop_angthong_hospital",
|
||||
"stop_angthong_bus_terminal"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"vehicle": {
|
||||
"type": "minibus",
|
||||
"class": "มินิบัสปรับอากาศ",
|
||||
"fleet_size": 6,
|
||||
"seats_total": 14,
|
||||
"standing_allowed": false,
|
||||
"vehicle_age_years_max": 5,
|
||||
"amenities": [
|
||||
"แอร์",
|
||||
"เข็มขัดนิรภัยทุกที่นั่ง",
|
||||
"ช่อง USB ชาร์จมือถือ",
|
||||
"ชั้นวางสัมภาระเหนือศีรษะ",
|
||||
"กล้อง CCTV"
|
||||
]
|
||||
},
|
||||
"luggage": {
|
||||
"hand_carry": "ถือขึ้นรถได้ไม่คิดเงิน",
|
||||
"size_limit": "ไม่เกิน 2 ชิ้น/คน และต้องวางบนตักหรือใต้เบาะ",
|
||||
"not_allowed": [
|
||||
"ของมีกลิ่นแรง",
|
||||
"สัตว์เลี้ยง (ยกเว้นสุนัขนำทาง)",
|
||||
"วัตถุไวไฟ",
|
||||
"ของที่กีดขวางทางเดิน"
|
||||
]
|
||||
},
|
||||
"accessibility": [
|
||||
"พื้นที่เก็บรถเข็นพับได้ 1 คัน",
|
||||
"พนักงานช่วยยกของขึ้น–ลงรถ",
|
||||
"เบาะแถวหน้า 2 ที่นั่งสำรองสำหรับผู้สูงอายุ/หญิงตั้งครรภ์"
|
||||
],
|
||||
"boarding_steps": [
|
||||
{
|
||||
"step": 1,
|
||||
"title": "ตรวจสอบทิศทางก่อนขึ้น",
|
||||
"detail": "ป้ายหน้าและข้างรถระบุปลายทาง อ่างทอง หรือ ชุมทางภาชี"
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"title": "รอที่จุดจอดที่กำหนด",
|
||||
"detail": "รถไม่จอดรับกลางถนน ยกเว้นจุดที่ทำเครื่องหมายไว้"
|
||||
},
|
||||
{
|
||||
"step": 3,
|
||||
"title": "ชำระค่าโดยสารบนรถ",
|
||||
"detail": "บอกจุดหมายกับพนักงาน เก็บตั๋วไว้จนถึงปลายทาง"
|
||||
},
|
||||
{
|
||||
"step": 4,
|
||||
"title": "กดออด/บอกก่อนถึงจุดลง",
|
||||
"detail": "แจ้งล่วงหน้าอย่างน้อย 1 จุดจอด"
|
||||
}
|
||||
],
|
||||
"operating_rules": [
|
||||
"ไม่รับยืน ไม่วิ่งเกิน 14 ที่นั่ง",
|
||||
"ไม่สูบบุหรี่และไม่ดื่มแอลกอฮอล์บนรถ",
|
||||
"ความเร็วไม่เกิน 80 กม./ชม.",
|
||||
"จอดรับ–ส่งเฉพาะจุดจอดที่กำหนด"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,286 @@
|
||||
{
|
||||
"service_mode": "minibus",
|
||||
"updated_at": "2026-11-20",
|
||||
"remark": "รถออกทุกชั่วโมงตรงเวลา ทั้ง 2 ทิศทาง · ไม่มีที่ยืน · ถ้ารถเต็มรอบนั้น ผู้โดยสารใช้รอบถัดไป (60 นาที)",
|
||||
"days": [
|
||||
{
|
||||
"day_type": "all_days",
|
||||
"label": "ทุกวัน (จันทร์–อาทิตย์ และวันหยุดนักขัตฤกษ์)",
|
||||
"headway_minutes": 60,
|
||||
"directions": [
|
||||
{
|
||||
"direction_id": "outbound",
|
||||
"name": "อ่างทอง → ชุมทางภาชี",
|
||||
"departures": [
|
||||
{
|
||||
"departure_time": "05:00",
|
||||
"arrival_time": "05:55",
|
||||
"vehicle_type": "minibus",
|
||||
"vehicle_class": "มินิบัสปรับอากาศ 14 ที่นั่ง",
|
||||
"seats_total": 14,
|
||||
"standing_allowed": false,
|
||||
"fare_to_terminus": 40,
|
||||
"note": "เที่ยวแรกของวัน"
|
||||
},
|
||||
{
|
||||
"departure_time": "06:00",
|
||||
"arrival_time": "06:55",
|
||||
"vehicle_type": "minibus",
|
||||
"vehicle_class": "มินิบัสปรับอากาศ 14 ที่นั่ง",
|
||||
"seats_total": 14,
|
||||
"standing_allowed": false,
|
||||
"fare_to_terminus": 40,
|
||||
"note": ""
|
||||
},
|
||||
{
|
||||
"departure_time": "07:00",
|
||||
"arrival_time": "07:55",
|
||||
"vehicle_type": "minibus",
|
||||
"vehicle_class": "มินิบัสปรับอากาศ 14 ที่นั่ง",
|
||||
"seats_total": 14,
|
||||
"standing_allowed": false,
|
||||
"fare_to_terminus": 40,
|
||||
"note": ""
|
||||
},
|
||||
{
|
||||
"departure_time": "08:00",
|
||||
"arrival_time": "08:55",
|
||||
"vehicle_type": "minibus",
|
||||
"vehicle_class": "มินิบัสปรับอากาศ 14 ที่นั่ง",
|
||||
"seats_total": 14,
|
||||
"standing_allowed": false,
|
||||
"fare_to_terminus": 40,
|
||||
"note": ""
|
||||
},
|
||||
{
|
||||
"departure_time": "09:00",
|
||||
"arrival_time": "09:55",
|
||||
"vehicle_type": "minibus",
|
||||
"vehicle_class": "มินิบัสปรับอากาศ 14 ที่นั่ง",
|
||||
"seats_total": 14,
|
||||
"standing_allowed": false,
|
||||
"fare_to_terminus": 40,
|
||||
"note": ""
|
||||
},
|
||||
{
|
||||
"departure_time": "10:00",
|
||||
"arrival_time": "10:55",
|
||||
"vehicle_type": "minibus",
|
||||
"vehicle_class": "มินิบัสปรับอากาศ 14 ที่นั่ง",
|
||||
"seats_total": 14,
|
||||
"standing_allowed": false,
|
||||
"fare_to_terminus": 40,
|
||||
"note": ""
|
||||
},
|
||||
{
|
||||
"departure_time": "11:00",
|
||||
"arrival_time": "11:55",
|
||||
"vehicle_type": "minibus",
|
||||
"vehicle_class": "มินิบัสปรับอากาศ 14 ที่นั่ง",
|
||||
"seats_total": 14,
|
||||
"standing_allowed": false,
|
||||
"fare_to_terminus": 40,
|
||||
"note": ""
|
||||
},
|
||||
{
|
||||
"departure_time": "12:00",
|
||||
"arrival_time": "12:55",
|
||||
"vehicle_type": "minibus",
|
||||
"vehicle_class": "มินิบัสปรับอากาศ 14 ที่นั่ง",
|
||||
"seats_total": 14,
|
||||
"standing_allowed": false,
|
||||
"fare_to_terminus": 40,
|
||||
"note": ""
|
||||
},
|
||||
{
|
||||
"departure_time": "13:00",
|
||||
"arrival_time": "13:55",
|
||||
"vehicle_type": "minibus",
|
||||
"vehicle_class": "มินิบัสปรับอากาศ 14 ที่นั่ง",
|
||||
"seats_total": 14,
|
||||
"standing_allowed": false,
|
||||
"fare_to_terminus": 40,
|
||||
"note": ""
|
||||
},
|
||||
{
|
||||
"departure_time": "14:00",
|
||||
"arrival_time": "14:55",
|
||||
"vehicle_type": "minibus",
|
||||
"vehicle_class": "มินิบัสปรับอากาศ 14 ที่นั่ง",
|
||||
"seats_total": 14,
|
||||
"standing_allowed": false,
|
||||
"fare_to_terminus": 40,
|
||||
"note": ""
|
||||
},
|
||||
{
|
||||
"departure_time": "15:00",
|
||||
"arrival_time": "15:55",
|
||||
"vehicle_type": "minibus",
|
||||
"vehicle_class": "มินิบัสปรับอากาศ 14 ที่นั่ง",
|
||||
"seats_total": 14,
|
||||
"standing_allowed": false,
|
||||
"fare_to_terminus": 40,
|
||||
"note": ""
|
||||
},
|
||||
{
|
||||
"departure_time": "16:00",
|
||||
"arrival_time": "16:55",
|
||||
"vehicle_type": "minibus",
|
||||
"vehicle_class": "มินิบัสปรับอากาศ 14 ที่นั่ง",
|
||||
"seats_total": 14,
|
||||
"standing_allowed": false,
|
||||
"fare_to_terminus": 40,
|
||||
"note": ""
|
||||
},
|
||||
{
|
||||
"departure_time": "17:00",
|
||||
"arrival_time": "17:55",
|
||||
"vehicle_type": "minibus",
|
||||
"vehicle_class": "มินิบัสปรับอากาศ 14 ที่นั่ง",
|
||||
"seats_total": 14,
|
||||
"standing_allowed": false,
|
||||
"fare_to_terminus": 40,
|
||||
"note": "เที่ยวสุดท้ายของวัน"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"direction_id": "inbound",
|
||||
"name": "ชุมทางภาชี → อ่างทอง",
|
||||
"departures": [
|
||||
{
|
||||
"departure_time": "05:00",
|
||||
"arrival_time": "05:55",
|
||||
"vehicle_type": "minibus",
|
||||
"vehicle_class": "มินิบัสปรับอากาศ 14 ที่นั่ง",
|
||||
"seats_total": 14,
|
||||
"standing_allowed": false,
|
||||
"fare_to_terminus": 40,
|
||||
"note": "เที่ยวแรกของวัน"
|
||||
},
|
||||
{
|
||||
"departure_time": "06:00",
|
||||
"arrival_time": "06:55",
|
||||
"vehicle_type": "minibus",
|
||||
"vehicle_class": "มินิบัสปรับอากาศ 14 ที่นั่ง",
|
||||
"seats_total": 14,
|
||||
"standing_allowed": false,
|
||||
"fare_to_terminus": 40,
|
||||
"note": ""
|
||||
},
|
||||
{
|
||||
"departure_time": "07:00",
|
||||
"arrival_time": "07:55",
|
||||
"vehicle_type": "minibus",
|
||||
"vehicle_class": "มินิบัสปรับอากาศ 14 ที่นั่ง",
|
||||
"seats_total": 14,
|
||||
"standing_allowed": false,
|
||||
"fare_to_terminus": 40,
|
||||
"note": ""
|
||||
},
|
||||
{
|
||||
"departure_time": "08:00",
|
||||
"arrival_time": "08:55",
|
||||
"vehicle_type": "minibus",
|
||||
"vehicle_class": "มินิบัสปรับอากาศ 14 ที่นั่ง",
|
||||
"seats_total": 14,
|
||||
"standing_allowed": false,
|
||||
"fare_to_terminus": 40,
|
||||
"note": ""
|
||||
},
|
||||
{
|
||||
"departure_time": "09:00",
|
||||
"arrival_time": "09:55",
|
||||
"vehicle_type": "minibus",
|
||||
"vehicle_class": "มินิบัสปรับอากาศ 14 ที่นั่ง",
|
||||
"seats_total": 14,
|
||||
"standing_allowed": false,
|
||||
"fare_to_terminus": 40,
|
||||
"note": ""
|
||||
},
|
||||
{
|
||||
"departure_time": "10:00",
|
||||
"arrival_time": "10:55",
|
||||
"vehicle_type": "minibus",
|
||||
"vehicle_class": "มินิบัสปรับอากาศ 14 ที่นั่ง",
|
||||
"seats_total": 14,
|
||||
"standing_allowed": false,
|
||||
"fare_to_terminus": 40,
|
||||
"note": ""
|
||||
},
|
||||
{
|
||||
"departure_time": "11:00",
|
||||
"arrival_time": "11:55",
|
||||
"vehicle_type": "minibus",
|
||||
"vehicle_class": "มินิบัสปรับอากาศ 14 ที่นั่ง",
|
||||
"seats_total": 14,
|
||||
"standing_allowed": false,
|
||||
"fare_to_terminus": 40,
|
||||
"note": ""
|
||||
},
|
||||
{
|
||||
"departure_time": "12:00",
|
||||
"arrival_time": "12:55",
|
||||
"vehicle_type": "minibus",
|
||||
"vehicle_class": "มินิบัสปรับอากาศ 14 ที่นั่ง",
|
||||
"seats_total": 14,
|
||||
"standing_allowed": false,
|
||||
"fare_to_terminus": 40,
|
||||
"note": ""
|
||||
},
|
||||
{
|
||||
"departure_time": "13:00",
|
||||
"arrival_time": "13:55",
|
||||
"vehicle_type": "minibus",
|
||||
"vehicle_class": "มินิบัสปรับอากาศ 14 ที่นั่ง",
|
||||
"seats_total": 14,
|
||||
"standing_allowed": false,
|
||||
"fare_to_terminus": 40,
|
||||
"note": ""
|
||||
},
|
||||
{
|
||||
"departure_time": "14:00",
|
||||
"arrival_time": "14:55",
|
||||
"vehicle_type": "minibus",
|
||||
"vehicle_class": "มินิบัสปรับอากาศ 14 ที่นั่ง",
|
||||
"seats_total": 14,
|
||||
"standing_allowed": false,
|
||||
"fare_to_terminus": 40,
|
||||
"note": ""
|
||||
},
|
||||
{
|
||||
"departure_time": "15:00",
|
||||
"arrival_time": "15:55",
|
||||
"vehicle_type": "minibus",
|
||||
"vehicle_class": "มินิบัสปรับอากาศ 14 ที่นั่ง",
|
||||
"seats_total": 14,
|
||||
"standing_allowed": false,
|
||||
"fare_to_terminus": 40,
|
||||
"note": ""
|
||||
},
|
||||
{
|
||||
"departure_time": "16:00",
|
||||
"arrival_time": "16:55",
|
||||
"vehicle_type": "minibus",
|
||||
"vehicle_class": "มินิบัสปรับอากาศ 14 ที่นั่ง",
|
||||
"seats_total": 14,
|
||||
"standing_allowed": false,
|
||||
"fare_to_terminus": 40,
|
||||
"note": ""
|
||||
},
|
||||
{
|
||||
"departure_time": "17:00",
|
||||
"arrival_time": "17:55",
|
||||
"vehicle_type": "minibus",
|
||||
"vehicle_class": "มินิบัสปรับอากาศ 14 ที่นั่ง",
|
||||
"seats_total": 14,
|
||||
"standing_allowed": false,
|
||||
"fare_to_terminus": 40,
|
||||
"note": "เที่ยวสุดท้ายของวัน"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
<!doctype html>
|
||||
<html lang="th">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>มินิบัส อ่างทอง–ป่าโมก–ชุมทางภาชี | ตารางเดินรถ ค่าโดยสาร จุดจอด</title>
|
||||
<meta name="description" content="ตารางเดินรถมินิบัส อ่างทอง–ป่าโมก–ชุมทางภาชี ออกทุกชั่วโมง 05:00–17:00 ทั้ง 2 ทิศทาง 14 ที่นั่ง ค่าโดยสารเริ่ม 15 บาท จุดจอดครบทุกป้าย" />
|
||||
<meta name="theme-color" content="#17804E" />
|
||||
<link rel="icon" href="/favicon.svg" type="image/svg+xml" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
Generated
+1347
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"name": "idealroute",
|
||||
"private": true,
|
||||
"version": "1.0.0",
|
||||
"type": "module",
|
||||
"description": "Landing page ผู้ประกอบการมินิบัส อ่างทอง–ป่าโมก–ชุมทางภาชี (Vue 3 frontend + Node/JSON backend)",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
"preview": "vite preview",
|
||||
"api": "node server/server.mjs",
|
||||
"start": "node server/server.mjs"
|
||||
},
|
||||
"dependencies": {
|
||||
"@fontsource/k2d": "^5.1.1",
|
||||
"vue": "^3.5.13"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vitejs/plugin-vue": "^5.2.1",
|
||||
"vite": "^6.0.7"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
|
||||
<rect width="32" height="32" rx="8" fill="#17804E"/>
|
||||
<path d="M9 8h14a2 2 0 0 1 2 2v10H7V10a2 2 0 0 1 2-2Z" fill="#fff"/>
|
||||
<path d="M7 20h18v2.5a1.5 1.5 0 0 1-1.5 1.5H23a2.5 2.5 0 0 1-5 0h-4a2.5 2.5 0 0 1-5 0H8.5A1.5 1.5 0 0 1 7 22.5V20Z" fill="#E4F5EA"/>
|
||||
<rect x="10" y="10.5" width="5" height="4" rx="1" fill="#17804E"/>
|
||||
<rect x="17" y="10.5" width="5" height="4" rx="1" fill="#17804E"/>
|
||||
<circle cx="11.5" cy="24" r="1.4" fill="#0F6B41"/>
|
||||
<circle cx="20.5" cy="24" r="1.4" fill="#0F6B41"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 573 B |
@@ -0,0 +1,156 @@
|
||||
// Backend: Node.js (ไม่มี dependency) + ไฟล์ JSON ใน data/
|
||||
// รัน: node server/server.mjs → http://localhost:8090
|
||||
// dev: npm run dev (Vite 5173 proxy /api → 8090)
|
||||
import { createServer } from 'node:http'
|
||||
import { readFile, stat } from 'node:fs/promises'
|
||||
import { existsSync, statSync } from 'node:fs'
|
||||
import { extname, join, resolve } from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
|
||||
const ROOT = resolve(fileURLToPath(new URL('..', import.meta.url)))
|
||||
const DATA_DIR = join(ROOT, 'data')
|
||||
const DIST_DIR = join(ROOT, 'dist')
|
||||
const PORT = Number(process.env.PORT || 8090)
|
||||
|
||||
/* ── JSON loader: cache ตาม mtime (แก้ไฟล์แล้วไม่ต้องรีสตาร์ต) ── */
|
||||
const cache = new Map()
|
||||
async function loadJson(name) {
|
||||
const file = join(DATA_DIR, name)
|
||||
const info = await stat(file)
|
||||
const hit = cache.get(name)
|
||||
if (hit && hit.mtime === info.mtimeMs) return hit.data
|
||||
const data = JSON.parse(await readFile(file, 'utf8'))
|
||||
cache.set(name, { mtime: info.mtimeMs, data })
|
||||
return data
|
||||
}
|
||||
|
||||
/* ── helper เวลา ── */
|
||||
const toMinutes = (hhmm) => {
|
||||
const [h, m] = hhmm.split(':').map(Number)
|
||||
return h * 60 + m
|
||||
}
|
||||
const toHHMM = (min) => `${String(Math.floor(min / 60) % 24).padStart(2, '0')}:${String(min % 60).padStart(2, '0')}`
|
||||
const nowInBangkok = () => {
|
||||
const parts = new Intl.DateTimeFormat('en-GB', {
|
||||
timeZone: 'Asia/Bangkok', hour: '2-digit', minute: '2-digit', hour12: false
|
||||
}).format(new Date())
|
||||
return parts
|
||||
}
|
||||
|
||||
async function nextDepartures({ directionId, at, count }) {
|
||||
const timetable = await loadJson('timetable.json')
|
||||
const route = await loadJson('route.json')
|
||||
const day = timetable.days[0]
|
||||
const direction = day.directions.find((d) => d.direction_id === directionId)
|
||||
if (!direction) {
|
||||
const err = new Error(`ไม่รู้จัก direction_id="${directionId}" (ใช้ outbound หรือ inbound)`)
|
||||
err.statusCode = 400
|
||||
throw err
|
||||
}
|
||||
const nowMinutes = at ? toMinutes(at) : toMinutes(nowInBangkok())
|
||||
const limit = Math.min(Math.max(Number(count) || 3, 1), 10)
|
||||
|
||||
const upcoming = direction.departures
|
||||
.filter((trip) => toMinutes(trip.departure_time) >= nowMinutes)
|
||||
.slice(0, limit)
|
||||
.map((trip) => ({ ...trip, minutes_until: toMinutes(trip.departure_time) - nowMinutes }))
|
||||
|
||||
const lastTrip = direction.departures.at(-1)
|
||||
const serviceEnded = upcoming.length === 0
|
||||
return {
|
||||
direction_id: direction.direction_id,
|
||||
direction_name: direction.name,
|
||||
queried_at: toHHMM(nowMinutes),
|
||||
travel_minutes: route.journey.duration_minutes,
|
||||
upcoming: serviceEnded
|
||||
? [{ ...direction.departures[0], minutes_until: null, next_service_day: 'พรุ่งนี้' }]
|
||||
: upcoming,
|
||||
service_ended_for_today: serviceEnded,
|
||||
last_departure_today: lastTrip.departure_time,
|
||||
generated_at: new Date().toISOString()
|
||||
}
|
||||
}
|
||||
|
||||
/* ── API table ── */
|
||||
const API = {
|
||||
'/api/route': () => loadJson('route.json'),
|
||||
'/api/timetable': () => loadJson('timetable.json'),
|
||||
'/api/fares': () => loadJson('fares.json'),
|
||||
'/api/notices': () => loadJson('notices.json'),
|
||||
'/api/service': () => loadJson('service.json'),
|
||||
'/api/faq': () => loadJson('faq.json'),
|
||||
'/api/operator': () => loadJson('operator.json'),
|
||||
'/api/next': (url) => nextDepartures({
|
||||
directionId: url.searchParams.get('direction_id') || 'outbound',
|
||||
at: url.searchParams.get('at'),
|
||||
count: url.searchParams.get('count')
|
||||
}),
|
||||
'/api/overview': async () => {
|
||||
const [route, timetable, fares, notices, service, faq, operator] = await Promise.all(
|
||||
['route.json', 'timetable.json', 'fares.json', 'notices.json', 'service.json', 'faq.json', 'operator.json']
|
||||
.map(loadJson)
|
||||
)
|
||||
const outbound = await nextDepartures({ directionId: 'outbound', count: 2 })
|
||||
const inbound = await nextDepartures({ directionId: 'inbound', count: 2 })
|
||||
return { route, timetable, fares, notices, service, faq, operator, next: { outbound, inbound } }
|
||||
},
|
||||
'/api/health': () => ({ ok: true, service: 'idealroute-api', data_dir: DATA_DIR, time: new Date().toISOString() })
|
||||
}
|
||||
|
||||
const MIME = {
|
||||
'.html': 'text/html; charset=utf-8', '.js': 'text/javascript; charset=utf-8',
|
||||
'.css': 'text/css; charset=utf-8', '.json': 'application/json; charset=utf-8',
|
||||
'.svg': 'image/svg+xml', '.woff2': 'font/woff2', '.png': 'image/png',
|
||||
'.jpg': 'image/jpeg', '.ico': 'image/x-icon', '.webmanifest': 'application/manifest+json'
|
||||
}
|
||||
|
||||
function send(res, status, body, type = 'application/json; charset=utf-8') {
|
||||
res.writeHead(status, {
|
||||
'content-type': type,
|
||||
'cache-control': 'no-store',
|
||||
'access-control-allow-origin': '*',
|
||||
'x-content-type-options': 'nosniff'
|
||||
})
|
||||
res.end(body)
|
||||
}
|
||||
|
||||
const server = createServer(async (req, res) => {
|
||||
const url = new URL(req.url, `http://${req.headers.host || 'localhost'}`)
|
||||
|
||||
if (req.method === 'OPTIONS') {
|
||||
res.writeHead(204, { 'access-control-allow-origin': '*', 'access-control-allow-headers': '*' })
|
||||
return res.end()
|
||||
}
|
||||
|
||||
try {
|
||||
if (API[url.pathname]) {
|
||||
return send(res, 200, JSON.stringify(await API[url.pathname](url), null, 2))
|
||||
}
|
||||
if (url.pathname.startsWith('/api/')) {
|
||||
return send(res, 404, JSON.stringify({ error: 'ไม่พบ endpoint', path: url.pathname }))
|
||||
}
|
||||
|
||||
// static (เฉพาะโหมด production หลัง npm run build)
|
||||
const cleanPath = decodeURIComponent(url.pathname).replace(/\\/g, '/')
|
||||
const filePath = resolve(join(DIST_DIR, cleanPath))
|
||||
if (!filePath.startsWith(DIST_DIR)) {
|
||||
return send(res, 403, JSON.stringify({ error: 'forbidden' }))
|
||||
}
|
||||
if (!existsSync(DIST_DIR)) {
|
||||
return send(res, 404, 'ยังไม่มี dist/ — รัน npm run build ก่อน แล้วรีเฟรช', 'text/plain; charset=utf-8')
|
||||
}
|
||||
const isFile = existsSync(filePath) && statSync(filePath).isFile()
|
||||
const target = isFile ? filePath : join(DIST_DIR, 'index.html') // SPA fallback
|
||||
const body = await readFile(target)
|
||||
return send(res, 200, body, MIME[extname(target)] || 'application/octet-stream')
|
||||
} catch (error) {
|
||||
const status = error.statusCode || (error.code === 'ENOENT' ? 404 : 500)
|
||||
console.error('[api]', error.message)
|
||||
return send(res, status, JSON.stringify({ error: error.message }))
|
||||
}
|
||||
})
|
||||
|
||||
server.listen(PORT, () => {
|
||||
console.log(`idealroute API → http://localhost:${PORT}/api/overview`)
|
||||
if (!existsSync(DIST_DIR)) console.log('โหมด dev: รัน `npm run dev` เพื่อเปิด frontend (Vite 5173)')
|
||||
})
|
||||
+171
@@ -0,0 +1,171 @@
|
||||
<script setup>
|
||||
import { onBeforeUnmount, onMounted, ref } from 'vue'
|
||||
import { bangkokMinutes, getNext, getOverview } from './lib/api'
|
||||
import SiteHeader from './components/SiteHeader.vue'
|
||||
import HeroSection from './components/HeroSection.vue'
|
||||
import RouteStops from './components/RouteStops.vue'
|
||||
import TimetableSection from './components/TimetableSection.vue'
|
||||
import FaresSection from './components/FaresSection.vue'
|
||||
import ServiceSection from './components/ServiceSection.vue'
|
||||
import NoticesSection from './components/NoticesSection.vue'
|
||||
import FaqSection from './components/FaqSection.vue'
|
||||
import ContactSection from './components/ContactSection.vue'
|
||||
import SiteFooter from './components/SiteFooter.vue'
|
||||
|
||||
const data = ref(null)
|
||||
const next = ref(null)
|
||||
const error = ref('')
|
||||
const nowMinutes = ref(bangkokMinutes())
|
||||
const updatedAt = ref('')
|
||||
|
||||
let clockTimer = null
|
||||
let nextTimer = null
|
||||
let tickTimer = null
|
||||
|
||||
const stamp = () => new Intl.DateTimeFormat('th-TH', {
|
||||
timeZone: 'Asia/Bangkok', hour: '2-digit', minute: '2-digit', hour12: false
|
||||
}).format(new Date())
|
||||
|
||||
// JSON-LD เพื่อให้ค้นหาเจอ (Organization + Service + FAQPage)
|
||||
function injectStructuredData(overview) {
|
||||
const { route, faq, operator } = overview
|
||||
const provider = { '@type': 'Organization', name: operator.operator_name, telephone: operator.contact.hotline }
|
||||
const graph = [
|
||||
provider,
|
||||
{
|
||||
'@type': 'Service',
|
||||
name: `รถโดยสารประจำทาง มินิบัส ${route.route_name}`,
|
||||
serviceType: 'รถโดยสารประจำทาง (มินิบัส)',
|
||||
areaServed: ['อ่างทอง', 'ป่าโมก', 'ภาชี'],
|
||||
provider,
|
||||
hoursAvailable: { '@type': 'OpeningHoursSpecification', opens: route.service_hours.first_departure, closes: route.service_hours.last_departure },
|
||||
offers: { '@type': 'Offer', priceCurrency: 'THB', price: 40, description: 'ค่าโดยสารตลอดสาย' }
|
||||
},
|
||||
{
|
||||
'@type': 'FAQPage',
|
||||
mainEntity: faq.faq.map((item) => ({
|
||||
'@type': 'Question',
|
||||
name: item.question,
|
||||
acceptedAnswer: { '@type': 'Answer', text: item.answer }
|
||||
}))
|
||||
}
|
||||
]
|
||||
document.getElementById('ld-json')?.remove()
|
||||
const tag = document.createElement('script')
|
||||
tag.type = 'application/ld+json'
|
||||
tag.id = 'ld-json'
|
||||
tag.textContent = JSON.stringify({ '@context': 'https://schema.org', '@graph': graph })
|
||||
document.head.appendChild(tag)
|
||||
}
|
||||
|
||||
async function loadAll() {
|
||||
error.value = ''
|
||||
try {
|
||||
const overview = await getOverview()
|
||||
data.value = overview
|
||||
next.value = overview.next
|
||||
updatedAt.value = stamp()
|
||||
injectStructuredData(overview)
|
||||
} catch (err) {
|
||||
error.value = err.message
|
||||
}
|
||||
}
|
||||
|
||||
async function refreshNext() {
|
||||
if (!data.value) return
|
||||
try {
|
||||
const [outbound, inbound] = await Promise.all([getNext('outbound', 3), getNext('inbound', 3)])
|
||||
next.value = { outbound, inbound }
|
||||
updatedAt.value = stamp()
|
||||
nowMinutes.value = bangkokMinutes()
|
||||
} catch {
|
||||
/* เงียบไว้: การ์ดยังแสดงข้อมูลรอบล่าสุด ไม่รบกวนผู้โดยสาร */
|
||||
}
|
||||
}
|
||||
|
||||
function tickClock() {
|
||||
nowMinutes.value = bangkokMinutes()
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
loadAll()
|
||||
tickTimer = setInterval(tickClock, 30_000)
|
||||
clockTimer = setInterval(() => { if (data.value) refreshNext() }, 60_000)
|
||||
})
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
clearInterval(clockTimer)
|
||||
clearInterval(tickTimer)
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<a class="skip-link" href="#main">ข้ามไปเนื้อหาหลัก</a>
|
||||
|
||||
<SiteHeader
|
||||
v-if="data"
|
||||
:operator="data.operator"
|
||||
:hotline="data.operator.contact.hotline"
|
||||
/>
|
||||
|
||||
<main id="main">
|
||||
<!-- โหลดข้อมูลจาก backend -->
|
||||
<div v-if="!data && !error" class="boot">
|
||||
<div class="wrap boot__inner">
|
||||
<span class="boot__bar"></span>
|
||||
<p class="muted">กำลังโหลดข้อมูลเดินรถ…</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- เชื่อมต่อ backend ไม่ได้ -->
|
||||
<div v-else-if="error" class="boot">
|
||||
<div class="wrap boot__inner">
|
||||
<div class="card boot__card">
|
||||
<h1 class="boot__title">โหลดข้อมูลเดินรถไม่สำเร็จ</h1>
|
||||
<p class="muted">{{ error }}</p>
|
||||
<p class="small muted">ตรวจสอบว่า backend ทำงานอยู่ (<code>node server/server.mjs</code> ที่พอร์ต 8090) แล้วลองใหม่</p>
|
||||
<button class="btn btn--primary" type="button" @click="loadAll">ลองอีกครั้ง</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<template v-else>
|
||||
<HeroSection :route="data.route" :next="next" :updated-at="updatedAt" />
|
||||
<RouteStops :route="data.route" />
|
||||
<TimetableSection :timetable="data.timetable" :route="data.route" :now-minutes="nowMinutes" />
|
||||
<FaresSection :fares="data.fares" :route="data.route" />
|
||||
<ServiceSection :service="data.service" />
|
||||
<NoticesSection :notices="data.notices.notices" />
|
||||
<FaqSection :faq="data.faq.faq" />
|
||||
<ContactSection :operator="data.operator" :route="data.route" />
|
||||
</template>
|
||||
</main>
|
||||
|
||||
<SiteFooter
|
||||
v-if="data"
|
||||
:route="data.route"
|
||||
:operator="data.operator"
|
||||
:updated-at="data.timetable.updated_at"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.boot { padding-block: 96px; min-height: 70vh; }
|
||||
.boot__inner { display: grid; gap: var(--space-4); justify-items: start; }
|
||||
.boot__bar {
|
||||
width: 200px;
|
||||
height: 8px;
|
||||
border-radius: 999px;
|
||||
background: var(--primary-soft);
|
||||
border: 1px solid var(--border-strong);
|
||||
animation: pulse 1.4s ease-in-out infinite;
|
||||
}
|
||||
.boot__card { display: grid; gap: var(--space-3); justify-items: start; max-width: 560px; }
|
||||
.boot__title { font-size: 1.375rem; }
|
||||
code { background: var(--surface-alt); padding: 2px 6px; border-radius: 4px; font-size: 0.875rem; }
|
||||
|
||||
@keyframes pulse {
|
||||
0%, 100% { opacity: 1; }
|
||||
50% { opacity: 0.35; }
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,38 @@
|
||||
<script setup>
|
||||
// ไอคอน SVG เส้น (ไม่ใช้ emoji) — path จากชุด Lucide (ISC)
|
||||
const props = defineProps({
|
||||
name: { type: String, required: true },
|
||||
size: { type: [Number, String], default: 20 }
|
||||
})
|
||||
const paths = {
|
||||
bus: ['M4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v9H4V6Z', 'M4 15h16v2a1 1 0 0 1-1 1h-1a2 2 0 0 1-4 0H9a2 2 0 0 1-4 0H5a1 1 0 0 1-1-1v-2Z', 'M8 6v4M16 6v4'],
|
||||
clock: ['M12 6v6l4 2', 'M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z'],
|
||||
seat: ['M6 4h9a3 3 0 0 1 3 3v8H6V4Z', 'M4 15h17v3a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-3Z', 'M8 9h6'],
|
||||
pin: ['M20 10c0 6-8 12-8 12S4 16 4 10a8 8 0 1 1 16 0Z', 'M12 12a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z'],
|
||||
phone: ['M6.5 3h3l1.5 4-2 1.5a12 12 0 0 0 6 6L16.5 12l4 1.5v3a2 2 0 0 1-2.2 2A16.5 16.5 0 0 1 4.5 5.2 2 2 0 0 1 6.5 3Z'],
|
||||
wallet: ['M4 7h15a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h11', 'M16 13h3'],
|
||||
alert: ['M12 8v5', 'M12 17h.01', 'M10.3 3.9 2.5 17.2A1.8 1.8 0 0 0 4 20h16a1.8 1.8 0 0 0 1.5-2.8L13.7 3.9a1.8 1.8 0 0 0-3.4 0Z'],
|
||||
check: ['M4 12.5 9 17.5 20 6.5'],
|
||||
info: ['M12 11v6', 'M12 8h.01', 'M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z'],
|
||||
arrow: ['M5 12h13', 'M13 6l6 6-6 6'],
|
||||
chevron: ['M6 9l6 6 6-6'],
|
||||
access: ['M12 5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z', 'M5 9l5-1v6l-3 6', 'M10 14h6l3 6', 'M13 9h4'],
|
||||
luggage: ['M6 8h12v11a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2V8Z', 'M9 8V5a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v3'],
|
||||
snow: ['M12 3v18', 'M4 7.5l16 9', 'M20 7.5l-16 9'],
|
||||
seatbelt: ['M12 3 5 7v5c0 5 7 9 7 9s7-4 7-9V7l-7-4Z', 'M9 12l2 2 4-4'],
|
||||
camera: ['M4 8h3l1.5-2h7L17 8h3a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1Z', 'M12 16a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z'],
|
||||
usb: ['M12 3v12', 'M9 6l3-3 3 3', 'M8 15h8v3a4 4 0 0 1-8 0v-3Z'],
|
||||
complaint: ['M8 3h8a2 2 0 0 1 2 2v16l-6-3-6 3V5a2 2 0 0 1 2-2Z', 'M9 9h6', 'M9 13h4'],
|
||||
mail: ['M3 6h18v12H3V6Z', 'M3 7l9 6 9-6'],
|
||||
lost: ['M4 7h16v13H4V7Z', 'M9 7V4h6v3', 'M12 11v4M12 18h.01'],
|
||||
route: ['M6 19a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z', 'M18 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z', 'M6 15V9a4 4 0 0 1 4-4h4a4 4 0 0 0 4 4'],
|
||||
ticket: ['M4 8h16v3a2 2 0 0 0 0 4v3H4v-3a2 2 0 0 0 0-4V8Z', 'M12 8v10']
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<svg :width="size" :height="size" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
||||
stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">
|
||||
<path v-for="(d, i) in (paths[name] || paths.info)" :key="i" :d="d" />
|
||||
</svg>
|
||||
</template>
|
||||
@@ -0,0 +1,75 @@
|
||||
<script setup>
|
||||
import AppIcon from './AppIcon.vue'
|
||||
|
||||
defineProps({ operator: { type: Object, required: true }, route: { type: Object, required: true } })
|
||||
|
||||
const channelIcons = {
|
||||
'สอบถามเที่ยวรถ / รถล่าช้า': 'phone',
|
||||
'ของหาย / ลืมของบนรถ': 'lost',
|
||||
'ร้องเรียนการให้บริการ': 'complaint'
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section class="section" id="contact">
|
||||
<div class="wrap">
|
||||
<div class="section-head">
|
||||
<span class="eyebrow"><AppIcon name="phone" :size="16" /> ติดต่อผู้ประกอบการ</span>
|
||||
<h2>{{ operator.operator_name }}</h2>
|
||||
<p>ผู้ให้บริการเส้นทาง {{ route.route_name }} · {{ operator.license_number }}</p>
|
||||
</div>
|
||||
|
||||
<div class="contact">
|
||||
<div class="card">
|
||||
<h3 class="card__title"><AppIcon name="bus" :size="18" /> ข้อมูลผู้ประกอบการ</h3>
|
||||
<dl class="facts">
|
||||
<div><dt>รถที่ให้บริการ</dt><dd>มินิบัส {{ operator.fleet_size }} คัน</dd></div>
|
||||
<div><dt>สายด่วน</dt><dd><a class="num" :href="`tel:${operator.contact.hotline.replace(/-/g, '')}`">{{ operator.contact.hotline }}</a></dd></div>
|
||||
<div><dt>เวลารับสาย</dt><dd>{{ operator.contact.hotline_hours }}</dd></div>
|
||||
<div><dt>LINE</dt><dd>{{ operator.contact.line_id }}</dd></div>
|
||||
<div><dt>อีเมล</dt><dd>{{ operator.contact.email }}</dd></div>
|
||||
<div><dt>ที่อยู่</dt><dd>{{ operator.contact.address }}</dd></div>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<h3 class="card__title"><AppIcon name="complaint" :size="18" /> ช่องทางตามเรื่องที่ต้องการ</h3>
|
||||
<ul class="channels">
|
||||
<li v-for="item in operator.channels" :key="item.purpose">
|
||||
<span class="channels__icon"><AppIcon :name="channelIcons[item.purpose] || 'mail'" :size="18" /></span>
|
||||
<div>
|
||||
<strong>{{ item.purpose }}</strong>
|
||||
<p class="small muted">{{ item.channel }}</p>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<p class="small muted channels__note">ข้อมูลติดต่อในหน้านี้เป็นข้อมูลตัวอย่างสำหรับต้นแบบ ไม่ใช่ผู้ให้บริการจริง</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.contact { display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
|
||||
.card__title { font-size: 1rem; display: flex; align-items: center; gap: 8px; color: var(--primary-strong); margin-bottom: var(--space-3); }
|
||||
.facts { margin: 0; display: grid; gap: 10px; }
|
||||
.facts > div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: var(--space-3); border-bottom: 1px dashed var(--border); padding-bottom: 10px; }
|
||||
.facts > div:last-child { border-bottom: 0; padding-bottom: 0; }
|
||||
.facts dt { color: var(--muted); font-size: 0.875rem; }
|
||||
.facts dd { margin: 0; font-size: 0.9375rem; }
|
||||
.channels { list-style: none; padding: 0; display: grid; gap: var(--space-4); }
|
||||
.channels li { display: flex; gap: 12px; align-items: flex-start; }
|
||||
.channels__icon {
|
||||
display: grid; place-items: center;
|
||||
width: 34px; height: 34px; flex: none;
|
||||
border-radius: 8px;
|
||||
background: var(--primary-soft);
|
||||
color: var(--primary-strong);
|
||||
}
|
||||
.channels strong { font-size: 0.9375rem; }
|
||||
.channels__note { margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px solid var(--border); }
|
||||
|
||||
@media (max-width: 900px) { .contact { grid-template-columns: minmax(0, 1fr); } }
|
||||
@media (max-width: 480px) { .facts > div { grid-template-columns: minmax(0, 1fr); gap: 2px; } }
|
||||
</style>
|
||||
@@ -0,0 +1,54 @@
|
||||
<script setup>
|
||||
import AppIcon from './AppIcon.vue'
|
||||
|
||||
defineProps({ faq: { type: Array, required: true } })
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section class="section section--alt" id="faq">
|
||||
<div class="wrap faq">
|
||||
<div class="section-head">
|
||||
<span class="eyebrow"><AppIcon name="info" :size="16" /> คำถามที่พบบ่อย</span>
|
||||
<h2>ตอบข้อสงสัยก่อนขึ้นรถ</h2>
|
||||
<p>ไม่พบคำตอบ? โทรสายด่วนผู้ประกอบการได้ทุกวัน 05:00–18:00 น.</p>
|
||||
</div>
|
||||
|
||||
<div class="faq__list">
|
||||
<details v-for="item in faq" :key="item.question" class="qa">
|
||||
<summary>
|
||||
<span>{{ item.question }}</span>
|
||||
<AppIcon name="chevron" :size="18" class="qa__icon" />
|
||||
</summary>
|
||||
<p class="small">{{ item.answer }}</p>
|
||||
</details>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.faq { display: grid; gap: var(--space-4); }
|
||||
.faq__list { display: grid; gap: 8px; max-width: 78ch; }
|
||||
.qa {
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius-sm);
|
||||
padding: 0 var(--space-4);
|
||||
}
|
||||
.qa summary {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: var(--space-3);
|
||||
min-height: 52px;
|
||||
padding: var(--space-3) 0;
|
||||
cursor: pointer;
|
||||
font-weight: 600;
|
||||
list-style: none;
|
||||
}
|
||||
.qa summary::-webkit-details-marker { display: none; }
|
||||
.qa summary:hover { color: var(--primary-strong); }
|
||||
.qa__icon { color: var(--primary); flex: none; transition: transform 160ms ease; }
|
||||
.qa[open] .qa__icon { transform: rotate(180deg); }
|
||||
.qa p { padding-bottom: var(--space-4); color: var(--muted); }
|
||||
</style>
|
||||
@@ -0,0 +1,85 @@
|
||||
<script setup>
|
||||
import { computed } from 'vue'
|
||||
import AppIcon from './AppIcon.vue'
|
||||
|
||||
const props = defineProps({ fares: { type: Object, required: true }, route: { type: Object, required: true } })
|
||||
|
||||
const zoneNames = computed(() => Object.fromEntries(props.fares.zones.map((zone) => [zone.zone_id, zone.name])))
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section class="section" id="fares">
|
||||
<div class="wrap">
|
||||
<div class="section-head">
|
||||
<span class="eyebrow"><AppIcon name="wallet" :size="16" /> ค่าโดยสาร</span>
|
||||
<h2>คิดตามโซน 15 – 40 บาท</h2>
|
||||
<p>จ่ายครั้งเดียวตลอดเส้นทาง ไม่ต้องต่อรถ · คิดตามโซนที่ขึ้นและลง</p>
|
||||
</div>
|
||||
|
||||
<div class="fares">
|
||||
<div class="fares__table card">
|
||||
<div class="table-wrap">
|
||||
<table class="data">
|
||||
<caption>ตารางค่าโดยสาร (บาท/เที่ยว/คน)</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">จาก</th>
|
||||
<th scope="col">ไป</th>
|
||||
<th scope="col">ค่าโดยสาร</th>
|
||||
<th scope="col">ตัวอย่างจุดจอด</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="row in fares.fare_matrix" :key="`${row.from_zone_id}-${row.to_zone_id}`">
|
||||
<td>{{ zoneNames[row.from_zone_id] }}</td>
|
||||
<td>{{ zoneNames[row.to_zone_id] }}</td>
|
||||
<td class="num fare">{{ row.fare }}</td>
|
||||
<td class="small muted">{{ row.examples }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<p class="small muted fares__note"><AppIcon name="info" :size="15" /> คิดค่าโดยสารตามโซนที่ขึ้น–ลง ไม่คิดตามระยะทางจริง</p>
|
||||
</div>
|
||||
|
||||
<div class="stack">
|
||||
<div class="card">
|
||||
<h3 class="card__title"><AppIcon name="ticket" :size="18" /> ส่วนลด</h3>
|
||||
<ul class="plain">
|
||||
<li v-for="item in fares.discounts" :key="item.group">
|
||||
<strong>{{ item.group }}</strong> — ลด {{ item.discount_baht }} บาท
|
||||
<span class="small muted">{{ item.condition }}</span>
|
||||
</li>
|
||||
</ul>
|
||||
<p class="small muted">เด็กอายุต่ำกว่า 5 ปี หรือสูงไม่เกิน 100 ซม. นั่งตักผู้ปกครอง ไม่คิดค่าโดยสาร (1 คน/ผู้ใหญ่ 1 คน)</p>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<h3 class="card__title"><AppIcon name="wallet" :size="18" /> วิธีชำระเงิน</h3>
|
||||
<ul class="pay">
|
||||
<li v-for="method in fares.payment_methods" :key="method.method">
|
||||
<span class="chip chip--plain">{{ method.method }}</span>
|
||||
<span class="small muted">{{ method.detail }}</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.fares { display: grid; gap: var(--space-4); grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
|
||||
.fares__note { margin-top: var(--space-3); display: flex; align-items: center; gap: 6px; }
|
||||
.fare { font-weight: 700; color: var(--primary-strong); font-size: 1.0625rem; white-space: nowrap; }
|
||||
.card__title { font-size: 1rem; display: flex; align-items: center; gap: 8px; color: var(--primary-strong); margin-bottom: var(--space-3); }
|
||||
.plain { list-style: none; padding: 0; display: grid; gap: 10px; }
|
||||
.plain li { font-size: 0.9375rem; border-bottom: 1px dashed var(--border); padding-bottom: 10px; }
|
||||
.plain li:last-child { border-bottom: 0; padding-bottom: 0; }
|
||||
.plain span { display: block; }
|
||||
.pay { list-style: none; padding: 0; display: grid; gap: 12px; }
|
||||
.pay li { display: grid; gap: 4px; justify-items: start; }
|
||||
|
||||
@media (max-width: 900px) { .fares { grid-template-columns: minmax(0, 1fr); } }
|
||||
</style>
|
||||
@@ -0,0 +1,225 @@
|
||||
<script setup>
|
||||
import { computed, ref } from 'vue'
|
||||
import AppIcon from './AppIcon.vue'
|
||||
|
||||
const props = defineProps({
|
||||
route: { type: Object, required: true },
|
||||
next: { type: Object, required: true },
|
||||
updatedAt: { type: String, default: '' }
|
||||
})
|
||||
|
||||
const activeDirection = ref('outbound')
|
||||
const current = computed(() => props.next[activeDirection.value])
|
||||
const headlines = computed(() => {
|
||||
const trip = current.value?.upcoming?.[0]
|
||||
if (!trip) return null
|
||||
return trip
|
||||
})
|
||||
const waiting = computed(() => {
|
||||
const trip = headlines.value
|
||||
if (!trip || trip.minutes_until === null || trip.minutes_until === undefined) return null
|
||||
return trip.minutes_until
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section class="hero" id="top">
|
||||
<div class="wrap hero__grid">
|
||||
<div class="hero__copy">
|
||||
<span class="eyebrow"><AppIcon name="route" :size="16" /> รถโดยสารประจำทาง มินิบัส</span>
|
||||
<h1>อ่างทอง – ป่าโมก –<br />ชุมทางภาชี</h1>
|
||||
<p class="hero__lead">
|
||||
รถออกทุกชั่วโมงตรงเวลา ตั้งแต่ 05:00 ถึง 17:00 ทั้ง 2 ทิศทาง
|
||||
มินิบัสปรับอากาศ 14 ที่นั่ง ไม่มีที่ยืน ขึ้นปุ๊บมีที่นั่งปั๊บ
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- การ์ดเที่ยวถัดไป: ข้อมูลสดจาก /api/next -->
|
||||
<div class="next" aria-live="polite">
|
||||
<div class="next__tabs" role="group" aria-label="เลือกทิศทาง">
|
||||
<button
|
||||
v-for="direction in route.directions"
|
||||
:key="direction.direction_id"
|
||||
type="button"
|
||||
class="next__tab"
|
||||
:class="{ 'is-active': activeDirection === direction.direction_id }"
|
||||
:aria-pressed="activeDirection === direction.direction_id"
|
||||
@click="activeDirection = direction.direction_id"
|
||||
>{{ direction.name_short }}</button>
|
||||
</div>
|
||||
|
||||
<p class="next__dir">{{ current.direction_name }}</p>
|
||||
|
||||
<template v-if="current.upcoming.length">
|
||||
<div class="next__time">
|
||||
<span class="num">{{ headlines.departure_time }}</span>
|
||||
<span class="next__wait" v-if="waiting !== null">
|
||||
{{ waiting === 0 ? 'ออกเดี๋ยวนี้' : `อีก ${waiting} นาที` }}
|
||||
</span>
|
||||
<span class="next__wait" v-else>รอบแรกพรุ่งนี้</span>
|
||||
</div>
|
||||
<ul class="next__meta">
|
||||
<li><AppIcon name="pin" :size="16" /> ถึงปลายทาง <strong class="num">{{ headlines.arrival_time }}</strong> น.</li>
|
||||
<li><AppIcon name="seat" :size="16" /> {{ headlines.seats_total }} ที่นั่ง · ไม่รับยืน</li>
|
||||
<li><AppIcon name="wallet" :size="16" /> ตลอดสาย <strong class="num">{{ headlines.fare_to_terminus }}</strong> บาท</li>
|
||||
</ul>
|
||||
|
||||
<div class="next__after" v-if="current.upcoming.length > 1">
|
||||
<p class="small muted">ถัดไป</p>
|
||||
<ul>
|
||||
<li v-for="trip in current.upcoming.slice(1)" :key="trip.departure_time">
|
||||
<span class="num">{{ trip.departure_time }}</span>
|
||||
<span class="muted small">ถึง {{ trip.arrival_time }} น.</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<p class="next__ended" v-if="current.service_ended_for_today">
|
||||
วันนี้หมดรอบแล้ว (รอบสุดท้าย {{ current.last_departure_today }} น.) · รอบแรกพรุ่งนี้ 05:00 น.
|
||||
</p>
|
||||
|
||||
<p class="next__stamp small muted">
|
||||
ข้อมูลสดจากเซิร์ฟเวอร์ · เวลาไทย {{ current.queried_at }} น.<span v-if="updatedAt"> · รีเฟรช {{ updatedAt }}</span>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<ul class="hero__facts">
|
||||
<li><AppIcon name="clock" :size="18" /><span><strong>ทุก 60 นาที</strong><small>05:00–17:00 · 13 เที่ยว/ทิศทาง</small></span></li>
|
||||
<li><AppIcon name="seat" :size="18" /><span><strong>14 ที่นั่ง</strong><small>ไม่มีที่ยืน</small></span></li>
|
||||
<li><AppIcon name="route" :size="18" /><span><strong>{{ route.journey.distance_km }} กม.</strong><small>ใช้เวลาราว {{ route.journey.duration_minutes }} นาที</small></span></li>
|
||||
<li><AppIcon name="wallet" :size="18" /><span><strong>เริ่ม 15 บาท</strong><small>ตลอดสาย 40 บาท</small></span></li>
|
||||
</ul>
|
||||
|
||||
<div class="hero__actions">
|
||||
<a class="btn btn--primary" href="#timetable">
|
||||
ดูตารางเดินรถ <AppIcon name="arrow" :size="18" />
|
||||
</a>
|
||||
<a class="btn btn--ghost" href="#fares">ค่าโดยสารและส่วนลด</a>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.hero {
|
||||
background: var(--surface-alt);
|
||||
border-bottom: 1px solid var(--border);
|
||||
padding-block: var(--space-7) var(--space-8);
|
||||
}
|
||||
.hero__grid {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
|
||||
grid-template-areas:
|
||||
'copy next'
|
||||
'facts next'
|
||||
'actions next';
|
||||
column-gap: var(--space-6);
|
||||
row-gap: 0;
|
||||
align-items: start;
|
||||
}
|
||||
.hero__copy { grid-area: copy; }
|
||||
.next { grid-area: next; }
|
||||
.hero__facts { grid-area: facts; }
|
||||
.hero__actions { grid-area: actions; }
|
||||
.hero h1 {
|
||||
margin-top: 10px;
|
||||
font-size: clamp(2rem, 4.6vw, 3.1rem);
|
||||
letter-spacing: -0.02em;
|
||||
}
|
||||
.hero__lead { margin-top: var(--space-3); color: var(--muted); max-width: 46ch; }
|
||||
|
||||
.hero__facts {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: var(--space-5) 0 0;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: var(--space-3) var(--space-4);
|
||||
}
|
||||
.hero__facts li {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
align-items: flex-start;
|
||||
color: var(--primary-strong);
|
||||
}
|
||||
.hero__facts span { display: grid; line-height: 1.3; }
|
||||
.hero__facts strong { color: var(--fg); font-size: 0.9375rem; }
|
||||
.hero__facts small { color: var(--muted); font-size: 0.8125rem; }
|
||||
|
||||
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-6); }
|
||||
|
||||
.next {
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--border-strong);
|
||||
border-radius: var(--radius);
|
||||
padding: var(--space-5);
|
||||
}
|
||||
.next__tabs {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 4px;
|
||||
padding: 4px;
|
||||
background: var(--bg);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius-sm);
|
||||
}
|
||||
.next__tab {
|
||||
min-height: 40px;
|
||||
border: 0;
|
||||
border-radius: 6px;
|
||||
background: transparent;
|
||||
color: var(--muted);
|
||||
font-weight: 600;
|
||||
font-size: 0.875rem;
|
||||
cursor: pointer;
|
||||
transition: background-color 160ms ease, color 160ms ease;
|
||||
}
|
||||
.next__tab:hover { color: var(--primary-strong); }
|
||||
.next__tab.is-active { background: var(--primary); color: #fff; }
|
||||
|
||||
.next__dir { margin-top: var(--space-4); font-size: 0.875rem; font-weight: 600; color: var(--muted); }
|
||||
.next__time { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-top: 2px; }
|
||||
.next__time > .num { font-size: clamp(2.5rem, 7vw, 3.4rem); font-weight: 700; line-height: 1.05; letter-spacing: -0.02em; }
|
||||
.next__wait {
|
||||
background: var(--primary-soft);
|
||||
color: var(--primary-strong);
|
||||
font-weight: 600;
|
||||
font-size: 0.8125rem;
|
||||
padding: 4px 10px;
|
||||
border-radius: 999px;
|
||||
}
|
||||
.next__meta {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: var(--space-4) 0 0;
|
||||
display: grid;
|
||||
gap: 8px;
|
||||
font-size: 0.9375rem;
|
||||
}
|
||||
.next__meta li { display: flex; align-items: center; gap: 8px; color: var(--muted); }
|
||||
.next__meta svg { color: var(--primary); flex: none; }
|
||||
.next__meta strong { color: var(--fg); }
|
||||
|
||||
.next__after { margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px dashed var(--border-strong); }
|
||||
.next__after ul { list-style: none; padding: 0; display: flex; gap: var(--space-4); margin-top: 2px; }
|
||||
.next__after li { display: flex; gap: 6px; align-items: baseline; }
|
||||
.next__after .num { font-weight: 600; }
|
||||
|
||||
.next__ended { margin-top: var(--space-3); background: var(--warn-soft); color: var(--warn); padding: 10px 12px; border-radius: var(--radius-sm); font-size: 0.875rem; }
|
||||
.next__stamp { margin-top: var(--space-4); }
|
||||
|
||||
@media (max-width: 900px) {
|
||||
.hero__grid {
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
grid-template-areas: 'copy' 'next' 'facts' 'actions';
|
||||
row-gap: var(--space-5);
|
||||
}
|
||||
.hero { padding-block: var(--space-6) var(--space-7); }
|
||||
.hero__facts { margin-top: 0; }
|
||||
.hero__actions { margin-top: 0; }
|
||||
}
|
||||
@media (max-width: 420px) {
|
||||
.hero__facts { grid-template-columns: 1fr; }
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,49 @@
|
||||
<script setup>
|
||||
import { computed } from 'vue'
|
||||
import AppIcon from './AppIcon.vue'
|
||||
import { formatThaiDate } from '../lib/api'
|
||||
|
||||
const props = defineProps({ notices: { type: Array, required: true } })
|
||||
const sorted = computed(() => [...props.notices].sort((a, b) => Number(b.pinned) - Number(a.pinned)))
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section class="section" id="notices">
|
||||
<div class="wrap">
|
||||
<div class="section-head">
|
||||
<span class="eyebrow"><AppIcon name="alert" :size="16" /> ประกาศและแจ้งเปลี่ยนแปลง</span>
|
||||
<h2>เรื่องที่ผู้โดยสารควรรู้ก่อนเดินทาง</h2>
|
||||
<p>ประกาศที่มีผลกับเส้นทาง จุดจอด และเวลาเดินรถ จะอัปเดตที่นี่เป็นที่แรก</p>
|
||||
</div>
|
||||
|
||||
<ul class="notices">
|
||||
<li v-for="notice in sorted" :key="notice.notice_id" class="notice" :class="`notice--${notice.type}`">
|
||||
<div class="notice__head">
|
||||
<span class="chip" :class="notice.type === 'warning' ? 'chip--warn' : ''">
|
||||
<AppIcon :name="notice.type === 'warning' ? 'alert' : 'info'" :size="14" />
|
||||
{{ notice.type === 'warning' ? 'ผลกระทบการเดินทาง' : 'ประกาศ' }}
|
||||
</span>
|
||||
<span class="small muted">มีผล {{ formatThaiDate(notice.effective_date) }}</span>
|
||||
</div>
|
||||
<h3>{{ notice.title }}</h3>
|
||||
<p class="small">{{ notice.body }}</p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.notices { list-style: none; padding: 0; display: grid; gap: var(--space-3); }
|
||||
.notice {
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--border);
|
||||
border-left: 4px solid var(--primary);
|
||||
border-radius: var(--radius);
|
||||
padding: var(--space-4);
|
||||
}
|
||||
.notice--warning { border-left-color: var(--warn); }
|
||||
.notice__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-bottom: 8px; }
|
||||
.notice h3 { font-size: 1.0625rem; }
|
||||
.notice p { margin-top: 4px; color: var(--muted); }
|
||||
</style>
|
||||
@@ -0,0 +1,142 @@
|
||||
<script setup>
|
||||
import { computed, ref } from 'vue'
|
||||
import AppIcon from './AppIcon.vue'
|
||||
|
||||
const props = defineProps({ route: { type: Object, required: true } })
|
||||
|
||||
const activeDirection = ref('outbound')
|
||||
const stopsById = computed(() => Object.fromEntries(props.route.stops.map((stop) => [stop.stop_id, stop])))
|
||||
const direction = computed(() => props.route.directions.find((item) => item.direction_id === activeDirection.value))
|
||||
const origin = computed(() => stopsById.value[props.route.directions[0].origin_stop_id])
|
||||
const terminus = computed(() => stopsById.value[props.route.directions[0].destination_stop_id])
|
||||
const rows = computed(() => direction.value.stop_ids.map((stopId, index, all) => {
|
||||
const stop = stopsById.value[stopId]
|
||||
const position = index === 0 ? 'ต้นทาง' : index === all.length - 1 ? 'ปลายทาง' : 'กลางทาง'
|
||||
const minutes = Math.round((stop.distance_from_origin_km / props.route.journey.distance_km) * props.route.journey.duration_minutes)
|
||||
return { ...stop, position, order: index + 1, minutes }
|
||||
}))
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section class="section" id="stops">
|
||||
<div class="wrap">
|
||||
<div class="section-head">
|
||||
<span class="eyebrow"><AppIcon name="pin" :size="16" /> เส้นทางและจุดจอด</span>
|
||||
<h2>ขึ้น–ลงได้ 6 จุดจอด ระยะทาง {{ route.journey.distance_km }} กม.</h2>
|
||||
<p>รถใช้เวลาเดินทางตลอดสายประมาณ {{ route.journey.duration_minutes }} นาที {{ route.journey.note }}</p>
|
||||
<p class="small" style="margin-top:8px">
|
||||
<a :href="`https://www.google.com/maps/dir/?api=1&origin=${origin.latitude},${origin.longitude}&destination=${terminus.latitude},${terminus.longitude}`"
|
||||
target="_blank" rel="noopener">เปิดเส้นทางทั้งสายใน Google Maps</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="stops">
|
||||
<div class="stops__tabs" role="group" aria-label="เลือกทิศทาง">
|
||||
<button
|
||||
v-for="item in route.directions"
|
||||
:key="item.direction_id"
|
||||
type="button"
|
||||
class="stops__tab"
|
||||
:class="{ 'is-active': activeDirection === item.direction_id }"
|
||||
:aria-pressed="activeDirection === item.direction_id"
|
||||
@click="activeDirection = item.direction_id"
|
||||
>{{ item.name }}</button>
|
||||
</div>
|
||||
|
||||
<ol class="timeline">
|
||||
<li v-for="stop in rows" :key="stop.stop_id" class="timeline__item">
|
||||
<div class="timeline__marker" aria-hidden="true">
|
||||
<span class="timeline__dot" :class="{ 'is-end': stop.position !== 'กลางทาง' }"></span>
|
||||
</div>
|
||||
<div class="timeline__body">
|
||||
<div class="timeline__top">
|
||||
<span class="chip" :class="{ 'chip--plain': stop.position === 'กลางทาง' }">{{ stop.position }}</span>
|
||||
<span class="small muted num">กม. {{ stop.distance_from_origin_km.toFixed(1) }} · ถึงจุดนี้ประมาณ {{ stop.minutes }} นาที</span>
|
||||
</div>
|
||||
<h3>{{ stop.name }}</h3>
|
||||
<p class="small muted">{{ stop.landmark }}</p>
|
||||
<a class="timeline__map small" :href="`https://www.google.com/maps/search/?api=1&query=${stop.latitude},${stop.longitude}`"
|
||||
target="_blank" rel="noopener">
|
||||
<AppIcon name="pin" :size="14" /> เปิดตำแหน่งใน Google Maps
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.stops { display: grid; gap: var(--space-5); }
|
||||
.stops__tabs {
|
||||
display: inline-grid;
|
||||
grid-auto-flow: column;
|
||||
gap: 4px;
|
||||
padding: 4px;
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius-sm);
|
||||
justify-self: start;
|
||||
}
|
||||
.stops__tab {
|
||||
min-height: 40px;
|
||||
padding: 8px 16px;
|
||||
border: 0;
|
||||
border-radius: 6px;
|
||||
background: transparent;
|
||||
color: var(--muted);
|
||||
font-weight: 600;
|
||||
font-size: 0.875rem;
|
||||
cursor: pointer;
|
||||
transition: background-color 160ms ease, color 160ms ease;
|
||||
}
|
||||
.stops__tab:hover { color: var(--primary-strong); }
|
||||
.stops__tab.is-active { background: var(--primary); color: #fff; }
|
||||
|
||||
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
|
||||
.timeline__item { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: var(--space-3); }
|
||||
.timeline__marker { position: relative; display: flex; justify-content: center; }
|
||||
.timeline__marker::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 18px;
|
||||
bottom: 0;
|
||||
width: 2px;
|
||||
background: var(--border-strong);
|
||||
}
|
||||
.timeline__item:last-child .timeline__marker::before { display: none; }
|
||||
.timeline__dot {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
margin-top: 8px;
|
||||
border-radius: 999px;
|
||||
background: var(--surface);
|
||||
border: 2px solid var(--primary);
|
||||
}
|
||||
.timeline__dot.is-end { background: var(--primary); border-color: var(--primary-strong); }
|
||||
.timeline__body {
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius);
|
||||
padding: var(--space-3) var(--space-4);
|
||||
margin-bottom: var(--space-3);
|
||||
}
|
||||
.timeline__top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
|
||||
.timeline__map {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
margin-top: 6px;
|
||||
text-decoration: none;
|
||||
}
|
||||
.timeline__map:hover { text-decoration: underline; }
|
||||
.timeline__body h3 { font-size: 1.0625rem; margin-top: 6px; }
|
||||
|
||||
@media (max-width: 620px) {
|
||||
.stops__tabs { grid-auto-flow: row; width: 100%; }
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,122 @@
|
||||
<script setup>
|
||||
import AppIcon from './AppIcon.vue'
|
||||
|
||||
defineProps({ service: { type: Object, required: true } })
|
||||
|
||||
const amenityIcons = {
|
||||
'แอร์': 'snow',
|
||||
'เข็มขัดนิรภัยทุกที่นั่ง': 'seatbelt',
|
||||
'ช่อง USB ชาร์จมือถือ': 'usb',
|
||||
'ชั้นวางสัมภาระเหนือศีรษะ': 'luggage',
|
||||
'กล้อง CCTV': 'camera'
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section class="section section--alt" id="service">
|
||||
<div class="wrap">
|
||||
<div class="section-head">
|
||||
<span class="eyebrow"><AppIcon name="bus" :size="16" /> บริการบนรถ</span>
|
||||
<h2>มินิบัสปรับอากาศ {{ service.vehicle.seats_total }} ที่นั่ง ทุกคัน</h2>
|
||||
<p>รถทั้งหมด {{ service.vehicle.fleet_size }} คัน อายุไม่เกิน {{ service.vehicle.vehicle_age_years_max }} ปี ผ่านการตรวจสภาพประจำปี</p>
|
||||
</div>
|
||||
|
||||
<div class="grid">
|
||||
<article class="card">
|
||||
<h3 class="card__title"><AppIcon name="seat" :size="18" /> ภายในรถ</h3>
|
||||
<p class="small muted">{{ service.vehicle.class }} · {{ service.vehicle.seats_total }} ที่นั่ง · ไม่มีที่ยืน</p>
|
||||
<ul class="amenities">
|
||||
<li v-for="item in service.vehicle.amenities" :key="item">
|
||||
<AppIcon :name="amenityIcons[item] || 'check'" :size="16" /> {{ item }}
|
||||
</li>
|
||||
</ul>
|
||||
</article>
|
||||
|
||||
<article class="card">
|
||||
<h3 class="card__title"><AppIcon name="luggage" :size="18" /> สัมภาระ</h3>
|
||||
<p class="small">{{ service.luggage.hand_carry }}</p>
|
||||
<p class="small muted">{{ service.luggage.size_limit }}</p>
|
||||
<p class="small out-label">ไม่อนุญาต</p>
|
||||
<ul class="deny">
|
||||
<li v-for="item in service.luggage.not_allowed" :key="item">{{ item }}</li>
|
||||
</ul>
|
||||
</article>
|
||||
|
||||
<article class="card">
|
||||
<h3 class="card__title"><AppIcon name="access" :size="18" /> ผู้โดยสารที่ต้องการความช่วยเหลือ</h3>
|
||||
<ul class="plain">
|
||||
<li v-for="item in service.accessibility" :key="item">{{ item }}</li>
|
||||
</ul>
|
||||
</article>
|
||||
|
||||
<article class="card">
|
||||
<h3 class="card__title"><AppIcon name="info" :size="18" /> กฎการโดยสาร</h3>
|
||||
<ul class="plain">
|
||||
<li v-for="item in service.operating_rules" :key="item">{{ item }}</li>
|
||||
</ul>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
<div class="steps">
|
||||
<h3>วิธีขึ้นรถ 4 ขั้นตอน</h3>
|
||||
<ol class="steps__list">
|
||||
<li v-for="step in service.boarding_steps" :key="step.step">
|
||||
<span class="steps__num num">{{ step.step }}</span>
|
||||
<div>
|
||||
<strong>{{ step.title }}</strong>
|
||||
<p class="small muted">{{ step.detail }}</p>
|
||||
</div>
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
|
||||
.card__title { font-size: 1rem; display: flex; align-items: center; gap: 8px; color: var(--primary-strong); margin-bottom: var(--space-3); }
|
||||
.amenities { list-style: none; padding: 0; margin-top: var(--space-3); display: grid; gap: 8px; }
|
||||
.amenities li { display: flex; align-items: center; gap: 8px; font-size: 0.9375rem; color: var(--primary-strong); }
|
||||
.deny { margin: 6px 0 0; font-size: 0.9375rem; color: var(--danger); }
|
||||
.out-label { margin-top: var(--space-3); font-weight: 600; color: var(--fg); }
|
||||
.plain { list-style: none; padding: 0; display: grid; gap: 8px; font-size: 0.9375rem; }
|
||||
.plain li { border-bottom: 1px dashed var(--border); padding-bottom: 8px; }
|
||||
.plain li:last-child { border-bottom: 0; padding-bottom: 0; }
|
||||
|
||||
.steps {
|
||||
margin-top: var(--space-5);
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius);
|
||||
padding: var(--space-5);
|
||||
}
|
||||
.steps h3 { font-size: 1.0625rem; margin-bottom: var(--space-4); }
|
||||
.steps__list {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
display: grid;
|
||||
gap: var(--space-4);
|
||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||
}
|
||||
.steps__list li { display: grid; gap: 8px; align-content: start; }
|
||||
.steps__num {
|
||||
display: grid;
|
||||
place-items: center;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
border-radius: 999px;
|
||||
background: var(--primary-soft);
|
||||
color: var(--primary-strong);
|
||||
font-weight: 700;
|
||||
}
|
||||
.steps__list strong { font-size: 0.9375rem; }
|
||||
|
||||
@media (max-width: 900px) {
|
||||
.grid { grid-template-columns: minmax(0, 1fr); }
|
||||
.steps__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
||||
}
|
||||
@media (max-width: 520px) {
|
||||
.steps__list { grid-template-columns: minmax(0, 1fr); }
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,58 @@
|
||||
<script setup>
|
||||
import AppIcon from './AppIcon.vue'
|
||||
|
||||
defineProps({
|
||||
route: { type: Object, required: true },
|
||||
operator: { type: Object, required: true },
|
||||
updatedAt: { type: String, required: true }
|
||||
})
|
||||
const year = new Date().getFullYear()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<footer class="ftr">
|
||||
<div class="wrap ftr__inner">
|
||||
<div class="ftr__brand">
|
||||
<span class="ftr__mark" aria-hidden="true"><AppIcon name="bus" :size="20" /></span>
|
||||
<div>
|
||||
<strong>{{ operator.operator_short_name }}</strong>
|
||||
<p class="small">{{ route.route_name }} · ออกทุกชั่วโมง 05:00–17:00 น.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<nav class="ftr__nav" aria-label="เมนูล่าง">
|
||||
<a href="#stops">จุดจอด</a>
|
||||
<a href="#timetable">ตารางเดินรถ</a>
|
||||
<a href="#fares">ค่าโดยสาร</a>
|
||||
<a href="#service">บริการบนรถ</a>
|
||||
<a href="#faq">คำถามบ่อย</a>
|
||||
<a href="#contact">ติดต่อ</a>
|
||||
</nav>
|
||||
|
||||
<p class="small muted ftr__note">
|
||||
ข้อมูลเดินรถชุดล่าสุด {{ updatedAt }} · ข้อมูลผู้ประกอบการและค่าโดยสารในหน้านี้เป็นข้อมูลตัวอย่างสำหรับต้นแบบ
|
||||
(ไม่ได้อ้างอิงผู้ให้บริการจริง) · ตัวอักษร K2D · ไอคอน Lucide
|
||||
</p>
|
||||
<p class="small muted">© {{ year }} {{ operator.operator_name }}</p>
|
||||
</div>
|
||||
</footer>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.ftr { border-top: 1px solid var(--border); background: var(--surface); padding-block: var(--space-6); }
|
||||
.ftr__inner { display: grid; gap: var(--space-4); }
|
||||
.ftr__brand { display: flex; align-items: center; gap: 12px; }
|
||||
.ftr__mark {
|
||||
display: grid; place-items: center;
|
||||
width: 36px; height: 36px;
|
||||
border-radius: 10px;
|
||||
background: var(--primary-soft);
|
||||
color: var(--primary-strong);
|
||||
}
|
||||
.ftr__brand strong { font-size: 0.9375rem; }
|
||||
.ftr__brand p { color: var(--muted); margin-top: 2px; }
|
||||
.ftr__nav { display: flex; flex-wrap: wrap; gap: var(--space-4); }
|
||||
.ftr__nav a { color: var(--muted); text-decoration: none; font-size: 0.9375rem; }
|
||||
.ftr__nav a:hover { color: var(--primary-strong); text-decoration: underline; }
|
||||
.ftr__note { max-width: 90ch; padding-top: var(--space-3); border-top: 1px solid var(--border); }
|
||||
</style>
|
||||
@@ -0,0 +1,99 @@
|
||||
<script setup>
|
||||
import AppIcon from './AppIcon.vue'
|
||||
|
||||
defineProps({
|
||||
operator: { type: Object, required: true },
|
||||
hotline: { type: String, required: true }
|
||||
})
|
||||
|
||||
const links = [
|
||||
{ href: '#stops', label: 'จุดจอด' },
|
||||
{ href: '#timetable', label: 'ตารางเดินรถ' },
|
||||
{ href: '#fares', label: 'ค่าโดยสาร' },
|
||||
{ href: '#service', label: 'บริการบนรถ' },
|
||||
{ href: '#notices', label: 'ประกาศ' },
|
||||
{ href: '#faq', label: 'คำถามบ่อย' }
|
||||
]
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<header class="hdr">
|
||||
<div class="wrap hdr__inner">
|
||||
<a class="brand" href="#top">
|
||||
<span class="brand__mark" aria-hidden="true"><AppIcon name="bus" :size="22" /></span>
|
||||
<span class="brand__text">
|
||||
<strong>{{ operator.operator_short_name }}</strong>
|
||||
<small>มินิบัสล้วน · 14 ที่นั่ง</small>
|
||||
</span>
|
||||
</a>
|
||||
|
||||
<nav class="hdr__nav" aria-label="เมนูหลัก">
|
||||
<a v-for="link in links" :key="link.href" :href="link.href">{{ link.label }}</a>
|
||||
</nav>
|
||||
|
||||
<a class="btn btn--primary hdr__call" :href="`tel:${hotline.replace(/-/g, '')}`">
|
||||
<AppIcon name="phone" :size="18" />
|
||||
<span class="num">{{ hotline }}</span>
|
||||
</a>
|
||||
</div>
|
||||
</header>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.hdr {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 50;
|
||||
background: var(--surface);
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
.hdr__inner {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--space-5);
|
||||
min-height: 68px;
|
||||
}
|
||||
.brand {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
text-decoration: none;
|
||||
color: var(--fg);
|
||||
margin-right: auto;
|
||||
}
|
||||
.brand__mark {
|
||||
display: grid;
|
||||
place-items: center;
|
||||
width: 38px;
|
||||
height: 38px;
|
||||
border-radius: 10px;
|
||||
background: var(--primary-soft);
|
||||
color: var(--primary-strong);
|
||||
}
|
||||
.brand__text { display: grid; line-height: 1.2; }
|
||||
.brand__text strong { font-size: 1rem; white-space: nowrap; }
|
||||
.brand__text small { font-size: 0.75rem; color: var(--muted); font-weight: 500; }
|
||||
|
||||
.hdr__nav { display: flex; gap: var(--space-4); }
|
||||
.hdr__nav a {
|
||||
color: var(--muted);
|
||||
text-decoration: none;
|
||||
font-size: 0.9375rem;
|
||||
font-weight: 500;
|
||||
padding: 6px 2px;
|
||||
border-bottom: 2px solid transparent;
|
||||
transition: color 160ms ease, border-color 160ms ease;
|
||||
}
|
||||
.hdr__nav a:hover { color: var(--primary-strong); border-bottom-color: var(--primary); }
|
||||
|
||||
.hdr__call { flex: none; }
|
||||
|
||||
@media (max-width: 1000px) {
|
||||
.hdr__nav { display: none; }
|
||||
}
|
||||
@media (max-width: 520px) {
|
||||
.hdr__inner { min-height: 62px; gap: var(--space-3); }
|
||||
.brand__text small { display: none; }
|
||||
.hdr__call { padding: 10px 14px; }
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,156 @@
|
||||
<script setup>
|
||||
import { computed } from 'vue'
|
||||
import AppIcon from './AppIcon.vue'
|
||||
import { toMinutes } from '../lib/api'
|
||||
|
||||
const props = defineProps({
|
||||
timetable: { type: Object, required: true },
|
||||
route: { type: Object, required: true },
|
||||
nowMinutes: { type: Number, required: true }
|
||||
})
|
||||
|
||||
const day = computed(() => props.timetable.days[0])
|
||||
const columns = computed(() => day.value.directions.map((direction) => {
|
||||
const nextIndex = direction.departures.findIndex(
|
||||
(trip) => toMinutes(trip.departure_time) >= props.nowMinutes
|
||||
)
|
||||
return {
|
||||
...direction,
|
||||
rows: direction.departures.map((trip, index) => ({
|
||||
...trip,
|
||||
isNext: index === nextIndex
|
||||
})),
|
||||
trips: direction.departures.length
|
||||
}
|
||||
}))
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section class="section section--alt" id="timetable">
|
||||
<div class="wrap">
|
||||
<div class="section-head">
|
||||
<span class="eyebrow"><AppIcon name="clock" :size="16" /> ตารางเดินรถ</span>
|
||||
<h2>ออกทุกชั่วโมง · {{ day.directions[0].departures.length }} เที่ยว/ทิศทาง/วัน</h2>
|
||||
<p>{{ timetable.remark }} · {{ day.label }}</p>
|
||||
</div>
|
||||
|
||||
<div class="boards">
|
||||
<article v-for="column in columns" :key="column.direction_id" class="board">
|
||||
<header class="board__head">
|
||||
<div>
|
||||
<h3>{{ column.name }}</h3>
|
||||
<p class="small muted">{{ column.trips }} เที่ยว/วัน · เที่ยวสุดท้าย 17:00 น.</p>
|
||||
</div>
|
||||
<span class="chip">มินิบัสล้วน</span>
|
||||
</header>
|
||||
|
||||
<div class="table-wrap">
|
||||
<table class="data">
|
||||
<caption class="sr-only">ตารางเดินรถ {{ column.name }}</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">ออก</th>
|
||||
<th scope="col">ถึงปลายทาง</th>
|
||||
<th scope="col">ที่นั่ง</th>
|
||||
<th scope="col">หมายเหตุ</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="trip in column.rows" :key="trip.departure_time" :class="{ 'is-next': trip.isNext }">
|
||||
<th scope="row" class="num board__time">
|
||||
{{ trip.departure_time }}
|
||||
<span v-if="trip.isNext" class="board__flag">เที่ยวถัดไป</span>
|
||||
</th>
|
||||
<td class="num">{{ trip.arrival_time }} น.</td>
|
||||
<td class="num">{{ trip.seats_total }}</td>
|
||||
<td class="small muted">{{ trip.note || '—' }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<p class="board__foot small muted">
|
||||
<AppIcon name="info" :size="15" /> รถออกตรงเวลา · ถ้าเต็มรอบ ให้ใช้รอบถัดไป (ห่าง 60 นาที)
|
||||
</p>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
<div class="strip">
|
||||
<div class="strip__item"><AppIcon name="clock" :size="18" /><span><strong>{{ timetable.service_mode === 'minibus' ? 'ทุกเที่ยวเป็นมินิบัส' : 'มินิบัส' }}</strong><small>ไม่มีรถใหญ่เสริม</small></span></div>
|
||||
<div class="strip__item"><AppIcon name="seat" :size="18" /><span><strong>14 ที่นั่ง/คัน</strong><small>ไม่ขายตั๋วเกิน · ไม่รับยืน</small></span></div>
|
||||
<div class="strip__item"><AppIcon name="route" :size="18" /><span><strong>{{ route.journey.duration_minutes }} นาที/เที่ยว</strong><small>{{ route.journey.distance_km }} กม.</small></span></div>
|
||||
<div class="strip__item"><AppIcon name="bus" :size="18" /><span><strong>26 เที่ยว/วัน</strong><small>2 ทิศทาง รวมกัน</small></span></div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.boards { display: grid; gap: var(--space-4); grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
||||
.board {
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius);
|
||||
overflow: hidden;
|
||||
}
|
||||
.board__head {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
gap: var(--space-3);
|
||||
padding: var(--space-4);
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
.board__head h3 { font-size: 1.0625rem; }
|
||||
.board__time { white-space: nowrap; }
|
||||
.board__flag {
|
||||
display: block;
|
||||
font-size: 0.6875rem;
|
||||
font-weight: 700;
|
||||
color: var(--primary-strong);
|
||||
letter-spacing: 0.04em;
|
||||
}
|
||||
tr.is-next th,
|
||||
tr.is-next td { background: var(--primary-soft); }
|
||||
tr.is-next th { color: var(--primary-strong); }
|
||||
.board__foot { display: flex; align-items: center; gap: 6px; padding: var(--space-3) var(--space-4); border-top: 1px solid var(--border); }
|
||||
|
||||
.strip {
|
||||
margin-top: var(--space-5);
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||
gap: var(--space-3);
|
||||
}
|
||||
.strip__item {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
align-items: flex-start;
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius-sm);
|
||||
padding: var(--space-3) var(--space-4);
|
||||
color: var(--primary-strong);
|
||||
}
|
||||
.strip__item span { display: grid; line-height: 1.3; }
|
||||
.strip__item strong { color: var(--fg); font-size: 0.9375rem; }
|
||||
.strip__item small { color: var(--muted); font-size: 0.8125rem; }
|
||||
|
||||
.sr-only {
|
||||
position: absolute;
|
||||
width: 1px; height: 1px;
|
||||
padding: 0; margin: -1px;
|
||||
overflow: hidden;
|
||||
clip: rect(0 0 0 0);
|
||||
white-space: nowrap;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
@media (max-width: 900px) {
|
||||
.boards { grid-template-columns: minmax(0, 1fr); }
|
||||
.strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
||||
}
|
||||
@media (max-width: 460px) {
|
||||
.strip { grid-template-columns: minmax(0, 1fr); }
|
||||
table.data th, table.data td { padding: 10px 10px; }
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,30 @@
|
||||
// ชั้นติดต่อ backend (Node + JSON) — ทุกหน้าจอใช้ข้อมูลจากที่นี่เท่านั้น
|
||||
async function request(path) {
|
||||
const response = await fetch(path, { headers: { accept: 'application/json' } })
|
||||
if (!response.ok) {
|
||||
const detail = await response.text().catch(() => '')
|
||||
throw new Error(`เรียก ${path} ไม่สำเร็จ (${response.status}) ${detail.slice(0, 120)}`)
|
||||
}
|
||||
return response.json()
|
||||
}
|
||||
|
||||
export const getOverview = () => request('/api/overview')
|
||||
export const getNext = (directionId, count = 3) =>
|
||||
request(`/api/next?direction_id=${encodeURIComponent(directionId)}&count=${count}`)
|
||||
|
||||
/** เวลาปัจจุบันเขต Asia/Bangkok เป็นนาทีจากเที่ยงคืน — ใช้ไฮไลต์เที่ยวถัดไป */
|
||||
export function bangkokMinutes(date = new Date()) {
|
||||
const text = new Intl.DateTimeFormat('en-GB', {
|
||||
timeZone: 'Asia/Bangkok', hour: '2-digit', minute: '2-digit', hour12: false
|
||||
}).format(date)
|
||||
const [h, m] = text.split(':').map(Number)
|
||||
return h * 60 + m
|
||||
}
|
||||
|
||||
export const toMinutes = (hhmm) => {
|
||||
const [h, m] = hhmm.split(':').map(Number)
|
||||
return h * 60 + m
|
||||
}
|
||||
|
||||
export const formatThaiDate = (iso) =>
|
||||
new Intl.DateTimeFormat('th-TH', { day: 'numeric', month: 'long', year: 'numeric' }).format(new Date(iso))
|
||||
@@ -0,0 +1,9 @@
|
||||
import { createApp } from 'vue'
|
||||
import '@fontsource/k2d/400.css'
|
||||
import '@fontsource/k2d/500.css'
|
||||
import '@fontsource/k2d/600.css'
|
||||
import '@fontsource/k2d/700.css'
|
||||
import './style.css'
|
||||
import App from './App.vue'
|
||||
|
||||
createApp(App).mount('#app')
|
||||
+187
@@ -0,0 +1,187 @@
|
||||
/* ─────────────────────────────────────────────────────────────
|
||||
IdealRoute — design tokens (เขียวอ่อน–ขาว, flat, ไม่มีเงา/ไล่สี)
|
||||
ค่าคอนทราสต์วัดจริง: fg/bg 14.0:1 · muted 6.4:1 · ขาวบน primary 4.96:1
|
||||
───────────────────────────────────────────────────────────── */
|
||||
:root {
|
||||
--bg: #f5fbf7;
|
||||
--surface: #ffffff;
|
||||
--surface-alt: #eaf7ef;
|
||||
--border: #dcefe2;
|
||||
--border-strong: #bfddcb;
|
||||
--fg: #0e2e1d;
|
||||
--muted: #4a6154;
|
||||
--primary: #17804e;
|
||||
--primary-strong: #0f6b41;
|
||||
--primary-soft: #e4f5ea;
|
||||
--warn: #8a6a00;
|
||||
--warn-soft: #fff6da;
|
||||
--danger: #b3261e;
|
||||
--radius: 12px;
|
||||
--radius-sm: 8px;
|
||||
--wrap: 1140px;
|
||||
--space-1: 4px;
|
||||
--space-2: 8px;
|
||||
--space-3: 12px;
|
||||
--space-4: 16px;
|
||||
--space-5: 24px;
|
||||
--space-6: 32px;
|
||||
--space-7: 48px;
|
||||
--space-8: 64px;
|
||||
--font: 'K2D', 'Noto Sans Thai', 'Leelawadee UI', system-ui, sans-serif;
|
||||
}
|
||||
|
||||
*,
|
||||
*::before,
|
||||
*::after { box-sizing: border-box; }
|
||||
|
||||
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
background: var(--bg);
|
||||
color: var(--fg);
|
||||
font-family: var(--font);
|
||||
font-size: 16px;
|
||||
line-height: 1.6;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 700; letter-spacing: -0.01em; }
|
||||
p { margin: 0; }
|
||||
ul, ol { margin: 0; padding-left: 1.15rem; }
|
||||
a { color: var(--primary-strong); text-underline-offset: 3px; }
|
||||
a:hover { color: var(--fg); }
|
||||
img { max-width: 100%; display: block; }
|
||||
button { font: inherit; }
|
||||
|
||||
:focus-visible {
|
||||
outline: 2px solid var(--primary-strong);
|
||||
outline-offset: 2px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.skip-link {
|
||||
position: absolute;
|
||||
left: 12px;
|
||||
top: -60px;
|
||||
z-index: 100;
|
||||
background: var(--primary-strong);
|
||||
color: #fff;
|
||||
padding: 10px 16px;
|
||||
border-radius: var(--radius-sm);
|
||||
text-decoration: none;
|
||||
}
|
||||
.skip-link:focus { top: 12px; color: #fff; }
|
||||
|
||||
.wrap {
|
||||
width: 100%;
|
||||
max-width: var(--wrap);
|
||||
margin-inline: auto;
|
||||
padding-inline: 20px;
|
||||
}
|
||||
|
||||
/* ── typography helpers ── */
|
||||
.eyebrow {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
font-size: 0.8125rem;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
color: var(--primary-strong);
|
||||
}
|
||||
.muted { color: var(--muted); }
|
||||
.small { font-size: 0.875rem; }
|
||||
.num { font-variant-numeric: tabular-nums; }
|
||||
|
||||
/* ── buttons ── */
|
||||
.btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 8px;
|
||||
min-height: 44px;
|
||||
padding: 10px 18px;
|
||||
border: 1px solid transparent;
|
||||
border-radius: var(--radius-sm);
|
||||
font-weight: 600;
|
||||
font-size: 0.9375rem;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
|
||||
}
|
||||
.btn--primary { background: var(--primary); color: #fff; }
|
||||
.btn--primary:hover { background: var(--primary-strong); color: #fff; }
|
||||
.btn--ghost {
|
||||
background: var(--surface);
|
||||
color: var(--primary-strong);
|
||||
border-color: var(--border-strong);
|
||||
}
|
||||
.btn--ghost:hover { background: var(--primary-soft); color: var(--primary-strong); }
|
||||
|
||||
/* ── divider / section ── */
|
||||
.section { padding-block: var(--space-8); }
|
||||
.section--alt { background: var(--surface-alt); border-block: 1px solid var(--border); }
|
||||
.section-head { max-width: 62ch; margin-bottom: var(--space-5); }
|
||||
.section-head h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-top: 6px; }
|
||||
.section-head p { margin-top: 8px; color: var(--muted); }
|
||||
|
||||
/* ── card ── */
|
||||
.card {
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius);
|
||||
padding: var(--space-5);
|
||||
}
|
||||
.stack { display: grid; gap: var(--space-4); }
|
||||
.stack--sm { gap: var(--space-2); }
|
||||
|
||||
.chip {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
padding: 4px 10px;
|
||||
border-radius: 999px;
|
||||
background: var(--primary-soft);
|
||||
color: var(--primary-strong);
|
||||
font-size: 0.8125rem;
|
||||
font-weight: 600;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.chip--warn { background: var(--warn-soft); color: var(--warn); }
|
||||
.chip--plain { background: #fff; color: var(--muted); border: 1px solid var(--border-strong); }
|
||||
|
||||
/* ── tables ── */
|
||||
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
|
||||
table.data {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
font-size: 0.9375rem;
|
||||
}
|
||||
table.data caption { text-align: left; padding-bottom: 10px; color: var(--muted); font-size: 0.875rem; }
|
||||
table.data th,
|
||||
table.data td {
|
||||
padding: 12px 14px;
|
||||
border-bottom: 1px solid var(--border);
|
||||
text-align: left;
|
||||
vertical-align: top;
|
||||
}
|
||||
table.data thead th {
|
||||
background: var(--surface-alt);
|
||||
font-size: 0.8125rem;
|
||||
font-weight: 600;
|
||||
color: var(--primary-strong);
|
||||
letter-spacing: 0.02em;
|
||||
white-space: nowrap;
|
||||
}
|
||||
table.data tbody tr:last-child td { border-bottom: 0; }
|
||||
|
||||
/* ── motion ── */
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
html { scroll-behavior: auto; }
|
||||
*, *::before, *::after {
|
||||
animation-duration: 0.01ms !important;
|
||||
transition-duration: 0.01ms !important;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [vue()],
|
||||
server: {
|
||||
port: 5173,
|
||||
proxy: {
|
||||
'/api': { target: 'http://localhost:8090', changeOrigin: true }
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in new issue
Block a user