home2 round 2: Manrope nav, bigger logo, photo-top news / photo-left art, tinted static cards

- Self-hosted Manrope (OFL) as the hub sans; nav lighter (weight 500, soft slate, not all
  "on"). Logo up to 58px.
- News card: photo on top + headline below, and it now respects the reader's saved
  Closer-to-Home filter (goodnews:home/homeScope) so the headline matches their Brief.
- Art card: rectangular cover-cropped thumbnail on the LEFT (crops ragged scan edges),
  text on the right — variety against the photo-top news card.
- Play/Daily Moment: tinted backgrounds, bigger centered icon+title, blurb left-aligned.
- /fonts/* + /textures/* served immutable (Caddy live + snapshot).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
jay
2026-06-21 19:46:51 -04:00
parent 5a8e178f51
commit b172c5eefd
6 changed files with 116 additions and 57 deletions
+29 -8
View File
@@ -8,12 +8,21 @@
// promote to / and remove this clone — same approach we used for /art.
let artImg = $state(null);
let newsHeadline = $state('');
let newsImg = $state(null);
onMount(async () => {
try { artImg = (await getJSON('/api/art/today'))?.image_url ?? null; } catch { /* card falls back to blurb */ }
// Respect the reader's saved Closer-to-Home filter so the headline matches their Brief.
let homeq = '';
try {
const b = await getJSON('/api/brief?limit=1');
newsHeadline = b?.items?.[0]?.title ?? '';
const hv = localStorage.getItem('goodnews:home') || '';
const hs = localStorage.getItem('goodnews:homeScope') || 'nearby';
if (hv && hs !== 'world') homeq = `&home=${encodeURIComponent(hv)}&scope=${hs}`;
} catch { /* default global brief */ }
try {
const it = (await getJSON(`/api/brief?limit=1${homeq}`))?.items?.[0];
newsHeadline = it?.title ?? '';
newsImg = it?.image_url ?? null;
} catch { /* card falls back to blurb */ }
});
</script>
@@ -51,7 +60,7 @@
<div class="grid">
{#each ROOMS as r (r.id)}
<RoomCard room={r} {artImg} {newsHeadline} />
<RoomCard room={r} {artImg} {newsImg} {newsHeadline} />
{/each}
</div>
</main>
@@ -60,24 +69,36 @@
</div>
<style>
/* Self-hosted modern sans (OFL) — privacy-friendly, no Google hotlink. */
@font-face {
font-family: 'Manrope';
src: url('/fonts/manrope-var.woff2') format('woff2');
font-weight: 200 800; font-style: normal; font-display: swap;
}
.room {
--canvas: #faf6ee; --surface: #ffffff; --ink: #232a31; --muted: #707b86;
--line: #ece5d8; --accent: #0a93c0; --accent-deep: #066c8e;
--sans: 'Manrope', ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
min-height: 100vh; background: var(--canvas); color: var(--ink);
font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
font-family: var(--sans);
display: flex; flex-direction: column;
}
/* Bigger, more present top bar — logo + nav labels scaled up. */
/* Bigger, more present top bar — logo + lighter, modern nav labels. */
.bar {
display: flex; align-items: center; justify-content: space-between;
padding: 20px clamp(18px, 5vw, 64px);
max-width: 1180px; width: 100%; margin: 0 auto; box-sizing: border-box;
}
.brand { display: block; line-height: 0; }
.brand img { height: 50px; width: auto; display: block; }
.nav { display: flex; align-items: center; gap: clamp(18px, 3vw, 38px); }
.nav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 1.12rem; }
.brand img { height: 58px; width: auto; display: block; }
.nav { display: flex; align-items: center; gap: clamp(18px, 3vw, 40px); }
.nav a {
font-family: var(--sans); color: #4a525c; text-decoration: none;
font-weight: 500; font-size: 1.1rem; letter-spacing: 0.01em;
transition: color 0.15s ease;
}
.nav a:hover { color: var(--accent); }
.acct {
display: inline-flex; align-items: center; justify-content: center;