[ui] Rose: The rose with her face and words, water by holding, care when needed, her numbers on request
This commit is contained in:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user