Files
web-at-transit-mock/ui/responsive.css
T
Bkk1234 656f65b41c แผนที่จาก GPKG + บทความ 6 ชิ้น + ลดความหนา footer
== แผนที่ / GIS ==
- qgis-to-web.py: อ่าน GPKG ได้ (--from gpkg) + เพิ่ม dream-Watcharapol
- เพิ่ม dream-*.geojson 6 ไฟล์ (เส้นทางที่เสนอ: บ้านภาชี · ชานเมืองอยุธยา · HSR · เมืองทองธานี · ปากเกร็ด · วัชรพล)
- map.js: ATMap.proposal() วาดเส้นจริงจาก geojson (ไม่ใช่เส้นตรง) · smoothFactor 0.5
  · coordOf() รับ coords=[lat,lng] · fitAll รับได้ทั้งจุดเดี่ยวและเส้น · setStyle บน featureGroup

== บทความ (blog) ==
- text3: ถ้าผมได้ออกแบบสายเดินรถเอง (จาก mydream.html) TH+EN
- text4: วิธีเดินทางไปสถานีรถไฟ และสนามบิน (จาก train-airplane.html) TH+EN
- text5/text6: โครงเปล่ารอเติมเนื้อหา (แสวงหา-โพธิ์ทอง · อำเภอเข้าเมือง)
- แผนที่ความฝัน: map.groups 3 กลุ่ม · คลิกเส้น/หมุด/แถวได้ · ป้ายที่มา
- ย่อหน้า: ระยะห่าง 20px + ย่อหน้าหน้าบรรทัด 1.5em

== ตารางเดินรถ ==
- เปลี่ยนชื่อคีย์ dir_* -> direction_* ทุกไฟล์ (backward-compat ในโค้ด)
- 1011: จุดย่อย 2 ทิศ + offsets [0,25,55]
- 954/2194: จุดย่อย station 8 + offsets
- refreshHighlights: วนข้ามวันเมื่อเลยเที่ยวสุดท้าย + ไฮเทลต์ชิปทุกจุด
- 8 other_stop.md: อัปเดตตรงข้อมูลจริง 8 รายการ

== i18n ==
- แยกไฟล์ต่อภาษา ui/locales/{th,en}.json + i18n.js = loader (ลด 28KB -> 6.5KB)
- resource/tools/check-i18n.py ตรวจคีย์ขาด/ซ้ำ
- ข้อความผู้สนับสนุนหน้าแรก + คำแปล EN

== UI ==
- ฝังฟอนต์ K2D (ui/vendor/fonts/) ออฟไลน์ 100%
- cache busting ?v=<SW VERSION> ทุกรูป (ui/imageurl.js)
- footer: ลดความหนา 468 -> 349px + line-height 1.5 กันสระ/วรรณยุกต์ซ้อน
- QR modal + ปุ่มคัดลอกลิงก์ · หน้าอัปเดตล่าสุดใน #/check
- credits: ขอขอบคุณภาพรถ 3 สาย

== เครื่องมือ ==
- bump-version.py · stamp-schedules.py · derive-times.py (จุดอ้างอิง ± นาที)
2026-10-05 03:55:09 +07:00

