Files
web-at-transit-mock/ui/partials/home.html
T
Bkk1234 750b4a2ea8 mock: three search tabs - stop code, place name, near me
- busStop.html: added the third tab (data-mode=near) and its own panel with
  the location button, hint and result area; removed the near button from the
  toolbar and deleted the old on-screen numpad markup
- busStop.search.js: MODE_NEAR in setMode, disables the other panels, hides
  the stop list while ranked results are shown, skips filtering in that mode,
  and removed the dead initNumpad code
- security gate: the tab is revealed only when isSecureContext and
  navigator.geolocation exist; otherwise it stays hidden and the mode is
  refused
- map.js: re-enable the button after a successful lookup
- i18n: stops.modeNear / nearCta / nearHint
- bump SW version to 2026.09.27.98

Verified on localhost:8090 - three tabs, near mode shows a map with 8 ranked
stops, button re-enables and works again, switching back restores the list;
with isSecureContext forced false the tab is hidden and unselectable.
2026-10-24 00:11:56 +07:00

114 lines
9.8 KiB
HTML

<style>
/* ปุ่มแชร์ลิงก์สั้น — มุมล่างขวา ต่อจากการ์ดหมวดเส้นทาง */
.mu-share-row { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; margin: 22px 0 44px; }
.mu-share-btn {
display: inline-flex; align-items: center; gap: 8px;
padding: 10px 16px; border: 1px solid #7a4cc0; border-radius: 8px;
background: #7a4cc0; color: #fff; font: inherit; font-size: .9rem; font-weight: 700; cursor: pointer;
}
.mu-share-btn:hover { background: #6a3cae; }
.mu-share-btn:focus-visible { outline: 2px solid #2b2f42; outline-offset: 2px; }
.mu-share-btn .ic { width: 18px; height: 18px; }
.mu-share-status { margin: 0; font-size: .82rem; line-height: 1.7; color: #4b5570; text-align: right; }
.mu-share-status:empty { display: none; }
.mu-share-url { display: inline-block; padding: 2px 6px; border: 1px solid #e7e2f6; border-radius: 8px; background: #faf9ff; font-size: .8rem; }
.mu-share-line { display: inline-block; margin-left: 6px; font-weight: 700; color: #06c755; text-decoration: none; }
.mu-share-line:hover { text-decoration: underline; }
@media (max-width: 560px) {
.mu-share-row { align-items: stretch; }
.mu-share-btn { justify-content: center; }
.mu-share-status { text-align: left; }
}
</style>
<section class="mu-hero">
<img class="mu-hero-map" src="../.image/network/overview-map.png" alt="" aria-hidden="true" fetchpriority="high" decoding="async">
<div class="mu-blob one"></div>
<div class="mu-blob two"></div>
<div class="mu-blob three"></div>
<div class="mu-container mu-hero-content">
<span class="mu-badge" data-i18n="home.welcome">ยินดีต้อนรับ</span>
<h1><span data-i18n="home.title1">สถานีขนส่งผู้โดยสารภายใน</span><br><span class="mu-gradient-text" id="hero-province">จังหวัดอ่างทอง</span></h1>
<div class="mu-route-selector">
<div class="mu-select-field">
<label for="province-select">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0"/><circle cx="12" cy="10" r="3"/></svg>
<span data-i18n="home.chooseProvince">เลือกจังหวัด</span>
</label>
<div class="mu-select-box">
<svg class="mu-select-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0"/><circle cx="12" cy="10" r="3"/></svg>
<select id="province-select" data-i18n-attr="aria-label:home.chooseProvince"></select>
<svg class="mu-select-chevron" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m6 9 6 6 6-6"/></svg>
</div>
</div>
<span class="mu-select-arrow" aria-hidden="true"><svg class="ic"><use href="#ic-arrow-right"/></svg></span>
<div class="mu-select-field">
<label for="station-select">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 6v6"/><path d="M15 6v6"/><path d="M2 12h19.6"/><path d="M18 18h3s.5-1.7.8-2.8c.1-.4.2-.8.2-1.2 0-.4-.1-.8-.2-1.2l-1.4-5C20.1 6.8 19.1 6 18 6H4a2 2 0 0 0-2 2v10h3"/><circle cx="7" cy="18" r="2"/><path d="M9 18h5"/><circle cx="16" cy="18" r="2"/></svg>
<span data-i18n="home.chooseStation">สถานีขนส่งผู้โดยสาร</span>
</label>
<div class="mu-select-box">
<svg class="mu-select-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 6v6"/><path d="M15 6v6"/><path d="M2 12h19.6"/><path d="M18 18h3s.5-1.7.8-2.8c.1-.4.2-.8.2-1.2 0-.4-.1-.8-.2-1.2l-1.4-5C20.1 6.8 19.1 6 18 6H4a2 2 0 0 0-2 2v10h3"/><circle cx="7" cy="18" r="2"/><path d="M9 18h5"/><circle cx="16" cy="18" r="2"/></svg>
<select id="station-select" data-i18n-attr="aria-label:home.chooseStation"></select>
<svg class="mu-select-chevron" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m6 9 6 6 6-6"/></svg>
</div>
</div>
</div>
<p class="mu-select-hint" id="station-hint" aria-live="polite"></p>
</div>
</section>
<section class="mu-sponsor-marquee" aria-label="ผู้สนับสนุนและพาร์ทเนอร์" data-i18n-attr="aria-label:aria.sponsors">
<div class="mu-sponsor-head">
<h4 data-i18n="footer.sponsors">ผู้สนับสนุน &amp; พาร์ทเนอร์</h4>
<p class="lead" data-i18n="footer.sponsorsLead">ร่วมเป็นผู้สนับสนุนเราได้ เมื่อซื้อของออนไลน์ หรือซื้อตั๋วรถทัวร์ เครื่องบิน ออนไลน์กดเลือกสินค้า หรือบริการผ่านลิงค์นายหน้าของเราไม่มีค่าใช้จ่ายเพิ่ม</p>
</div>
<div class="mu-marquee">
<div class="mu-marquee-track">
<a class="mu-marquee-tile" href="#" aria-label="7-Eleven"><img src="../.image/partners/7-11.png" alt="7-Eleven" decoding="async"></a>
<a class="mu-marquee-tile" href="#" aria-label="Shopee"><img src="../.image/partners/shopee.png" alt="Shopee" decoding="async"></a>
<a class="mu-marquee-tile" href="#" aria-label="Lazada"><img src="../.image/partners/lazada.png" alt="Lazada" decoding="async"></a>
<a class="mu-marquee-tile" href="#" aria-label="airasia MOVE"><img src="../.image/partners/airasia-move.png" alt="airasia MOVE" decoding="async"></a>
<a class="mu-marquee-tile" href="#" aria-label="busonlineticket"><img src="../.image/partners/busonlineticket.png" alt="busonlineticket" decoding="async"></a>
<a class="mu-marquee-tile" href="#" aria-label="Trip.com"><img src="../.image/partners/trip.jpg" alt="Trip.com" decoding="async"></a>
<a class="mu-marquee-tile" href="#" aria-label="truck2hand"><img src="../.image/partners/truck2hand.png" alt="truck2hand" decoding="async"></a>
<a class="mu-marquee-tile" href="#" aria-label="ทีซีแอล 999 อ่างทอง"><img src="../.image/partners/tcl999-angthong.jpg" alt="ทีซีแอล 999 อ่างทอง" decoding="async"></a>
</div>
</div>
</section>
<main class="mu-main">
<div class="mu-container">
<!-- คำอธิบายสีการ์ดตามหมวดเส้นทาง -->
<section class="mu-legend" aria-label="คำอธิบายสีการ์ดตามหมวดเส้นทาง" data-i18n-attr="aria-label:aria.legend">
<h2 class="mu-legend-title" data-i18n="legend.title">คำอธิบายสีการ์ดตามหมวดเส้นทาง</h2>
<ul class="mu-legend-list">
<li><span class="sw sw-bangkok" aria-hidden="true"></span><span data-i18n="legend.bangkok">หมวดเส้นทางเข้ากรุงเทพฯ — การ์ดสีน้ำเงิน</span></li>
<li><span class="sw sw-interprov" aria-hidden="true"></span><span data-i18n="legend.interprov">หมวดเส้นทางระหว่างจังหวัด — การ์ดสีม่วง</span></li>
<li><span class="sw sw-inprov" aria-hidden="true"></span><span data-i18n="legend.inprov">หมวดเส้นทางภายในจังหวัด — การ์ดสีชมพู</span></li>
<li><span class="sw sw-municipal" aria-hidden="true"></span><span data-i18n="legend.municipal">หมวดเส้นทางภายในเทศบาล — การ์ดสีเหลืองอ่อน</span></li>
<li><span class="sw sw-empty" aria-hidden="true"></span><span data-i18n="legend.empty">ยังไม่มีข้อมูล — การ์ดสีเทา แสดง N/A แทนเลขสาย</span></li>
</ul>
<p class="mu-legend-note" data-i18n="legend.note">อ่างทองยังไม่มีรถหมวด 1 (เส้นทางภายในเทศบาล) จึงแสดงการ์ดสีเทาและใช้ N/A แทนตัวเลขสายเส้นทาง</p>
</section>
<!-- หมวดเส้นทางทั้งหมด: สร้างจาก resource/data/route_groups.json + routes.json (+ routes_municipal.json)
ที่มา: ui/partials/home.init.js → initRouteZones() — ห้าม hardcode การ์ดในไฟล์นี้ -->
<div id="route-zones"></div>
<!-- ปุ่มแชร์ลิงก์สั้น (มุมล่างขวา ต่อจากการ์ดหมวดเส้นทางภายในจังหวัด) -->
<div class="mu-share-row">
<button type="button" class="mu-share-btn" id="share-btn">
<svg class="ic" aria-hidden="true"><use href="#ic-share-2"/></svg>
<span data-i18n="share.label">แชร์ลิงก์สั้น</span>
</button>
<p class="mu-share-status" id="share-status" aria-live="polite"></p>
</div>
</div>
</main>
<script src="./partials/home.init.js"></script>