[ui] Rose: The rose with her face and words, water by holding, care when needed, her numbers on request

This commit is contained in:
2026-11-02 00:20:59 +01:00
parent 2b5cd719c1
commit 6a3ca84aaa
7 changed files with 484 additions and 1 deletions
+11 -1
View File
@@ -4,18 +4,23 @@
import { en } from './copy/en.js';
import Letter from './letter/Letter.svelte';
import { parseLetter } from './letter/parse.js';
import Rose from './rose/Rose.svelte';
import type { RoseWiring } from './rose/types.js';
import SunsetLine from './sunset/SunsetLine.svelte';
import SunsetPlace from './sunset/SunsetPlace.svelte';
import type { SunsetChoice, SunsetWiring } from './sunset/types.js';
let {
letter = '',
sunset
sunset,
rose
}: {
/** The author's Markdown from docs/LETTER.md. Empty means there is no way to the page. */
letter?: string;
/** Where the sunset is, and how to keep it. Absent, the garden shows no sunset at all. */
sunset?: SunsetWiring;
/** The rose and her care log. Absent, the garden has no rose. */
rose?: RoseWiring;
} = $props();
// --- The sunset (sunset-place.md) ---------------------------------------
@@ -28,6 +33,8 @@
let sunLine = $state<HTMLElement>();
const place = $derived(choice?.kind === 'town' ? choice.town : (sunset?.guess ?? null));
// One zone for the sunset and the rose's days: the chosen town's, else the device's (rose.md R8).
const roseZone = $derived(choice?.kind === 'town' ? choice.town.timeZone : (rose?.deviceZone ?? 'UTC'));
$effect(() => {
const wiring = sunset;
@@ -105,6 +112,9 @@
<main class="shell">
<h1 bind:this={heading} tabindex="-1">{PRODUCT_NAME}</h1>
<p>{en.shell.preparing}</p>
{#if rose}
<Rose wiring={rose} timeZone={roseZone} />
{/if}
{#if sunset && (status === 'asking' || changing)}
<SunsetPlace
guess={sunset.guess}