Redesign review screen
This commit is contained in:
1 parent
7d9692932f
commit
b770152d1c
1 file changed
+205
-122
+205
-122
@@ -1,7 +1,28 @@
|
||||
<script lang="ts">
|
||||
import CheckCheck from '@lucide/svelte/icons/check-check';
|
||||
import ChevronDown from '@lucide/svelte/icons/chevron-down';
|
||||
import EyeOff from '@lucide/svelte/icons/eye-off';
|
||||
import LayoutGrid from '@lucide/svelte/icons/layout-grid';
|
||||
import List from '@lucide/svelte/icons/list';
|
||||
import ListChecks from '@lucide/svelte/icons/list-checks';
|
||||
import MapPin from '@lucide/svelte/icons/map-pin';
|
||||
import Pencil from '@lucide/svelte/icons/pencil';
|
||||
import Plus from '@lucide/svelte/icons/plus';
|
||||
import RefreshCw from '@lucide/svelte/icons/refresh-cw';
|
||||
import Send from '@lucide/svelte/icons/send';
|
||||
import Sparkles from '@lucide/svelte/icons/sparkles';
|
||||
import TriangleAlert from '@lucide/svelte/icons/triangle-alert';
|
||||
import Undo2 from '@lucide/svelte/icons/undo-2';
|
||||
import Utensils from '@lucide/svelte/icons/utensils';
|
||||
import X from '@lucide/svelte/icons/x';
|
||||
import ZoomIn from '@lucide/svelte/icons/zoom-in';
|
||||
import ZoomOut from '@lucide/svelte/icons/zoom-out';
|
||||
import type { Component } from 'svelte';
|
||||
import { api, KINDS, type CalEvent, type EventValues as Values, type Kind, type MenuItem, type Scan } from '../lib/api';
|
||||
import { app, toast } from '../lib/state.svelte';
|
||||
import { dayLabel, monthsBetween, whenLabel } from '../lib/dates';
|
||||
import { KIND_ICONS } from '../lib/icons';
|
||||
import Segmented from '../lib/ui/Segmented.svelte';
|
||||
import EventEditor from './EventEditor.svelte';
|
||||
import MonthGrid from './MonthGrid.svelte';
|
||||
|
||||
@@ -26,17 +47,18 @@
|
||||
const fresh = $derived(live.filter((e) => e.include && !e.flags.length && (e.match === 'new' || !e.match)));
|
||||
const unchanged = $derived(live.filter((e) => e.include && !e.flags.length && e.match === 'unchanged'));
|
||||
const excluded = $derived(live.filter((e) => !e.include));
|
||||
const included = $derived(live.filter((e) => e.include).length);
|
||||
// Select all takes only events on screen: collapsed groups stay out, so a bulk delete can't hit unseen events.
|
||||
const visibleIds = $derived([
|
||||
...needs, ...updated, ...fresh, ...(open.unchanged ? unchanged : []), ...(open.excluded ? excluded : []),
|
||||
].map((e) => e.id));
|
||||
const allSelected = $derived(visibleIds.length > 0 && visibleIds.every((id) => selected.includes(id)));
|
||||
const activeBox = $derived(scan.events.find((e) => e.id === active)?.cell_bbox ?? null);
|
||||
const activeEvent = $derived(scan.events.find((e) => e.id === active));
|
||||
const months = $derived(
|
||||
monthsBetween(scan.date_start ?? `${scan.hint_month}-01`, scan.date_end ?? `${scan.hint_month}-01`),
|
||||
);
|
||||
const children = $derived(new Map(app.household!.children.map((c) => [c.id, c])));
|
||||
const colorFor = (e: CalEvent) => children.get(e.child_ids[0])?.color ?? 'var(--accent)';
|
||||
const colorFor = (e: CalEvent) => children.get(e.child_ids[0])?.color ?? 'var(--primary)';
|
||||
const flaggedMenu = $derived(scan.menu_items.filter((m) => m.flags.length).length);
|
||||
|
||||
async function refresh() {
|
||||
@@ -71,6 +93,7 @@
|
||||
async function undo() {
|
||||
try {
|
||||
scan = await api<Scan>(`/scans/${scan.id}/undo`, { method: 'POST' });
|
||||
toast('Undone');
|
||||
} catch (e: any) {
|
||||
toast(e.message);
|
||||
}
|
||||
@@ -79,7 +102,7 @@
|
||||
async function bulk(body: object, what: string) {
|
||||
if (!selected.length) return;
|
||||
await run(() => api('/events/bulk', { method: 'POST', json: { ids: selected, ...body } }));
|
||||
toast(`${what}: ${selected.length} events`);
|
||||
toast(`${what}: ${selected.length} events. Undo is in the toolbar.`);
|
||||
selected = [];
|
||||
selecting = false;
|
||||
}
|
||||
@@ -117,25 +140,37 @@
|
||||
</script>
|
||||
|
||||
{#snippet eventRow(e: CalEvent)}
|
||||
<li class="event card" class:active={active === e.id}>
|
||||
{@const KindIcon = KIND_ICONS[e.kind]}
|
||||
<li class="event" class:active={active === e.id} class:off={!e.include} style:--child={colorFor(e)}>
|
||||
<div class="line">
|
||||
{#if selecting}
|
||||
<input type="checkbox" bind:group={selected} value={e.id} aria-label={`Select ${e.title}`} />
|
||||
{/if}
|
||||
<button class="item" onclick={() => focus(e)} aria-pressed={active === e.id}>
|
||||
<span class="title"><span class="dot" style:background={colorFor(e)}></span>{e.title}</span>
|
||||
<span class="muted small">{whenLabel(e)} · {KINDS[e.kind]}{e.location ? ` · ${e.location}` : ''}</span>
|
||||
{#each e.flags as flag}
|
||||
<span class="badge warn"><span aria-hidden="true">⚠</span> {flag}</span>
|
||||
{/each}
|
||||
{#if e.match === 'updated'}
|
||||
<span class="badge info">Changes: {changes(e).join(', ') || 'children'}</span>
|
||||
<span class="kind" title={KINDS[e.kind]}><KindIcon size={18} aria-hidden="true" /></span>
|
||||
<button class="item" onclick={() => focus(e)} aria-pressed={active === e.id} aria-label={`${e.title}, ${whenLabel(e)}. Show on photo`}>
|
||||
<span class="title">{e.title}</span>
|
||||
<span class="meta">
|
||||
<span>{whenLabel(e)}</span>
|
||||
<span class="sep" aria-hidden="true">·</span><span>{KINDS[e.kind]}</span>
|
||||
{#if e.location}<span class="sep" aria-hidden="true">·</span><span class="loc"><MapPin size={13} aria-hidden="true" />{e.location}</span>{/if}
|
||||
</span>
|
||||
{#if e.flags.length || e.match === 'updated'}
|
||||
<span class="badges">
|
||||
{#each e.flags as flag}
|
||||
<span class="badge warn"><TriangleAlert size={12} aria-hidden="true" />{flag}</span>
|
||||
{/each}
|
||||
{#if e.match === 'updated'}
|
||||
<span class="badge info"><RefreshCw size={12} aria-hidden="true" />Changes {changes(e).join(', ') || 'children'}</span>
|
||||
{/if}
|
||||
</span>
|
||||
{/if}
|
||||
</button>
|
||||
{#if e.include}
|
||||
<button class="small" onclick={() => (editing = editing === e.id ? null : e.id)} aria-expanded={editing === e.id}>Edit</button>
|
||||
<button class="sm ghost" onclick={() => (editing = editing === e.id ? null : e.id)} aria-expanded={editing === e.id}>
|
||||
<Pencil size={16} aria-hidden="true" /><span class="hide-sm">Edit</span>
|
||||
</button>
|
||||
{:else}
|
||||
<button class="small" onclick={() => include(e, true)}>Include</button>
|
||||
<button class="sm" onclick={() => include(e, true)}><Plus size={16} aria-hidden="true" />Include</button>
|
||||
{/if}
|
||||
</div>
|
||||
{#if editing === e.id}
|
||||
@@ -144,78 +179,93 @@
|
||||
</li>
|
||||
{/snippet}
|
||||
|
||||
{#snippet group(title: string, list: CalEvent[], note: string)}
|
||||
{#snippet group(title: string, Icon: Component<any>, tone: string, list: CalEvent[], note: string)}
|
||||
{#if list.length}
|
||||
<h2>{title} <span class="muted">({list.length})</span></h2>
|
||||
{#if note}<p class="muted small">{note}</p>{/if}
|
||||
<ul class="events">
|
||||
{#each list as e (e.id)}{@render eventRow(e)}{/each}
|
||||
</ul>
|
||||
<section class="section">
|
||||
<h2 class="section-title {tone}"><Icon size={16} aria-hidden="true" />{title} <span class="count">{list.length}</span></h2>
|
||||
{#if note}<p class="hint">{note}</p>{/if}
|
||||
<ul class="card-list">{#each list as e (e.id)}{@render eventRow(e)}{/each}</ul>
|
||||
</section>
|
||||
{/if}
|
||||
{/snippet}
|
||||
|
||||
{#snippet collapsed(key: 'unchanged' | 'excluded', title: string, Icon: Component<any>, list: CalEvent[])}
|
||||
{#if list.length}
|
||||
<section class="section">
|
||||
<button class="disclosure ghost" aria-expanded={open[key]} onclick={() => (open[key] = !open[key])}>
|
||||
<ChevronDown size={18} class="chev" aria-hidden="true" />
|
||||
<Icon size={16} aria-hidden="true" />{title} <span class="count">{list.length}</span>
|
||||
</button>
|
||||
{#if open[key]}<ul class="card-list">{#each list as e (e.id)}{@render eventRow(e)}{/each}</ul>{/if}
|
||||
</section>
|
||||
{/if}
|
||||
{/snippet}
|
||||
|
||||
<div class="layout">
|
||||
<div class="photo-col">
|
||||
<div class="photo" bind:this={photo} class:zoom>
|
||||
{#if scan.image_keys.length}
|
||||
<div class="frame">
|
||||
<img src={`/api/scans/${scan.id}/pages/${page}`} alt={`Page ${page} of the scanned ${scan.source_name}`} />
|
||||
{#if activeBox && scan.events.find((e) => e.id === active)?.page === page}
|
||||
<div class="box" style:left="{activeBox[0] * 100}%" style:top="{activeBox[1] * 100}%"
|
||||
style:width="{activeBox[2] * 100}%" style:height="{activeBox[3] * 100}%"></div>
|
||||
{/if}
|
||||
</div>
|
||||
{:else}
|
||||
<p class="muted">The photo has been deleted.</p>
|
||||
{/if}
|
||||
<aside class="photo-col" aria-label="Scanned page">
|
||||
<div class="photo-card">
|
||||
<div class="photo-bar">
|
||||
{#if scan.image_keys.length > 1}
|
||||
<Segmented label="Page" bind:value={page} options={scan.image_keys.map((_, i) => ({ value: i + 1, label: `Page ${i + 1}` }))} />
|
||||
{:else}
|
||||
<span class="hint">Tap an event to see where it came from</span>
|
||||
{/if}
|
||||
<button class="sm ghost" aria-pressed={zoom} onclick={() => (zoom = !zoom)} aria-label={zoom ? 'Fit photo' : 'Zoom photo'}>
|
||||
{#if zoom}<ZoomOut size={18} aria-hidden="true" />{:else}<ZoomIn size={18} aria-hidden="true" />{/if}
|
||||
</button>
|
||||
</div>
|
||||
<div class="photo" bind:this={photo} class:zoom>
|
||||
{#if scan.image_keys.length}
|
||||
<div class="frame">
|
||||
<img src={`/api/scans/${scan.id}/pages/${page}`} alt={`Page ${page} of the scanned ${scan.source_name}`} />
|
||||
{#if activeEvent?.cell_bbox && activeEvent.page === page}
|
||||
{@const b = activeEvent.cell_bbox}
|
||||
<div class="box" style:left="{b[0] * 100}%" style:top="{b[1] * 100}%" style:width="{b[2] * 100}%" style:height="{b[3] * 100}%"></div>
|
||||
{/if}
|
||||
</div>
|
||||
{:else}
|
||||
<p class="hint" style="padding: var(--s4)">The photo was deleted after the retention period.</p>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
{#if scan.image_keys.length > 1}
|
||||
{#each scan.image_keys as _, i}
|
||||
<button class="small" aria-pressed={page === i + 1} onclick={() => (page = i + 1)}>Page {i + 1}</button>
|
||||
{/each}
|
||||
{/if}
|
||||
<button class="small" aria-pressed={zoom} onclick={() => (zoom = !zoom)}>{zoom ? 'Fit photo' : 'Zoom photo'}</button>
|
||||
</div>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
<div class="list-col">
|
||||
<div class="toolbar row">
|
||||
<button class="small" onclick={undo} disabled={!scan.can_undo}>Undo</button>
|
||||
<button class="small" aria-pressed={selecting} onclick={() => { selecting = !selecting; selected = []; }}>
|
||||
{selecting ? 'Done selecting' : 'Select'}
|
||||
<div class="toolbar">
|
||||
<button class="sm" onclick={undo} disabled={!scan.can_undo}><Undo2 size={16} aria-hidden="true" />Undo</button>
|
||||
<button class="sm" aria-pressed={selecting} onclick={() => { selecting = !selecting; selected = []; }}>
|
||||
{#if selecting}<X size={16} aria-hidden="true" />Done{:else}<ListChecks size={16} aria-hidden="true" />Select{/if}
|
||||
</button>
|
||||
<button class="small" onclick={() => addOn(`${scan.hint_month}-01`)}>Add event</button>
|
||||
<button class="small" onclick={() => (view = view === 'list' ? 'grid' : 'list')}>{view === 'list' ? 'Month view' : 'List view'}</button>
|
||||
<button class="sm" onclick={() => addOn(`${scan.hint_month}-01`)}><Plus size={16} aria-hidden="true" />Add</button>
|
||||
<span class="grow"></span>
|
||||
<button class="primary" onclick={publish} disabled={busy}>Publish</button>
|
||||
<Segmented label="View" bind:value={view} options={[{ value: 'list', label: 'List', icon: List }, { value: 'grid', label: 'Month', icon: LayoutGrid }]} />
|
||||
</div>
|
||||
|
||||
{#if selecting}
|
||||
<div class="card bulk stack">
|
||||
<div class="bulk card">
|
||||
<div class="row spread">
|
||||
<p class="small">{selected.length} selected</p>
|
||||
<button class="small" disabled={!visibleIds.length} onclick={() => (selected = allSelected ? [] : [...visibleIds])}>
|
||||
<span class="strong tabular">{selected.length} selected</span>
|
||||
<button class="sm ghost" disabled={!visibleIds.length} onclick={() => (selected = allSelected ? [] : [...visibleIds])}>
|
||||
{allSelected ? 'Clear all' : 'Select all'}
|
||||
</button>
|
||||
</div>
|
||||
<div class="row">
|
||||
<button class="small" onclick={() => bulk({ delete: true }, 'Deleted')}>Delete</button>
|
||||
<button class="small" onclick={() => bulk({ changes: { include: false } }, 'Unchecked')}>Uncheck</button>
|
||||
<select bind:value={bulkKind} aria-label="Kind to set" style="width:auto">
|
||||
{#each Object.entries(KINDS).filter(([k]) => k !== 'pack_lunch') as [value, label]}
|
||||
<option {value}>{label}</option>
|
||||
{/each}
|
||||
</select>
|
||||
<button class="small" onclick={() => bulk({ changes: { kind: bulkKind } }, 'Kind changed')}>Set kind</button>
|
||||
<button class="small" onclick={() => bulk({ changes: { all_day: true } }, 'Made all-day')}>Make all-day</button>
|
||||
<button class="sm danger" disabled={!selected.length} onclick={() => bulk({ delete: true }, 'Deleted')}>Delete</button>
|
||||
<button class="sm" disabled={!selected.length} onclick={() => bulk({ changes: { include: false } }, 'Unchecked')}>Uncheck</button>
|
||||
<button class="sm" disabled={!selected.length} onclick={() => bulk({ changes: { all_day: true } }, 'Made all-day')}>All-day</button>
|
||||
<span class="kind-set">
|
||||
<select bind:value={bulkKind} aria-label="Kind to set">
|
||||
{#each Object.entries(KINDS).filter(([k]) => k !== 'pack_lunch') as [value, label]}<option {value}>{label}</option>{/each}
|
||||
</select>
|
||||
<button class="sm" disabled={!selected.length} onclick={() => bulk({ changes: { kind: bulkKind } }, 'Kind changed')}>Set kind</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{#if editing === 'new'}
|
||||
<div class="card">
|
||||
<h3 style="margin-top:0">New event</h3>
|
||||
<div class="card new-event">
|
||||
<h2>New event</h2>
|
||||
<EventEditor
|
||||
defaults={{ date: newDate, child_ids: app.household!.sources.find((s) => s.id === scan.source_id)?.child_ids ?? [] }}
|
||||
onsave={add}
|
||||
@@ -225,82 +275,115 @@
|
||||
{/if}
|
||||
|
||||
{#if view === 'grid'}
|
||||
<p class="muted small">Tap a day to add an event.</p>
|
||||
<p class="hint">Tap a day to add an event.</p>
|
||||
{#each months as month}
|
||||
<MonthGrid {month} events={live.filter((e) => e.include)} {colorFor} onday={addOn} />
|
||||
{/each}
|
||||
{:else}
|
||||
{#if !live.length && !scan.menu_items.length}
|
||||
<p class="empty">Nothing was found on this page. Add events by hand, or discard the scan.</p>
|
||||
{/if}
|
||||
{@render group('Needs a look', needs, 'Each one says why. Tap to see where it came from on the photo.')}
|
||||
{@render group('Updated', updated, 'Already on your calendar; publishing applies these changes.')}
|
||||
{@render group('New', fresh, '')}
|
||||
|
||||
{#if unchanged.length}
|
||||
<button class="quiet disclosure" aria-expanded={open.unchanged} onclick={() => (open.unchanged = !open.unchanged)}>
|
||||
{open.unchanged ? '▾' : '▸'} Unchanged ({unchanged.length})
|
||||
</button>
|
||||
{#if open.unchanged}<ul class="events">{#each unchanged as e (e.id)}{@render eventRow(e)}{/each}</ul>{/if}
|
||||
{/if}
|
||||
{#if excluded.length}
|
||||
<button class="quiet disclosure" aria-expanded={open.excluded} onclick={() => (open.excluded = !open.excluded)}>
|
||||
{open.excluded ? '▾' : '▸'} Not for this child, or unchecked ({excluded.length})
|
||||
</button>
|
||||
{#if open.excluded}<ul class="events">{#each excluded as e (e.id)}{@render eventRow(e)}{/each}</ul>{/if}
|
||||
<div class="alert info">Nothing was found on this page. Add events by hand, or discard the scan.</div>
|
||||
{/if}
|
||||
{@render group('Needs a look', TriangleAlert, 'warn', needs, 'Each one says why. Tap it to see where it came from on the photo.')}
|
||||
{@render group('Updated', RefreshCw, 'info', updated, 'Already on your calendar; publishing applies these changes.')}
|
||||
{@render group('New', Sparkles, '', fresh, '')}
|
||||
{@render collapsed('unchanged', 'Unchanged', CheckCheck, unchanged)}
|
||||
{@render collapsed('excluded', 'Not for this child, or unchecked', EyeOff, excluded)}
|
||||
|
||||
{#if scan.menu_items.length}
|
||||
<h2>Menu <span class="muted">({scan.menu_items.length} days{flaggedMenu ? `, ${flaggedMenu} need a look` : ''})</span></h2>
|
||||
<p class="muted small">One food per line. Your kids pick lunch days on the Lunch screen after you publish.</p>
|
||||
<ul class="events">
|
||||
{#each scan.menu_items as m (m.id)}
|
||||
{@const text = m.items.join('\n')}
|
||||
<li class="card menu-day">
|
||||
<form onsubmit={(ev) => { ev.preventDefault(); const fd = new FormData(ev.currentTarget as HTMLFormElement); saveMenu(m, String(fd.get('items') ?? ''), fd.get('no_lunch') === 'on'); }}>
|
||||
<div class="row spread">
|
||||
<strong>{dayLabel(m.date)}</strong>
|
||||
{#each m.flags as flag}<span class="badge warn"><span aria-hidden="true">⚠</span> {flag}</span>{/each}
|
||||
</div>
|
||||
<textarea name="items" aria-label={`Menu for ${dayLabel(m.date)}`} rows={Math.max(2, m.items.length)}>{text}</textarea>
|
||||
<div class="row spread">
|
||||
<label class="check"><input type="checkbox" name="no_lunch" checked={m.no_lunch} /> No lunch this day</label>
|
||||
<button class="small" type="submit">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</li>
|
||||
{/each}
|
||||
</ul>
|
||||
<section class="section">
|
||||
<h2 class="section-title"><Utensils size={16} aria-hidden="true" />Menu <span class="count">{scan.menu_items.length} days{flaggedMenu ? `, ${flaggedMenu} need a look` : ''}</span></h2>
|
||||
<p class="hint">One food per line. Your kids pick lunch days on the Lunch tab after you publish.</p>
|
||||
<ul class="menu-days">
|
||||
{#each scan.menu_items as m (m.id)}
|
||||
<li class="card menu-day">
|
||||
<form class="stack" onsubmit={(ev) => { ev.preventDefault(); const fd = new FormData(ev.currentTarget as HTMLFormElement); saveMenu(m, String(fd.get('items') ?? ''), fd.get('no_lunch') === 'on'); }}>
|
||||
<div class="row spread">
|
||||
<span class="strong">{dayLabel(m.date)}</span>
|
||||
{#each m.flags as flag}<span class="badge warn"><TriangleAlert size={12} aria-hidden="true" />{flag}</span>{/each}
|
||||
</div>
|
||||
<textarea name="items" aria-label={`Menu for ${dayLabel(m.date)}`} rows={Math.max(2, m.items.length)}>{m.items.join('\n')}</textarea>
|
||||
<div class="row spread">
|
||||
<label class="check small"><input type="checkbox" name="no_lunch" checked={m.no_lunch} /> No lunch this day</label>
|
||||
<button class="sm" type="submit">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</li>
|
||||
{/each}
|
||||
</ul>
|
||||
</section>
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
<div class="publish-bar">
|
||||
<span class="small muted tabular">{included} {included === 1 ? 'event' : 'events'}{scan.menu_items.length ? ` · ${scan.menu_items.length} menu days` : ''}</span>
|
||||
<button class="primary" onclick={publish} disabled={busy}><Send size={18} aria-hidden="true" />{busy ? 'Publishing…' : 'Publish'}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.layout { display: grid; gap: 16px; }
|
||||
@media (min-width: 900px) {
|
||||
.layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
|
||||
.photo-col { position: sticky; top: 16px; }
|
||||
.photo { max-height: calc(100vh - 140px); }
|
||||
.layout { display: grid; gap: var(--s5); }
|
||||
@media (min-width: 960px) {
|
||||
.layout { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: start; }
|
||||
.photo-col { position: sticky; top: var(--s4); }
|
||||
.photo { max-height: calc(100dvh - 140px); }
|
||||
}
|
||||
.photo-col { position: sticky; top: 0; z-index: 2; background: var(--bg); padding-bottom: 8px; }
|
||||
.photo { max-height: 38vh; overflow: auto; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); }
|
||||
|
||||
/* Phones: the photo stays pinned above the list, so a tapped event is always visible on it. */
|
||||
.photo-col { position: sticky; top: 0; z-index: var(--z-sticky); background: var(--bg); padding-bottom: var(--s2); }
|
||||
.photo-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-1); }
|
||||
.photo-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); padding: var(--s1) var(--s1) var(--s1) var(--s3); border-bottom: 1px solid var(--border); min-height: 48px; }
|
||||
.photo { max-height: 36dvh; overflow: auto; background: var(--surface-2); }
|
||||
.frame { position: relative; }
|
||||
.frame img { display: block; width: 100%; height: auto; }
|
||||
.zoom .frame { width: 250%; }
|
||||
.box { position: absolute; border: 3px solid var(--accent); background: var(--highlight); border-radius: 4px; pointer-events: none; }
|
||||
.toolbar { position: sticky; top: calc(38vh + 52px); z-index: 1; background: var(--bg); padding: 8px 0; }
|
||||
@media (min-width: 900px) { .toolbar { top: 0; } }
|
||||
.events { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
|
||||
.event { padding: 8px 12px; }
|
||||
.event.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
|
||||
.line { display: flex; align-items: center; gap: 8px; }
|
||||
.item {
|
||||
flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left;
|
||||
border: 0; background: none; padding: 4px 0; min-width: 0;
|
||||
.box { position: absolute; border: 3px solid var(--primary); background: var(--highlight); border-radius: 6px; pointer-events: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 20%, transparent); }
|
||||
|
||||
.list-col { display: flex; flex-direction: column; gap: var(--s5); min-width: 0; }
|
||||
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
|
||||
.bulk { display: flex; flex-direction: column; gap: var(--s3); border-color: var(--primary); }
|
||||
.kind-set { display: inline-flex; gap: var(--s2); }
|
||||
.kind-set select { width: auto; min-height: 44px; padding: 0 var(--s2); font-size: var(--fs-sm); }
|
||||
.new-event { display: flex; flex-direction: column; gap: var(--s2); }
|
||||
|
||||
.section-title.warn { color: var(--warn); }
|
||||
.section-title.info { color: var(--info); }
|
||||
|
||||
.event {
|
||||
background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--child);
|
||||
border-radius: var(--r-lg); padding: var(--s2) var(--s2) var(--s2) var(--s3); box-shadow: var(--shadow-1);
|
||||
transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
|
||||
}
|
||||
.title { font-weight: 600; display: flex; align-items: center; gap: 8px; }
|
||||
.disclosure { margin-top: 16px; padding: 0; font-weight: 600; }
|
||||
.bulk { margin-bottom: 8px; }
|
||||
.menu-day textarea { margin: 8px 0; }
|
||||
.event.active { border-color: var(--primary); border-left-color: var(--child); box-shadow: 0 0 0 3px var(--highlight); }
|
||||
.event.off { opacity: 0.75; }
|
||||
.line { display: flex; align-items: center; gap: var(--s2); }
|
||||
.kind { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: var(--r-md); background: var(--surface-2); color: var(--text-2); }
|
||||
.item {
|
||||
flex: 1; min-width: 0; min-height: 48px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
|
||||
padding: var(--s1) var(--s1); border: 0; background: none; text-align: left; white-space: normal; font-weight: 400;
|
||||
}
|
||||
.item:hover:not(:disabled) { background: none; }
|
||||
.item:active:not(:disabled) { transform: none; }
|
||||
.title { font-weight: 650; font-size: var(--fs-md); color: var(--text); }
|
||||
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: var(--fs-sm); color: var(--text-2); }
|
||||
.loc { display: inline-flex; align-items: center; gap: 2px; }
|
||||
.sep { color: var(--text-3); }
|
||||
.badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
|
||||
|
||||
.disclosure { align-self: flex-start; padding: 0 var(--s2); color: var(--text-2); font-size: var(--fs-sm); }
|
||||
.disclosure .count { color: var(--text-3); font-weight: 600; }
|
||||
.disclosure :global(.chev) { transition: transform var(--dur) var(--ease); transform: rotate(-90deg); }
|
||||
.disclosure[aria-expanded='true'] :global(.chev) { transform: none; }
|
||||
|
||||
.menu-days { display: grid; gap: var(--s2); grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
|
||||
.menu-day textarea { min-height: 72px; }
|
||||
|
||||
.publish-bar {
|
||||
position: sticky; bottom: calc(var(--nav-h) + var(--s2) + env(safe-area-inset-bottom)); z-index: var(--z-sticky);
|
||||
display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
|
||||
padding: var(--s2) var(--s2) var(--s2) var(--s4); border-radius: var(--r-lg);
|
||||
background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-3);
|
||||
}
|
||||
@media (min-width: 1024px) { .publish-bar { bottom: var(--s4); } }
|
||||
@media (max-width: 420px) { .hide-sm { display: none; } }
|
||||
</style>
|
||||
Reference in new issue
Block a user