ตารางเวลาคำนวณได้ + หน้ารายละเอียดป้ายขับเคลื่อนด้วยข้อมูล + แผนที่ Leaflet
Schedules — กติกา "จุดนี้ = เวลาจุดอ้างอิง ± n นาที"
- ฟิลด์ derive { from_station_id, offset_min } คำนวณที่ ui/partials/schedules.js (ท่อเดียว) รองรับอ้างจุดข้ามทิศ
- จุดย่อยของ "8 other_stop" ใช้ offsets_min จับคู่ตามลำดับ (เช่น ตลาดสามโก้ = ตลาดท่าช้าง +45 นาที)
- เครื่องมือ resource/tools/derive-times.py + ตาราง resource/data/derive-times.csv (--check / --audit ชี้จุดที่ควรตั้งกฎ)
- แยกตารางเป็นรายสาย: scheduleslist/schedules<route_id>.json และ schedules.json เป็นสารบัญ (โหลดแบบ lazy + cache)
- ตรวจจับวันทำงาน/วันหยุด + schema 3 (weekday/holiday → directions) · ไฟล์ข้อมูลเป็น CRLF ทั้งชุด
- ล้างค่าที่ไม่ใช่ HH:MM ที่ฝังใน times (ทำให้ KPI เพี้ยน) + กันค่าหลอกในตัวสรุปเวลา
UI
- หน้ารายละเอียดป้าย/ตารางเวลา ขับเคลื่อนด้วย JSON (stopDetail.init.js) · จุดขึ้นรถประจำทางอื่นๆ รองรับหลายจุดต่อสาย
- #/stops: แสดง 6 ป้ายแรก + ปุ่ม "แสดงป้ายทั้งหมด" (โหลดรูปเฉพาะที่แสดง) · ชิปสาย → #/routes/<route_id>
- หน้าแรก: ตัดตัวเลือก "ทุกสถานีในจังหวัดนี้" · ตัวกรองจังหวัด/สถานี + ปุ่มแชร์ (share URL)
- การ์ดติดต่อ: ไอคอน/ชื่อ/สีเปลี่ยนตามชนิด URL (Facebook / LINE / เว็บไซต์) + ปุ่มเปิดลิงก์จาก web_url
- รูปรองรับหลายนามสกุล (.jpg → .jpeg → .webp → .png) · ป้าย "ประมาณ" + หมายเหตุสำหรับตารางที่คำนวณ
- หน้าเครดิตเหลือ 3 หมวด · แก้ข้อความหมวดแผนที่ให้ตรงกับข้อมูลจริง
- แผนที่ Leaflet (vendor ในโปรเจกต์ ไม่ใช้ CDN): เส้นทาง + หมุด + ป๊อปอัป · แก้ CSS ที่ทำให้ SVG ยุบ 0x0
เครื่องมือและเอกสาร
- qgis-to-web.py อ่าน .shp ตรง → geojson-web (สร้างใหม่ 10 ไฟล์) + audit-geojson.py ตรวจ 3 ส่วน
- stop-km.py วัดระยะ กม. ตามเส้นจริง → stop-km.json · schedules-editor.html (แก้ทีละไฟล์ · มุมมองตารางแบบ Excel)
- AGENTS.md: กติกา derive · offsets_min · นามสกุลรูป · ชิปสาย · หน้ารายละเอียดป้ายมาจากไหน
This commit is contained in:
1 parent
88311326e6
commit
1cfaeb1526
91 files changed
+7560
-844
No files matched your search
+42
-405
@@ -1,4 +1,18 @@
|
||||
<style>
|
||||
.mu-other-stops { margin: 16px 0 6px; }
|
||||
.mu-other-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
|
||||
.mu-other-item { display: block; padding: 10px 12px; background: #fff;
|
||||
border: 1px solid #eef0f6; border-radius: 12px; min-width: 0; }
|
||||
.mu-other-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
|
||||
.mu-other-item .mu-time-grid { margin-top: 8px; }
|
||||
.mu-other-item .mu-est-note { margin-top: 4px; }
|
||||
.mu-other-idx { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%; background: #f1e9ff;
|
||||
color: #7a4cc0; font-size: .78rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
|
||||
.mu-other-txt { flex: 1; min-width: 0; }
|
||||
.mu-other-txt strong { display: block; color: #1f2a44; font-size: .94rem; }
|
||||
.mu-other-txt span { display: block; color: #6f7b95; font-size: .8rem; }
|
||||
.mu-other-item .mu-chip { flex: 0 0 auto; font-family: ui-monospace, Consolas, monospace; font-size: .72rem; }
|
||||
.mu-other-item .mu-chip.warn { background: #fff5e6; color: #9a6b00; border-color: #f2d9a8; }
|
||||
:root {
|
||||
--mu-accent: #7a4cc0;
|
||||
--mu-accent-soft: #f3eafe;
|
||||
@@ -55,8 +69,10 @@
|
||||
.mu-stop-hero > * {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
min-width: 0; /* กัน grid track บวมตาม min-content (ไม่งั้นเนื้อหาถูก overflow:hidden ตัดที่จอแคบ) */
|
||||
}
|
||||
.mu-stop-hero-title {
|
||||
overflow-wrap: anywhere;
|
||||
margin: 0;
|
||||
font-size: 1.72rem;
|
||||
color: var(--mu-ink);
|
||||
@@ -68,7 +84,7 @@
|
||||
font-size: .9rem;
|
||||
}
|
||||
.mu-meta-row { display:flex; flex-wrap:wrap; gap:8px; margin: 12px 0 0; }
|
||||
.mu-meta-pill { background:linear-gradient(135deg, #ffffff, #f7f9ff); border:1px solid rgba(231, 224, 246, 0.9); color:#5b3b71; padding:6px 14px; border-radius:999px; font-size:.85rem; font-weight:600; box-shadow: 0 4px 10px rgba(122, 76, 192, 0.08); }
|
||||
.mu-meta-pill { max-width: 100%; overflow-wrap: anywhere; background:linear-gradient(135deg, #ffffff, #f7f9ff); border:1px solid rgba(231, 224, 246, 0.9); color:#5b3b71; padding:6px 14px; border-radius:999px; font-size:.85rem; font-weight:600; box-shadow: 0 4px 10px rgba(122, 76, 192, 0.08); }
|
||||
.mu-meta-pill.purple { background:linear-gradient(135deg, #f5eeff, #fce7f3); color:#7a4cc0; border-color:#e8d9f0; }
|
||||
.mu-meta-pill.sky { background:linear-gradient(135deg, #ebf5ff, #eff6ff); color:#3071b8; border-color:#d7e7fb; }
|
||||
.mu-meta-pill.mint { background:linear-gradient(135deg, #eafaf4, #ecfeff); color:#1f8765; border-color:#d1efdf; }
|
||||
@@ -86,6 +102,8 @@
|
||||
padding: 10px;
|
||||
background: #fff;
|
||||
box-shadow: 0 6px 14px rgba(122, 76, 192, 0.08);
|
||||
min-width: 0;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
.mu-hero-metric:nth-child(1) { background: linear-gradient(135deg, #f5efff, #fdf2f8); }
|
||||
.mu-hero-metric:nth-child(2) { background: linear-gradient(135deg, #ecfeff, #eef6ff); }
|
||||
@@ -338,6 +356,8 @@
|
||||
}
|
||||
}
|
||||
@media (max-width: 640px) {
|
||||
.mu-hero-metric-grid { grid-template-columns: 1fr; }
|
||||
.mu-hero-metric { min-width: 0; overflow-wrap: anywhere; }
|
||||
.mu-stop-summary-rail {
|
||||
gap: 6px;
|
||||
}
|
||||
@@ -390,438 +410,55 @@
|
||||
|
||||
<main class="mu-page">
|
||||
<div class="mu-container">
|
||||
<p class="mu-breadcrumb"><a href="#/">หน้าแรก</a>/ <a href="#/stops">ป้ายหยุดรถ</a>/ บขส.อ่างทอง</p>
|
||||
<p class="mu-breadcrumb" id="stop-breadcrumb"></p>
|
||||
|
||||
<section class="mu-stop-hero">
|
||||
<div>
|
||||
<h1 class="mu-stop-hero-title"><svg class="ic" aria-hidden="true"><use href="#ic-map-pin"/></svg> บขส.อ่างทอง</h1>
|
||||
<p class="mu-stop-hero-sub">ศูนย์รวมรถโดยสารหลักของจังหวัดอ่างทอง พร้อมข้อมูลเวลารถแบบอ่านง่ายและหาเที่ยวถัดไปได้ทันที</p>
|
||||
<div class="mu-meta-row">
|
||||
<span class="mu-meta-pill purple"><span data-i18n="type.terminal">สถานีขนส่งหลัก</span></span>
|
||||
<span class="mu-meta-pill sky">รหัส: at_main_terminal</span>
|
||||
<span class="mu-meta-pill mint">เมืองอ่างทอง · จังหวัดอ่างทอง</span>
|
||||
</div>
|
||||
<div class="mu-hero-metric-grid">
|
||||
<div class="mu-hero-metric">
|
||||
<p class="mu-hero-metric-label">จำนวนสายรถ</p>
|
||||
<p class="mu-hero-metric-value">8 สายหลัก</p>
|
||||
</div>
|
||||
<div class="mu-hero-metric">
|
||||
<p class="mu-hero-metric-label">เวลาบริการ</p>
|
||||
<p class="mu-hero-metric-value">04:30 - 21:00</p>
|
||||
</div>
|
||||
<div class="mu-hero-metric">
|
||||
<p class="mu-hero-metric-label">เที่ยวเร็วสุดถัดไป</p>
|
||||
<p class="mu-hero-metric-value">คำนวณอัตโนมัติ</p>
|
||||
</div>
|
||||
<div class="mu-hero-metric">
|
||||
<p class="mu-hero-metric-label">สิ่งอำนวยความสะดวก</p>
|
||||
<p class="mu-hero-metric-value">ห้องน้ำ · ที่พักคอย · ร้านอาหาร</p>
|
||||
</div>
|
||||
</div>
|
||||
<h1 class="mu-stop-hero-title"><svg class="ic" aria-hidden="true"><use href="#ic-map-pin"/></svg> <span id="stop-title"></span></h1>
|
||||
<p class="mu-stop-hero-sub" id="stop-sub"></p>
|
||||
<div class="mu-meta-row" id="stop-meta"></div>
|
||||
<div class="mu-hero-metric-grid" id="stop-metrics"></div>
|
||||
</div>
|
||||
<div>
|
||||
<img class="mu-stop-hero-photo" src="../.image/stops/54950.jpg" alt="ผังป้าย บขส.อ่างทอง" fetchpriority="high" decoding="async">
|
||||
<img class="mu-stop-hero-photo" id="stop-photo" alt="" fetchpriority="high" decoding="async" hidden>
|
||||
<div class="mu-live-clock-card" id="mu-live-clock-card">
|
||||
<div>
|
||||
<p class="mu-live-clock-title">เวลาปัจจุบัน ณ ป้ายนี้</p>
|
||||
<p class="mu-live-clock-title" data-i18n="stop.nowAtStop">เวลาปัจจุบัน ณ ป้ายนี้</p>
|
||||
<p class="mu-live-clock-time" id="mu-current-time">--:--</p>
|
||||
</div>
|
||||
<p class="mu-live-clock-note"><span class="mu-live-dot"></span>กำลังคำนวณเที่ยวถัดไปอัตโนมัติ</p>
|
||||
<p class="mu-live-clock-note"><span class="mu-live-dot"></span><span data-i18n="stop.autoNext">กำลังคำนวณเที่ยวถัดไปอัตโนมัติ</span></p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="mu-nearby" aria-label="สถานที่ใกล้เคียง">
|
||||
<section class="mu-nearby" id="stop-nearby" aria-label="สถานที่ใกล้เคียง" hidden>
|
||||
<h2><span data-i18n="stop.nearby">ใกล้เคียงป้าย</span></h2>
|
||||
<p class="sub">สถานที่น่าสนใจและจุดแวะระหว่างรอรถได้สะดวก · เดินถึงได้ภายใน 5–10 นาที</p>
|
||||
<div class="mu-nearby-grid">
|
||||
<div class="mu-nearby-card"><img src="../.image/landmarks/riverbank.jpg" alt="ริมแม่น้ำเจ้าพระยา" loading="lazy" decoding="async"><p class="cap">ริมแม่น้ำเจ้าพระยา<small>จุดพักผ่อน · เดิน 6 นาที</small></p></div>
|
||||
<div class="mu-nearby-card"><img src="../.image/landmarks/waterpark.png" alt="สวนน้ำอ่างทอง" loading="lazy" decoding="async"><p class="cap">สวนน้ำอ่างทอง<small>สวนสนุก · เดิน 8 นาที</small></p></div>
|
||||
<div class="mu-nearby-card"><img src="../.image/landmarks/temple.png" alt="วัดใกล้สถานี" loading="lazy" decoding="async"><p class="cap">วัดสำคัญใกล้ป้าย<small>จุดแวะสักการะ · เดิน 5 นาที</small></p></div>
|
||||
<div class="mu-nearby-card"><img src="../.image/landmarks/market.png" alt="ตลาดใกล้สถานี" loading="lazy" decoding="async"><p class="cap">ตลาดชุมชน<small>อาหาร · ติดป้าย</small></p></div>
|
||||
</div> </section>
|
||||
<div class="mu-toolbar">
|
||||
<a class="mu-btn primary" href="#/routes/101&origin=at_main_terminal">ดูตารางเวลาสายรถ 101</a>
|
||||
<a class="mu-back-btn" href="#/stops"><span data-i18n="common.backStops">← กลับไปยังรายการป้าย</span></a>
|
||||
</div>
|
||||
|
||||
<section class="mu-info-grid" aria-label="stop highlights">
|
||||
<article class="mu-info-card" style="background:linear-gradient(135deg, #f7f1ff, #f2e8ff);">
|
||||
<p class="label">จำนวนสายรถ</p>
|
||||
<p class="value">8 สาย</p>
|
||||
</article>
|
||||
<article class="mu-info-card" style="background:linear-gradient(135deg, #edf6ff, #e8f3ff); border-color:#d7e7fb;">
|
||||
<p class="label">เวลาบริการ</p>
|
||||
<p class="value">04:30 - 21:00</p>
|
||||
</article>
|
||||
<article class="mu-info-card" style="background:linear-gradient(135deg, #eefdf6, #e7f9f1); border-color:#d1efdf;">
|
||||
<p class="label">ประเภท</p>
|
||||
<p class="value">สถานีหลัก</p>
|
||||
</article>
|
||||
<article class="mu-info-card" style="background:linear-gradient(135deg, #fff5fa, #ffeef6); border-color:#f7d6e5;">
|
||||
<p class="label">สิ่งอำนวยความสะดวก</p>
|
||||
<p class="value">ครบครัน</p>
|
||||
</article>
|
||||
<p class="sub" id="stop-nearby-sub"></p>
|
||||
<div class="mu-nearby-grid" id="stop-nearby-grid"></div>
|
||||
</section>
|
||||
|
||||
<div class="mu-toolbar" id="stop-toolbar"></div>
|
||||
|
||||
<section class="mu-info-grid" id="stop-info" aria-label="stop highlights"></section>
|
||||
|
||||
<section class="mu-layout-grid">
|
||||
<div class="mu-card-panel">
|
||||
<h2><span data-i18n="stop.routes">สายรถที่ผ่านจุดนี้</span></h2>
|
||||
<div class="mu-route-tools">
|
||||
<input id="mu-route-filter" class="mu-route-filter" type="text" placeholder="ค้นหาสายรถหรือปลายทาง" data-i18n-attr="placeholder:stop.searchRoute,aria-label:stop.searchRoute" data-i18n-attr="placeholder:stop.searchRoute,aria-label:stop.searchRoute">
|
||||
<span class="mu-route-count" id="mu-route-count">แสดง 8 จาก 8 สาย</span>
|
||||
<input id="mu-route-filter" class="mu-route-filter" type="text" placeholder="ค้นหาสายรถหรือปลายทาง" data-i18n-attr="placeholder:stop.searchRoute,aria-label:stop.searchRoute">
|
||||
<span class="mu-route-count" id="mu-route-count"></span>
|
||||
</div>
|
||||
<ul class="mu-list mu-stop-list">
|
||||
<li>
|
||||
<details class="mu-stop-expander">
|
||||
<summary>
|
||||
<span class="mu-route-chip">902</span>
|
||||
<span class="mu-route-type-badge"><svg class="ic" aria-hidden="true"><use href="#ic-bus-front"/></svg> รถบัส</span>
|
||||
<span class="mu-stop-summary-main">
|
||||
<strong>กรุงเทพ-อ่างทอง สายเอเซีย</strong>
|
||||
<span class="mu-stop-summary-meta">เที่ยวกลับเข้า บขส.อ่างทอง</span>
|
||||
</span>
|
||||
<span class="mu-stop-summary-rail">
|
||||
<span class="mu-status-pill info">18 รอบ/วัน</span>
|
||||
<span class="mu-stop-chevron">⌄</span>
|
||||
</span>
|
||||
</summary>
|
||||
<div class="mu-stop-expander-body">
|
||||
<div class="mu-time-grid">
|
||||
<div class="mu-time-chip">04:00</div><div class="mu-time-chip">04:30</div>
|
||||
<div class="mu-time-chip">05:00</div><div class="mu-time-chip">05:30</div>
|
||||
<div class="mu-time-chip">06:00</div><div class="mu-time-chip">06:30</div>
|
||||
<div class="mu-time-chip">07:00</div><div class="mu-time-chip">07:30</div>
|
||||
<div class="mu-time-chip">08:00</div><div class="mu-time-chip">08:30</div>
|
||||
<div class="mu-time-chip">09:00</div><div class="mu-time-chip">09:30</div>
|
||||
<div class="mu-time-chip">10:00</div><div class="mu-time-chip">10:30</div>
|
||||
<div class="mu-time-chip">11:00</div><div class="mu-time-chip">11:30</div>
|
||||
<div class="mu-time-chip">12:00</div><div class="mu-time-chip">12:30</div>
|
||||
<div class="mu-time-chip">13:00</div><div class="mu-time-chip">13:30</div>
|
||||
<div class="mu-time-chip">14:00</div><div class="mu-time-chip">14:30</div>
|
||||
<div class="mu-time-chip">15:00</div><div class="mu-time-chip">15:30</div>
|
||||
<div class="mu-time-chip">16:00</div><div class="mu-time-chip">16:30</div>
|
||||
<div class="mu-time-chip">17:00</div><div class="mu-time-chip">17:30</div>
|
||||
</div>
|
||||
</div>
|
||||
</details>
|
||||
</li>
|
||||
<li>
|
||||
<details class="mu-stop-expander">
|
||||
<summary>
|
||||
<span class="mu-route-chip">15</span>
|
||||
<span class="mu-route-type-badge"><svg class="ic" aria-hidden="true"><use href="#ic-bus-front"/></svg> รถบัส</span>
|
||||
<span class="mu-stop-summary-main">
|
||||
<strong>กรุงเทพ-อ่างทอง สายใน</strong>
|
||||
<span class="mu-stop-summary-meta">เที่ยวกลับเข้า บขส.อ่างทอง</span>
|
||||
</span>
|
||||
<span class="mu-stop-summary-rail">
|
||||
<span class="mu-status-pill info">4 รอบ/วัน</span>
|
||||
<span class="mu-stop-chevron">⌄</span>
|
||||
</span>
|
||||
</summary>
|
||||
<div class="mu-stop-expander-body">
|
||||
<div class="mu-time-grid">
|
||||
<div class="mu-time-chip">05:00</div><div class="mu-time-chip">05:45</div>
|
||||
<div class="mu-time-chip">06:30</div><div class="mu-time-chip">07:30</div>
|
||||
</div>
|
||||
</div>
|
||||
</details>
|
||||
</li>
|
||||
<li>
|
||||
<details class="mu-stop-expander">
|
||||
<summary>
|
||||
<span class="mu-route-chip">101</span>
|
||||
<span class="mu-route-type-badge"><svg class="ic" aria-hidden="true"><use href="#ic-bus-front"/></svg> รถบัส</span>
|
||||
<span class="mu-stop-summary-main">
|
||||
<strong>อ่างทอง-ป่าโมก-อยุธยา</strong>
|
||||
<span class="mu-stop-summary-meta">เที่ยวออกจาก บขส.อ่างทอง</span>
|
||||
</span>
|
||||
<span class="mu-stop-summary-rail">
|
||||
<span class="mu-status-pill info">9 รอบ/วัน</span>
|
||||
<span class="mu-stop-chevron">⌄</span>
|
||||
</span>
|
||||
</summary>
|
||||
<div class="mu-stop-expander-body">
|
||||
<div class="mu-time-grid">
|
||||
<div class="mu-time-chip next">07:30</div><div class="mu-time-chip">08:20</div>
|
||||
<div class="mu-time-chip">09:10</div><div class="mu-time-chip">10:00</div>
|
||||
<div class="mu-time-chip">10:50</div><div class="mu-time-chip">11:50</div>
|
||||
<div class="mu-time-chip">13:00</div><div class="mu-time-chip">14:00</div>
|
||||
<div class="mu-time-chip">15:00</div>
|
||||
</div>
|
||||
<p class="mu-schedule-note">flow mock: เปิด route detail ที่ <strong>?route=101&origin=at_main_terminal</strong></p>
|
||||
<div class="mu-contact-row" style="margin-top:10px;">
|
||||
<a href="#/routes/101&origin=at_main_terminal"><span data-i18n="stop.openRoute">เปิดหน้ารายละเอียดสายรถนี้</span></a>
|
||||
</div>
|
||||
</div>
|
||||
</details>
|
||||
</li>
|
||||
<li>
|
||||
<details class="mu-stop-expander">
|
||||
<summary>
|
||||
<span class="mu-route-chip">464</span>
|
||||
<span class="mu-route-type-badge"><svg class="ic" aria-hidden="true"><use href="#ic-bus-front"/></svg> รถบัส</span>
|
||||
<span class="mu-stop-summary-main">
|
||||
<strong>สุพรรณ-อ่างทอง-สระบุรี</strong>
|
||||
<span class="mu-stop-summary-meta">เที่ยวผ่านจุดนี้</span>
|
||||
</span>
|
||||
<span class="mu-stop-summary-rail">
|
||||
<span class="mu-status-pill info">20 รอบ/วัน</span>
|
||||
<span class="mu-stop-chevron">⌄</span>
|
||||
</span>
|
||||
</summary>
|
||||
<div class="mu-stop-expander-body">
|
||||
<div class="mu-time-grid">
|
||||
<div class="mu-time-chip">06:30</div><div class="mu-time-chip">07:10</div>
|
||||
<div class="mu-time-chip">07:50</div><div class="mu-time-chip">08:40</div>
|
||||
<div class="mu-time-chip">09:30</div><div class="mu-time-chip">10:10</div>
|
||||
<div class="mu-time-chip">10:50</div><div class="mu-time-chip">11:30</div>
|
||||
<div class="mu-time-chip">12:10</div><div class="mu-time-chip">12:50</div>
|
||||
<div class="mu-time-chip">13:30</div><div class="mu-time-chip">14:10</div>
|
||||
<div class="mu-time-chip">14:50</div><div class="mu-time-chip">15:30</div>
|
||||
<div class="mu-time-chip">16:10</div><div class="mu-time-chip">16:50</div>
|
||||
<div class="mu-time-chip">17:30</div><div class="mu-time-chip">18:10</div>
|
||||
<div class="mu-time-chip">18:50</div><div class="mu-time-chip">19:30</div>
|
||||
</div>
|
||||
<p class="mu-schedule-note"><svg class="ic" aria-hidden="true"><use href="#ic-triangle-alert"/></svg> เวลารถเปลี่ยนทุกวัน</p>
|
||||
</div>
|
||||
</details>
|
||||
</li>
|
||||
<li>
|
||||
<details class="mu-stop-expander">
|
||||
<summary>
|
||||
<span class="mu-route-chip">641</span>
|
||||
<span class="mu-route-type-badge"><svg class="ic" aria-hidden="true"><use href="#ic-bus-front"/></svg> รถบัส</span>
|
||||
<span class="mu-stop-summary-main">
|
||||
<strong>อ่างทอง-บ้านแพรก-ลพบุรี</strong>
|
||||
<span class="mu-stop-summary-meta">เที่ยวออกจาก บขส.อ่างทอง</span>
|
||||
</span>
|
||||
<span class="mu-stop-summary-rail">
|
||||
<span class="mu-status-pill info">9 รอบ/วัน</span>
|
||||
<span class="mu-stop-chevron">⌄</span>
|
||||
</span>
|
||||
</summary>
|
||||
<div class="mu-stop-expander-body">
|
||||
<div class="mu-time-grid">
|
||||
<div class="mu-time-chip">07:00</div><div class="mu-time-chip">08:00</div>
|
||||
<div class="mu-time-chip">09:00</div><div class="mu-time-chip">10:00</div>
|
||||
<div class="mu-time-chip">11:00</div><div class="mu-time-chip">12:00</div>
|
||||
<div class="mu-time-chip">13:30</div><div class="mu-time-chip">14:30</div>
|
||||
<div class="mu-time-chip">16:30</div>
|
||||
</div>
|
||||
</div>
|
||||
</details>
|
||||
</li>
|
||||
<li>
|
||||
<details class="mu-stop-expander">
|
||||
<summary>
|
||||
<span class="mu-route-chip">324</span>
|
||||
<span class="mu-route-type-badge"><svg class="ic" aria-hidden="true"><use href="#ic-bus-front"/></svg> รถบัส</span>
|
||||
<span class="mu-stop-summary-main">
|
||||
<strong>อ่างทอง-วัดพิกุลทอง</strong>
|
||||
<span class="mu-stop-summary-meta">เที่ยวผ่านจุดนี้</span>
|
||||
</span>
|
||||
<span class="mu-stop-summary-rail">
|
||||
<span class="mu-status-pill info">1 รอบ/วัน</span>
|
||||
<span class="mu-stop-chevron">⌄</span>
|
||||
</span>
|
||||
</summary>
|
||||
<div class="mu-stop-expander-body">
|
||||
<div class="mu-time-grid">
|
||||
<div class="mu-time-chip">10:00</div>
|
||||
</div>
|
||||
</div>
|
||||
</details>
|
||||
</li>
|
||||
<li>
|
||||
<details class="mu-stop-expander">
|
||||
<summary>
|
||||
<span class="mu-route-chip">1011</span>
|
||||
<span class="mu-route-type-badge"><svg class="ic" aria-hidden="true"><use href="#ic-bus-front"/></svg> รถบัส</span>
|
||||
<span class="mu-stop-summary-main">
|
||||
<strong>อ่างทอง-สีบัวทอง</strong>
|
||||
<span class="mu-stop-summary-meta">เที่ยวผ่านจุดนี้</span>
|
||||
</span>
|
||||
<span class="mu-stop-summary-rail">
|
||||
<span class="mu-status-pill info">3 รอบ/วัน</span>
|
||||
<span class="mu-stop-chevron">⌄</span>
|
||||
</span>
|
||||
</summary>
|
||||
<div class="mu-stop-expander-body">
|
||||
<div class="mu-time-grid">
|
||||
<div class="mu-time-chip">12:00</div><div class="mu-time-chip">16:00</div>
|
||||
<div class="mu-time-chip">17:00</div>
|
||||
</div>
|
||||
</div>
|
||||
</details>
|
||||
</li>
|
||||
<li>
|
||||
<details class="mu-stop-expander">
|
||||
<summary>
|
||||
<span class="mu-route-chip">2231</span>
|
||||
<span class="mu-route-type-badge"><svg class="ic" aria-hidden="true"><use href="#ic-bus-front"/></svg> รถบัส</span>
|
||||
<span class="mu-stop-summary-main">
|
||||
<strong>อ่างทอง-มหานาม</strong>
|
||||
<span class="mu-stop-summary-meta">เที่ยวผ่านจุดนี้</span>
|
||||
</span>
|
||||
<span class="mu-stop-summary-rail">
|
||||
<span class="mu-status-pill info">1 รอบ/วัน</span>
|
||||
<span class="mu-stop-chevron">⌄</span>
|
||||
</span>
|
||||
</summary>
|
||||
<div class="mu-stop-expander-body">
|
||||
<div class="mu-time-grid">
|
||||
<div class="mu-time-chip">16:00</div>
|
||||
</div>
|
||||
</div>
|
||||
</details>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="mu-list mu-stop-list" id="stop-routes"></ul>
|
||||
</div>
|
||||
|
||||
<aside class="mu-card-panel">
|
||||
<h2><span data-i18n="stop.mapInfo">แผนที่และข้อมูลป้าย</span></h2>
|
||||
<div class="at-map" id="stop-map" role="region" aria-label="แผนที่เส้นทางที่ผ่านป้ายนี้"></div>
|
||||
<p class="at-map-caption" id="stop-map-caption"></p>
|
||||
<div style="display:flex; flex-wrap:wrap; gap:8px; margin-top:14px;">
|
||||
<span class="mu-chip" style="background: rgba(255,255,255,.9); border:1px solid rgba(231, 224, 246, 0.95); color:#5b3b71;">เปิด 04:30</span>
|
||||
<span class="mu-chip" style="background: rgba(255,255,255,.9); border:1px solid rgba(231, 224, 246, 0.95); color:#5b3b71;">ปิด 21:00</span>
|
||||
<span class="mu-chip" style="background: rgba(31, 135, 101, 0.08); color:#1f8765; border:1px solid rgba(31,135,101,.15);">มีห้องน้ำ</span>
|
||||
<span class="mu-chip" style="background: rgba(31, 135, 101, 0.08); color:#1f8765; border:1px solid rgba(31,135,101,.15);">ที่พักคอย</span>
|
||||
<span class="mu-chip" style="background: rgba(31, 135, 101, 0.08); color:#1f8765; border:1px solid rgba(31,135,101,.15);">ร้านอาหาร</span>
|
||||
</div>
|
||||
<div id="stop-chips" style="display:flex; flex-wrap:wrap; gap:8px; margin-top:14px;"></div>
|
||||
</aside>
|
||||
</section>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<script>
|
||||
(function () {
|
||||
function pad2(num) {
|
||||
return String(num).padStart(2, "0");
|
||||
}
|
||||
|
||||
function timeToMinutes(timeText) {
|
||||
var match = /^([01]?\d|2[0-3]):([0-5]\d)$/.exec(timeText.trim());
|
||||
if (!match) {
|
||||
return null;
|
||||
}
|
||||
return Number(match[1]) * 60 + Number(match[2]);
|
||||
}
|
||||
|
||||
function renderCurrentTime(now) {
|
||||
var currentTimeEl = document.getElementById("mu-current-time");
|
||||
if (!currentTimeEl) {
|
||||
return;
|
||||
}
|
||||
currentTimeEl.textContent = pad2(now.getHours()) + ":" + pad2(now.getMinutes());
|
||||
}
|
||||
|
||||
function updateNextArrivalForRow(detailEl, nowMinutes) {
|
||||
var chips = Array.from(detailEl.querySelectorAll(".mu-time-chip"));
|
||||
if (!chips.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
chips.forEach(function (chip) {
|
||||
chip.classList.remove("next");
|
||||
chip.classList.remove("next-live");
|
||||
});
|
||||
|
||||
var times = chips
|
||||
.map(function (chip, idx) {
|
||||
return { chip: chip, idx: idx, minutes: timeToMinutes(chip.textContent) };
|
||||
})
|
||||
.filter(function (item) {
|
||||
return item.minutes !== null;
|
||||
})
|
||||
.sort(function (a, b) {
|
||||
return a.minutes - b.minutes;
|
||||
});
|
||||
|
||||
if (!times.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
var next = times.find(function (item) {
|
||||
return item.minutes >= nowMinutes;
|
||||
});
|
||||
var wrapsToTomorrow = false;
|
||||
if (!next) {
|
||||
next = times[0];
|
||||
wrapsToTomorrow = true;
|
||||
}
|
||||
|
||||
next.chip.classList.add("next-live");
|
||||
|
||||
var rail = detailEl.querySelector(".mu-stop-summary-rail");
|
||||
if (!rail) {
|
||||
return;
|
||||
}
|
||||
|
||||
var nextEl = rail.querySelector(".mu-next-arrival");
|
||||
if (!nextEl) {
|
||||
nextEl = document.createElement("span");
|
||||
nextEl.className = "mu-next-arrival";
|
||||
var chevron = rail.querySelector(".mu-stop-chevron");
|
||||
if (chevron) {
|
||||
rail.insertBefore(nextEl, chevron);
|
||||
} else {
|
||||
rail.appendChild(nextEl);
|
||||
}
|
||||
}
|
||||
|
||||
nextEl.textContent = (wrapsToTomorrow ? "พรุ่งนี้ " : "ถัดไป ") + next.chip.textContent.trim();
|
||||
}
|
||||
|
||||
function setupRouteFilter() {
|
||||
var inputEl = document.getElementById("mu-route-filter");
|
||||
var countEl = document.getElementById("mu-route-count");
|
||||
var items = Array.from(document.querySelectorAll(".mu-stop-list > li"));
|
||||
if (!inputEl || !countEl || !items.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
function applyFilter() {
|
||||
var keyword = inputEl.value.trim().toLowerCase();
|
||||
var visibleCount = 0;
|
||||
|
||||
items.forEach(function (li) {
|
||||
var summaryText = li.textContent.toLowerCase();
|
||||
var matched = !keyword || summaryText.indexOf(keyword) !== -1;
|
||||
li.style.display = matched ? "block" : "none";
|
||||
if (matched) {
|
||||
visibleCount += 1;
|
||||
}
|
||||
});
|
||||
|
||||
countEl.textContent = "แสดง " + visibleCount + " จาก " + items.length + " สาย";
|
||||
}
|
||||
|
||||
inputEl.addEventListener("input", applyFilter);
|
||||
applyFilter();
|
||||
}
|
||||
|
||||
function tick() {
|
||||
var now = new Date();
|
||||
var nowMinutes = now.getHours() * 60 + now.getMinutes();
|
||||
renderCurrentTime(now);
|
||||
document.querySelectorAll(".mu-stop-expander").forEach(function (detailEl) {
|
||||
updateNextArrivalForRow(detailEl, nowMinutes);
|
||||
});
|
||||
}
|
||||
|
||||
tick();
|
||||
setupRouteFilter();
|
||||
setInterval(tick, 30000);
|
||||
})();
|
||||
</script>
|
||||
|
||||
<script>
|
||||
(function () {
|
||||
var r = window.__route || { params: {} };
|
||||
var el = document.getElementById('stop-map');
|
||||
if (el && window.ATMap && r.params.code) ATMap.forStop(el, r.params.code);
|
||||
})();
|
||||
</script>
|
||||
<script src="./partials/stopDetail.init.js"></script>
|
||||
Reference in new issue
Block a user