Files
web-at-transit-mock/ui/partials/home.html
T
Bkk1234 b6ccb66ce2 check page: add share button (parity with Next) + shared share row styles
- ui/share.js: one handler for all pages (id=share-btn / id=share-status),
  short link = origin+path+hash, navigator.share + clipboard, LINE link,
  re-binds after router swaps the view (MutationObserver), skips buttons that
  a page already bound itself
- checkSchedule.html: share row inside .mu-container (same position as Next)
- _shared.css: .mu-share-* moved here from home.html, values copied from Next
  (ghost button, radius 8, 44px, tokens) so light/dark match
- home.init.js marks its own binding so the shared handler does not double-bind
- index.html + sw PRECACHE: share.js · VERSION 2026.09.27.124
2026-11-04 02:05:47 +07:00

101 lines
8.9 KiB
HTML

<style>
/* ปุ่มแชร์ลิงก์สั้น — มุมล่างขวา ต่อจากการ์ดหมวดเส้นทาง */
display: inline-flex; align-items: center; gap: 8px;
padding: 10px 16px; border: 1px solid #7a4cc0; border-radius: 8px;
background: var(--c-brand); color: #fff; font: inherit; font-size: .9rem; font-weight: 700; cursor: pointer;
}
@media (max-width: 560px) {
}
</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>