451 lines
18 KiB
HTML
451 lines
18 KiB
HTML
<style>
|
|
.mu-page {
|
|
background:
|
|
linear-gradient(180deg, #ffffff 0%, #faf7ff 55%, #f4f0fd 100%);
|
|
}
|
|
|
|
.mu-hero-panel {
|
|
background: linear-gradient(135deg, #ffffff 0%, #f7f2ff 60%, #efe6ff 100%);
|
|
border: 1px solid #e7e0f6;
|
|
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: #1f2a44; }
|
|
.mu-hero-subtitle { margin: 8px 0 0; color: #66728f; 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:#6b5b8a; font-size:.76rem; font-weight:700; letter-spacing:.03em; text-transform: uppercase; }
|
|
.mu-kpi .value { margin:4px 0 0; color:#2b1f4d; font-size:1.03rem; font-weight:800; font-variant-numeric: tabular-nums; }
|
|
.mu-hero-map {
|
|
border: 1px solid #e7e0f6;
|
|
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:#2c3e50; }
|
|
.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:#66728f;
|
|
font-weight:700;
|
|
text-align:center;
|
|
padding: 18px;
|
|
}
|
|
|
|
/* ===== Search toolbar: 2 โหมด ===== */
|
|
.mu-toolbar {
|
|
background: linear-gradient(135deg, #f0e7fc, #e6d8f8);
|
|
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: .88rem;
|
|
font-weight: 700;
|
|
padding: 10px 18px;
|
|
border: none;
|
|
border-right: 1px solid #d5c3f0;
|
|
background: #fff;
|
|
color: #5b3b71;
|
|
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: #fff;
|
|
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: #1f2a44;
|
|
padding: 12px 0;
|
|
}
|
|
.mu-search-field input::placeholder { color: #6f7b95; 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: #1f2a44;
|
|
background: #fff;
|
|
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: #faf7ff;
|
|
}
|
|
.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: #7a4cc0;
|
|
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: #6d28d9;
|
|
font-variant-numeric: tabular-nums;
|
|
}
|
|
.mu-search-hint { margin: 8px 0 0; font-size: .82rem; color: #6f7b95; }
|
|
|
|
/* 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: #fff;
|
|
color: #1f2a44;
|
|
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: #fff;
|
|
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: #fff;
|
|
font-family: inherit;
|
|
font-size: .9rem;
|
|
text-align: left;
|
|
cursor: pointer;
|
|
color: #1f2a44;
|
|
}
|
|
.mu-suggest-item:last-child { border-bottom: none; }
|
|
.mu-suggest-item:hover { background: #faf7ff; }
|
|
.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-toolbar-count { margin: 10px 0 0; font-size: .84rem; color: #6f7b95; }
|
|
.mu-toolbar-count b { color: #7a4cc0; font-variant-numeric: tabular-nums; }
|
|
|
|
/* ===== การ์ดป้าย ===== */
|
|
.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 #e7e0f6;
|
|
background: #fff;
|
|
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: #fff;
|
|
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: #6d28d9; }
|
|
.mu-stop-title { margin:6px 0 0; font-size:1.05rem; line-height:1.3; color:#1f2a44; }
|
|
.mu-loc { color:#6f7b95; 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: #faf7ff;
|
|
border: 1px solid #e7e0f6;
|
|
color:#5b3b71;
|
|
font-size:.8rem;
|
|
font-weight:700;
|
|
}
|
|
.mu-chip.route { background: #f3ecff; color:#6d28d9; border-color: #e0d6f5; }
|
|
/* รหัสป้าย = ม่วง-ขาว แบบเดียวกับป้ายสายรถ */
|
|
.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:#6f7b95; font-size:.8rem; margin:0; }
|
|
|
|
.mu-stop-thumb {
|
|
display: block;
|
|
width: 100%;
|
|
height: 180px;
|
|
object-fit: cover;
|
|
background: #f7f9fd;
|
|
border-bottom: 1px solid #e7e0f6;
|
|
}
|
|
/* รูป 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: #6f7b95;
|
|
border: 1px dashed #e0d6f5;
|
|
border-radius: 8px;
|
|
background: #fff;
|
|
}
|
|
|
|
@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" 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="รูปแบบการค้นหา">
|
|
<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>
|
|
</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" placeholder="0">
|
|
<input class="mu-code-cell" type="text" inputmode="numeric" maxlength="1"
|
|
autocomplete="off" aria-label="หลักที่ 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" placeholder="0">
|
|
<input class="mu-code-cell" type="text" inputmode="numeric" maxlength="1"
|
|
autocomplete="off" aria-label="หลักที่ 4" placeholder="0">
|
|
<input class="mu-code-cell" type="text" inputmode="numeric" maxlength="1"
|
|
autocomplete="off" aria-label="หลักที่ 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 class="mu-numpad" id="stops-numpad">
|
|
<button type="button" data-key="1">1</button>
|
|
<button type="button" data-key="2">2</button>
|
|
<button type="button" data-key="3">3</button>
|
|
<button type="button" data-key="4">4</button>
|
|
<button type="button" data-key="5">5</button>
|
|
<button type="button" data-key="6">6</button>
|
|
<button type="button" data-key="7">7</button>
|
|
<button type="button" data-key="8">8</button>
|
|
<button type="button" data-key="9">9</button>
|
|
<button type="button" data-key="0">0</button>
|
|
<button type="button" data-key="back"><span data-i18n="stops.padDelete">ลบ</span></button>
|
|
</div>
|
|
</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>
|
|
|
|
<div class="mu-toolbar-actions">
|
|
<button type="button" class="mu-btn primary" id="stops-search-btn"><span data-i18n="common.search">ค้นหา</span></button>
|
|
<button type="button" class="mu-btn ghost" 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>
|
|
</main>
|
|
|
|
<script src="./partials/busStop.search.js"></script>
|
|
<script src="./partials/busStop.init.js"></script>
|