Files
web-at-transit-mock/ui/_shared.css
T
Bkk1234 eabcff197c navbar: rebuild mock header from the Next implementation (source of truth)
- markup: lang + theme moved into .mu-topbar-tools (theme first, then lang),
  same order as web-at-transit: brand, nav, menu, tools, CTA
- CSS: replaced mock's .mu-lang-*/.mu-theme-* buttons with the Next rules
  (.mu-pop / .mu-pop-btn / .mu-pop-btn-lang / .mu-pop-panel / .mu-pop-item,
  40px tall, radius 8px, surface bg, 44px on coarse pointers)
- lang button keeps short label + 12px chevron; menu items use
  .mu-pop-item-th/.mu-pop-item-en and data-active for the selected row
- nav 0.95rem (was .92rem), header border -> var(--c-border)
- theme.js was never included in the shell (regex missed the versioned src) —
  added after i18n.js + precached with theme.css; that was why the theme menu
  did not open in the previous build
- VERSION 2026.09.27.120
2026-11-04 01:37:50 +07:00

681 lines
19 KiB
CSS
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/* =========================================================
Atroute shared polish — applied to all mockup pages
Loaded AFTER main-theme.css, BEFORE per-page <style>.
========================================================= */
/* ---------- Brand logo ---------- */
.mu-logo-img {
width: 44px;
height: 44px;
border-radius: 12px;
object-fit: cover;
box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
}
/* ---------- Universal "cover" card pattern ---------- */
/* A card whose top region is a 16:10 image hero with a soft
gradient overlay and a label sitting on top. Used by route
cards (index) and stop cards (busStop) so duplicate stock
photos no longer look bolted on. */
.mu-cover {
position: relative;
aspect-ratio: 16 / 10;
background: linear-gradient(135deg, #eef1ff 0%, #f7f0ff 100%);
overflow: hidden;
}
.mu-cover > img {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
object-fit: cover;
transition: transform .45s ease;
}
.mu-card:hover .mu-cover > img,
.mu-cover-card:hover .mu-cover > img {
transform: scale(1.06);
}
.mu-cover::after {
content: "";
position: absolute;
inset: 0;
background:
linear-gradient(180deg, rgba(15, 23, 42, 0) 30%, rgba(15, 23, 42, .72) 100%);
pointer-events: none;
}
.mu-cover-tag {
position: absolute;
top: 12px;
left: 12px;
z-index: 1;
display: inline-flex;
align-items: center;
gap: 6px;
padding: 5px 10px;
border-radius: 999px;
font-size: .72rem;
font-weight: 800;
letter-spacing: .02em;
background: var(--c-glass);
color: var(--c-ink);
backdrop-filter: blur(8px);
box-shadow: 0 4px 10px rgba(15, 23, 42, .15);
}
.mu-cover-title {
position: absolute;
left: 14px;
right: 14px;
bottom: 12px;
z-index: 1;
margin: 0;
color: #fff;
font-size: 1.05rem;
font-weight: 800;
line-height: 1.25;
text-shadow: 0 2px 6px rgba(0, 0, 0, .45);
}
.mu-cover-title small {
display: block;
font-weight: 500;
font-size: .78rem;
opacity: .92;
margin-top: 2px;
}
.mu-cover.no-photo {
background:
radial-gradient(circle at 20% 20%, rgba(255, 255, 255, .35), transparent 55%),
linear-gradient(135deg, #7a4cc0 0%, #3071b8 100%);
}
.mu-cover.no-photo::after {
background: linear-gradient(180deg, rgba(15, 23, 42, 0) 40%, rgba(15, 23, 42, .35) 100%);
}
.mu-cover.tone-purple { background: linear-gradient(135deg, #7a4cc0, #c084fc); }
.mu-cover.tone-sky { background: linear-gradient(135deg, #3071b8, #60a5fa); }
.mu-cover.tone-pink { background: linear-gradient(135deg, #bb3a78, #f472b6); }
.mu-cover.tone-mint { background: linear-gradient(135deg, #1f8765, #34d399); }
.mu-cover.tone-amber { background: linear-gradient(135deg, #c47b1d, #fbbf24); }
/* ---------- Index route cards (rebuilt) ---------- */
.mu-card {
overflow: hidden;
transition: transform .18s ease, box-shadow .18s ease;
}
.mu-card:hover {
transform: translateY(-3px);
box-shadow: 0 18px 36px rgba(15, 23, 42, .14);
}
.mu-card-head {
position: relative;
height: auto;
aspect-ratio: 16 / 10;
overflow: hidden;
}
.mu-card-head .mu-card-photo {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
object-fit: cover;
transition: transform .45s ease;
}
.mu-card:hover .mu-card-photo { transform: scale(1.06); }
.mu-card-head::after {
content: "";
position: absolute;
inset: 0;
background: linear-gradient(180deg, rgba(15, 23, 42, 0) 30%, rgba(15, 23, 42, .72) 100%);
}
.mu-card-head .mu-route-number {
position: absolute;
left: 14px;
bottom: 12px;
margin: 0;
color: #fff;
font-weight: 900;
font-size: 32px;
letter-spacing: .02em;
text-shadow: 0 2px 8px rgba(0, 0, 0, .45);
z-index: 1;
}
.mu-card-head .mu-route-kind {
position: absolute;
top: 12px;
left: 12px;
z-index: 1;
padding: 4px 10px;
border-radius: 999px;
font-size: .7rem;
font-weight: 700;
background: var(--c-glass);
color: var(--c-ink);
backdrop-filter: blur(6px);
box-shadow: 0 4px 10px rgba(15, 23, 42, .14);
}
.mu-card-head.no-photo {
background:
radial-gradient(circle at 20% 20%, rgba(255, 255, 255, .25), transparent 55%),
linear-gradient(135deg, #7a4cc0 0%, #3071b8 100%);
}
.mu-card-head.no-photo.bg-purple { background: linear-gradient(135deg, #7a4cc0, #c084fc); }
.mu-card-head.no-photo.bg-sky { background: linear-gradient(135deg, #3071b8, #60a5fa); }
.mu-card-head.no-photo.bg-pink { background: linear-gradient(135deg, #bb3a78, #f472b6); }
.mu-card-head.no-photo.bg-mint { background: linear-gradient(135deg, #1f8765, #34d399); }
/* ---------- BusStop: integrated stop cards (no more
disjoint thumbnails) ---------- */
.mu-stop-grid li.mu-stop-cell {
list-style: none;
border-radius: 18px;
overflow: hidden;
box-shadow: 0 10px 24px rgba(63, 43, 94, .08);
border: 1px solid rgba(231, 224, 246, .95);
background: var(--c-surface);
display: flex;
flex-direction: column;
transition: transform .18s ease, box-shadow .18s ease;
}
.mu-stop-grid li.mu-stop-cell:hover {
transform: translateY(-3px);
box-shadow: 0 18px 36px rgba(63, 43, 94, .14);
}
.mu-stop-cell .mu-stop-card {
padding: 16px 18px 18px;
flex: 1;
display: flex;
flex-direction: column;
gap: 12px;
background: transparent;
}
/* ---------- Rich shared footer ---------- */
.mu-site-footer {
margin-top: 34px;
background:
radial-gradient(circle at 0% 0%, rgba(122, 76, 192, .35), transparent 35%),
radial-gradient(circle at 100% 10%, rgba(48, 113, 184, .35), transparent 35%),
linear-gradient(180deg, #1a1830 0%, #0f1126 100%);
color: #cfd5ec;
padding: 34px 0 0;
}
.mu-site-footer .mu-container {
max-width: 1200px;
margin: 0 auto;
padding: 0 24px;
}
.mu-footer-grid {
display: grid;
grid-template-columns: 1.4fr 1fr 1fr 1.1fr;
gap: 20px;
}
.mu-footer-brand {
display: flex;
flex-direction: column;
gap: 10px;
}
.mu-footer-brand-row {
display: flex;
align-items: center;
gap: 12px;
}
.mu-footer-brand-row img {
width: 48px;
height: 48px;
border-radius: 12px;
background: var(--c-surface);
padding: 4px;
object-fit: contain;
}
.mu-footer-brand-row strong {
display: block;
color: #fff;
font-size: 1.05rem;
font-weight: 800;
letter-spacing: .01em;
}
.mu-footer-brand-row span {
display: block;
color: #9aa3c3;
font-size: .82rem;
margin-top: 2px;
}
.mu-footer-brand p.about {
margin: 0;
color: #b6bdda;
font-size: .88rem;
line-height: 1.6;
}
.mu-footer-col h4 {
margin: 0 0 10px;
color: #fff;
font-size: .9rem;
font-weight: 800;
letter-spacing: .03em;
text-transform: uppercase;
}
.mu-footer-col ul {
list-style: none;
padding: 0;
margin: 0;
display: flex;
flex-direction: column;
gap: 3px;
}
.mu-footer-col ul a {
color: #cfd5ec;
text-decoration: none;
font-size: .9rem;
line-height: 1.5;
transition: color .15s ease;
display: inline-flex;
align-items: center;
gap: 8px;
}
.mu-footer-col ul a:hover { color: #fff; }
.mu-footer-col ul a::before {
content: "›";
color: var(--c-brand-ink);
font-weight: 800;
}
.mu-footer-contact a,
.mu-footer-contact span {
display: inline-flex;
align-items: center;
gap: 8px;
color: #cfd5ec;
text-decoration: none;
font-size: .88rem;
}
.mu-footer-contact .row { margin-bottom: 4px; }
/* ---------- Sponsor strip inside footer ---------- */
.mu-footer-sponsors {
margin-top: 22px;
padding-top: 16px;
border-top: 1px solid rgba(255, 255, 255, .08);
}
.mu-footer-sponsors h4 {
margin: 0 0 6px;
color: #fff;
font-size: .95rem;
font-weight: 800;
}
.mu-footer-sponsors p.lead {
margin: 0 0 18px;
color: #9aa3c3;
font-size: .85rem;
line-height: 1.5;
}
.mu-sponsor-strip {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
gap: 12px;
}
.mu-sponsor-tile {
background: var(--c-surface);
border-radius: 12px;
padding: 14px;
display: flex;
align-items: center;
justify-content: center;
aspect-ratio: 5 / 3;
transition: transform .15s ease, box-shadow .15s ease;
border: 1px solid rgba(255, 255, 255, .04);
}
.mu-sponsor-tile:hover {
transform: translateY(-3px);
box-shadow: 0 12px 24px rgba(0, 0, 0, .35);
}
.mu-sponsor-tile img {
max-width: 84%;
max-height: 70%;
object-fit: contain;
filter: grayscale(.1);
transition: filter .2s ease;
}
.mu-sponsor-tile:hover img { filter: grayscale(0); }
/* ---------- Footer bottom bar ---------- */
.mu-footer-bottom {
margin-top: 20px;
padding: 12px 0 14px;
border-top: 1px solid rgba(255, 255, 255, .08);
text-align: center;
}
.mu-footer-bottom p {
margin: 0;
color: #8d96b8;
font-size: .82rem;
letter-spacing: .02em;
}
.mu-footer-bottom .pill {
display: inline-block;
margin-left: 10px;
padding: 2px 10px;
border-radius: 999px;
background: rgba(122, 76, 192, .25);
color: #d8c7ff;
font-size: .72rem;
font-weight: 700;
}
/* Hide legacy thin footer when shared rich footer is present */
body:has(.mu-site-footer) .mu-footer { display: none; }
@media (max-width: 980px) {
.mu-footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
.mu-footer-grid { grid-template-columns: 1fr; }
.mu-site-footer { padding: 28px 0 0; }
}
/* =========================================================
Icon system — Lucide (MIT) — ใช้ <svg class="ic"><use href="#ic-NAME"/></svg>
sprite: partials/icons-sprite.svg | credit: ui/credits.html
========================================================= */
.ic {
width: 1em;
height: 1em;
display: inline-block;
vertical-align: -0.125em;
fill: none;
stroke: currentColor;
stroke-width: 2;
stroke-linecap: round;
stroke-linejoin: round;
flex-shrink: 0;
}
.ic--lg { width: 1.4em; height: 1.4em; }
/* ---------- Search field (input + icon ข้างหน้า) ---------- */
.mu-search-field {
position: relative;
display: flex;
align-items: center;
flex: 1;
min-width: 220px;
}
.mu-search-field .ic {
position: absolute;
left: 12px;
color: var(--c-ink-2);
pointer-events: none;
}
.mu-search-field input {
width: 100%;
padding: 10px 12px 10px 38px;
}
/* ============================================================
ปุ่มเครื่องมือในแถบนำทาง — พอร์ตจาก web-at-transit (ต้นทางความจริง)
ธีม 1 ปุ่ม · ภาษา 1 ปุ่ม · แต่ละปุ่มมีเมนูของตัวเอง
radius 8px · สูง 40px (44px บนจอสัมผัส)
============================================================ */
.mu-topbar-tools {
display: flex;
align-items: center;
gap: 8px; /* WCAG 2.5.8 — เว้นระหว่างเป้ากด ≥ 8px */
flex-shrink: 0;
}
.mu-pop { position: relative; display: inline-flex; }
.mu-pop-btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 4px;
min-width: 40px;
height: 40px;
padding: 0 8px;
border: 1px solid var(--c-border);
border-radius: var(--radius);
background: var(--c-surface);
color: var(--c-brand-ink);
font-family: inherit;
font-size: .78rem;
font-weight: 700;
line-height: 1;
cursor: pointer;
transition: border-color .15s ease, background .15s ease;
}
.mu-pop-btn-lang { min-width: 56px; padding: 0 10px; }
.mu-pop-btn:hover { border-color: #d8c9f2; background: var(--c-surface-2); }
.mu-pop-btn:active { transform: translateY(1px); }
.mu-pop-btn:focus-visible {
outline: 2px solid var(--c-focus);
outline-offset: 2px;
}
.mu-pop-btn[aria-expanded="true"] {
border-color: var(--c-brand-ink);
background: var(--c-surface-2);
}
.mu-pop-btn .ic { width: 18px; height: 18px; }
/* เมนูที่กางออก */
.mu-pop-panel {
position: absolute;
top: calc(100% + 6px);
right: 0;
z-index: 1200;
min-width: 168px;
padding: 6px;
border: 1px solid var(--c-border);
border-radius: var(--radius);
background: var(--c-surface);
box-shadow: 0 10px 24px var(--c-shadow);
}
.mu-pop-panel[hidden] { display: none; }
.mu-pop-item {
display: flex;
align-items: center;
gap: 8px;
width: 100%;
min-height: 40px;
padding: 8px 10px;
border: 0;
border-radius: var(--radius-sm);
background: transparent;
color: var(--c-ink);
font-family: inherit;
font-size: .85rem;
font-weight: 600;
text-align: start;
cursor: pointer;
}
.mu-pop-item:hover { background: var(--c-surface-2); }
.mu-pop-item:focus-visible {
outline: 2px solid var(--c-focus);
outline-offset: -2px;
}
.mu-pop-item[data-active="1"] {
background: var(--c-tint-purple);
color: var(--c-brand-ink);
font-weight: 700;
}
.mu-pop-item-th { flex: 1 1 auto; }
.mu-pop-item-en {
flex: 0 0 auto;
font-size: .72rem;
font-weight: 600;
color: var(--c-ink-2);
letter-spacing: .04em;
}
.mu-pop-item[data-active="1"] .mu-pop-item-en { color: var(--c-brand-ink); }
@media (pointer: coarse) {
.mu-pop-btn { min-width: 44px; height: 44px; }
.mu-pop-btn-lang { min-width: 60px; }
}
/* ============================================================
ปุ่ม + ฟอร์มคอนโทรล (shared — ทุกหน้าใช้ร่วมกัน)
.mu-btn อยู่ที่นี่ (ไม่ใช่ใน partial) → หน้าไหนก็ได้สไตล์เดียวกัน
============================================================ */
.mu-btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 6px;
min-height: 44px;
padding: 10px 18px;
border-radius: 8px;
font-family: inherit;
font-weight: 700;
font-size: .85rem;
line-height: 1;
text-decoration: none;
border: 1px solid transparent;
cursor: pointer;
transition: box-shadow .15s ease, transform .1s ease, background .15s ease, border-color .15s ease;
}
.mu-btn:active { transform: translateY(1px); }
.mu-btn.primary {
background: linear-gradient(135deg, #a855f7, #7c3aed);
color: #fff;
box-shadow: 0 8px 18px rgba(124, 58, 237, .25);
}
.mu-btn.primary:hover { box-shadow: 0 10px 22px rgba(124, 58, 237, .35); }
.mu-btn.ghost {
background: var(--c-surface);
border-color: var(--c-border);
color: var(--c-brand-ink);
box-shadow: 0 2px 8px rgba(63, 43, 94, .05);
}
.mu-btn.ghost:hover { border-color: #d8c9f2; background: var(--c-surface-2); }
/* select แบบโมเดิร์น — custom chevron แทนลูกศร native (prefix #view ชนะ partial style) */
#view .mu-toolbar select {
appearance: none;
-webkit-appearance: none;
background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237a4cc0' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"), linear-gradient(180deg, var(--c-surface), #f8fbff);
background-repeat: no-repeat;
background-position: right 12px center;
padding-right: 38px;
cursor: pointer;
}
#view .mu-toolbar select:hover { border-color: #c8b4ec; }
#view .mu-toolbar input:hover { border-color: #c8b4ec; }
/* focus ring อันเดียวกันทั้งฟอร์ม — มองเห็นชัดตอน tab (a11y) */
#view .mu-toolbar input:focus-visible,
#view .mu-toolbar select:focus-visible,
#view .mu-toolbar .mu-btn:focus-visible {
outline: 2px solid #7a4cc0;
outline-offset: 2px;
}
/* =========================================================
Toast แจ้งอัปเดตเวอร์ชันใหม่ (inject จาก ui/pwa.js)
========================================================= */
.mu-update-toast {
position: fixed;
left: 50%;
bottom: calc(20px + env(safe-area-inset-bottom, 0px));
z-index: 1300;
display: inline-flex;
align-items: center;
gap: 10px;
max-width: calc(100vw - 32px);
padding: 10px 16px;
border-radius: 999px;
background: #1f2a44;
color: #fff;
font-size: .82rem;
font-weight: 600;
line-height: 1.35;
box-shadow: 0 10px 24px rgba(15, 23, 42, .22);
transform: translate(-50%, 12px);
opacity: 0;
pointer-events: none;
transition: opacity .25s ease, transform .25s ease;
}
.mu-update-toast.is-in { opacity: 1; transform: translate(-50%, 0); }
.mu-update-dot {
width: 8px;
height: 8px;
border-radius: 50%;
background: #b694f6;
flex: none;
animation: muUpdatePulse 1.1s ease-in-out infinite;
}
@keyframes muUpdatePulse {
0%, 100% { opacity: .35; transform: scale(.85); }
50% { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
.mu-update-toast { transition: none; }
.mu-update-dot { animation: none; }
}
/* =========================================================
Motion — อนิเมชันร่วมทุกหน้า (ไฟล์ JS: ui/motion.js)
---------------------------------------------------------
โทเคนเดียวทั้งเว็บ: ระยะ/ความเร็ว/เส้นโค้ง อยู่ที่นี่ที่เดียว
· --mu-ease = deceleration (เข้าช้า ออกเร็ว ตาม MD motion)
· 420ms = เข้าหน้า · 520ms = reveal · 45ms = ระยะเหลื่อมต่อชิ้น
ปิดทั้งชุดเมื่อผู้ใช้ตั้ง prefers-reduced-motion: reduce
========================================================= */
:root {
--mu-ease: cubic-bezier(.22, .61, .36, 1);
}
/* ---------- แถบโหลดบาง ๆ บนสุด (ระหว่าง fetch partial) ---------- */
.mu-loadbar {
position: fixed;
top: 0;
left: 0;
right: 0;
height: 3px;
z-index: 1200; /* เหนือ topbar (1100) แต่ใต้ vreset (3000) */
pointer-events: none;
opacity: 0;
transition: opacity .25s ease; /* ออกเร็วกว่าเข้า (60–70%) */
}
.mu-loadbar.is-on { opacity: 1; }
.mu-loadbar-fill {
height: 100%;
width: 100%;
transform: scaleX(0);
transform-origin: 0 50%;
border-radius: 0 2px 2px 0;
background: linear-gradient(90deg, #7a4cc0, #b694f6);
box-shadow: 0 0 8px rgba(122, 76, 192, .45);
}
@media (prefers-reduced-motion: no-preference) {
/* ---------- เข้าหน้าใหม่: จาง + เลื่อนขึ้นเล็กน้อย ---------- */
#view.mu-view-in {
animation: muViewIn .42s var(--mu-ease) both;
}
@keyframes muViewIn {
from { opacity: 0; transform: translate3d(0, 10px, 0); }
to { opacity: 1; transform: none; }
}
/* ---------- เลื่อนแล้วค่อยโผล่ ---------- */
/* JS ใส่ .mu-reveal เฉพาะของที่ยังไม่เห็นบนจอ → ไม่มีอะไรกะพริบตอนโหลด
ใช้เฉพาะ opacity + transform = ไม่ดันเลย์เอาต์ (CLS 0) */
.mu-reveal {
opacity: 0;
transform: translate3d(0, 18px, 0);
transition:
opacity .52s var(--mu-ease),
transform .52s var(--mu-ease);
transition-delay: var(--mu-d, 0ms);
}
.mu-reveal.is-in {
opacity: 1;
transform: none;
}
}
/* ลดการเคลื่อนไหว: ไม่มีอนิเมชัน แต่เนื้อหาต้องอ่านได้ทันที */
@media (prefers-reduced-motion: reduce) {
#view.mu-view-in { animation: none; }
.mu-reveal { opacity: 1; transform: none; transition: none; }
.mu-loadbar { display: none; }
}