@spunto/brand-kit 0.8.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/home/check.ts +6 -0
- package/src/home/editions/desktop.json +386 -0
- package/src/home/editions/foyer.json +329 -0
- package/src/home/editions.ts +2 -2
- package/src/home/guide.ts +3 -2
- package/src/home/home.tsx +9 -3
- package/src/home/showcase/catalog.ts +67 -3
- package/src/home/showcase/desktop/desk.tsx +195 -0
- package/src/home/showcase/desktop/drive.tsx +71 -0
- package/src/home/showcase/desktop/handoff.tsx +94 -0
- package/src/home/showcase/desktop/launcher.tsx +161 -0
- package/src/home/showcase/desktop/parts.tsx +388 -0
- package/src/home/showcase/desktop/sample.ts +157 -0
- package/src/home/showcase/desktop/wall.tsx +85 -0
- package/src/home/showcase/foyer/book.tsx +149 -0
- package/src/home/showcase/foyer/pantry.tsx +159 -0
- package/src/home/showcase/foyer/parts.tsx +226 -0
- package/src/home/showcase/foyer/phone.tsx +256 -0
- package/src/home/showcase/foyer/sample.ts +174 -0
- package/src/home/showcase/foyer/week.tsx +204 -0
- package/src/home/showcase/stage.tsx +28 -12
- package/src/home/showcase/view.tsx +16 -0
- package/src/home/types.ts +3 -0
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import type { ReactNode } from "react"
|
|
4
|
+
import { FONT, hexAlpha } from "../../../theme"
|
|
5
|
+
import { INK, MUTED, Stage, u, useStage, type StageColors } from "../stage"
|
|
6
|
+
import { Btn, Bubble, Chip, FoyerMark, Glyph, Painting, Pill, t, type FoyerIcon, type Lang } from "./parts"
|
|
7
|
+
import { APP, PROPOSAL, THREAD, TODAY, TONIGHT, UI, WEEK, painting } from "./sample"
|
|
8
|
+
|
|
9
|
+
/* The phone, for a hero's column: the Menus page as the app draws it on a phone (« Ce soir » on top, the days under it,
|
|
10
|
+
the round Assistant button in the bottom bar). Nothing is planned tonight; the button is pressed, the assistant's
|
|
11
|
+
sheet rises, it reads the pantry and the cookbook, proposes, is told yes — the sheet goes down on a planned
|
|
12
|
+
evening, tonight's dish painted on top.
|
|
13
|
+
|
|
14
|
+
Drawn from the app at phone width (app/src/views/menus.jsx, the bottom bar of components/shell — five tabs and the
|
|
15
|
+
Assistant in the middle) and the assistant's panel (components/panel.jsx). Its own board: 400 wide. */
|
|
16
|
+
|
|
17
|
+
const BOARD = 400
|
|
18
|
+
const H = 640
|
|
19
|
+
const STILL = 7
|
|
20
|
+
/* 0 rest · 1 the button · 2 the sheet, the question · 3 it reads · 4 its proposal · 5 « oui » · 6 the sheet goes down · 7 planned · 8 rest */
|
|
21
|
+
const LENGTHS = [1400, 600, 1600, 1300, 2600, 900, 700, 3600, 600] as const
|
|
22
|
+
|
|
23
|
+
const PHONE = { x: 52, y: 18, w: 296, h: 604 }
|
|
24
|
+
|
|
25
|
+
export function PhoneScreen({ lang, colors, night, label }: { lang: Lang; colors: StageColors; night: boolean; label: string }) {
|
|
26
|
+
const { ref, step } = useStage(LENGTHS, STILL)
|
|
27
|
+
const sheet = step >= 2 && step <= 5
|
|
28
|
+
const planned = step >= 6 && step <= 8
|
|
29
|
+
const days = WEEK.slice(TODAY)
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<Stage stageRef={ref} colors={colors} night={night} height={H} label={label} board={BOARD} bare>
|
|
33
|
+
<div
|
|
34
|
+
style={{
|
|
35
|
+
position: "absolute",
|
|
36
|
+
left: u(PHONE.x),
|
|
37
|
+
top: u(PHONE.y),
|
|
38
|
+
width: u(PHONE.w),
|
|
39
|
+
height: u(PHONE.h),
|
|
40
|
+
padding: u(10),
|
|
41
|
+
borderRadius: u(44),
|
|
42
|
+
background: "#141010",
|
|
43
|
+
boxShadow: `0 ${u(30)} ${u(70)} ${u(-18)} rgba(0,0,0,0.6), inset 0 0 0 ${u(1.5)} rgba(255,255,255,0.14)`,
|
|
44
|
+
transform: "translateY(calc((0.5 - var(--p)) * 40px))",
|
|
45
|
+
}}
|
|
46
|
+
>
|
|
47
|
+
<div style={{ position: "relative", width: "100%", height: "100%", borderRadius: u(35), overflow: "hidden", background: APP.bg, color: INK }}>
|
|
48
|
+
{/* the app's top bar */}
|
|
49
|
+
<div style={{ display: "flex", alignItems: "center", gap: u(7), height: u(46), padding: `${u(10)} ${u(14)} 0`, borderBottom: `1px solid ${APP.border}` }}>
|
|
50
|
+
<FoyerMark size={20} colors={colors} />
|
|
51
|
+
<span style={{ fontFamily: FONT.display, fontSize: u(14) }}>Foyer</span>
|
|
52
|
+
<span style={{ marginLeft: "auto", display: "grid", placeItems: "center", width: u(22), height: u(22), borderRadius: u(5), background: "#f6c9c4", color: "#b42318", fontSize: u(9), fontWeight: 600 }}>C</span>
|
|
53
|
+
</div>
|
|
54
|
+
|
|
55
|
+
<div style={{ padding: `${u(10)} ${u(10)} 0` }}>
|
|
56
|
+
<div style={{ display: "flex", alignItems: "center", marginBottom: u(9) }}>
|
|
57
|
+
<span style={{ fontFamily: FONT.display, fontSize: u(19) }}>{t(UI.nav[0], lang)}</span>
|
|
58
|
+
<span style={{ marginLeft: "auto", display: "flex", alignItems: "center", gap: u(5), height: u(22), padding: `0 ${u(8)}`, borderRadius: u(5), background: APP.card, boxShadow: `inset 0 0 0 1px ${APP.border}`, fontSize: u(9) }}>
|
|
59
|
+
<Glyph id="house" size={10} color={MUTED} />
|
|
60
|
+
{UI.household}
|
|
61
|
+
<Glyph id="chevron" size={9} color={MUTED} />
|
|
62
|
+
</span>
|
|
63
|
+
</div>
|
|
64
|
+
|
|
65
|
+
{/* « Ce soir » — empty, then tonight's dish */}
|
|
66
|
+
<div style={{ position: "relative", height: u(236), borderRadius: u(12), overflow: "hidden", background: APP.card, boxShadow: `0 0 0 1px ${APP.border}` }}>
|
|
67
|
+
<Layer on={!planned}>
|
|
68
|
+
<Painting src={painting("scenes/cloche")} w="100%" h={124} radius={0} />
|
|
69
|
+
<div style={{ padding: `${u(10)} ${u(12)}` }}>
|
|
70
|
+
<Kicker tone={colors.tone}>{t(UI.tonight, lang)}</Kicker>
|
|
71
|
+
<div style={{ marginTop: u(3), fontFamily: FONT.display, fontSize: u(15) }}>{t(UI.nothingTonight, lang)}</div>
|
|
72
|
+
<div style={{ marginTop: u(3), fontSize: u(8.6), color: MUTED, lineHeight: 1.4 }}>{t(UI.nothingTonightSub, lang)}</div>
|
|
73
|
+
<div style={{ display: "flex", gap: u(5), marginTop: u(8) }}>
|
|
74
|
+
<Btn icon="sparkles" tone={colors.tone} size={8.4}>
|
|
75
|
+
{t(UI.fillWeek, lang)}
|
|
76
|
+
</Btn>
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
</Layer>
|
|
80
|
+
<Layer on={planned}>
|
|
81
|
+
<Painting src={TONIGHT.painting} w="100%" h={124} radius={0}>
|
|
82
|
+
<span style={{ position: "absolute", top: u(7), left: u(7) }}>
|
|
83
|
+
<Pill kind="season" size={7.6}>
|
|
84
|
+
{t(UI.inSeason, lang)}
|
|
85
|
+
</Pill>
|
|
86
|
+
</span>
|
|
87
|
+
</Painting>
|
|
88
|
+
<div style={{ padding: `${u(10)} ${u(12)}` }}>
|
|
89
|
+
<Kicker tone={colors.tone}>
|
|
90
|
+
{t(UI.tonight, lang)} · {t(UI.tonightDate, lang)}
|
|
91
|
+
</Kicker>
|
|
92
|
+
<div style={{ marginTop: u(3), fontFamily: FONT.display, fontSize: u(17) }}>{t(TONIGHT.title, lang)}</div>
|
|
93
|
+
<div style={{ marginTop: u(3), fontSize: u(8.6), color: MUTED }}>
|
|
94
|
+
{TONIGHT.time} · {t(UI.serves, lang)}
|
|
95
|
+
</div>
|
|
96
|
+
<div style={{ display: "flex", gap: u(5), marginTop: u(8) }}>
|
|
97
|
+
<Btn icon="chef" tone={colors.tone} size={8.4}>
|
|
98
|
+
{t(UI.cook, lang)}
|
|
99
|
+
</Btn>
|
|
100
|
+
<Btn icon="book" tone={colors.tone} size={8.4} outline>
|
|
101
|
+
{t(UI.seeRecipe, lang)}
|
|
102
|
+
</Btn>
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
105
|
+
</Layer>
|
|
106
|
+
</div>
|
|
107
|
+
|
|
108
|
+
{/* the days to come */}
|
|
109
|
+
<div style={{ display: "flex", flexDirection: "column", gap: u(7), marginTop: u(10) }}>
|
|
110
|
+
{days.map((d, i) => (
|
|
111
|
+
<div key={i} style={{ display: "flex", alignItems: "center", gap: u(9), height: u(50), padding: `0 ${u(9)}`, borderRadius: u(10), background: APP.card, boxShadow: i === 0 ? `0 0 0 ${u(1.5)} ${colors.tone}` : `0 0 0 1px ${APP.border}` }}>
|
|
112
|
+
<div style={{ width: u(62), flexShrink: 0 }}>
|
|
113
|
+
<div style={{ fontFamily: FONT.display, fontSize: u(9.6), color: i === 0 ? colors.tone : INK }}>{t(d.day, lang)}</div>
|
|
114
|
+
<div style={{ display: "flex", alignItems: "center", gap: u(3), marginTop: u(2), fontSize: u(7.4), color: MUTED, textTransform: "uppercase", letterSpacing: "0.04em" }}>
|
|
115
|
+
<Glyph id="moon" size={7.4} color={MUTED} />
|
|
116
|
+
{t(UI.dinner, lang)}
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
119
|
+
<div style={{ position: "relative", flex: 1, height: u(36) }}>
|
|
120
|
+
<Layer on={!planned}>
|
|
121
|
+
<div style={{ height: "100%", display: "flex", alignItems: "center", justifyContent: "center", gap: u(4), border: `1px dashed ${APP.border}`, borderRadius: u(8), fontSize: u(8.4), color: MUTED }}>
|
|
122
|
+
<Glyph id="plus" size={8.4} color={MUTED} />
|
|
123
|
+
{t(UI.nothingPlanned, lang)}
|
|
124
|
+
</div>
|
|
125
|
+
</Layer>
|
|
126
|
+
<Layer on={planned} delay={0.15 + i * 0.18}>
|
|
127
|
+
<div style={{ display: "flex", alignItems: "center", gap: u(7), height: "100%" }}>
|
|
128
|
+
<Painting src={d.meals[0].painting} w={36} h={36} radius={7} />
|
|
129
|
+
<span style={{ minWidth: 0 }}>
|
|
130
|
+
<span style={{ display: "block", fontSize: u(9.4), fontWeight: 500 }}>{t(d.meals[0].title, lang)}</span>
|
|
131
|
+
<span style={{ display: "flex", alignItems: "center", gap: u(3), fontSize: u(7.6), color: colors.tone }}>
|
|
132
|
+
<Glyph id="book" size={7.6} color={colors.tone} />
|
|
133
|
+
{t(UI.recipe, lang)}
|
|
134
|
+
<span style={{ color: MUTED }}>{d.meals[0].time}</span>
|
|
135
|
+
</span>
|
|
136
|
+
</span>
|
|
137
|
+
</div>
|
|
138
|
+
</Layer>
|
|
139
|
+
</div>
|
|
140
|
+
</div>
|
|
141
|
+
))}
|
|
142
|
+
</div>
|
|
143
|
+
</div>
|
|
144
|
+
|
|
145
|
+
{/* the assistant's sheet */}
|
|
146
|
+
<div
|
|
147
|
+
style={{
|
|
148
|
+
position: "absolute",
|
|
149
|
+
left: 0,
|
|
150
|
+
right: 0,
|
|
151
|
+
bottom: 0,
|
|
152
|
+
height: "76%",
|
|
153
|
+
zIndex: 3,
|
|
154
|
+
borderRadius: `${u(18)} ${u(18)} 0 0`,
|
|
155
|
+
background: APP.card,
|
|
156
|
+
boxShadow: "0 -12px 40px rgba(0,0,0,0.25)",
|
|
157
|
+
transform: sheet ? "none" : "translateY(104%)",
|
|
158
|
+
transition: "transform 0.55s cubic-bezier(0.3, 0.7, 0.2, 1)",
|
|
159
|
+
display: "flex",
|
|
160
|
+
flexDirection: "column",
|
|
161
|
+
}}
|
|
162
|
+
>
|
|
163
|
+
<div style={{ alignSelf: "center", width: u(34), height: u(4), marginTop: u(7), borderRadius: u(2), background: APP.border }} />
|
|
164
|
+
<div style={{ display: "flex", alignItems: "center", gap: u(6), padding: `${u(7)} ${u(14)}`, borderBottom: `1px solid ${APP.border}`, fontSize: u(10.4), fontWeight: 600 }}>
|
|
165
|
+
<Glyph id="bot" size={13} color={colors.tone} />
|
|
166
|
+
{t(UI.assistant, lang)}
|
|
167
|
+
<span style={{ marginLeft: "auto", fontWeight: 450, fontSize: u(9), color: MUTED }}>{t(UI.todayTab, lang)}</span>
|
|
168
|
+
</div>
|
|
169
|
+
<div style={{ flex: 1, display: "flex", flexDirection: "column", justifyContent: "flex-end", gap: u(7), padding: `${u(10)} ${u(12)}`, fontSize: u(10), lineHeight: 1.4, overflow: "hidden" }}>
|
|
170
|
+
<Bubble from="you" tone={colors.tone}>
|
|
171
|
+
{t(THREAD.ask, lang)}
|
|
172
|
+
</Bubble>
|
|
173
|
+
<div style={{ display: step >= 3 ? "flex" : "none", gap: u(4) }}>
|
|
174
|
+
<Chip icon="fridge" done={step >= 4}>
|
|
175
|
+
{t(THREAD.readStock, lang)}
|
|
176
|
+
</Chip>
|
|
177
|
+
<Chip icon="book" done={step >= 4}>
|
|
178
|
+
{t(THREAD.readBook, lang)}
|
|
179
|
+
</Chip>
|
|
180
|
+
</div>
|
|
181
|
+
<Bubble from="agent" tone={colors.tone} show={step >= 4}>
|
|
182
|
+
{t(THREAD.proposal, lang)}
|
|
183
|
+
<div style={{ display: "flex", flexDirection: "column", gap: u(5), margin: `${u(6)} 0` }}>
|
|
184
|
+
{PROPOSAL.map((p, i) => (
|
|
185
|
+
<div key={i} style={{ display: "flex", alignItems: "center", gap: u(6) }}>
|
|
186
|
+
<Painting src={p.meal.painting} w={28} h={28} radius={6} />
|
|
187
|
+
<span style={{ minWidth: 0 }}>
|
|
188
|
+
<span style={{ display: "block", fontWeight: 600, fontSize: u(9.4) }}>
|
|
189
|
+
{t(p.day, lang)} · {t(p.meal.title, lang)}
|
|
190
|
+
</span>
|
|
191
|
+
<span style={{ display: "block", fontSize: u(8.2), color: MUTED }}>{t(p.note, lang)}</span>
|
|
192
|
+
</span>
|
|
193
|
+
</div>
|
|
194
|
+
))}
|
|
195
|
+
</div>
|
|
196
|
+
{t(THREAD.confirm, lang)}
|
|
197
|
+
</Bubble>
|
|
198
|
+
<Bubble from="you" tone={colors.tone} show={step >= 5}>
|
|
199
|
+
{t(THREAD.yes, lang)}
|
|
200
|
+
</Bubble>
|
|
201
|
+
</div>
|
|
202
|
+
<div style={{ display: "flex", alignItems: "center", gap: u(6), margin: `0 ${u(12)} ${u(64)}`, height: u(28), padding: `0 ${u(10)}`, borderRadius: u(20), boxShadow: `inset 0 0 0 1px ${APP.border}`, fontSize: u(8.8), color: MUTED }}>
|
|
203
|
+
<Glyph id="paperclip" size={10} color={MUTED} />
|
|
204
|
+
{t(UI.placeholder, lang)}
|
|
205
|
+
</div>
|
|
206
|
+
</div>
|
|
207
|
+
|
|
208
|
+
{/* the bottom bar: five tabs, the Assistant in the middle */}
|
|
209
|
+
<div style={{ position: "absolute", left: 0, right: 0, bottom: 0, zIndex: 4, height: u(54), display: "flex", alignItems: "flex-end", paddingBottom: u(8), background: APP.card, borderTop: `1px solid ${APP.border}` }}>
|
|
210
|
+
{([[0, "utensils"], [1, "book"], [4, "bot"], [2, "fridge"], [5, "house"]] as [number, FoyerIcon][]).map(([n, icon], i) =>
|
|
211
|
+
i === 2 ? (
|
|
212
|
+
<div key={i} style={{ flex: 1, display: "flex", flexDirection: "column", alignItems: "center", gap: u(3) }}>
|
|
213
|
+
<span
|
|
214
|
+
style={{
|
|
215
|
+
display: "grid",
|
|
216
|
+
placeItems: "center",
|
|
217
|
+
width: u(40),
|
|
218
|
+
height: u(40),
|
|
219
|
+
marginTop: u(-24),
|
|
220
|
+
borderRadius: "50%",
|
|
221
|
+
background: colors.tone,
|
|
222
|
+
boxShadow: `0 0 0 ${u(4)} ${APP.card}${step === 1 ? `, 0 0 0 ${u(9)} ${hexAlpha(colors.tone, 0.2)}` : ""}`,
|
|
223
|
+
transform: step === 1 ? "scale(0.9)" : "none",
|
|
224
|
+
transition: "transform 0.15s ease, box-shadow 0.3s ease",
|
|
225
|
+
}}
|
|
226
|
+
>
|
|
227
|
+
<Glyph id="bot" size={18} color="#ffffff" />
|
|
228
|
+
</span>
|
|
229
|
+
<span style={{ fontSize: u(7.6), color: colors.tone }}>{t(UI.nav[n], lang)}</span>
|
|
230
|
+
</div>
|
|
231
|
+
) : (
|
|
232
|
+
<div key={i} style={{ flex: 1, display: "flex", flexDirection: "column", alignItems: "center", gap: u(3), color: n === 0 ? colors.tone : MUTED }}>
|
|
233
|
+
<Glyph id={icon} size={14} color={n === 0 ? colors.tone : MUTED} />
|
|
234
|
+
<span style={{ fontSize: u(7.6) }}>{t(UI.nav[n], lang)}</span>
|
|
235
|
+
</div>
|
|
236
|
+
),
|
|
237
|
+
)}
|
|
238
|
+
</div>
|
|
239
|
+
</div>
|
|
240
|
+
</div>
|
|
241
|
+
</Stage>
|
|
242
|
+
)
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
function Kicker({ tone, children }: { tone: string; children: ReactNode }) {
|
|
246
|
+
return <div style={{ fontSize: u(7.6), fontWeight: 600, letterSpacing: "0.14em", textTransform: "uppercase", color: tone }}>{children}</div>
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/** Two states of the same place, crossfading. */
|
|
250
|
+
function Layer({ on, delay = 0, children }: { on: boolean; delay?: number; children: ReactNode }) {
|
|
251
|
+
return (
|
|
252
|
+
<div style={{ position: "absolute", inset: 0, opacity: on ? 1 : 0, transform: on ? "none" : `translateY(${u(6)})`, transition: `opacity 0.4s ease ${on ? delay : 0}s, transform 0.5s ease ${on ? delay : 0}s` }}>
|
|
253
|
+
{children}
|
|
254
|
+
</div>
|
|
255
|
+
)
|
|
256
|
+
}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
// What the Foyer screens show: the app's own words, colours and paintings, not invented ones.
|
|
2
|
+
//
|
|
3
|
+
// Drawn from coderhammer/foyer@aa0f3b1 — the Menus, Stock and Recettes pages (app/src/views/menus.jsx,
|
|
4
|
+
// stock.jsx, recettes.jsx, components/cuisine.jsx), captured on a household seeded like the landing's
|
|
5
|
+
// demo (« Chez Camille », four at the table, week of 16–22 November). The app speaks English and French
|
|
6
|
+
// (app/src/i18n/en.js, fr.js): its labels follow the page's language.
|
|
7
|
+
//
|
|
8
|
+
// The pictures are the app's own paintings (scripts/illustrations.mjs), loaded from where the app serves
|
|
9
|
+
// them — foyer.spunto.net/app/illustrations — never copied into the kit: a dish shows the painting the
|
|
10
|
+
// app would show for it (its recipe's from the Foyer cookbook, else its family's; a pantry item its
|
|
11
|
+
// produce's or its shelf's, app/src/lib/illustrations.js). When the app or its paintings change, this
|
|
12
|
+
// file is what to refresh.
|
|
13
|
+
|
|
14
|
+
import type { Words } from "../../../facts"
|
|
15
|
+
|
|
16
|
+
const w = (en: string, fr: string): Words => ({ en, fr })
|
|
17
|
+
|
|
18
|
+
/** Where the app serves its paintings. */
|
|
19
|
+
const ILLUS = "https://foyer.spunto.net/app/illustrations"
|
|
20
|
+
export const painting = (path: string) => `${ILLUS}/${path}.webp`
|
|
21
|
+
|
|
22
|
+
/** The app's surfaces: the Foyer paint's light tokens (paints.ts), the one paint of the family that tints them too. */
|
|
23
|
+
export const APP = {
|
|
24
|
+
bg: "#fff9f1",
|
|
25
|
+
card: "#fffdf9",
|
|
26
|
+
sidebar: "#fdf4e7",
|
|
27
|
+
muted: "#f7efe3",
|
|
28
|
+
border: "#e9ddd0",
|
|
29
|
+
accent: "#ffead3",
|
|
30
|
+
accentInk: "#70280a",
|
|
31
|
+
/** The cream the paintings are set on (--illus-bg). */
|
|
32
|
+
illus: "#f6ecdd",
|
|
33
|
+
green: "#3f9a4a",
|
|
34
|
+
amber: "#c77a12",
|
|
35
|
+
red: "#d13b3b",
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** The app's labels, in both languages (app/src/i18n). */
|
|
39
|
+
export const UI = {
|
|
40
|
+
nav: [w("Meal plan", "Menus"), w("Recipes", "Recettes"), w("Pantry", "Stock"), w("Lists", "Listes"), w("Assistant", "Assistant"), w("Household", "Foyer")],
|
|
41
|
+
household: "Chez Camille",
|
|
42
|
+
tonight: w("Tonight", "Ce soir"),
|
|
43
|
+
tonightDate: w("Friday 20 November", "vendredi 20 novembre"),
|
|
44
|
+
nothingTonight: w("Nothing planned tonight", "Rien de prévu ce soir"),
|
|
45
|
+
nothingTonightSub: w("The assistant can suggest a dish with what's left in the kitchen.", "L'assistant peut proposer un plat avec ce qu'il reste dans la cuisine."),
|
|
46
|
+
askIdea: w("An idea for tonight", "Une idée pour ce soir"),
|
|
47
|
+
fillWeek: w("Fill in the week", "Compléter la semaine"),
|
|
48
|
+
cook: w("Cooking mode", "Mode cuisine"),
|
|
49
|
+
seeRecipe: w("See the recipe", "Voir la recette"),
|
|
50
|
+
inSeason: w("In season", "De saison"),
|
|
51
|
+
atTable: w("4 at the table", "4 à table"),
|
|
52
|
+
serves: w("4 people", "4 personnes"),
|
|
53
|
+
week: w("Week of 16 – 22 November", "Semaine du 16 au 22 novembre"),
|
|
54
|
+
planned: (n: number) => w(`${n} meals planned · updated by Camille on 20/11/2026`, `${n} repas prévus · mis à jour par Camille le 20/11/2026`),
|
|
55
|
+
today: w("today", "aujourd'hui"),
|
|
56
|
+
lunch: w("Lunch", "Midi"),
|
|
57
|
+
dinner: w("Dinner", "Soir"),
|
|
58
|
+
recipe: w("Recipe", "Recette"),
|
|
59
|
+
nothingPlanned: w("Nothing planned", "Rien de prévu"),
|
|
60
|
+
assistant: w("Assistant", "Assistant"),
|
|
61
|
+
todayTab: w("Today", "Aujourd'hui"),
|
|
62
|
+
placeholder: w("Your question or request…", "Ta question ou ta demande…"),
|
|
63
|
+
// Stock
|
|
64
|
+
pantry: w("Pantry", "Stock"),
|
|
65
|
+
value: w("Pantry value", "Valeur du stock"),
|
|
66
|
+
items: (n: number) => w(`${n} items`, `${n} articles`),
|
|
67
|
+
rebuy: w("Running low", "À racheter"),
|
|
68
|
+
rebuyBadge: w("running low", "à racheter"),
|
|
69
|
+
in30: w("In, last 30 days", "Entrées sur 30 jours"),
|
|
70
|
+
in30Hint: w("groceries", "courses"),
|
|
71
|
+
out30: w("Used, last 30 days", "Consommé sur 30 jours"),
|
|
72
|
+
out30Hint: w("meals and waste", "repas et pertes"),
|
|
73
|
+
kitchen: w("In the kitchen", "Dans la cuisine"),
|
|
74
|
+
kitchenSub: w("For a stock check (by voice or photo), your groceries (snap the receipt) or a meal you've cooked, ask the assistant.", "Pour l'inventaire (à la voix ou en photo), les courses (photo du ticket) ou un repas cuisiné, demande à l'assistant."),
|
|
75
|
+
search: w("Find an item…", "Chercher un article…"),
|
|
76
|
+
filters: [w("All", "Tout"), w("Fridge", "Frigo"), w("Freezer", "Congélateur"), w("Cupboards", "Placards")],
|
|
77
|
+
fridge: w("Fridge", "Frigo"),
|
|
78
|
+
cupboards: w("Cupboards", "Placards"),
|
|
79
|
+
// Recettes
|
|
80
|
+
recipes: w("Recipes", "Recettes"),
|
|
81
|
+
ours: w("Our cookbook", "Notre carnet"),
|
|
82
|
+
ideas: w("Foyer ideas", "Idées Foyer"),
|
|
83
|
+
searchBook: w("Recipe, ingredient, tag…", "Recette, ingrédient, étiquette…"),
|
|
84
|
+
newRecipe: w("New recipe", "Nouvelle recette"),
|
|
85
|
+
all: (n: number) => w(`All · ${n}`, `Toutes · ${n}`),
|
|
86
|
+
official: w("Approved", "Officielle"),
|
|
87
|
+
toTry: w("To try", "À tester"),
|
|
88
|
+
neverUsed: w("Never on the meal plan", "Jamais au menu"),
|
|
89
|
+
seasonFilter: w("In season", "De saison"),
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** What the assistant's thread says — what someone at home asks, and what it answers. */
|
|
93
|
+
export const THREAD = {
|
|
94
|
+
ask: w("Plan the end of the week. Camille is vegetarian, and there are leeks left.", "Prépare la fin de semaine. Camille est végé, et il reste des poireaux."),
|
|
95
|
+
readStock: w("Reads the pantry", "Lit le stock"),
|
|
96
|
+
readBook: w("Reads the cookbook", "Lit le carnet"),
|
|
97
|
+
proposal: w("Here's the end of the week, from what's left:", "Voici la fin de semaine, avec ce qu'il reste :"),
|
|
98
|
+
confirm: w("Shall I put it on the meal plan?", "Je l'inscris au menu ?"),
|
|
99
|
+
yes: w("Yes!", "Oui !"),
|
|
100
|
+
saved: w("Meal plan updated", "Menu mis à jour"),
|
|
101
|
+
receipt: w("Here's the receipt from the shopping.", "Voilà le ticket des courses."),
|
|
102
|
+
readReceipt: w("Reads the receipt", "Lit le ticket"),
|
|
103
|
+
stocked: w("4 items added to the pantry", "4 articles rangés dans le stock"),
|
|
104
|
+
page: w("Add this recipe (photo)", "Ajoute cette recette (photo)"),
|
|
105
|
+
readPage: w("Reads the page", "Lit la page"),
|
|
106
|
+
added: w("“Sweet potato curry” added to the cookbook", "« Curry de patate douce » ajoutée au carnet"),
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export type Meal = { title: Words; painting: string; slot?: "lunch" | "dinner"; side?: Words; time: string }
|
|
110
|
+
|
|
111
|
+
const quiche: Meal = { title: w("Leek and comté quiche", "Quiche poireaux comté"), painting: painting("recettes/quiche-poireaux-comte"), time: "50 min" }
|
|
112
|
+
const soupe: Meal = { title: w("French onion soup", "Soupe à l'oignon gratinée"), painting: painting("recettes/soupe-oignon-gratinee"), time: "1 h" }
|
|
113
|
+
const crepes: Meal = { title: w("Homemade crêpes", "Crêpes maison"), painting: painting("recettes/crepes-maison"), time: "30 min" }
|
|
114
|
+
|
|
115
|
+
/** The week, Monday first: the first four days are planned, the last three are what the assistant fills. */
|
|
116
|
+
export const WEEK: { day: Words; meals: Meal[] }[] = [
|
|
117
|
+
{ day: w("Monday 16", "Lundi 16"), meals: [{ title: w("Pea and lemon risotto", "Risotto petits pois citron"), painting: painting("recettes/risotto-petits-pois-citron"), side: w("no parmesan for Jade", "sans parmesan pour Jade"), time: "40 min" }] },
|
|
118
|
+
{ day: w("Tuesday 17", "Mardi 17"), meals: [{ title: w("Red lentil dahl", "Dahl de lentilles corail"), painting: painting("recettes/dahl-lentilles-corail-carottes"), time: "35 min" }] },
|
|
119
|
+
{ day: w("Wednesday 18", "Mercredi 18"), meals: [{ title: w("Roast chicken, potatoes", "Poulet rôti, pommes de terre"), painting: painting("recettes/poulet-roti-pommes-de-terre"), side: w("chickpea patty for Camille", "galette de pois chiches pour Camille"), time: "1 h 15" }] },
|
|
120
|
+
{ day: w("Thursday 19", "Jeudi 19"), meals: [{ title: w("Leftover dahl", "Restes du dahl"), painting: painting("recettes/dahl-lentilles-corail-carottes"), time: "35 min" }] },
|
|
121
|
+
{ day: w("Friday 20", "Vendredi 20"), meals: [quiche] },
|
|
122
|
+
{ day: w("Saturday 21", "Samedi 21"), meals: [soupe] },
|
|
123
|
+
{ day: w("Sunday 22", "Dimanche 22"), meals: [crepes] },
|
|
124
|
+
]
|
|
125
|
+
/** Today is Friday: the fifth day. */
|
|
126
|
+
export const TODAY = 4
|
|
127
|
+
export const TONIGHT = quiche
|
|
128
|
+
|
|
129
|
+
/** The proposal, as the assistant writes it: the three days it fills. */
|
|
130
|
+
export const PROPOSAL: { day: Words; meal: Meal; note: Words }[] = [
|
|
131
|
+
{ day: w("Fri", "Ven"), meal: quiche, note: w("the leeks in the fridge", "les poireaux du frigo") },
|
|
132
|
+
{ day: w("Sat", "Sam"), meal: soupe, note: w("onions and comté in stock", "oignons et comté en stock") },
|
|
133
|
+
{ day: w("Sun", "Dim"), meal: crepes, note: w("eggs and milk in stock", "œufs et lait en stock") },
|
|
134
|
+
]
|
|
135
|
+
|
|
136
|
+
/** The pantry, as the receipt finds it: `after` once the shopping is put away. */
|
|
137
|
+
export type StockRow = { name: Words; unit: Words; painting: string; qty: number; after: number; low?: boolean; out?: boolean; price: number }
|
|
138
|
+
|
|
139
|
+
export const FRIDGE: StockRow[] = [
|
|
140
|
+
{ name: w("Butter", "Beurre doux"), unit: w("250 g block · €2.60", "plaquette 250 g · 2,60 €"), painting: painting("garde-manger/beurre"), qty: 0.6, after: 0.6, price: 2.6 },
|
|
141
|
+
{ name: w("Semi-skimmed milk", "Lait demi-écrémé"), unit: w("1 L bottle · €1.05", "bouteille 1 L · 1,05 €"), painting: painting("garde-manger/lait"), qty: 1, after: 3, low: true, price: 1.05 },
|
|
142
|
+
{ name: w("Eggs", "Œufs"), unit: w("each · €0.35", "pièce · 0,35 €"), painting: painting("garde-manger/oeufs"), qty: 2, after: 14, low: true, price: 0.35 },
|
|
143
|
+
{ name: w("Leeks", "Poireaux"), unit: w("each · €0.80", "pièce · 0,80 €"), painting: painting("saisons/poireau"), qty: 3, after: 3, price: 0.8 },
|
|
144
|
+
]
|
|
145
|
+
export const CUPBOARDS: StockRow[] = [
|
|
146
|
+
{ name: w("Red lentils", "Lentilles corail"), unit: w("500 g pack · €2.40", "paquet 500 g · 2,40 €"), painting: painting("garde-manger/riz"), qty: 0.5, after: 2.5, low: true, price: 2.4 },
|
|
147
|
+
{ name: w("Penne", "Pâtes penne"), unit: w("500 g pack · €1.20", "paquet 500 g · 1,20 €"), painting: painting("garde-manger/pates"), qty: 0, after: 2, out: true, price: 1.2 },
|
|
148
|
+
]
|
|
149
|
+
|
|
150
|
+
/** The receipt: what it lists is what `after` adds. Its shop is no real one. */
|
|
151
|
+
export const RECEIPT = {
|
|
152
|
+
shop: "ÉPICERIE DU COIN",
|
|
153
|
+
lines: [
|
|
154
|
+
["Lait ½ écrémé ×2", "2,10"],
|
|
155
|
+
["Œufs plein air ×12", "4,20"],
|
|
156
|
+
["Lentilles corail ×2", "4,80"],
|
|
157
|
+
["Penne ×2", "2,40"],
|
|
158
|
+
] as [string, string][],
|
|
159
|
+
total: "13,50",
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export type BookCard = { title: Words; painting: string; cat: Words; time: string; badge: "official" | "toTry"; season?: boolean; menu?: Words }
|
|
163
|
+
|
|
164
|
+
export const BOOK: BookCard[] = [
|
|
165
|
+
{ title: w("Shepherd's pie", "Hachis parmentier"), painting: painting("recettes/hachis-parmentier"), cat: w("Main", "Plat"), time: "1 h", badge: "official", season: true, menu: w("On the meal plan once", "Au menu 1 fois") },
|
|
166
|
+
{ title: w("Red lentil dahl", "Dahl de lentilles corail"), painting: painting("recettes/dahl-lentilles-corail-carottes"), cat: w("Main", "Plat"), time: "35 min", badge: "official", season: true, menu: w("On the meal plan 2 times", "Au menu 2 fois") },
|
|
167
|
+
{ title: w("Homemade crêpes", "Crêpes maison"), painting: painting("recettes/crepes-maison"), cat: w("Dessert", "Dessert"), time: "30 min", badge: "official", menu: w("On the meal plan once", "Au menu 1 fois") },
|
|
168
|
+
{ title: w("Roast chicken, potatoes", "Poulet rôti, pommes de terre"), painting: painting("recettes/poulet-roti-pommes-de-terre"), cat: w("Main", "Plat"), time: "1 h 15", badge: "official", menu: w("On the meal plan once", "Au menu 1 fois") },
|
|
169
|
+
{ title: w("Pea and lemon risotto", "Risotto petits pois citron"), painting: painting("recettes/risotto-petits-pois-citron"), cat: w("Main", "Plat"), time: "40 min", badge: "official", menu: w("On the meal plan once", "Au menu 1 fois") },
|
|
170
|
+
{ title: w("Leek and comté quiche", "Quiche poireaux comté"), painting: painting("recettes/quiche-poireaux-comte"), cat: w("Main", "Plat"), time: "50 min", badge: "toTry", season: true, menu: w("On the meal plan once", "Au menu 1 fois") },
|
|
171
|
+
]
|
|
172
|
+
|
|
173
|
+
/** The recipe the photo brings: written by the assistant, so painted as its family (a curry), « to try ». */
|
|
174
|
+
export const FROM_PHOTO: BookCard = { title: w("Sweet potato curry", "Curry de patate douce"), painting: painting("familles/curry"), cat: w("Main", "Plat"), time: "35 min", badge: "toTry", season: true }
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import { FONT } from "../../../theme"
|
|
4
|
+
import { AppWindow, Float, INK, MUTED, Stage, u, useStage, type StageColors } from "../stage"
|
|
5
|
+
import { AppShell, Btn, Bubble, Chip, Faces, Glyph, Painting, Pill, ROOM, t, Thread, WIN, type Lang } from "./parts"
|
|
6
|
+
import { APP, PROPOSAL, THREAD, TODAY, TONIGHT, UI, WEEK, painting, type Meal } from "./sample"
|
|
7
|
+
|
|
8
|
+
/* The Menus page: the end of the week is empty, and so is tonight. Someone at home asks the assistant; it reads the
|
|
9
|
+
pantry and the cookbook, proposes three dinners, asks before writing — and once told yes, the days fill one by
|
|
10
|
+
one with their paintings, and « Ce soir » becomes tonight's dish.
|
|
11
|
+
|
|
12
|
+
Drawn from app/src/views/menus.jsx (Tonight, the day cards, MealLine of components/cuisine.jsx) and the panel the
|
|
13
|
+
« Assistant » button opens (components/panel.jsx): the assistant proposes, then writes when told to. */
|
|
14
|
+
|
|
15
|
+
const H = 640
|
|
16
|
+
const STILL = 8
|
|
17
|
+
/* 0 rest · 1 the question · 2 it reads · 3 its proposal · 4 « oui » · 5–7 Fri, Sat, Sun fill · 8 saved · 9 the panel closes · 10 rest */
|
|
18
|
+
const LENGTHS = [1300, 1500, 1300, 2600, 900, 550, 550, 650, 3200, 500, 900] as const
|
|
19
|
+
|
|
20
|
+
const GAP = 8
|
|
21
|
+
const COL = (ROOM - GAP * 3) / 4
|
|
22
|
+
const ROW = 134
|
|
23
|
+
const GRID_TOP = 204
|
|
24
|
+
|
|
25
|
+
export function WeekScreen({ lang, colors, night, label }: { lang: Lang; colors: StageColors; night: boolean; label: string }) {
|
|
26
|
+
const { ref, step } = useStage(LENGTHS, STILL)
|
|
27
|
+
// How many of the last three days are written: none until the « oui », then one a step.
|
|
28
|
+
const written = step >= 5 && step <= 10 ? Math.min(3, step - 4) : 0
|
|
29
|
+
const planned = (i: number) => i < TODAY || i - TODAY < written
|
|
30
|
+
const tonight = planned(TODAY)
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<Stage stageRef={ref} colors={colors} night={night} height={H} label={label}>
|
|
34
|
+
<AppWindow {...WIN} h={H} address="foyer.spunto.net/app/#/menus">
|
|
35
|
+
<AppShell lang={lang} colors={colors} active={0} title={t(UI.nav[0], lang)}>
|
|
36
|
+
<Tonight lang={lang} tone={colors.tone} meal={tonight ? TONIGHT : null} />
|
|
37
|
+
|
|
38
|
+
<div style={{ position: "absolute", top: u(160), left: u(4), right: 0, display: "flex", alignItems: "flex-end" }}>
|
|
39
|
+
<div>
|
|
40
|
+
<div style={{ fontFamily: FONT.display, fontSize: u(14) }}>{t(UI.week, lang)}</div>
|
|
41
|
+
<div style={{ marginTop: u(3), fontSize: u(8.8), color: MUTED }}>{t(UI.planned(4 + written), lang)}</div>
|
|
42
|
+
</div>
|
|
43
|
+
<span style={{ marginLeft: "auto" }}>
|
|
44
|
+
<Faces size={17} />
|
|
45
|
+
</span>
|
|
46
|
+
</div>
|
|
47
|
+
|
|
48
|
+
{WEEK.map((d, i) => (
|
|
49
|
+
<DayCard key={i} lang={lang} tone={colors.tone} x={(i % 4) * (COL + GAP)} y={GRID_TOP + Math.floor(i / 4) * (ROW + GAP)} day={t(d.day, lang)} meals={d.meals} planned={planned(i)} today={i === TODAY} past={i < TODAY} />
|
|
50
|
+
))}
|
|
51
|
+
</AppShell>
|
|
52
|
+
</AppWindow>
|
|
53
|
+
|
|
54
|
+
<Float x={708} y={250} w={204} depth={120} show={step >= 1 && step <= 8}>
|
|
55
|
+
<Thread lang={lang} colors={colors}>
|
|
56
|
+
<Bubble from="you" tone={colors.tone}>
|
|
57
|
+
{t(THREAD.ask, lang)}
|
|
58
|
+
</Bubble>
|
|
59
|
+
<div style={{ display: step >= 2 ? "flex" : "none", flexWrap: "wrap", gap: u(4) }}>
|
|
60
|
+
<Chip icon="fridge" done={step >= 3}>
|
|
61
|
+
{t(THREAD.readStock, lang)}
|
|
62
|
+
</Chip>
|
|
63
|
+
<Chip icon="book" done={step >= 3}>
|
|
64
|
+
{t(THREAD.readBook, lang)}
|
|
65
|
+
</Chip>
|
|
66
|
+
</div>
|
|
67
|
+
<Bubble from="agent" tone={colors.tone} show={step >= 3}>
|
|
68
|
+
{t(THREAD.proposal, lang)}
|
|
69
|
+
<div style={{ display: "flex", flexDirection: "column", gap: u(5), margin: `${u(6)} 0` }}>
|
|
70
|
+
{PROPOSAL.map((p, i) => (
|
|
71
|
+
<div key={i} style={{ display: "flex", alignItems: "center", gap: u(6) }}>
|
|
72
|
+
<Painting src={p.meal.painting} w={26} h={26} radius={6} />
|
|
73
|
+
<span style={{ minWidth: 0 }}>
|
|
74
|
+
<span style={{ display: "block", fontWeight: 600, fontSize: u(9.4) }}>
|
|
75
|
+
{t(p.day, lang)} · {t(p.meal.title, lang)}
|
|
76
|
+
</span>
|
|
77
|
+
<span style={{ display: "block", fontSize: u(8.2), color: MUTED }}>{t(p.note, lang)}</span>
|
|
78
|
+
</span>
|
|
79
|
+
</div>
|
|
80
|
+
))}
|
|
81
|
+
</div>
|
|
82
|
+
{t(THREAD.confirm, lang)}
|
|
83
|
+
</Bubble>
|
|
84
|
+
<Bubble from="you" tone={colors.tone} show={step >= 4}>
|
|
85
|
+
{t(THREAD.yes, lang)}
|
|
86
|
+
</Bubble>
|
|
87
|
+
<div style={{ display: step >= 8 ? "flex" : "none", justifyContent: "center" }}>
|
|
88
|
+
<Pill kind="done" size={8.8}>
|
|
89
|
+
{t(THREAD.saved, lang)}
|
|
90
|
+
</Pill>
|
|
91
|
+
</div>
|
|
92
|
+
</Thread>
|
|
93
|
+
</Float>
|
|
94
|
+
</Stage>
|
|
95
|
+
)
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/** « Ce soir »: tonight's dish in large, its painting beside it — or, when nothing is planned, the cloche and an invitation. */
|
|
99
|
+
function Tonight({ lang, tone, meal }: { lang: Lang; tone: string; meal: Meal | null }) {
|
|
100
|
+
const card = { position: "absolute" as const, top: 0, left: 0, width: u(ROOM), height: u(146), borderRadius: u(12), overflow: "hidden", display: "flex" }
|
|
101
|
+
if (!meal)
|
|
102
|
+
return (
|
|
103
|
+
<div style={{ ...card, background: APP.illus, boxShadow: `0 0 0 1px ${APP.border}` }}>
|
|
104
|
+
<div style={{ flex: 1, padding: `${u(22)} ${u(22)}` }}>
|
|
105
|
+
<div style={{ fontSize: u(8.4), fontWeight: 600, letterSpacing: "0.14em", textTransform: "uppercase", color: tone }}>{t(UI.tonight, lang)}</div>
|
|
106
|
+
<div style={{ marginTop: u(5), fontFamily: FONT.display, fontSize: u(19) }}>{t(UI.nothingTonight, lang)}</div>
|
|
107
|
+
<div style={{ marginTop: u(5), maxWidth: u(300), fontSize: u(9.4), color: MUTED }}>{t(UI.nothingTonightSub, lang)}</div>
|
|
108
|
+
<div style={{ display: "flex", gap: u(6), marginTop: u(12) }}>
|
|
109
|
+
<Btn icon="sparkles" tone={tone} size={9}>
|
|
110
|
+
{t(UI.fillWeek, lang)}
|
|
111
|
+
</Btn>
|
|
112
|
+
<Btn icon="sparkles" tone={tone} size={9} outline>
|
|
113
|
+
{t(UI.askIdea, lang)}
|
|
114
|
+
</Btn>
|
|
115
|
+
</div>
|
|
116
|
+
</div>
|
|
117
|
+
<Painting src={painting("scenes/cloche")} w={260} h="100%" radius={0} />
|
|
118
|
+
</div>
|
|
119
|
+
)
|
|
120
|
+
return (
|
|
121
|
+
<div style={{ ...card, background: APP.card, boxShadow: `0 0 0 1px ${APP.border}` }}>
|
|
122
|
+
<div style={{ flex: 1, padding: `${u(20)} ${u(22)}` }}>
|
|
123
|
+
<div style={{ fontSize: u(8.4), fontWeight: 600, letterSpacing: "0.14em", textTransform: "uppercase", color: tone }}>
|
|
124
|
+
{t(UI.tonight, lang)} · {t(UI.tonightDate, lang)}
|
|
125
|
+
</div>
|
|
126
|
+
<div style={{ marginTop: u(5), fontFamily: FONT.display, fontSize: u(21), lineHeight: 1.1 }}>{t(meal.title, lang)}</div>
|
|
127
|
+
<div style={{ display: "flex", alignItems: "center", gap: u(6), marginTop: u(7), fontSize: u(8.8), color: MUTED }}>
|
|
128
|
+
<Pill kind="season">{t(UI.inSeason, lang)}</Pill>
|
|
129
|
+
{meal.time} · {t(UI.serves, lang)}
|
|
130
|
+
</div>
|
|
131
|
+
<div style={{ display: "flex", alignItems: "center", gap: u(6), marginTop: u(6), fontSize: u(8.8), color: MUTED }}>
|
|
132
|
+
{t(UI.atTable, lang)} <Faces size={13} />
|
|
133
|
+
</div>
|
|
134
|
+
<div style={{ display: "flex", gap: u(6), marginTop: u(10) }}>
|
|
135
|
+
<Btn icon="chef" tone={tone} size={9}>
|
|
136
|
+
{t(UI.cook, lang)}
|
|
137
|
+
</Btn>
|
|
138
|
+
<Btn icon="book" tone={tone} size={9} outline>
|
|
139
|
+
{t(UI.seeRecipe, lang)}
|
|
140
|
+
</Btn>
|
|
141
|
+
</div>
|
|
142
|
+
</div>
|
|
143
|
+
<Painting src={meal.painting} w={300} h="100%" radius={0} />
|
|
144
|
+
</div>
|
|
145
|
+
)
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/** A day of the week: its name, a faint lunch line, and dinner — a meal with its painting, or a dashed « Rien de prévu ». The
|
|
149
|
+
meal is always drawn, so that it can rise in when it is written. */
|
|
150
|
+
function DayCard({ lang, tone, x, y, day, meals, planned, today, past }: { lang: Lang; tone: string; x: number; y: number; day: string; meals: Meal[]; planned: boolean; today: boolean; past: boolean }) {
|
|
151
|
+
const swap = "opacity 0.35s ease, transform 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.25)"
|
|
152
|
+
return (
|
|
153
|
+
<div
|
|
154
|
+
style={{
|
|
155
|
+
position: "absolute",
|
|
156
|
+
left: u(x),
|
|
157
|
+
top: u(y),
|
|
158
|
+
width: u(COL),
|
|
159
|
+
height: u(ROW),
|
|
160
|
+
padding: u(8),
|
|
161
|
+
borderRadius: u(10),
|
|
162
|
+
background: APP.card,
|
|
163
|
+
boxShadow: today ? `0 0 0 ${u(1.5)} ${tone}` : `0 0 0 1px ${APP.border}`,
|
|
164
|
+
opacity: past ? 0.72 : 1,
|
|
165
|
+
display: "flex",
|
|
166
|
+
flexDirection: "column",
|
|
167
|
+
}}
|
|
168
|
+
>
|
|
169
|
+
<div style={{ display: "flex", alignItems: "center", gap: u(5), fontFamily: FONT.display, fontSize: u(10.4), color: today ? tone : INK }}>
|
|
170
|
+
{day}
|
|
171
|
+
{today && <Pill kind="today" size={7.4}>{t(UI.today, lang)}</Pill>}
|
|
172
|
+
<Glyph id="people" size={9} color={MUTED} style={{ marginLeft: "auto" }} />
|
|
173
|
+
</div>
|
|
174
|
+
<div style={{ display: "flex", alignItems: "center", gap: u(4), marginTop: u(6), fontSize: u(8), color: MUTED, opacity: 0.7 }}>
|
|
175
|
+
<Glyph id="sun" size={8} color={MUTED} />
|
|
176
|
+
{t(UI.lunch, lang)}
|
|
177
|
+
</div>
|
|
178
|
+
<div style={{ display: "flex", alignItems: "center", gap: u(4), marginTop: u(4), fontSize: u(8), fontWeight: 550, letterSpacing: "0.04em", textTransform: "uppercase", color: MUTED }}>
|
|
179
|
+
<Glyph id="moon" size={8} color={MUTED} />
|
|
180
|
+
{t(UI.dinner, lang)}
|
|
181
|
+
</div>
|
|
182
|
+
<div style={{ position: "relative", flex: 1, marginTop: u(6) }}>
|
|
183
|
+
<div style={{ position: "absolute", inset: 0, display: "flex", alignItems: "center", justifyContent: "center", gap: u(4), border: `1px dashed ${APP.border}`, borderRadius: u(9), fontSize: u(8.6), color: MUTED, opacity: planned ? 0 : 1, transition: "opacity 0.3s ease" }}>
|
|
184
|
+
<Glyph id="plus" size={9} color={MUTED} />
|
|
185
|
+
{t(UI.nothingPlanned, lang)}
|
|
186
|
+
</div>
|
|
187
|
+
{meals.map((m, i) => (
|
|
188
|
+
<div key={i} style={{ position: "relative", display: "flex", gap: u(7), opacity: planned ? 1 : 0, transform: planned ? "none" : `translateY(${u(8)}) scale(0.94)`, transition: swap }}>
|
|
189
|
+
<Painting src={m.painting} w={40} h={40} radius={8} />
|
|
190
|
+
<div style={{ minWidth: 0, display: "flex", flexDirection: "column", gap: u(2) }}>
|
|
191
|
+
<span style={{ fontSize: u(9.6), lineHeight: 1.25, fontWeight: 500 }}>{t(m.title, lang)}</span>
|
|
192
|
+
{m.side && <span style={{ fontSize: u(7.8), color: MUTED, lineHeight: 1.25 }}>{t(m.side, lang)}</span>}
|
|
193
|
+
<span style={{ display: "flex", alignItems: "center", gap: u(3), fontSize: u(7.8), color: tone }}>
|
|
194
|
+
<Glyph id="book" size={8} color={tone} />
|
|
195
|
+
{t(UI.recipe, lang)}
|
|
196
|
+
<span style={{ color: MUTED }}>{m.time}</span>
|
|
197
|
+
</span>
|
|
198
|
+
</div>
|
|
199
|
+
</div>
|
|
200
|
+
))}
|
|
201
|
+
</div>
|
|
202
|
+
</div>
|
|
203
|
+
)
|
|
204
|
+
}
|