Split the trip page into tabs and move the header into the navbar
Three deep-linkable tabs (#/trip/:id/:tab): Trip (countdown, calendar, map, summary), Money (costs + expenses side by side), Checklist. Panels stay mounted; switching toggles visibility and updates the URL via history.replaceState so an open day editor and the live tickers are undisturbed. The Leaflet map revalidates its size on every trip-tab activation but only auto-fits once, when its container first gains real size - later visits keep the user's pan/zoom. The full-width trip-header card is gone: the navbar now carries a compact identity (back link, truncated name, date/days/currency) plus a single overflow menu holding members, join code, edit (now a centered modal) and delete. Dead header CSS removed; new styles live in tabs.css.
This commit is contained in:
+1
-19
@@ -175,8 +175,6 @@ textarea.input { resize: vertical; }
|
||||
.trip-card-currency { margin-left: auto; font-weight: 700; font-size: 0.72rem; letter-spacing: 0.03em; color: var(--text-faint); }
|
||||
.join-form { display: flex; flex-direction: column; gap: 0.8rem; }
|
||||
|
||||
/* Join-code row on the trip header */
|
||||
.joincode-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding-top: 0.8rem; border-top: 1px solid var(--border); }
|
||||
.joincode-chip { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-weight: 700; letter-spacing: 0.08em; background: var(--brand-soft); color: var(--brand-dark); padding: 0.25rem 0.6rem; border-radius: var(--radius-sm); user-select: all; }
|
||||
|
||||
/* ---------- Trip list ---------- */
|
||||
@@ -211,22 +209,9 @@ textarea.input { resize: vertical; }
|
||||
.empty-state h3 { color: var(--text); }
|
||||
.error-box { text-align: center; padding: 2rem; color: var(--danger); display: flex; flex-direction: column; gap: 0.8rem; align-items: center; }
|
||||
|
||||
/* ---------- Trip header ---------- */
|
||||
.trip-header { display: flex; flex-direction: column; gap: 1rem; }
|
||||
.trip-header-top { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
|
||||
.back-link { font-size: 0.85rem; color: var(--brand); font-weight: 600; }
|
||||
.back-link:hover { text-decoration: underline; }
|
||||
.trip-title { margin-top: 0.3rem; }
|
||||
.trip-subtitle { margin-top: 0.2rem; }
|
||||
.trip-header-actions { display: flex; gap: 0.5rem; align-items: flex-start; }
|
||||
.members-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding-top: 0.8rem; border-top: 1px solid var(--border); }
|
||||
.members-label { font-size: 0.82rem; font-weight: 600; color: var(--text-muted); }
|
||||
.member-chip { display: inline-flex; align-items: center; gap: 0.4rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 0.25rem 0.6rem 0.25rem 0.3rem; font-size: 0.85rem; font-weight: 600; }
|
||||
.member-owner { background: #fffbeb; border-color: #fde68a; }
|
||||
/* ---------- Trip menu dropdown (nav-bar trip identity, see tabs.css) ---------- */
|
||||
.member-remove { border: none; background: none; cursor: pointer; color: var(--text-faint); font-size: 1rem; line-height: 1; padding: 0; }
|
||||
.member-remove:hover { color: var(--danger); }
|
||||
.invite-form { display: flex; gap: 0.4rem; margin-left: auto; }
|
||||
.invite-form .input { width: 180px; }
|
||||
.trip-edit { display: flex; flex-direction: column; gap: 0.8rem; padding-top: 0.9rem; border-top: 1px solid var(--border); }
|
||||
|
||||
/* ---------- Calendar ---------- */
|
||||
@@ -484,9 +469,6 @@ textarea.input { resize: vertical; }
|
||||
.cal-chip .chip-text { display: none; }
|
||||
.cal-chip { justify-content: center; }
|
||||
.stat-grid { grid-template-columns: repeat(3, 1fr); }
|
||||
.invite-form { margin-left: 0; width: 100%; }
|
||||
.invite-form .input { flex: 1; width: auto; }
|
||||
.trip-header-actions { width: 100%; }
|
||||
}
|
||||
@media (max-width: 480px) {
|
||||
.calendar { gap: 3px; }
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
/* Trip page tabs + compact nav header. Split out of styles.css — which is at
|
||||
its 500-line cap — following the same per-feature stylesheet convention as
|
||||
flipclock.css/checklist.css/expenses.css. Reuses the shared palette and
|
||||
existing vocabulary (.card, .btn, .icon-btn, .field, .form-row,
|
||||
.form-actions, .form-error, .slideover-head, .overlay, .overlay-center,
|
||||
.modal, .member-avatar, .member-remove, .role-badge, .joincode-chip)
|
||||
rather than re-declaring it. */
|
||||
|
||||
/* ---------- Nav trip-identity slot ---------- */
|
||||
.nav-trip-slot { display: flex; align-items: center; gap: 0.7rem; flex: 1; min-width: 0; margin: 0 1rem; }
|
||||
.nav-trip-slot:empty { display: none; margin: 0; }
|
||||
.nav-trip-back { flex-shrink: 0; font-size: 1.1rem; font-weight: 700; color: var(--brand); }
|
||||
.nav-trip-back:hover { text-decoration: underline; }
|
||||
.nav-trip-id { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
|
||||
.nav-trip-name { font-weight: 700; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
||||
.nav-trip-sub { font-size: 0.76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
||||
|
||||
.nav-trip-menu { position: relative; flex-shrink: 0; }
|
||||
.nav-trip-menu-btn { font-size: 1.15rem; }
|
||||
|
||||
.trip-menu-dropdown {
|
||||
position: absolute; top: calc(100% + 0.5rem); right: 0; z-index: 30;
|
||||
width: min(300px, 90vw); max-height: 70vh; overflow-y: auto;
|
||||
display: none; flex-direction: column; gap: 0.7rem;
|
||||
background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
|
||||
box-shadow: var(--shadow-lg); padding: 0.85rem; animation: fade 0.12s ease;
|
||||
}
|
||||
.trip-menu-dropdown.open { display: flex; }
|
||||
.trip-menu-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); margin-bottom: 0.35rem; }
|
||||
.trip-menu-members { display: flex; flex-direction: column; gap: 0.4rem; max-height: 200px; overflow-y: auto; }
|
||||
.trip-menu-member { display: flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; }
|
||||
.trip-menu-member-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.trip-menu-joincode { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; padding-top: 0.6rem; border-top: 1px solid var(--border); }
|
||||
.trip-menu-actions { display: flex; flex-direction: column; gap: 0.4rem; padding-top: 0.6rem; border-top: 1px solid var(--border); }
|
||||
.trip-menu-actions .btn { justify-content: flex-start; }
|
||||
|
||||
/* Edit-trip modal reuses .trip-edit's field layout but not its old header-card
|
||||
top border/spacing (it now opens directly under the modal's own heading). */
|
||||
.modal .trip-edit { padding-top: 0; border-top: none; }
|
||||
|
||||
/* ---------- Tab bar ---------- */
|
||||
.tab-bar { display: inline-flex; gap: 0.3rem; padding: 0.3rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
|
||||
.tab-btn { display: flex; align-items: center; gap: 0.4rem; border: none; background: none; padding: 0.5rem 0.9rem; border-radius: var(--radius-sm); cursor: pointer; font-weight: 600; font-size: 0.9rem; color: var(--text-muted); }
|
||||
.tab-btn:hover { color: var(--text); }
|
||||
.tab-btn.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
|
||||
.tab-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
|
||||
.tab-icon { font-size: 1rem; }
|
||||
.tab-panel[hidden] { display: none; }
|
||||
|
||||
/* ---------- Money tab (Costs + Expenses side by side) ---------- */
|
||||
.money-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; align-items: start; }
|
||||
|
||||
/* ---------- Checklist tab (single card, comfortable reading width) ---------- */
|
||||
.checklist-wrap { max-width: 720px; margin: 0 auto; }
|
||||
|
||||
@media (max-width: 900px) {
|
||||
.money-grid { grid-template-columns: 1fr; }
|
||||
}
|
||||
@media (max-width: 640px) {
|
||||
.nav-trip-sub { display: none; }
|
||||
.nav-trip-slot { gap: 0.4rem; margin: 0 0.5rem; }
|
||||
}
|
||||
@media (max-width: 480px) {
|
||||
.tab-label { display: none; }
|
||||
.tab-btn { padding: 0.5rem 0.65rem; }
|
||||
}
|
||||
Reference in New Issue
Block a user