Show food emoji in each lunch day's header

This commit is contained in:
iamdoubz committed 2026-11-06 00:23:06 -06:00
1 parent 1a61a72527
commit ce1eb8b201
1 file changed
+8 -1
+8 -1
View File
@@ -11,6 +11,7 @@
import { api, type LunchDay } from '../lib/api';
import { app, toast } from '../lib/state.svelte';
import { monthLabel, parse, shiftMonth, thisMonth } from '../lib/dates';
import { foodEmoji } from '../lib/foodEmoji';
import PageHeader from '../lib/ui/PageHeader.svelte';
import EmptyState from '../lib/ui/EmptyState.svelte';
@@ -133,7 +134,11 @@
<span class="dnum tabular">{date.getDate()}</span>
</span>
<span class="visually-hidden">{date.toLocaleDateString(undefined, { weekday: 'long', month: 'long', day: 'numeric' })}</span>
{#if d.warning}<span class="badge warn"><TriangleAlert size={12} aria-hidden="true" />{d.warning}</span>{/if}
<span class="head-end">
{#if d.warning}<span class="badge warn"><TriangleAlert size={12} aria-hidden="true" />{d.warning}</span>{/if}
<!-- Decoration only: the foods are listed below, so screen readers skip this. -->
{#if !d.greyed}<span class="emoji" aria-hidden="true">{foodEmoji(d.menus.flatMap((m) => m.items)).join('')}</span>{/if}
</span>
</div>
{#if d.greyed}
<p class="closed-note"><CalendarX size={18} aria-hidden="true" />{d.closed ?? 'No lunch this day'}</p>
@@ -174,6 +179,8 @@
.day.closed { background: var(--day-closed); box-shadow: none; }
.day-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
.date-tile { display: flex; align-items: baseline; gap: 6px; }
.head-end { display: flex; align-items: center; gap: var(--s2); min-width: 0; }
.emoji { font-size: var(--fs-lg); line-height: 1; letter-spacing: 2px; white-space: nowrap; }
.dow { font-size: var(--fs-sm); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-2); }
.dnum { font-size: var(--fs-xl); font-weight: 750; }
.food { display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-sm); color: var(--text); }