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 · นามสกุลรูป · ชิปสาย · หน้ารายละเอียดป้ายมาจากไหน
156 lines
6.9 KiB
CSS
156 lines
6.9 KiB
CSS
/* =========================================================
|
|
Atroute — แผนที่เส้นทาง (Leaflet)
|
|
ธีมตาม DESIGN.md §5: เส้นทาง --green-700 หนา 5px · หมุดสี่เหลี่ยมมน
|
|
เขียว = ป้ายตามเส้นทาง · อำพัน = ต้นทาง/ปลายทาง · ไม่มี drop shadow
|
|
========================================================= */
|
|
|
|
.at-map {
|
|
position: relative;
|
|
width: 100%;
|
|
height: 300px;
|
|
border: 1px solid #ddd5c0;
|
|
border-radius: 8px;
|
|
background: #f7f1e2; /* --paper — พื้นตอน tile ยังไม่มา/ออฟไลน์ */
|
|
overflow: hidden;
|
|
}
|
|
.at-map.is-offline { background: repeating-linear-gradient(45deg, #f7f1e2 0 12px, #f2ebd8 12px 24px); }
|
|
.at-map .leaflet-container { background: transparent; font-family: inherit; }
|
|
|
|
/* ปุ่ม zoom — ให้เข้าธีม (ขอบบาง ไม่มีเงา) */
|
|
.at-map .leaflet-control-zoom a {
|
|
border-radius: 4px;
|
|
border: 1px solid #ddd5c0;
|
|
background: #fffdf6;
|
|
color: #14211a;
|
|
font-weight: 700;
|
|
box-shadow: none;
|
|
}
|
|
.at-map .leaflet-control-zoom a:hover { background: #e4efe4; color: #14532d; }
|
|
.at-map .leaflet-bar { border: 0; box-shadow: none; }
|
|
|
|
/* attribution — เล็ก อ่านได้ ไม่ทับข้อมูล */
|
|
.at-map .leaflet-control-attribution {
|
|
background: rgba(255, 253, 246, .88);
|
|
border-top-left-radius: 4px;
|
|
font-size: .68rem;
|
|
color: #6b7268;
|
|
}
|
|
|
|
/* ---------- หมุด: สี่เหลี่ยมมน (ไม่ใช่หยดน้ำ ไม่มีเงา) ---------- */
|
|
.at-pin-wrap { background: none; border: 0; }
|
|
.at-pin {
|
|
display: block;
|
|
width: 14px; height: 14px;
|
|
border-radius: 4px;
|
|
border: 2px solid #fffdf6;
|
|
box-sizing: border-box;
|
|
}
|
|
.at-pin.stop { background: #1f7a3d; } /* --green-500 */
|
|
.at-pin.term { background: #f2a900; } /* --amber */
|
|
.at-pin.mute { background: #6b7268; } /* --muted */
|
|
/* ป้ายที่กำลังเปิดดูอยู่ — ใหญ่กว่าเพื่อให้เห็นชัด */
|
|
.at-pin.here { background: #f2a900; width: 18px; height: 18px; border-width: 3px; }
|
|
|
|
.at-map .leaflet-tooltip {
|
|
border-radius: 4px;
|
|
border: 1px solid #ddd5c0;
|
|
background: #fffdf6;
|
|
color: #14211a;
|
|
box-shadow: none;
|
|
font-size: .78rem;
|
|
padding: 5px 8px;
|
|
}
|
|
.at-map .leaflet-tooltip b { color: #14532d; }
|
|
|
|
/* ---------- legend (มุมซ้ายล่าง) ---------- */
|
|
.at-legend {
|
|
position: absolute;
|
|
left: 10px; bottom: 10px;
|
|
z-index: 500;
|
|
background: rgba(255, 253, 246, .94);
|
|
border: 1px solid #ddd5c0;
|
|
border-radius: 4px;
|
|
padding: 7px 10px;
|
|
font-size: .74rem;
|
|
color: #14211a;
|
|
line-height: 1.65;
|
|
pointer-events: none;
|
|
}
|
|
.at-legend i {
|
|
display: inline-block;
|
|
width: 14px; height: 5px;
|
|
border-radius: 2px;
|
|
margin-right: 6px;
|
|
vertical-align: middle;
|
|
}
|
|
.at-legend i.sq { width: 10px; height: 10px; border-radius: 3px; border: 2px solid #fffdf6; box-sizing: border-box; }
|
|
|
|
/* ---------- caption ใต้แผนที่ ---------- */
|
|
.at-map-caption {
|
|
margin: 9px 0 0;
|
|
color: #6b7268;
|
|
font-size: .82rem;
|
|
}
|
|
.at-map-caption b { color: #14211a; }
|
|
.at-map-caption .at-offline { color: #8a6100; }
|
|
|
|
@media (min-width: 768px) {
|
|
.at-map { height: 380px; }
|
|
}
|
|
|
|
/* ---------- popup บนแผนที่ (ป้าย/สถานี) ---------- */
|
|
.at-map .leaflet-popup-content-wrapper {
|
|
border-radius: 4px;
|
|
border: 1px solid #ddd5c0;
|
|
background: #fffdf6;
|
|
box-shadow: none;
|
|
color: #14211a;
|
|
}
|
|
.at-map .leaflet-popup-tip { background: #fffdf6; box-shadow: none; }
|
|
.at-map .leaflet-popup-content { margin: 10px 12px; font-size: .8rem; }
|
|
.at-pop { display: flex; flex-direction: column; gap: 3px; min-width: 150px; }
|
|
.at-pop b { font-size: .86rem; color: #14532d; }
|
|
.at-pop span { color: #6b7268; }
|
|
.at-pop a { margin-top: 4px; color: #14532d; font-weight: 700; text-decoration: none; border-bottom: 1px solid #1f7a3d; align-self: flex-start; }
|
|
.at-pop a:hover { color: #1f7a3d; }
|
|
|
|
/* ---------- รายการจุดจอดตามเส้นทาง + กม. จากต้นทาง ---------- */
|
|
.at-km-wrap { margin-top: 14px; border-top: 1px solid #ddd5c0; padding-top: 12px; }
|
|
.at-km-wrap > h3 { margin: 0 0 8px; font-size: .9rem; font-weight: 800; color: #14211a; }
|
|
.at-km-wrap ul { list-style: none; margin: 0; padding: 0; }
|
|
.at-km-wrap li + li { border-top: 1px dashed #ddd5c0; }
|
|
.at-km-row { display: flex; align-items: center; gap: 9px; padding: 7px 2px; text-decoration: none; color: #14211a; font-size: .86rem; }
|
|
.at-km-row:hover .at-km-name { color: #1f7a3d; text-decoration: underline; }
|
|
.at-km-dot { width: 9px; height: 9px; border-radius: 3px; background: #f2a900; flex: none; }
|
|
.at-km-name { flex: 1; font-weight: 600; }
|
|
.at-km-val { font-variant-numeric: tabular-nums; font-weight: 700; color: #14532d; }
|
|
/* จุดจอดที่ไม่มีหน้ารายละเอียด (มาจาก 8 other_stop.json) — ไม่ใช่ลิงก์ */
|
|
.at-km-row.is-plain { cursor: default; }
|
|
.at-km-row.is-plain .at-km-dot { background: #7a4cc0; }
|
|
.at-km-row.is-plain:hover .at-km-name { color: inherit; text-decoration: none; }
|
|
.at-km-row .at-km-val.is-off { color: #a3560f; font-weight: 600; font-size: .78rem; }
|
|
|
|
/* ---------- ป้ายใกล้ฉัน ---------- */
|
|
.at-near-msg { margin: 14px 0 0; color: #6b7268; font-size: .86rem; }
|
|
.at-near-err { color: #8a6100; }
|
|
.at-near-list { list-style: none; margin: 12px 0 0; padding: 0; }
|
|
.at-near-list li + li { border-top: 1px dashed #ddd5c0; }
|
|
.at-near-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 9px 2px; text-decoration: none; color: #14211a; align-items: center; }
|
|
.at-near-row:hover .at-near-name { color: #1f7a3d; text-decoration: underline; }
|
|
.at-near-name { font-weight: 700; font-size: .9rem; }
|
|
.at-near-meta { grid-column: 1; color: #6b7268; font-size: .76rem; }
|
|
.at-near-dist { grid-column: 2; grid-row: 1 / span 2; font-variant-numeric: tabular-nums; font-weight: 800; color: #14532d; white-space: nowrap; }
|
|
|
|
/* ---------- กัน CSS ภายนอกทำลายขนาด SVG ของ Leaflet ----------
|
|
responsive.css ตั้ง `img, svg, video { max-width: 100%; height: auto; }` และบาง partial
|
|
เคยตั้ง `.mu-map-card svg { width: 100%; height: auto; }` → ทำให้ viewport SVG ของ Leaflet
|
|
(ซึ่งถูกวางใน pane ขนาด 0x0) ยุบเป็น 0x0 แล้ว "เส้นทางไม่แสดง" ทั้งที่ถูกวาดแล้ว
|
|
Leaflet กำหนดขนาดเองผ่าน attribute width/height เสมอ — ห้าม CSS อื่นทับ */
|
|
.at-map svg.leaflet-zoom-animated,
|
|
.at-map canvas.leaflet-zoom-animated {
|
|
width: auto;
|
|
height: auto;
|
|
max-width: none;
|
|
max-height: none;
|
|
}
|