feat: pwa and responsive

This commit is contained in:
phattaranun.a committed 2026-09-12 17:21:19 +07:00
1 parent 71dacc0da2
commit 6b612e2758
7 files changed
+269 -18

No files matched your search

+61 -13
View File
@@ -17,7 +17,25 @@
/* ---------- base: มือถือ ---------- */
html { -webkit-text-size-adjust: 100%; }
body { font-size: 15px; }
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; }
@@ -35,21 +53,49 @@ img, svg, video { max-width: 100%; height: auto; }
.mu-container { padding: 0 16px; }
main.mu-container { padding-top: 24px; padding-bottom: 24px; }
/* --- topbar: 2 แถวบนมือถือ (brand+lang บรรทัด1, nav บรรทัด2) — ไม่มี scroll ซ้ายขวา --- */
/* --- 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: .92rem; white-space: nowrap; }
.mu-brand-title { font-size: 1.05rem; white-space: nowrap; }
.mu-brand-subtitle { display: none; } /* กันล้น — โผล่กลับ ≥768px */
.mu-nav { order: 3; width: 100%; justify-content: space-between; margin-left: 0; gap: 8px; }
.mu-nav a { font-size: .76rem; padding: 10px 2px; white-space: nowrap; } /* tap target ≥44px */
.mu-lang-switch { margin-left: auto; padding: 2px; }
.mu-lang-btn { font-size: .68rem; padding: 8px 12px; min-height: 40px; min-width: 40px; } /* tap target */
.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 */
/* --- hero (หน้าแรก) — ลดช่องว่างแนวตั้ง --- */
.mu-hero { padding: 20px 0 22px; }
.mu-hero h1 { font-size: clamp(1.6rem, 7vw, 2.4rem); margin-bottom: 10px; line-height: 1.28; }
/* 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; }
@@ -72,7 +118,7 @@ main.mu-container { padding-top: 14px; padding-bottom: 14px; }
.mu-zone { margin-bottom: 20px; }
.mu-zone-head { margin-bottom: 10px; gap: 10px; }
.mu-grid { gap: 12px; }
.mu-route-info { padding: 12px 12px 13px; }
.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; }
@@ -85,6 +131,7 @@ main.mu-container { padding-top: 14px; padding-bottom: 14px; }
#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-province-strip {
display: flex; flex-wrap: wrap; padding-bottom: 6px;
}
@@ -102,7 +149,7 @@ main.mu-container { padding-top: 14px; padding-bottom: 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; }
#view .mu-back-btn { width: 100%; justify-content: center; padding: 10px; min-height: 44px; }
#view .mu-schedule-note { font-size: .82rem; }
/* --- stopDetail --- */
@@ -146,8 +193,9 @@ main.mu-container { padding-top: 14px; padding-bottom: 14px; }
.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; }
.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; }