287 lines
15 KiB
CSS
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/* ============================================================
Atroute — Mobile-first responsive layer
------------------------------------------------------------
base = มือถือ (จอเล็กสุด iPhone 8 = 375px, รองรับ SE 320px)
ขยายขึ้นด้วย min-width:
≥480px มือถือใหญ่
≥640px มือถือใหญ่ / แท็บเล็ตเล็ก
≥768px iPad แนวตั้ง / แท็บเล็ต
≥1024px iPad แนวนอน / แล็ปท็อป
≥1280px คอม 19.5"–24"
≥1600px คอม 27" / 1440p+
หมายเหตุ: component ที่ router inject จาก partial (อยู่ใน #view)
ต้องใช้ prefix `#view` — เพราะ <style> ของ partial ถูก inject
ทีหลัง จึงต้องชนะด้วย specificity (ID > class)
============================================================ */
/* ---------- base: มือถือ ---------- */
html { -webkit-text-size-adjust: 100%; }
body { font-size: 16px; }
/* --- ขยายขนาด component บนมือถือ (desktop-oriented เดิมเล็กเกิน) --- */
/* topbar อยู่ใน section ด้านล่าง — content ใน #view ใช้ prefix ชนะ partial style */
#view .mu-btn { font-size: .95rem; min-height: 48px; }
#view .mu-badge { font-size: 1.05rem; }
#view .mu-zone-tag { font-size: 1rem; }
#view .mu-zone-desc, #view .mu-zone-sub { font-size: 1.05rem; }
#view .mu-route-name { font-size: 1.2rem; }
#view .mu-next-trip { font-size: .95rem; }
#view .mu-meta-pill { font-size: .95rem; }
#view .mu-route-type-badge { font-size: .85rem; }
#view .mu-stop-summary-meta { font-size: .85rem; }
#view .mu-time-chip { font-size: .95rem; min-height: 40px; }
#view .mu-info-card .label { font-size: .85rem; }
#view .mu-info-card .value { font-size: 1.1rem; }
#view .mu-stat p { font-size: .9rem; }
#view .mu-hero-lead { font-size: 1rem; }
#view .mu-select-box select { font-size: 1rem; }
/* --- กัน overflow พื้นฐาน (padding/รูป/grid/ข้อความยาว ไม่ให้ล้นจอมือถือ) --- */
*, *::before, *::after { box-sizing: border-box; }
img, svg, video { max-width: 100%; height: auto; }
/* grid/flex child ต้อง shrink ได้ (กัน min-width:auto ล้น container) */
#view .mu-hero-panel > *,
#view .mu-layout-grid > *,
#view .mu-hero-metric-grid > *,
#view .mu-stop-summary-main { min-width: 0; }
/* ข้อความยาวไม่ break (เช่น mock state query string / ชื่อยาว) */
#view .mu-inline-context strong,
#view .mu-stop-hero-title,
#view .mu-stop-hero-sub { overflow-wrap: anywhere; }
.mu-container { padding: 0 16px; }
main.mu-container { padding-top: 24px; padding-bottom: 24px; }
/* --- topbar: hamburger menu บนมือถือ (brand + lang + ☰ บรรทัดเดียว) --- */
.mu-topbar-inner { gap: 8px; padding: 10px 14px; flex-wrap: wrap; }
.mu-logo-img { width: 36px; height: 36px; }
.mu-brand { gap: 8px; flex-shrink: 0; }
.mu-brand-title { font-size: 1.05rem; white-space: nowrap; }
.mu-brand-subtitle { display: none; } /* กันล้น — โผล่กลับ ≥768px */
.mu-nav { display: none; } /* ซ่อน nav — ใช้ hamburger แทน */
.mu-lang-switch { order: 3; margin-left: auto; padding: 2px; }
.mu-lang-btn { font-size: .8rem; padding: 8px 12px; min-height: 40px; min-width: 40px; } /* tap target */
.mu-action-btn { display: none; } /* กันล้นบนจอเล็ก — โผล่กลับ ≥1024px */
/* hamburger menu (ขวาสุด) */
.mu-menu { display: block; position: relative; order: 4; margin-left: 2px; }
.mu-menu-btn {
display: flex; align-items: center; justify-content: center;
width: 44px; height: 44px;
border: none; background: transparent; cursor: pointer;
color: #1f2a44; list-style: none;
border-radius: 10px;
}
.mu-menu-btn::-webkit-details-marker { display: none; }
.mu-menu-btn svg { width: 26px; height: 26px; }
.mu-menu-panel {
position: absolute; top: calc(100% + 8px); right: 0;
min-width: 220px;
background: #fff; border: 1px solid #e7e2f6; border-radius: 14px;
box-shadow: 0 12px 28px rgba(20, 40, 90, .16);
padding: 8px;
z-index: 60;
display: flex; flex-direction: column; gap: 2px;
}
.mu-menu-panel a {
display: flex; align-items: center;
min-height: 48px; padding: 10px 14px;
border-radius: 10px;
color: #1f2a44; text-decoration: none;
font-size: 1.05rem; font-weight: 600;
}
.mu-menu-panel a:hover, .mu-menu-panel a:active { background: #f5efff; }
/* --- hero (หน้าแรก) — ช่องว่าง + ตัวหนังสือใหญ่ขึ้น --- */
.mu-hero { padding: 30px 0 34px; }
.mu-hero h1 { font-size: clamp(1.9rem, 8vw, 2.9rem); margin-bottom: 14px; line-height: 1.28; }
.mu-badge { margin-bottom: 10px; padding: 5px 14px; }
.mu-hero-lead { margin: 0 0 8px; }
.mu-hero-actions { flex-direction: column; align-items: stretch; padding: 0 6px; margin-top: 10px; gap: 8px; }
.mu-pill-link { justify-content: center; padding: 11px 18px; font-size: .9rem; }
/* --- ตัวเลือกจังหวัด/สถานี (หน้าแรก) --- */
#view .mu-route-selector { flex-direction: column; align-items: stretch; gap: 8px; margin-top: 12px; }
#view .mu-route-selector select,
#view .mu-route-selector .mu-select-arrow { width: 100%; }
/* flex-basis 250px (จาก index.html) กลายเป็นความสูงตอน column — reset เป็น content height */
#view .mu-route-selector .mu-select-field { width: 100%; flex: 0 0 auto; }
#view .mu-select-arrow { transform: rotate(90deg); justify-content: center; }
/* --- marquee (สปอนเซอร์) — การ์ดเล็กลงบนมือถือ --- */
.mu-marquee-track { padding: 2px 0 10px; }
.mu-marquee-tile { width: 132px; height: 68px; margin-right: 10px; border-radius: 10px; }
/* --- โซนเส้นทาง + การ์ด — ระยะห่างกระชับ --- */
main.mu-container { padding-top: 14px; padding-bottom: 14px; }
.mu-zone { margin-bottom: 20px; }
.mu-zone-head { margin-bottom: 10px; gap: 4px 10px; }
/* --- หัวโซน: ป้ายหัวข้อ + บรรทัดข้อมูล (มือถือ = เรียงลงมาเต็มความกว้าง) ---
ใช้ #view เพื่อชนะ <style> ของ partial ที่ inject ทีหลัง */
#view .mu-zone-head .mu-zone-desc { flex-basis: 100%; min-width: 0; line-height: 1.65; }
#view .mu-zone-meta { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; row-gap: 2px; }
#view .mu-zone-seg { display: inline-flex; align-items: baseline; gap: 5px; min-width: 0; }
#view .mu-zone-seg:not(:last-child)::after { content: "\00b7"; color: #c4bcd8; margin-left: 8px; } /* คั่นท้ายชิ้น → ตัดบรรทัดแล้วจุดไม่ไปอยู่ต้นบรรทัด */
#view .mu-zone-seg .ic { align-self: center; flex: none; }
#view .mu-zone-now b { color: #1f2a44; font-variant-numeric: tabular-nums; }
#view .mu-zone-at { color: #8a93a8; } /* ชื่อสถานีในวงเล็บ — จางกว่ารอบรถ */
#view .mu-zone-updated { color: #8a7aa8; font-size: .95rem; }
.mu-grid { gap: 12px; }
.mu-route-info { padding: 16px 16px 18px; }
.mu-route-name { margin-bottom: 6px; }
.mu-route-chip-wrap { gap: 6px; }
.mu-next-trip { padding: 3px 10px; font-size: .74rem; }
/* --- busStop --- */
#view .mu-hero-panel { grid-template-columns: 1fr; padding: 14px; gap: 12px; }
#view .mu-hero-title { font-size: 1.35rem; }
#view .mu-kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
#view .mu-toolbar { flex-direction: column; align-items: stretch; }
#view .mu-toolbar select,
#view .mu-toolbar .mu-btn { width: 100%; min-height: 44px; }
#view .mu-search-field { width: 100%; min-width: 0; }
#view .mu-search-field input { min-height: 44px; }
#view .mu-stop-grid { grid-template-columns: 1fr; gap: 12px; }
#view .mu-hero-map { min-height: 200px; }
/* --- busDetail / expanded --- */
#view .mu-layout-grid { grid-template-columns: 1fr; gap: 12px; }
#view .mu-page-title { font-size: 1.45rem; }
#view .mu-route-hero { padding: 16px; }
#view .mu-info-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
#view .mu-panel,
#view .mu-card-panel { padding: 14px; }
#view .mu-photo-strip { grid-template-columns: repeat(2, 1fr); gap: 8px; }
#view .mu-quickpick { display: flex; flex-wrap: wrap; gap: 8px; }
#view .mu-inline-actions { flex-wrap: wrap; }
#view .mu-back-btn { width: 100%; justify-content: center; padding: 10px; min-height: 44px; }
#view .mu-schedule-note { font-size: .82rem; }
/* --- stopDetail --- */
#view .mu-hero-metric-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
#view .mu-live-clock-card { padding: 14px; }
#view .mu-stop-summary-rail { flex-wrap: wrap; }
#view .mu-time-chip { min-width: 0; }
#view .mu-contact-row { flex-wrap: wrap; }
/* --- credits --- */
#view .mu-credit-wrap { padding: 24px 16px 40px; }
#view .mu-credit-hero h1 { font-size: 1.5rem; }
#view .mu-credit-section { padding: 16px; }
/* --- footer --- */
.mu-site-footer { margin-top: 24px; padding: 28px 0 0; }
.mu-site-footer .mu-container { padding: 0 16px; }
.mu-footer-grid { grid-template-columns: 1fr; gap: 16px; }
.mu-footer-col ul a { padding: 5px 0; min-height: 34px; } /* tap target (กดได้ ≥34px) */
.mu-footer-contact a { min-height: 34px; } /* tap target */
.mu-sponsor-strip { grid-template-columns: repeat(2, 1fr); gap: 8px; }
/* ============================================================
≥480px — มือถือใหญ่
============================================================ */
@media (min-width: 480px) {
.mu-topbar-inner { padding: 12px 18px; }
.mu-hero-actions { flex-direction: row; justify-content: center; }
.mu-pill-link { width: auto; }
#view .mu-stop-grid { grid-template-columns: repeat(2, 1fr); }
#view .mu-photo-strip { grid-template-columns: repeat(3, 1fr); }
.mu-sponsor-strip { grid-template-columns: repeat(3, 1fr); }
}
/* ============================================================
≥640px — มือถือใหญ่ / แท็บเล็ตเล็ก
============================================================ */
@media (min-width: 640px) {
body { font-size: 16px; }
.mu-container { padding: 0 28px; }
.mu-brand-title { font-size: 1.05rem; }
.mu-topbar-inner { gap: 18px; padding: 14px 28px; flex-wrap: nowrap; }
.mu-logo-img { width: 44px; height: 44px; }
.mu-nav { order: 0; width: auto; margin-left: auto; justify-content: flex-start; gap: 24px; display: flex; }
.mu-nav a { font-size: .92rem; }
.mu-menu { display: none; }
.mu-lang-btn { font-size: .72rem; padding: 6px 10px; }
.mu-hero { padding: 44px 0 52px; }
.mu-hero-actions { margin-top: 14px; }
.mu-marquee-tile { width: 170px; height: 96px; margin-right: 16px; }
#view .mu-route-selector { flex-direction: row; align-items: flex-end; justify-content: center; }
#view .mu-route-selector select,
#view .mu-route-selector .mu-select-field { width: auto; }
#view .mu-select-arrow { transform: none; }
#view .mu-toolbar { flex-direction: row; flex-wrap: wrap; align-items: center; }
#view .mu-toolbar select,
#view .mu-toolbar .mu-btn { width: auto; }
#view .mu-search-field { flex: 1; min-width: 200px; }
#view .mu-back-btn { width: auto; }
.mu-footer-grid { grid-template-columns: 1fr 1fr; }
}
/* ============================================================
≥768px — iPad แนวตั้ง / แท็บเล็ต
============================================================ */
@media (min-width: 768px) {
.mu-brand-subtitle { display: block; font-size: .72rem; }
#view .mu-kpi-grid { grid-template-columns: repeat(4, 1fr); }
#view .mu-info-grid { grid-template-columns: repeat(4, 1fr); }
#view .mu-hero-metric-grid { grid-template-columns: repeat(4, 1fr); }
#view .mu-photo-strip { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
#view .mu-hero-panel { grid-template-columns: 1.1fr .9fr; padding: 18px; }
.mu-footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1.1fr; }
.mu-sponsor-strip { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
/* หัวโซนบนจอใหญ่: ป้ายหัวข้ออยู่ซ้าย · บรรทัดข้อมูลเป็นคอลัมน์ขวา
(อ่านง่ายกว่าเดิมที่ข้อความยืดเต็มความกว้างจอ ~1144px) */
#view .mu-zone-head { display: grid; grid-template-columns: auto minmax(0, 1fr);
align-items: start; column-gap: 14px; row-gap: 5px; }
#view .mu-zone-head .mu-zone-desc { grid-column: 2; max-width: 82ch; }
}
/* ============================================================
≥1024px — iPad แนวนอน / แล็ปท็อป
============================================================ */
@media (min-width: 1024px) {
.mu-hero { padding: 56px 0 64px; }
.mu-action-btn { display: inline-flex; }
.mu-hero h1 { font-size: clamp(2.2rem, 4vw, 3rem); }
.mu-hero-actions { padding: 0; }
#view .mu-layout-grid { grid-template-columns: 1.35fr .9fr; gap: 16px; }
#view .mu-hero-title { font-size: 1.8rem; }
#view .mu-hero-map { min-height: auto; }
#view .mu-photo-strip { gap: 10px; }
}
/* ============================================================
≥1280px — คอม 19.5"–24"
============================================================ */
@media (min-width: 1280px) {
.mu-container { max-width: 1200px; }
#view .mu-stop-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
#view .mu-credit-wrap { padding: 40px 28px 56px; }
}
/* ============================================================
≥1600px — คอม 27" / 1440p+
============================================================ */
@media (min-width: 1600px) {
body { font-size: 17px; }
.mu-container { max-width: 1280px; }
#view .mu-photo-strip { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
#view .mu-stop-grid { grid-template-columns: repeat(4, 1fr); }
}
/* เวลาที่ "คำนวณจากต้นทาง" (ไม่ใช่ตารางจริงของผู้ประกอบการ) — ทำเครื่องหมายให้ผู้ใช้รู้ ไม่ให้เข้าใจผิด */
.mu-time-grid.is-est .mu-time-chip {
border: 1px dashed #a892d4;
background: #faf7ff;
color: #6b5a8e;
font-style: italic;
}
.mu-est-note {
margin: 6px 0 0;
font-size: .78rem;
color: #6b5a8e;
}