Files
bus_sg_app/src/app.css
T

720 lines
11 KiB
CSS

@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;700&family=Chakra+Petch:wght@600;700&display=swap");
:root {
--bg-0: #f7f4ef;
--bg-1: #efe6d7;
--ink: #1e1b16;
--ink-soft: #5e5648;
--accent: #d25f1f;
--accent-dark: #923d0f;
--line: #cbbca2;
--ok: #1e7a3f;
--card: rgba(255, 251, 243, 0.8);
--shadow: 0 14px 30px rgba(54, 39, 12, 0.15);
}
* {
box-sizing: border-box;
}
body {
margin: 0;
font-family: "Space Grotesk", sans-serif;
color: var(--ink);
min-height: 100vh;
background: radial-gradient(circle at 15% 15%, #fff4dc 0%, transparent 35%),
radial-gradient(circle at 82% 0%, #ffd3b6 0%, transparent 32%),
linear-gradient(155deg, var(--bg-0), var(--bg-1));
overflow-x: hidden;
}
.bg-grid {
position: fixed;
inset: 0;
pointer-events: none;
opacity: 0.2;
background-image: linear-gradient(to right, #a88f63 1px, transparent 1px),
linear-gradient(to bottom, #a88f63 1px, transparent 1px);
background-size: 36px 36px;
}
.app-shell {
width: min(1100px, calc(100% - 2rem));
margin: 1.05rem auto 2.2rem;
position: relative;
z-index: 1;
}
.hero {
margin-bottom: 0.4rem;
animation: rise 420ms ease-out both;
}
.kicker {
margin: 0;
text-transform: uppercase;
letter-spacing: 0.17em;
font-size: 0.76rem;
color: var(--accent-dark);
}
h1,
h2,
h3 {
font-family: "Chakra Petch", sans-serif;
margin: 0;
}
h1 {
font-size: clamp(2rem, 7vw, 3.6rem);
line-height: 1;
margin-top: 0.5rem;
}
.subtitle {
max-width: 60ch;
color: var(--ink-soft);
margin: 0.25rem 0 0;
font-size: 0.93rem;
}
.panel {
background: var(--card);
border: 1px solid var(--line);
border-radius: 16px;
box-shadow: var(--shadow);
padding: 1rem;
margin-top: 1rem;
backdrop-filter: blur(4px);
animation: rise 520ms ease-out both;
}
.panel-header {
display: flex;
justify-content: space-between;
align-items: center;
gap: 0.7rem;
margin-bottom: 0.85rem;
}
.panel-header.compact {
margin-bottom: 0.65rem;
}
.map-title-row {
display: flex;
align-items: center;
gap: 0.5rem;
margin-bottom: 0.2rem;
}
.map-actions {
display: flex;
gap: 0.45rem;
align-items: center;
}
.arrivals-head-actions {
display: flex;
align-items: center;
gap: 0.45rem;
}
.sheet-grabber,
.mobile-sheet-toggle {
display: none;
}
.sheet-content {
display: block;
}
label {
display: flex;
flex-direction: column;
gap: 0.35rem;
font-size: 0.92rem;
}
input,
select,
button {
font: inherit;
}
input,
select {
border: 1px solid var(--line);
border-radius: 12px;
padding: 0.62rem 0.7rem;
background: #fffcf5;
}
input:focus,
select:focus {
outline: 2px solid #f5ac79;
outline-offset: 1px;
}
button {
border: 0;
border-radius: 12px;
padding: 0.6rem 0.9rem;
cursor: pointer;
transition: transform 140ms ease, filter 140ms ease;
}
button:hover {
transform: translateY(-1px);
filter: brightness(1.02);
}
.icon-btn {
display: inline-flex;
align-items: center;
justify-content: center;
width: 40px;
min-width: 40px;
height: 40px;
padding: 0;
}
.icon-btn svg {
display: block;
}
.spin {
animation: spin 900ms linear infinite;
}
.visually-hidden {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
white-space: nowrap;
}
.btn-accent {
color: #fff;
background: linear-gradient(135deg, #d25f1f, #a94411);
}
.btn-ghost {
background: #f2e7d0;
color: #3a3024;
}
.hint {
color: var(--ink-soft);
font-size: 0.86rem;
}
.location-head {
display: flex;
justify-content: space-between;
align-items: center;
gap: 0.7rem;
margin-bottom: 0.7rem;
}
.location-head .hint {
margin: 0;
}
.map-panel {
width: 100%;
height: 360px;
border: 1px solid var(--line);
border-radius: 14px;
overflow: hidden;
margin-bottom: 0.8rem;
}
.map-wrap {
position: relative;
margin-bottom: 0.8rem;
isolation: isolate;
}
.map-wrap .map-panel {
margin-bottom: 0;
position: relative;
z-index: 1;
}
.map-arrivals-overlay {
position: absolute;
right: 0.7rem;
bottom: 0.7rem;
z-index: 900;
width: min(320px, calc(100% - 1.4rem));
padding: 0.62rem 0.72rem;
background: rgba(31, 26, 19, 0.84);
color: #f8edd5;
border: 1px solid rgba(251, 219, 180, 0.35);
border-radius: 12px;
backdrop-filter: blur(4px);
box-shadow: 0 10px 20px rgba(17, 13, 9, 0.25);
}
.map-arrivals-overlay h3 {
font-size: 0.94rem;
margin-bottom: 0.2rem;
}
.map-overlay-stop {
margin: 0 0 0.45rem;
font-size: 0.78rem;
color: #e8cfab;
}
.map-arrivals-list {
margin: 0;
padding: 0;
list-style: none;
display: grid;
gap: 0.34rem;
}
.map-arrivals-list li {
display: grid;
grid-template-columns: auto auto;
justify-content: space-between;
gap: 0.15rem 0.6rem;
align-items: baseline;
font-size: 0.83rem;
}
.map-arrivals-list li strong {
color: #ffd79f;
}
.map-arrivals-list li small {
grid-column: 1 / -1;
color: #f1ddbe;
font-size: 0.74rem;
}
.map-overlay-empty {
margin: 0;
font-size: 0.8rem;
color: #ead8bb;
}
.map-overlay-fallback-list {
margin: 0.45rem 0 0;
padding: 0;
list-style: none;
display: grid;
gap: 0.3rem;
}
.map-overlay-fallback-list li {
display: flex;
justify-content: space-between;
align-items: center;
gap: 0.5rem;
font-size: 0.8rem;
}
.map-overlay-fallback-list li strong {
color: #ffd79f;
}
.map-hint {
margin: 0 0 0.55rem;
color: var(--ink-soft);
font-size: 0.86rem;
}
.stop-meta {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 0.7rem;
}
.meta-item {
background: #fff8ea;
border: 1px solid #d9c6a8;
border-radius: 12px;
padding: 0.65rem 0.75rem;
}
.meta-label {
display: block;
font-size: 0.75rem;
text-transform: uppercase;
letter-spacing: 0.08em;
color: #846950;
margin-bottom: 0.2rem;
}
.nearby-stops {
margin-top: 0.85rem;
}
.nearby-list {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 0.55rem;
}
.stop-choice {
display: flex;
justify-content: space-between;
align-items: center;
gap: 0.6rem;
text-align: left;
width: 100%;
border: 1px solid #d7c3a6;
background: #fff8ea;
color: #3f3325;
padding: 0.62rem 0.72rem;
min-height: 48px;
}
.stop-choice small {
color: #846950;
font-weight: 600;
white-space: nowrap;
}
.stop-choice.active {
border-color: #b14d14;
background: #ffe9d7;
box-shadow: inset 0 0 0 1px #d25f1f;
}
.arrivals-actions {
display: grid;
grid-template-columns: minmax(0, 1fr) auto;
gap: 0.7rem;
align-items: end;
margin-bottom: 0.8rem;
}
.status-pill {
font-size: 0.8rem;
padding: 0.28rem 0.55rem;
border-radius: 999px;
background: #efe8da;
color: #5f5140;
}
.status-pill.ok {
background: #d6f2df;
color: var(--ok);
}
.status-pill.error {
background: #f7dbd7;
color: #8f2424;
}
.arrival-board {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
gap: 0.7rem;
margin-bottom: 0.9rem;
}
.arrival-card {
border: 1px solid #d9c6a8;
background: #fff8ea;
border-radius: 14px;
padding: 0.8rem;
}
.arrival-card h4 {
margin: 0;
font-size: 1.15rem;
}
.arrival-card h3 {
margin: 0;
font-size: 1.15rem;
}
.arrival-line {
margin-top: 0.35rem;
font-size: 0.9rem;
color: #4b4134;
}
.response {
margin: 0;
background: #201d18;
color: #f5e9cf;
border-radius: 14px;
padding: 0.8rem;
min-height: 170px;
max-height: 420px;
overflow: auto;
font-size: 0.84rem;
line-height: 1.45;
}
.raw-response {
margin-top: 0.8rem;
}
.raw-response summary {
cursor: pointer;
color: #4d4032;
font-weight: 500;
margin-bottom: 0.5rem;
}
.hidden {
display: none;
}
@keyframes rise {
from {
opacity: 0;
transform: translateY(10px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
@media (max-width: 760px) {
body {
padding-bottom: 12.2rem;
}
.app-shell {
width: min(1100px, calc(100% - 1rem));
margin-top: 0.3rem;
margin-bottom: 1.2rem;
}
.hero {
margin-bottom: 0.1rem;
}
.kicker {
font-size: 0.66rem;
letter-spacing: 0.13em;
}
h1 {
font-size: clamp(1.3rem, 6.8vw, 1.75rem);
margin-top: 0.25rem;
}
.subtitle {
display: none;
}
.stop-meta,
.arrivals-actions,
.nearby-list {
grid-template-columns: 1fr;
}
.panel-header {
flex-wrap: wrap;
}
.map-actions {
width: 100%;
display: grid;
grid-template-columns: 1fr;
}
.map-title-row .map-actions {
width: auto;
display: flex;
grid-template-columns: none;
}
.location-head {
flex-direction: column;
align-items: flex-start;
}
.map-panel {
height: min(43vh, 290px);
}
.map-arrivals-overlay {
right: 0.5rem;
left: 0.5rem;
width: auto;
bottom: 0.5rem;
padding: 0.48rem 0.58rem;
}
.panel {
padding: 0.68rem;
margin-top: 0.58rem;
border-radius: 14px;
}
.hint,
.map-hint,
.meta-label {
font-size: 0.78rem;
}
.map-overlay-stop,
.map-overlay-empty,
.map-arrivals-list li,
.map-overlay-fallback-list li {
font-size: 0.74rem;
}
.meta-item {
padding: 0.5rem 0.58rem;
}
.stop-choice {
min-height: 42px;
padding: 0.5rem 0.58rem;
font-size: 0.83rem;
}
.arrivals-actions {
gap: 0.5rem;
margin-bottom: 0.55rem;
}
.arrival-board {
gap: 0.45rem;
margin-bottom: 0.55rem;
}
.arrival-card {
border-radius: 12px;
padding: 0.6rem;
}
.arrival-card h3 {
font-size: 1rem;
}
.arrival-line {
margin-top: 0.22rem;
font-size: 0.83rem;
}
.response {
min-height: 120px;
max-height: 260px;
font-size: 0.76rem;
padding: 0.62rem;
}
.arrivals-panel {
position: fixed;
left: 0.5rem;
right: 0.5rem;
bottom: 0.5rem;
z-index: 14;
margin-top: 0;
border-radius: 14px;
background: rgba(255, 251, 243, 0.96);
box-shadow: 0 16px 36px rgba(54, 39, 12, 0.22);
max-height: min(60vh, 420px);
overflow: hidden;
transition: transform 220ms ease, max-height 220ms ease;
}
.sheet-grabber {
display: flex;
width: 100%;
justify-content: center;
align-items: center;
background: transparent;
padding: 0.1rem 0 0.45rem;
min-height: 20px;
}
.sheet-grabber span {
width: 44px;
height: 5px;
border-radius: 999px;
background: #cfbaa0;
}
.mobile-sheet-toggle {
display: inline-flex;
align-items: center;
justify-content: center;
min-height: 34px;
border-radius: 10px;
background: #efe2ca;
color: #5a4734;
font-size: 0.83rem;
padding: 0.35rem 0.58rem;
}
.arrivals-panel .panel-header.compact {
margin-bottom: 0.45rem;
}
.arrivals-panel .sheet-content {
max-height: calc(min(60vh, 420px) - 78px);
overflow: auto;
padding-bottom: 0.15rem;
}
.arrivals-panel.sheet-collapsed {
max-height: 62px;
}
.arrivals-panel.sheet-collapsed .panel-header,
.arrivals-panel.sheet-collapsed .sheet-content {
opacity: 0;
pointer-events: none;
}
.arrivals-panel.sheet-collapsed .panel-header {
margin: 0;
min-height: 0;
}
.arrivals-panel.sheet-collapsed .sheet-grabber {
padding: 0.4rem 0;
}
.btn-accent,
.btn-ghost {
min-height: 38px;
padding: 0.48rem 0.65rem;
font-size: 0.86rem;
}
.icon-btn {
width: 38px;
min-width: 38px;
height: 38px;
padding: 0;
}
input,
select {
padding: 0.5rem 0.6rem;
font-size: 0.86rem;
}
}