fix: UI tweaks — grid gutters, default switching, badge position, contrast, padding, disclaimer
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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 += `<a href="${href}" class="agenda-entry__link">`;
|
||||
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) {
|
||||
html += '<span class="vcr-badge">VCR</span>';
|
||||
agendaExtras.push('<span class="vcr-badge">VCR</span>');
|
||||
}
|
||||
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) {
|
||||
html += `<span class="agenda-entry__hosts">${hosts}</span>`;
|
||||
}
|
||||
|
||||
@@ -54,6 +54,7 @@ export function renderPage(title: string, bodyContent: string, prefs: Preference
|
||||
<body>
|
||||
<header class="site-header">
|
||||
<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">
|
||||
<div class="controls-row">${modeLinks}</div>
|
||||
<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>
|
||||
</nav>
|
||||
</header>
|
||||
<main>${bodyContent}</main>
|
||||
<main class="page-container">${bodyContent}</main>
|
||||
<footer class="site-footer">
|
||||
<p>Times shown in ${escapeHtml(TIMEZONE_CONFIG[prefs.tz].label)}</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 {
|
||||
const params = new URLSearchParams();
|
||||
if (prefs.tz && prefs.tz !== "eastern") params.set("tz", prefs.tz);
|
||||
if (prefs.theme && prefs.theme !== "system") params.set("theme", prefs.theme);
|
||||
if (prefs.mode && prefs.mode !== "vcr") params.set("mode", prefs.mode);
|
||||
if (prefs.tz) params.set("tz", prefs.tz);
|
||||
if (prefs.theme) params.set("theme", prefs.theme);
|
||||
if (prefs.mode) params.set("mode", prefs.mode);
|
||||
if (prefs.week) params.set("week", prefs.week);
|
||||
const qs = params.toString();
|
||||
return qs ? `${path}?${qs}` : path;
|
||||
|
||||
@@ -64,24 +64,29 @@ export function renderWeekGrid(shows: Show[], prefs: Preferences): string {
|
||||
|
||||
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++) {
|
||||
const dayDate = new Date(weekBounds.start);
|
||||
dayDate.setUTCDate(dayDate.getUTCDate() + i);
|
||||
const dateNum = dayDate.getUTCDate();
|
||||
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++) {
|
||||
const slotMin = gridStartMin + slot * 30;
|
||||
const hour = Math.floor(slotMin / 60) % 24;
|
||||
const minute = slotMin % 60;
|
||||
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++) {
|
||||
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) {
|
||||
@@ -90,14 +95,15 @@ export function renderWeekGrid(shows: Show[], prefs: Preferences): string {
|
||||
const liveClass = isLive ? " is-live" : "";
|
||||
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>`;
|
||||
inner += `<span class="show-block__time">${startDisplay} – ${endDisplay}</span>`;
|
||||
const nameExtras: string[] = [];
|
||||
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") {
|
||||
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>`;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ const LIGHT_VARS = `
|
||||
--bg-surface: #ffffff;
|
||||
--text: #1a1a1a;
|
||||
--text-muted: #666666;
|
||||
--text-heading: #111111;
|
||||
--border: #e0e0e0;
|
||||
--grid-line: #eeeeee;
|
||||
--today-highlight: rgba(0, 0, 0, 0.03);
|
||||
@@ -12,11 +13,12 @@ const LIGHT_VARS = `
|
||||
const DARK_VARS = `
|
||||
--bg: #111214;
|
||||
--bg-surface: #1a1c1e;
|
||||
--text: #e8e8e8;
|
||||
--text-muted: #999999;
|
||||
--border: #2a2c2e;
|
||||
--grid-line: #222426;
|
||||
--today-highlight: rgba(255, 255, 255, 0.03);
|
||||
--text: #ececec;
|
||||
--text-muted: #a0a0a0;
|
||||
--text-heading: #ffffff;
|
||||
--border: #333538;
|
||||
--grid-line: #262830;
|
||||
--today-highlight: rgba(255, 255, 255, 0.04);
|
||||
--live-pulse: #ff4d4d;
|
||||
`;
|
||||
|
||||
@@ -93,6 +95,14 @@ ${DARK_VARS}
|
||||
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 {
|
||||
border-top: 1px solid var(--border);
|
||||
padding: 1.5rem 1.25rem;
|
||||
@@ -236,6 +246,7 @@ ${DARK_VARS}
|
||||
font-weight: 600;
|
||||
font-size: 1rem;
|
||||
white-space: nowrap;
|
||||
color: var(--text-heading, var(--text));
|
||||
}
|
||||
|
||||
/* Week grid */
|
||||
@@ -249,15 +260,12 @@ ${DARK_VARS}
|
||||
|
||||
.week-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;
|
||||
min-width: 100%;
|
||||
}
|
||||
|
||||
.week-grid__gutter {
|
||||
position: sticky;
|
||||
left: 0;
|
||||
z-index: 2;
|
||||
background: var(--bg-surface);
|
||||
border-right: 1px solid var(--grid-line);
|
||||
padding: 0 0.5rem;
|
||||
@@ -266,7 +274,24 @@ ${DARK_VARS}
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
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 {
|
||||
@@ -274,22 +299,18 @@ ${DARK_VARS}
|
||||
font-size: 0.8125rem;
|
||||
font-weight: 600;
|
||||
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);
|
||||
background: var(--bg-surface);
|
||||
}
|
||||
|
||||
.week-grid__day-header:last-child {
|
||||
border-right: none;
|
||||
}
|
||||
|
||||
.week-grid__cell {
|
||||
border-right: 1px solid var(--grid-line);
|
||||
border-bottom: 1px solid var(--grid-line);
|
||||
min-height: 2rem;
|
||||
}
|
||||
|
||||
.week-grid__cell:nth-child(8n) {
|
||||
.week-grid__cell:last-of-type {
|
||||
border-right: none;
|
||||
}
|
||||
|
||||
@@ -424,6 +445,7 @@ ${DARK_VARS}
|
||||
.agenda-day__heading {
|
||||
font-size: 1rem;
|
||||
font-weight: 600;
|
||||
color: var(--text-heading, var(--text));
|
||||
padding-bottom: 0.5rem;
|
||||
margin-bottom: 0.5rem;
|
||||
border-bottom: 1px solid var(--border);
|
||||
@@ -469,6 +491,7 @@ ${DARK_VARS}
|
||||
.show-detail__heading {
|
||||
font-size: 1.75rem;
|
||||
font-weight: 600;
|
||||
color: var(--text-heading, var(--text));
|
||||
padding-top: 0.75rem;
|
||||
border-top: 4px solid var(--show-accent, var(--border));
|
||||
margin-bottom: 0.75rem;
|
||||
@@ -564,7 +587,7 @@ ${DARK_VARS}
|
||||
}
|
||||
|
||||
.week-grid {
|
||||
grid-template-columns: 3.5rem repeat(7, 120px);
|
||||
grid-template-columns: 3.5rem repeat(7, 120px) 3.5rem;
|
||||
min-width: max-content;
|
||||
}
|
||||
|
||||
@@ -573,6 +596,12 @@ ${DARK_VARS}
|
||||
min-width: 120px;
|
||||
}
|
||||
|
||||
.week-grid__gutter--right {
|
||||
position: sticky;
|
||||
right: 0;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.controls-row {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
|
||||
Reference in New Issue
Block a user