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

+28 -2
View File
@@ -2,6 +2,7 @@
<html lang="th">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<title>หน้าแรก | AT Transit (mockup)</title>
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@400;500;600;700;800&family=Prompt:wght@400;500;600;700&display=swap" rel="stylesheet">
<link href="../../frontend-web-transit/web-transit/css/main-theme.css" rel="stylesheet">
@@ -13,7 +14,7 @@
/* Page-specific: hero */
.mu-hero { position: relative; overflow: hidden; }
.mu-hero-map { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .14; filter: saturate(1.1); z-index: 0; pointer-events: none; }
.mu-hero-map { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .3; filter: saturate(1.1); z-index: 0; pointer-events: none; }
.mu-hero-content { position: relative; z-index: 1; }
/* ===== maintheme-style cards: solid gradient block with big centered number ===== */
@@ -64,7 +65,7 @@
/* Hero */
.mu-hero { position: relative; overflow: hidden; padding: 56px 0 64px; background: linear-gradient(180deg, #f0ebff 0%, #ffe8ee 50%, #fff4d6 100%); text-align: center; }
.mu-hero-map { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .14; filter: saturate(1.1); z-index: 0; pointer-events: none; }
.mu-hero-map { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .3; filter: saturate(1.1); z-index: 0; pointer-events: none; }
.mu-blob { position: absolute; border-radius: 50%; filter: blur(50px); opacity: .55; z-index: 0; }
.mu-blob.one { width: 220px; height: 220px; background: #b794f4; top: -50px; left: 8%; }
.mu-blob.two { width: 260px; height: 260px; background: #f9a8d4; top: 40%; right: 8%; }
@@ -374,6 +375,17 @@
<a href="#/stops" data-i18n="nav.stops">ป้ายหยุดรถ</a>
<a href="#/routes" data-i18n="nav.routes">รายละเอียดสายรถ</a>
</nav>
<details class="mu-menu" id="topnav">
<summary class="mu-menu-btn" aria-label="เมนูหลัก" aria-haspopup="true">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><line x1="4" x2="20" y1="6" y2="6"/><line x1="4" x2="20" y1="12" y2="12"/><line x1="4" x2="20" y1="18" y2="18"/></svg>
</summary>
<div class="mu-menu-panel" role="menu">
<a href="#/" data-i18n="nav.home" role="menuitem">หน้าแรก</a>
<a href="#/stops" data-i18n="nav.stops" role="menuitem">ป้ายหยุดรถ</a>
<a href="#/routes" data-i18n="nav.routes" role="menuitem">รายละเอียดสายรถ</a>
<a href="#/check" data-i18n="cta.check" role="menuitem">เช็กเวลาเดินรถ</a>
</div>
</details>
<div class="mu-lang-switch" role="group" aria-label="ภาษา / Language">
<button type="button" class="mu-lang-btn" data-i18n-switch="th">ไทย</button>
<button type="button" class="mu-lang-btn" data-i18n-switch="en">EN</button>
@@ -444,5 +456,19 @@
el.textContent = n.toLocaleString('en-US');
})();
</script>
<script>
// ปิดเมนู hamburger เมื่อ hash เปลี่ยน หรือคลิกนอกเมนู
(function () {
var menu = document.getElementById('topnav');
function close() { if (menu) menu.removeAttribute('open'); }
window.addEventListener('hashchange', close);
document.addEventListener('click', function (e) {
if (!menu) return;
if (e.target.closest('.mu-menu-panel a')) { close(); return; }
if (!e.target.closest('.mu-menu')) close();
});
})();
</script>
</body>
</html>