- ui/theme.css: token set copied value-for-value from the Next app (--c-surface/-ink/-border/-brand/-tint/-glass + radius), light and dark blocks - ui/theme.js: 3-mode switch (light / dark / auto=prefers-color-scheme) with a header dropdown, aria-haspopup/menu, Esc/outside close, live matchMedia listener - index.html: pre-paint theme script (no flash), theme.css link before _shared.css - remapped ~290 literal colours in _shared.css/index.html/partials to var(--c-*) so both projects render from the same tokens; dark patch block covers the remaining decorative gradients - DESIGN.md: new section 3.2 (theme tokens + where to add colours) - VERSION 2026.09.27.114
492 lines
21 KiB
HTML
492 lines
21 KiB
HTML
<style>
|
|
.mu-page {
|
|
background:
|
|
linear-gradient(180deg, var(--c-surface) 0%, #faf7ff 55%, #f4f0fd 100%);
|
|
}
|
|
|
|
.mu-hero-panel {
|
|
background: var(--c-surface);
|
|
border: 1px solid #1f2a44;
|
|
border-radius: 8px;
|
|
padding: 18px;
|
|
margin-bottom: 16px;
|
|
display: grid;
|
|
grid-template-columns: 1.1fr .9fr;
|
|
gap: 16px;
|
|
align-items: stretch;
|
|
}
|
|
.mu-hero-title { margin: 0; font-size: 1.6rem; line-height: 1.2; color: var(--c-ink); }
|
|
.mu-hero-subtitle { margin: 8px 0 0; color: var(--c-ink-2); font-size: .95rem; max-width: 48rem; }
|
|
.mu-kpi-grid { display:grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
|
|
.mu-kpi {
|
|
border: 1px solid #d9c9f2;
|
|
border-radius: 8px;
|
|
padding: 12px;
|
|
background: linear-gradient(135deg, #f0e7fc, #e6d8f8);
|
|
}
|
|
.mu-kpi .label { margin: 0; color:var(--c-ink-3); font-size:.76rem; font-weight:700; letter-spacing:.03em; text-transform: uppercase; }
|
|
.mu-kpi .value { margin:4px 0 0; color:var(--c-ink); font-size:1.03rem; font-weight:800; font-variant-numeric: tabular-nums; }
|
|
.mu-hero-map {
|
|
border: 1px solid var(--c-border);
|
|
border-radius: 8px;
|
|
padding: 14px;
|
|
display:flex;
|
|
flex-direction:column;
|
|
gap: 10px;
|
|
justify-content:space-between;
|
|
}
|
|
.mu-hero-map-title { margin:0; font-size:1rem; font-weight:800; color:var(--c-ink); }
|
|
.mu-hero-map-box {
|
|
flex:1;
|
|
min-height: 160px;
|
|
border-radius: 8px;
|
|
background: linear-gradient(135deg, #faf7ff, #f2ecfd);
|
|
border: 1px dashed #d9cdf2;
|
|
display:flex;
|
|
align-items:center;
|
|
justify-content:center;
|
|
color:var(--c-ink-2);
|
|
font-weight:700;
|
|
text-align:center;
|
|
padding: 18px;
|
|
}
|
|
|
|
/* ===== Search toolbar: 2 โหมด ===== */
|
|
.mu-toolbar {
|
|
background: var(--c-surface);
|
|
border: 1px solid #d9c9f2;
|
|
border-radius: 8px;
|
|
padding: 14px;
|
|
margin-bottom: 12px;
|
|
}
|
|
.mu-search-tabs {
|
|
display: flex;
|
|
gap: 0;
|
|
border: 1px solid #d5c3f0;
|
|
border-radius: 8px;
|
|
overflow: hidden;
|
|
margin-bottom: 12px;
|
|
width: fit-content;
|
|
max-width: 100%;
|
|
}
|
|
.mu-search-tab {
|
|
font-family: inherit;
|
|
font-size: .85rem;
|
|
font-weight: 700;
|
|
padding: 10px 18px;
|
|
border: none;
|
|
border-right: 1px solid #d5c3f0;
|
|
background: var(--c-surface);
|
|
color: var(--c-ink-2);
|
|
cursor: pointer;
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 7px;
|
|
transition: background .15s ease, color .15s ease;
|
|
}
|
|
.mu-search-tab:last-child { border-right: none; }
|
|
.mu-search-tab:hover { background: #f3ecff; }
|
|
.mu-search-tab.active { background: linear-gradient(135deg, #7a4cc0, #b07ce0); color: #fff; }
|
|
.mu-search-tab .ic { width: 16px; height: 16px; }
|
|
|
|
.mu-search-mode { display: block; }
|
|
/* กัน .display:block ทับ attribute [hidden] — โหมดที่ไม่ได้ใช้ต้องซ่อนจริง */
|
|
.mu-search-mode[hidden],
|
|
.mu-numpad[hidden] { display: none; }
|
|
|
|
.mu-search-field {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 10px;
|
|
border: 1px solid #d5c3f0;
|
|
border-radius: 8px;
|
|
background: var(--c-surface);
|
|
padding: 0 12px;
|
|
min-height: 48px;
|
|
transition: border-color .15s ease;
|
|
}
|
|
.mu-search-field:focus-within { border-color: #a855f7; }
|
|
.mu-search-field .ic { position: static; width: 18px; height: 18px; color: #8b5cf6; flex: none; }
|
|
.mu-search-field input {
|
|
flex: 1;
|
|
min-width: 0;
|
|
border: none;
|
|
outline: none;
|
|
background: transparent;
|
|
font-family: inherit;
|
|
font-size: 1rem;
|
|
font-weight: 600;
|
|
color: var(--c-ink);
|
|
padding: 12px 0;
|
|
}
|
|
.mu-search-field input::placeholder { color: var(--c-ink-2); font-weight: 500; opacity: .8; }
|
|
|
|
/* ===== ช่องรหัสป้าย 6 ช่อง: [x] + [x][x][x][x] ===== */
|
|
.mu-code-boxes {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
}
|
|
.mu-code-cell {
|
|
width: 46px;
|
|
height: 54px;
|
|
text-align: center;
|
|
font-family: "IBM Plex Mono", ui-monospace, monospace;
|
|
font-size: 1.35rem;
|
|
font-weight: 700;
|
|
font-variant-numeric: tabular-nums;
|
|
color: var(--c-ink);
|
|
background: var(--c-surface);
|
|
border: 2px solid #e0d6f5;
|
|
border-radius: 8px;
|
|
outline: none;
|
|
padding: 0;
|
|
transition: border-color .15s ease, background .15s ease;
|
|
-moz-appearance: textfield;
|
|
}
|
|
.mu-code-cell::-webkit-outer-spin-button,
|
|
.mu-code-cell::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
|
|
.mu-code-cell::placeholder { color: #7a6a9e; font-weight: 600; opacity: 1; }
|
|
.mu-code-cell:focus {
|
|
border-color: #a855f7;
|
|
background: var(--c-surface-2);
|
|
}
|
|
.mu-code-cell:disabled { opacity: .45; }
|
|
/* 2 หลักหน้า (ก่อน +) — เน้นให้เห็นว่าเป็นหัวของรหัส */
|
|
.mu-code-cell:nth-of-type(1),
|
|
.mu-code-cell:nth-of-type(2) {
|
|
border-color: #b07ce0;
|
|
background: linear-gradient(135deg, #7a4cc0, #b07ce0);
|
|
color: #fff;
|
|
}
|
|
.mu-code-cell:nth-of-type(1)::placeholder,
|
|
.mu-code-cell:nth-of-type(2)::placeholder { color: #fff; opacity: .8; font-weight: 600; }
|
|
.mu-code-cell:nth-of-type(1):focus,
|
|
.mu-code-cell:nth-of-type(2):focus { border-color: #6d28d9; }
|
|
.mu-code-plus {
|
|
font-family: "IBM Plex Mono", ui-monospace, monospace;
|
|
font-size: 1.5rem;
|
|
font-weight: 700;
|
|
color: var(--c-brand-ink);
|
|
line-height: 1;
|
|
padding: 0 2px;
|
|
}
|
|
.mu-code-display {
|
|
margin: 10px 0 0;
|
|
font-family: "IBM Plex Mono", ui-monospace, monospace;
|
|
font-size: .9rem;
|
|
font-weight: 700;
|
|
color: var(--c-brand-ink);
|
|
font-variant-numeric: tabular-nums;
|
|
}
|
|
.mu-search-hint { margin: 8px 0 0; font-size: .85rem; color: var(--c-ink-2); }
|
|
|
|
/* numpad — โชว์เฉพาะจอเล็ก */
|
|
.mu-numpad { display: none; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; max-width: 320px; }
|
|
.mu-numpad button {
|
|
font-family: "IBM Plex Mono", ui-monospace, monospace;
|
|
font-size: 1.2rem;
|
|
font-weight: 700;
|
|
padding: 14px 0;
|
|
border: 1px solid #e0d6f5;
|
|
border-radius: 8px;
|
|
background: var(--c-surface);
|
|
color: var(--c-ink);
|
|
cursor: pointer;
|
|
font-variant-numeric: tabular-nums;
|
|
transition: background .12s ease, border-color .12s ease;
|
|
}
|
|
.mu-numpad button:active { background: #f3ecff; border-color: #b07ce0; }
|
|
.mu-numpad button[data-key="back"] { grid-column: span 2; font-size: 1rem; }
|
|
|
|
/* suggest */
|
|
.mu-suggest {
|
|
border: 1px solid #e0d6f5;
|
|
border-radius: 8px;
|
|
margin-top: 8px;
|
|
overflow: hidden;
|
|
background: var(--c-surface);
|
|
max-height: 260px;
|
|
overflow-y: auto;
|
|
}
|
|
.mu-suggest-item {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
gap: 12px;
|
|
width: 100%;
|
|
padding: 11px 14px;
|
|
border: none;
|
|
border-bottom: 1px solid #f1edfa;
|
|
background: var(--c-surface);
|
|
font-family: inherit;
|
|
font-size: .9rem;
|
|
text-align: left;
|
|
cursor: pointer;
|
|
color: var(--c-ink);
|
|
}
|
|
.mu-suggest-item:last-child { border-bottom: none; }
|
|
.mu-suggest-item:hover { background: var(--c-surface-2); }
|
|
.mu-suggest-code {
|
|
font-family: "IBM Plex Mono", ui-monospace, monospace;
|
|
font-size: .85rem;
|
|
font-weight: 700;
|
|
color: #fff;
|
|
background: linear-gradient(135deg, #7a4cc0, #b07ce0);
|
|
padding: 3px 9px;
|
|
border-radius: 4px;
|
|
flex: none;
|
|
font-variant-numeric: tabular-nums;
|
|
}
|
|
|
|
.mu-toolbar-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
|
|
.mu-show-more { display: flex; justify-content: center; margin: 14px 0 4px; }
|
|
.mu-show-more .mu-btn { min-width: 220px; }
|
|
.mu-stop-card.is-stub { min-height: 120px; background: #faf8ff; border: 1px dashed #ddd2f2; box-shadow: none; }
|
|
|
|
.mu-toolbar-count { margin: 10px 0 0; font-size: .84rem; color: var(--c-ink-2); }
|
|
.mu-toolbar-count b { color: var(--c-brand-ink); font-variant-numeric: tabular-nums; }
|
|
|
|
/* ===== การ์ดป้าย ===== */
|
|
.mu-stop-grid[hidden] { display: none; }
|
|
.mu-stop-grid {
|
|
display:grid;
|
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
gap: 14px;
|
|
padding-left: 0;
|
|
list-style: none;
|
|
}
|
|
.mu-stop-grid li {
|
|
margin: 0;
|
|
border-radius: 8px;
|
|
overflow: hidden;
|
|
border: 1px solid var(--c-border);
|
|
background: var(--c-surface);
|
|
transition: border-color .15s ease, transform .15s ease;
|
|
}
|
|
.mu-stop-grid li:hover { border-color: #a855f7; transform: translateY(-1px); }
|
|
.mu-stop-card {
|
|
height: 100%;
|
|
padding: 16px;
|
|
background: var(--c-surface);
|
|
display:flex;
|
|
flex-direction:column;
|
|
gap: 12px;
|
|
}
|
|
|
|
.mu-stop-top { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; }
|
|
.mu-type-pill {
|
|
display:inline-block;
|
|
border-radius: 4px;
|
|
padding: 4px 9px;
|
|
font-size:.74rem;
|
|
font-weight:800;
|
|
letter-spacing:.01em;
|
|
}
|
|
.mu-type-pill.local { background: #f3ecff; color: var(--c-brand-ink); }
|
|
.mu-stop-title { margin:6px 0 0; font-size:1.05rem; line-height:1.3; color:var(--c-ink); }
|
|
.mu-loc { color:var(--c-ink-2); font-size:.85rem; margin-top:4px; }
|
|
.mu-chip-row { display:flex; flex-wrap:wrap; gap:8px; }
|
|
.mu-chip {
|
|
display:inline-flex;
|
|
align-items:center;
|
|
gap:6px;
|
|
padding:5px 10px;
|
|
border-radius: 4px;
|
|
background: var(--c-surface-2);
|
|
border: 1px solid var(--c-border);
|
|
color:var(--c-ink-2);
|
|
font-size:.8rem;
|
|
font-weight:700;
|
|
}
|
|
.mu-chip.route { background: #f3ecff; color:var(--c-brand-ink); border-color: #e0d6f5; }
|
|
/* ชิปสายที่เป็นลิงก์ → ไปหน้าเช็กเวลาของสายนั้น (หน้าตาเหมือนชิปเดิม + มี hover/focus) */
|
|
a.mu-chip.route { text-decoration: none; cursor: pointer; }
|
|
a.mu-chip.route:hover { background:#e9dcff; border-color:#cdb5f2; }
|
|
a.mu-chip.route:focus-visible { outline: 2px solid #7a4cc0; outline-offset: 2px; }
|
|
/* รหัสป้าย = ม่วง-ขาว แบบเดียวกับป้ายสายรถ */
|
|
.mu-chip.count.stop-code {
|
|
background: linear-gradient(135deg, #7a4cc0, #b07ce0);
|
|
color: #fff;
|
|
border-color: transparent;
|
|
font-family: "IBM Plex Mono", ui-monospace, monospace;
|
|
font-size: .92rem;
|
|
font-weight: 700;
|
|
letter-spacing: .05em;
|
|
font-variant-numeric: tabular-nums;
|
|
flex: none;
|
|
padding: 7px 11px;
|
|
}
|
|
.mu-stop-action { margin-top:auto; display:flex; justify-content:space-between; align-items:center; gap:12px; }
|
|
.mu-stop-note { color:var(--c-ink-2); font-size:.8rem; margin:0; }
|
|
|
|
.mu-stop-thumb {
|
|
display: block;
|
|
width: 100%;
|
|
height: 180px;
|
|
object-fit: cover;
|
|
background: var(--c-bg);
|
|
border-bottom: 1px solid var(--c-border);
|
|
}
|
|
/* รูป placeholder — ย่อและจัดกลาง ไม่ให้ครอปโลโก้ */
|
|
.mu-stop-thumb.is-placeholder {
|
|
object-fit: contain;
|
|
padding: 34px;
|
|
background: linear-gradient(135deg, #faf7ff, #f2ecfd);
|
|
}
|
|
|
|
.mu-stop-empty {
|
|
grid-column: 1 / -1;
|
|
list-style: none;
|
|
padding: 40px 16px;
|
|
text-align: center;
|
|
color: var(--c-ink-2);
|
|
border: 1px dashed #e0d6f5;
|
|
border-radius: 8px;
|
|
background: var(--c-surface);
|
|
}
|
|
|
|
@media (max-width: 980px) {
|
|
.mu-hero-panel { grid-template-columns: 1fr; }
|
|
.mu-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
.mu-stop-grid { grid-template-columns: 1fr; }
|
|
}
|
|
|
|
@media (max-width: 640px) {
|
|
.mu-kpi-grid { grid-template-columns: 1fr; }
|
|
.mu-numpad { display: grid; }
|
|
.mu-search-tabs { width: 100%; }
|
|
.mu-search-tab { flex: 1; justify-content: center; padding: 10px 12px; font-size: .84rem; }
|
|
.mu-stop-action { flex-direction: column; align-items: flex-start; }
|
|
/* กล่องรหัส: ย่อให้พอดีจอ 375px (5×40 + เครื่องหมาย + gap = ~244px) */
|
|
.mu-code-boxes { gap: 5px; }
|
|
.mu-code-cell { width: 40px; height: 48px; font-size: 1.15rem; }
|
|
.mu-code-plus { font-size: 1.25rem; }
|
|
}
|
|
|
|
.mu-hero-map-photo { width: 100%; height: 100%; min-height: 160px; object-fit: cover; border-radius: 8px; display: block; }
|
|
</style>
|
|
|
|
<main class="mu-page">
|
|
<div class="mu-container">
|
|
<p class="mu-breadcrumb"><a href="#/" data-i18n="nav.home">หน้าแรก</a>/ <span data-i18n="nav.stops">ป้ายหยุดรถ</span></p>
|
|
|
|
<section class="mu-hero-panel">
|
|
<div>
|
|
<h1 class="mu-hero-title"><span data-i18n="stops.title">ค้นหาป้ายหยุดรถแบบรวดเร็ว</span></h1>
|
|
<p class="mu-hero-subtitle"><span data-i18n="stops.subtitle">ค้นหาด้วยรหัสหลักกิโลเมตรของป้าย หรือค้นหาด้วยชื่อสถานที่สำคัญ</span></p>
|
|
<div class="mu-kpi-grid" id="stops-kpi" aria-label="summary metrics"></div>
|
|
</div>
|
|
<div class="mu-hero-map">
|
|
<p class="mu-hero-map-title"><span data-i18n="stops.mapTitle">แผนที่ย่อของเครือข่ายป้าย</span></p>
|
|
<div class="mu-hero-map-box">
|
|
<img class="mu-hero-map-photo" src="../.image/network/overview-map.png" alt="แผนที่เครือข่ายป้าย Atroute" data-i18n-attr="alt:aria.networkMapAlt" loading="lazy" decoding="async">
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<form class="mu-toolbar" id="stops-form" onsubmit="return false">
|
|
<!-- โหมดค้นหา: เลือกอย่างใดอย่างหนึ่ง (ห้ามชนกัน) -->
|
|
<div class="mu-search-tabs" role="tablist" aria-label="รูปแบบการค้นหา" data-i18n-attr="aria-label:aria.searchMode">
|
|
<button type="button" class="mu-search-tab" data-mode="code" role="tab" aria-selected="true">
|
|
<svg class="ic" aria-hidden="true"><use href="#ic-map-pin"/></svg>
|
|
<span data-i18n="stops.modeCode">ค้นหาด้วยรหัสป้าย</span>
|
|
</button>
|
|
<button type="button" class="mu-search-tab" data-mode="place" role="tab" aria-selected="false">
|
|
<svg class="ic" aria-hidden="true"><use href="#ic-landmark"/></svg>
|
|
<span data-i18n="stops.modePlace">ค้นหาด้วยชื่อสถานที่</span>
|
|
</button>
|
|
<!-- หมวดที่ 3: ป้ายใกล้ฉัน — แสดงเฉพาะเมื่อเป็น secure context (ดูสคริปต์ท้ายไฟล์) -->
|
|
<button type="button" class="mu-search-tab" data-mode="near" role="tab" aria-selected="false" id="stops-near-tab" hidden>
|
|
<svg class="ic" aria-hidden="true"><use href="#ic-map-pin"/></svg>
|
|
<span data-i18n="stops.modeNear">ป้ายใกล้ฉัน</span>
|
|
</button>
|
|
</div>
|
|
|
|
<!-- โหมด 1: รหัสป้าย (5 ช่อง: 2 หน้า + 3 หลัง) -->
|
|
<div class="mu-search-mode" id="stops-code-wrap">
|
|
<div class="mu-code-boxes" id="stops-code-boxes" role="group"
|
|
data-i18n-attr="aria-label:stops.codePh" aria-label="รหัสป้าย">
|
|
<input class="mu-code-cell" type="text" inputmode="numeric" maxlength="1"
|
|
autocomplete="off" aria-label="หลักที่ 1" data-i18n-attr="aria-label:aria.digitN" data-i18n-n="1" placeholder="0">
|
|
<input class="mu-code-cell" type="text" inputmode="numeric" maxlength="1"
|
|
autocomplete="off" aria-label="หลักที่ 2" data-i18n-attr="aria-label:aria.digitN" data-i18n-n="2" placeholder="0">
|
|
<span class="mu-code-plus" aria-hidden="true">+</span>
|
|
<input class="mu-code-cell" type="text" inputmode="numeric" maxlength="1"
|
|
autocomplete="off" aria-label="หลักที่ 3" data-i18n-attr="aria-label:aria.digitN" data-i18n-n="3" placeholder="0">
|
|
<input class="mu-code-cell" type="text" inputmode="numeric" maxlength="1"
|
|
autocomplete="off" aria-label="หลักที่ 4" data-i18n-attr="aria-label:aria.digitN" data-i18n-n="4" placeholder="0">
|
|
<input class="mu-code-cell" type="text" inputmode="numeric" maxlength="1"
|
|
autocomplete="off" aria-label="หลักที่ 5" data-i18n-attr="aria-label:aria.digitN" data-i18n-n="5" placeholder="0">
|
|
</div>
|
|
<p class="mu-code-display" id="stops-code-display" hidden></p>
|
|
<p class="mu-search-hint" data-i18n="stops.codeHintBox">พิมพ์ตัวเลขในช่อง ระบบจะเติม 0 ให้อัตโนมัติเมื่อเว้นว่าง</p>
|
|
</div>
|
|
|
|
<!-- โหมด 2: ชื่อสถานที่ -->
|
|
<div class="mu-search-mode" id="stops-place-wrap" hidden>
|
|
<div class="mu-search-field">
|
|
<svg class="ic" aria-hidden="true"><use href="#ic-search"/></svg>
|
|
<input type="search" id="stops-place-input" autocomplete="off"
|
|
placeholder="โรงพยาบาลอ่างทอง" data-i18n-attr="placeholder:stops.placePh,aria-label:stops.placePh">
|
|
</div>
|
|
<div class="mu-suggest" id="stops-suggest" hidden></div>
|
|
<p class="mu-search-hint" data-i18n="stops.placeHint">พิมพ์ชื่อสถานที่สำคัญ เช่น โรงพยาบาล สำนักงานที่ดิน แล้วเลือกรายการที่ตรงกัน</p>
|
|
</div>
|
|
|
|
<!-- หมวดที่ 3: ป้ายใกล้ฉัน — ขอพิกัดจากเครื่อง แล้วเรียงป้ายตามระยะจริง -->
|
|
<div class="mu-search-mode" id="stops-near-wrap" hidden>
|
|
<button type="button" class="mu-btn primary" id="near-me-btn">
|
|
<svg class="ic" aria-hidden="true"><use href="#ic-map-pin"/></svg>
|
|
<span data-i18n="stops.nearCta">ขอพิกัดและหาป้ายใกล้ฉัน</span>
|
|
</button>
|
|
<p class="mu-search-hint" data-i18n="stops.nearHint">ระบบจะขอตำแหน่งจากเครื่อง แล้วคำนวณระยะจากพิกัดป้าย/ศาลารถ เรียงจากใกล้ไปไกล</p>
|
|
<div id="near-me-result" class="mu-near-wrap" hidden></div>
|
|
</div>
|
|
|
|
<div class="mu-toolbar-actions">
|
|
<!-- การกรองทำงานทันทีขณะพิมพ์ — ไม่ต้องมีปุ่มค้นหา -->
|
|
<button type="button" class="mu-btn primary" id="stops-reset-btn"><span data-i18n="stops.reset">ล้างค่า</span></button>
|
|
<a class="mu-btn ghost" href="#/"><span data-i18n="common.back">ย้อนกลับ</span></a>
|
|
</div>
|
|
|
|
<p class="mu-toolbar-count" id="stops-count" hidden></p>
|
|
</form>
|
|
|
|
<ul class="mu-stop-grid" id="stops-list"></ul>
|
|
|
|
<div class="mu-show-more">
|
|
<button type="button" class="mu-btn outline" id="stops-show-all" data-i18n="stops.showAll" hidden>แสดงป้ายทั้งหมด</button>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
|
|
<script>
|
|
/* ป้ายใกล้ฉัน — หมวดที่ 3 ของการค้นหา
|
|
ต้องมี secure context (HTTPS หรือ localhost) เบราว์เซอร์จึงยอมให้ geolocation
|
|
ไม่ผ่านเงื่อนไข → ซ่อนแท็บทั้งแท็บ (กดไปก็ได้แต่ error) */
|
|
(function () {
|
|
var SECURE = (typeof window !== 'undefined') &&
|
|
window.isSecureContext === true &&
|
|
typeof navigator !== 'undefined' && !!navigator.geolocation;
|
|
|
|
var tab = document.getElementById('stops-near-tab');
|
|
if (tab) tab.hidden = !SECURE;
|
|
|
|
if (!SECURE) {
|
|
var wrap0 = document.getElementById('stops-near-wrap');
|
|
if (wrap0) wrap0.hidden = true;
|
|
return;
|
|
}
|
|
|
|
var btn = document.getElementById('near-me-btn');
|
|
var out = document.getElementById('near-me-result');
|
|
if (!btn || !out || !window.ATMap) return;
|
|
if (btn.dataset.nearBound === '1') return;
|
|
btn.dataset.nearBound = '1';
|
|
ATMap.nearMe(btn, out, { limit: 8 });
|
|
})();
|
|
</script>
|
|
<script src="./partials/busStop.search.js"></script>
|
|
<script src="./partials/busStop.init.js"></script>
|