fix: UI tweaks — grid gutters, default switching, badge position, contrast, padding, disclaimer

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-11-02 19:05:19 -05:00
parent 0ab17fe6e0
commit c45aa8371e
4 changed files with 69 additions and 32 deletions

View File

@@ -64,13 +64,14 @@ export function renderAgenda(shows: Show[], prefs: Preferences): string {
html += `<div class="agenda-entry${liveClass}" style="border-left-color:${show.accentColor}; --show-accent:${show.accentColor}">`; html += `<div class="agenda-entry${liveClass}" style="border-left-color:${show.accentColor}; --show-accent:${show.accentColor}">`;
html += `<a href="${href}" class="agenda-entry__link">`; html += `<a href="${href}" class="agenda-entry__link">`;
html += `<span class="agenda-entry__time">${startDisplay} – ${endDisplay}</span>`; html += `<span class="agenda-entry__time">${startDisplay} – ${endDisplay}</span>`;
html += `<span class="agenda-entry__name">${escapeHtml(show.name)}</span>`; const agendaExtras: string[] = [];
if (prefs.mode === "all" && show.isVcr) { if (prefs.mode === "all" && show.isVcr) {
html += '<span class="vcr-badge">VCR</span>'; agendaExtras.push('<span class="vcr-badge">VCR</span>');
} }
if (show.schedule.recurrence === "biweekly") { if (show.schedule.recurrence === "biweekly") {
html += '<span class="biweekly-label">(bi-weekly)</span>'; agendaExtras.push('<span class="biweekly-label">(bi-weekly)</span>');
} }
html += `<span class="agenda-entry__name">${escapeHtml(show.name)}${agendaExtras.join("")}</span>`;
if (hosts) { if (hosts) {
html += `<span class="agenda-entry__hosts">${hosts}</span>`; html += `<span class="agenda-entry__hosts">${hosts}</span>`;
} }

View File

@@ -54,6 +54,7 @@ export function renderPage(title: string, bodyContent: string, prefs: Preference
<body> <body>
<header class="site-header"> <header class="site-header">
<h1 class="site-title"><a href="/week">📻 VCR Calendar</a></h1> <h1 class="site-title"><a href="/week">📻 VCR Calendar</a></h1>
<p class="site-header__disclaimer">Subject to change, not official</p>
<nav class="controls-bar"> <nav class="controls-bar">
<div class="controls-row">${modeLinks}</div> <div class="controls-row">${modeLinks}</div>
<div class="controls-row"> <div class="controls-row">
@@ -65,7 +66,7 @@ export function renderPage(title: string, bodyContent: string, prefs: Preference
<div class="controls-row">${themeLinks} · <a href="/week?reset=1" class="reset-link">Reset</a></div> <div class="controls-row">${themeLinks} · <a href="/week?reset=1" class="reset-link">Reset</a></div>
</nav> </nav>
</header> </header>
<main>${bodyContent}</main> <main class="page-container">${bodyContent}</main>
<footer class="site-footer"> <footer class="site-footer">
<p>Times shown in ${escapeHtml(TIMEZONE_CONFIG[prefs.tz].label)}</p> <p>Times shown in ${escapeHtml(TIMEZONE_CONFIG[prefs.tz].label)}</p>
<p>voidzero Community Radio</p> <p>voidzero Community Radio</p>
@@ -76,9 +77,9 @@ export function renderPage(title: string, bodyContent: string, prefs: Preference
function buildLink(path: string, prefs: Record<string, string>): string { function buildLink(path: string, prefs: Record<string, string>): string {
const params = new URLSearchParams(); const params = new URLSearchParams();
if (prefs.tz && prefs.tz !== "eastern") params.set("tz", prefs.tz); if (prefs.tz) params.set("tz", prefs.tz);
if (prefs.theme && prefs.theme !== "system") params.set("theme", prefs.theme); if (prefs.theme) params.set("theme", prefs.theme);
if (prefs.mode && prefs.mode !== "vcr") params.set("mode", prefs.mode); if (prefs.mode) params.set("mode", prefs.mode);
if (prefs.week) params.set("week", prefs.week); if (prefs.week) params.set("week", prefs.week);
const qs = params.toString(); const qs = params.toString();
return qs ? `${path}?${qs}` : path; return qs ? `${path}?${qs}` : path;

View File

@@ -64,24 +64,29 @@ export function renderWeekGrid(shows: Show[], prefs: Preferences): string {
let html = '<div class="week-grid-wrapper"><div class="week-grid">'; let html = '<div class="week-grid-wrapper"><div class="week-grid">';
html += '<div class="week-grid__gutter"></div>'; // Header row: left gutter + 7 day headers + right gutter
html += '<div class="week-grid__gutter week-grid__header-gutter" style="grid-column:1; grid-row:1"></div>';
for (let i = 0; i < 7; i++) { for (let i = 0; i < 7; i++) {
const dayDate = new Date(weekBounds.start); const dayDate = new Date(weekBounds.start);
dayDate.setUTCDate(dayDate.getUTCDate() + i); dayDate.setUTCDate(dayDate.getUTCDate() + i);
const dateNum = dayDate.getUTCDate(); const dateNum = dayDate.getUTCDate();
const todayClass = dateKeyFromUtcDate(dayDate) === todayKey ? " day-today" : ""; const todayClass = dateKeyFromUtcDate(dayDate) === todayKey ? " day-today" : "";
html += `<div class="week-grid__day-header${todayClass}">${DAY_SHORT[i]}<br>${dateNum}</div>`; html += `<div class="week-grid__day-header${todayClass}" style="grid-column:${i + 2}; grid-row:1">${DAY_SHORT[i]}<br>${dateNum}</div>`;
} }
html += '<div class="week-grid__gutter week-grid__header-gutter week-grid__gutter--right" style="grid-column:9; grid-row:1"></div>';
// Time slot rows
for (let slot = 0; slot < slotCount; slot++) { for (let slot = 0; slot < slotCount; slot++) {
const slotMin = gridStartMin + slot * 30; const slotMin = gridStartMin + slot * 30;
const hour = Math.floor(slotMin / 60) % 24; const hour = Math.floor(slotMin / 60) % 24;
const minute = slotMin % 60; const minute = slotMin % 60;
const gutterLabel = minute === 0 ? formatTime12(hour, minute) : ""; const gutterLabel = minute === 0 ? formatTime12(hour, minute) : "";
html += `<div class="week-grid__gutter">${gutterLabel}</div>`; const row = slot + 2;
html += `<div class="week-grid__gutter" style="grid-column:1; grid-row:${row}">${gutterLabel}</div>`;
for (let col = 0; col < 7; col++) { for (let col = 0; col < 7; col++) {
html += '<div class="week-grid__cell"></div>'; html += `<div class="week-grid__cell" style="grid-column:${col + 2}; grid-row:${row}"></div>`;
} }
html += `<div class="week-grid__gutter week-grid__gutter--right" style="grid-column:9; grid-row:${row}">${gutterLabel}</div>`;
} }
for (const block of placed) { for (const block of placed) {
@@ -90,14 +95,15 @@ export function renderWeekGrid(shows: Show[], prefs: Preferences): string {
const liveClass = isLive ? " is-live" : ""; const liveClass = isLive ? " is-live" : "";
const href = `/show/${encodeURIComponent(show.slug)}?week=${encodeURIComponent(prefs.week)}&tz=${encodeURIComponent(prefs.tz)}`; const href = `/show/${encodeURIComponent(show.slug)}?week=${encodeURIComponent(prefs.week)}&tz=${encodeURIComponent(prefs.tz)}`;
let inner = `<span class="show-block__name">${escapeHtml(show.name)}</span>`; const nameExtras: string[] = [];
inner += `<span class="show-block__time">${startDisplay} – ${endDisplay}</span>`;
if (prefs.mode === "all" && show.isVcr) { if (prefs.mode === "all" && show.isVcr) {
inner += '<span class="vcr-badge">VCR</span>'; nameExtras.push('<span class="vcr-badge">VCR</span>');
} }
if (show.schedule.recurrence === "biweekly") { if (show.schedule.recurrence === "biweekly") {
inner += '<span class="biweekly-label">(bi-weekly)</span>'; nameExtras.push('<span class="biweekly-label">(bi-weekly)</span>');
} }
let inner = `<span class="show-block__name">${escapeHtml(show.name)}${nameExtras.join("")}</span>`;
inner += `<span class="show-block__time">${startDisplay} – ${endDisplay}</span>`;
html += `<a href="${href}" class="show-block${liveClass}" style="grid-column:${gridColumn}; grid-row:${startRow}/${endRow}; border-left-color:${show.accentColor}; --show-accent:${show.accentColor}; --show-bg:${bg}">${inner}</a>`; html += `<a href="${href}" class="show-block${liveClass}" style="grid-column:${gridColumn}; grid-row:${startRow}/${endRow}; border-left-color:${show.accentColor}; --show-accent:${show.accentColor}; --show-bg:${bg}">${inner}</a>`;
} }

View File

@@ -3,6 +3,7 @@ const LIGHT_VARS = `
--bg-surface: #ffffff; --bg-surface: #ffffff;
--text: #1a1a1a; --text: #1a1a1a;
--text-muted: #666666; --text-muted: #666666;
--text-heading: #111111;
--border: #e0e0e0; --border: #e0e0e0;
--grid-line: #eeeeee; --grid-line: #eeeeee;
--today-highlight: rgba(0, 0, 0, 0.03); --today-highlight: rgba(0, 0, 0, 0.03);
@@ -12,11 +13,12 @@ const LIGHT_VARS = `
const DARK_VARS = ` const DARK_VARS = `
--bg: #111214; --bg: #111214;
--bg-surface: #1a1c1e; --bg-surface: #1a1c1e;
--text: #e8e8e8; --text: #ececec;
--text-muted: #999999; --text-muted: #a0a0a0;
--border: #2a2c2e; --text-heading: #ffffff;
--grid-line: #222426; --border: #333538;
--today-highlight: rgba(255, 255, 255, 0.03); --grid-line: #262830;
--today-highlight: rgba(255, 255, 255, 0.04);
--live-pulse: #ff4d4d; --live-pulse: #ff4d4d;
`; `;
@@ -93,6 +95,14 @@ ${DARK_VARS}
text-decoration: none; text-decoration: none;
} }
.site-header__disclaimer {
font-size: 0.75rem;
color: var(--text-muted);
font-style: italic;
margin-top: 0.15rem;
opacity: 0.7;
}
.site-footer { .site-footer {
border-top: 1px solid var(--border); border-top: 1px solid var(--border);
padding: 1.5rem 1.25rem; padding: 1.5rem 1.25rem;
@@ -236,6 +246,7 @@ ${DARK_VARS}
font-weight: 600; font-weight: 600;
font-size: 1rem; font-size: 1rem;
white-space: nowrap; white-space: nowrap;
color: var(--text-heading, var(--text));
} }
/* Week grid */ /* Week grid */
@@ -249,15 +260,12 @@ ${DARK_VARS}
.week-grid { .week-grid {
display: grid; display: grid;
grid-template-columns: auto repeat(7, minmax(0, 1fr)); grid-template-columns: 3.5rem repeat(7, minmax(0, 1fr)) 3.5rem;
grid-auto-rows: 2rem; grid-auto-rows: 2rem;
min-width: 100%; min-width: 100%;
} }
.week-grid__gutter { .week-grid__gutter {
position: sticky;
left: 0;
z-index: 2;
background: var(--bg-surface); background: var(--bg-surface);
border-right: 1px solid var(--grid-line); border-right: 1px solid var(--grid-line);
padding: 0 0.5rem; padding: 0 0.5rem;
@@ -266,7 +274,24 @@ ${DARK_VARS}
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;
justify-content: flex-end; justify-content: flex-end;
padding-top: 0.25rem; padding-top: 0.125rem;
white-space: nowrap;
}
.week-grid__gutter:not(.week-grid__gutter--right) {
position: sticky;
left: 0;
z-index: 2;
}
.week-grid__gutter--right {
border-right: none;
border-left: 1px solid var(--grid-line);
justify-content: flex-start;
}
.week-grid__header-gutter {
border-bottom: 2px solid var(--border);
} }
.week-grid__day-header { .week-grid__day-header {
@@ -274,22 +299,18 @@ ${DARK_VARS}
font-size: 0.8125rem; font-size: 0.8125rem;
font-weight: 600; font-weight: 600;
padding: 0.5rem 0.25rem; padding: 0.5rem 0.25rem;
border-bottom: 1px solid var(--grid-line); border-bottom: 2px solid var(--border);
border-right: 1px solid var(--grid-line); border-right: 1px solid var(--grid-line);
background: var(--bg-surface); background: var(--bg-surface);
} }
.week-grid__day-header:last-child {
border-right: none;
}
.week-grid__cell { .week-grid__cell {
border-right: 1px solid var(--grid-line); border-right: 1px solid var(--grid-line);
border-bottom: 1px solid var(--grid-line); border-bottom: 1px solid var(--grid-line);
min-height: 2rem; min-height: 2rem;
} }
.week-grid__cell:nth-child(8n) { .week-grid__cell:last-of-type {
border-right: none; border-right: none;
} }
@@ -424,6 +445,7 @@ ${DARK_VARS}
.agenda-day__heading { .agenda-day__heading {
font-size: 1rem; font-size: 1rem;
font-weight: 600; font-weight: 600;
color: var(--text-heading, var(--text));
padding-bottom: 0.5rem; padding-bottom: 0.5rem;
margin-bottom: 0.5rem; margin-bottom: 0.5rem;
border-bottom: 1px solid var(--border); border-bottom: 1px solid var(--border);
@@ -469,6 +491,7 @@ ${DARK_VARS}
.show-detail__heading { .show-detail__heading {
font-size: 1.75rem; font-size: 1.75rem;
font-weight: 600; font-weight: 600;
color: var(--text-heading, var(--text));
padding-top: 0.75rem; padding-top: 0.75rem;
border-top: 4px solid var(--show-accent, var(--border)); border-top: 4px solid var(--show-accent, var(--border));
margin-bottom: 0.75rem; margin-bottom: 0.75rem;
@@ -564,7 +587,7 @@ ${DARK_VARS}
} }
.week-grid { .week-grid {
grid-template-columns: 3.5rem repeat(7, 120px); grid-template-columns: 3.5rem repeat(7, 120px) 3.5rem;
min-width: max-content; min-width: max-content;
} }
@@ -573,6 +596,12 @@ ${DARK_VARS}
min-width: 120px; min-width: 120px;
} }
.week-grid__gutter--right {
position: sticky;
right: 0;
z-index: 2;
}
.controls-row { .controls-row {
flex-direction: column; flex-direction: column;
align-items: flex-start; align-items: flex-start;