Refactor code structure for improved readability and maintainability

This commit is contained in:
phattaranun.a committed 2026-08-22 17:29:38 +07:00
1 parent db4bbcf9ae
commit 7bf06e6f88
57 files changed

No files matched your search

+368
View File
@@ -0,0 +1,368 @@
/* =========================================================
AT Transit 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: rgba(255, 255, 255, .92);
color: #1f2a44;
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: rgba(255, 255, 255, .92);
color: #1f2a44;
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: #fff;
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: 48px;
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: 48px 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: 28px;
}
.mu-footer-brand {
display: flex;
flex-direction: column;
gap: 12px;
}
.mu-footer-brand-row {
display: flex;
align-items: center;
gap: 12px;
}
.mu-footer-brand-row img {
width: 48px;
height: 48px;
border-radius: 12px;
background: #fff;
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 14px;
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: 8px;
}
.mu-footer-col ul a {
color: #cfd5ec;
text-decoration: none;
font-size: .9rem;
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: #7a4cc0;
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: 8px; }
/* ---------- Sponsor strip inside footer ---------- */
.mu-footer-sponsors {
margin-top: 36px;
padding-top: 28px;
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;
}
.mu-sponsor-strip {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
gap: 12px;
}
.mu-sponsor-tile {
background: #fff;
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: 36px;
padding: 18px 0 22px;
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: 36px 0 0; }
}