diff --git a/CLAUDE.md b/CLAUDE.md index 7deeed5..e478739 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,13 +1,13 @@ -# „Was gibt's?“ (lunch) — Projekt-Briefing für Claude Code +# foodplanhero (lunch) — Projekt-Briefing für Claude Code -> **Produkt:** „Was gibt's?“ — die Familie entscheidet gemeinsam, was es warm +> **Produkt:** foodplanhero („Plan. Cook. Smile.“, für Maike; bis 26.11.34 „Was gibt's?“) — die Familie entscheidet gemeinsam, was es warm > gibt, und aus dem Plan entsteht die Einkaufsliste. Konzept: `docs/konzept.md`. > **Technischer Name:** `lunch` (E-0003). **Maintainer:** Kai Böhm. > **Nutzerin, für die gebaut wird:** die Planerin (bei uns Maike). > **Plattform:** Olares One (Kubernetes), Repo und CI auf Gitea — kein Supabase, > kein Vercel (E-0001). Eigene Gestaltung, nicht AImighty (E-0002). > Verteilung über den Markt, Repo öffentlich (E-0005). -> **Status:** 26.11.34 — alle neun Arbeitspakete aus `docs/PROJEKTSTART.md` sind gebaut: +> **Status:** 26.11.35 — alle neun Arbeitspakete aus `docs/PROJEKTSTART.md` sind gebaut: > Anmeldung (Passkeys, Kinder mit Gerät + PIN), Gerichte (Link, Kochbuchfoto, AI über den > Olares Router), Wünschen, Plan, Einkaufsliste (Echtzeit, offline), Kochmodus mit > Bewertung, Web-App; Einzahl bei Stück-Mengen (26.11.15), Preise und Kosten mit Ampel @@ -16,7 +16,8 @@ > Produkte je Gericht (26.11.21), Veto mit Gegenvorschlag (26.11.22), > bis zu 5 Fotos je Gericht (26.11.23), Gerichte einsprechen (26.11.24), Kassenbons (V2b, 26.11.25), > Führung (26.11.27), Präsentationsmodus und Küchendisplay (26.11.28), -> lange Bons und Aldi (26.11.29), „Mein Gericht“ (26.11.30). Offen ist der +> lange Bons und Aldi (26.11.29), „Mein Gericht“ (26.11.30), Bons „nicht zum Kochen“ +> (26.11.33), foodplanhero für Maike (26.11.35). Offen ist der > Magic Link (braucht SMTP). > **Letzte Aktualisierung:** 7. November 2026 @@ -412,6 +413,20 @@ Vorlagen ersetzt. `tests/seed.test.ts` prüft die Dateien. Ein Haushalt - In einer Karte (`bg-secondary`) kein `outline`-Knopf: Seitenfläche auf Kartenfläche wirkt im Dunkeln wie ein Loch. Zweite Wege als Textlink, Nebenknöpfe bündig (`px-0`), seit 26.11.31. +## foodplanhero für Maike (seit 26.11.35, E-0013) + +- Name in der Oberfläche „foodplanhero“ (`app.name`), technisch bleibt alles `lunch` + (appid, Chart, Datenbank). Slogan „Plan. Cook. Smile.“. +- `components/brand/brand.tsx`: `Wordmark` (Poppins Bold, „hero“ in `--hero`), `Slogan` + (`active` hebt plan/cook/smile hervor), `Portrait` (grüner Ring, „by Maike“ in Caveat, + 5,31° gedreht — nach Kais Figma). Schriften lokal: `app/fonts` (woff2) und + `lib/brand-fonts` (woff fürs Startbild, `outputFileTracingIncludes` in next.config). +- Widmung je Haushalt (`households.dedication_*`, Migration 0021): Foto unter + `/app/data/fotos//widmung-*.webp`, nie im Repo. `/api/widmung/foto` liefert es + auch ohne Sitzung (Anmelden, Einladung, Startbild) — von Kai so gewollt. +- Startbild: `/startbild/x` (`next/og`), Größen in `lib/startup-sizes.ts`, verlinkt + über `appleWebApp.startupImage`. Nur solange die App lädt, keine künstliche Pause. + ## Mein Gericht (seit 26.11.30, Kai und Mike, E-0012) - `wishes.is_mine` (Migration 0019, eins je Person und Runde, nie an einem Veto oder diff --git a/OlaresManifest.yaml b/OlaresManifest.yaml index b28989a..d63ad02 100644 --- a/OlaresManifest.yaml +++ b/OlaresManifest.yaml @@ -1,5 +1,5 @@ # ============================================================================ -# OlaresManifest.yaml — Lunch („Was gibt's?“) +# OlaresManifest.yaml — foodplanhero (lunch, bis 26.11.35 „Was gibt's?“) # # Linter-Regeln, die hier zwingend gelten (scripts/check-chart.sh): # - metadata.name, metadata.appid, Chart.yaml.name und der Ordnername @@ -18,10 +18,10 @@ workloadReplicas: metadata: name: lunch appid: lunch - title: What's cooking? - description: The family decides together what's for dinner — and the shopping list writes itself. Runs entirely on your own box. + title: foodplanhero + description: Plan. Cook. Smile. The family decides together what's for dinner — and the shopping list writes itself. Runs entirely on your own box. icon: https://git.aimighty.olares.de/aimighty/bilder/raw/branch/main/lunch/icon.png - version: 26.11.34 + version: 26.11.35 categories: - Applications @@ -38,7 +38,7 @@ entrances: - name: lunch host: lunch port: 3000 - title: What's cooking? + title: foodplanhero icon: https://git.aimighty.olares.de/aimighty/bilder/raw/branch/main/lunch/icon.png authLevel: public invisible: false @@ -61,14 +61,14 @@ permission: appData: true spec: - versionName: '26.11.34' + versionName: '26.11.35' featuredImage: https://git.aimighty.olares.de/aimighty/bilder/raw/branch/main/lunch/icon.png promoteImage: - https://git.aimighty.olares.de/aimighty/bilder/raw/branch/main/lunch/icon.png fullDescription: | - **What's cooking?** takes the daily "what are we eating?" off the + **foodplanhero** — Plan. Cook. Smile. — takes the daily "what are we eating?" off the person who usually plans. Everyone in the family wishes for dishes in ten seconds — children diff --git a/README.md b/README.md index 5b3ac2a..acc546d 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ -# Was gibt's? (lunch) +# foodplanhero (lunch) Die Familie entscheidet gemeinsam, was es warm gibt, und aus dem Plan entsteht die Einkaufsliste — als PWA auf der eigenen Olares One. Konzept in [`docs/konzept.md`](docs/konzept.md), Weichen in [`docs/entscheidungen.md`](docs/entscheidungen.md), Regeln für jede Sitzung in [`CLAUDE.md`](CLAUDE.md), Daten und Arbeitspakete für den Start in [`docs/PROJEKTSTART.md`](docs/PROJEKTSTART.md). diff --git a/app/(app)/kochen/[id]/page.tsx b/app/(app)/kochen/[id]/page.tsx index 9b91ca8..dfa4d5f 100644 --- a/app/(app)/kochen/[id]/page.tsx +++ b/app/(app)/kochen/[id]/page.tsx @@ -5,6 +5,7 @@ import { CookingMode } from "@/components/cooking/cooking-mode"; import { requireSession } from "@/lib/auth/session"; import { cookingSlot } from "@/lib/cooking"; import { withHousehold } from "@/lib/db"; +import { Slogan } from "@/components/brand/brand"; export const dynamic = "force-dynamic"; @@ -22,6 +23,7 @@ export default async function CookingPage({ params }: { params: Promise<{ id: st

{slot.cookName ? t("eyebrowCook", { name: slot.cookName }) : t("eyebrow")}

{slot.dish.title}

+
{slot.cookedAt ? (

{t("alreadyCooked")}

diff --git a/app/(app)/mehr/page.tsx b/app/(app)/mehr/page.tsx index 4cfb170..68fe7aa 100644 --- a/app/(app)/mehr/page.tsx +++ b/app/(app)/mehr/page.tsx @@ -6,6 +6,9 @@ import { LanguageSelect, SignOutButton } from "@/components/more/account-actions import { RemoveButton } from "@/components/more/remove-button"; import { requireAdult } from "@/lib/auth/session"; import { KidDevices, KidsAdmin } from "@/components/more/kids-admin"; +import { DedicationForm } from "@/components/more/dedication-form"; +import { Portrait, Slogan, Wordmark } from "@/components/brand/brand"; +import { getDedication, photoVersion } from "@/lib/dedication"; import { aiFor } from "@/lib/ai-settings"; import { InstallHint } from "@/components/install-hint"; import { BudgetSettings } from "@/components/more/budget-settings"; @@ -27,7 +30,7 @@ export default async function MorePage() { const t = await getTranslations("more"); const tc = await getTranslations("costs.settings"); const locale = await getLocale(); - const { members, passkeys, founder, kids, kidDevices, money } = await withHousehold(session.householdId, async (client) => { + const { members, passkeys, founder, kids, kidDevices, money, dedication } = await withHousehold(session.householdId, async (client) => { const members = (await client.query("select id, display_name, role from members order by created_at")).rows; const founder = (await client.query("select created_by from households")).rows[0]?.created_by as string | null; const passkeys = ( @@ -43,7 +46,7 @@ export default async function MorePage() { ) ).rows; const money = (await client.query("select budget_per_round::float as budget, expensive_per_slots as per, currency from households")).rows[0]; - return { members, passkeys, founder, kids, kidDevices, money }; + return { members, passkeys, founder, kids, kidDevices, money, dedication: await getDedication(client) }; }); const aiReady = !!(await aiFor(session.householdId)); const date = new Intl.DateTimeFormat(locale, { dateStyle: "medium" }); @@ -134,6 +137,20 @@ export default async function MorePage() { ) : null} + {dedication.photo || dedication.text || session.role === "admin" ? ( +
+ {dedication.photo ? ( + + ) : null} + {dedication.text ?

{dedication.text}

: null} +

+ + +

+ {session.role === "admin" ? : null} +
+ ) : null} +
diff --git a/app/(app)/plan/page.tsx b/app/(app)/plan/page.tsx index 28f53b8..9b53feb 100644 --- a/app/(app)/plan/page.tsx +++ b/app/(app)/plan/page.tsx @@ -9,6 +9,7 @@ import { listDishes } from "@/lib/dishes"; import { planSlots } from "@/lib/plan"; import { currentRound } from "@/lib/rounds"; import { cn } from "@/lib/utils"; +import { Slogan } from "@/components/brand/brand"; export const dynamic = "force-dynamic"; @@ -42,6 +43,7 @@ export default async function PlanPage() {

{data.round ? t(`status.${data.round.status}`) : t("eyebrow")}

{t("title")}

+ {data.round && data.round.status !== "open" ? : null} {data.round ? (

{[day, t("meals", { n: data.round.slotsCount }), t("wishes", { n: "wishCount" in data ? data.wishCount ?? 0 : 0 })].filter(Boolean).join(" · ")} diff --git a/app/anmelden/page.tsx b/app/anmelden/page.tsx index 002941c..a243e8f 100644 --- a/app/anmelden/page.tsx +++ b/app/anmelden/page.tsx @@ -6,6 +6,7 @@ import { getTranslations } from "next-intl/server"; import { AuthShell } from "@/components/auth/auth-shell"; import { LoginButton } from "@/components/auth/login-button"; import { getSession, isSetUp } from "@/lib/auth/session"; +import { photoVersion, publicDedication } from "@/lib/dedication"; export const dynamic = "force-dynamic"; @@ -13,8 +14,10 @@ export default async function SignInPage() { if (!(await isSetUp())) redirect("/einrichten"); if (await getSession()) redirect("/"); const t = await getTranslations("auth.login"); + const d = await publicDedication(); + const portrait = d?.photo ? { src: `/api/widmung/foto?v=${photoVersion(d.photo)}`, name: d.name ?? "Maike" } : null; return ( - + {(await cookies()).has(KIDS_COOKIE) ? ( diff --git a/app/api/household/dedication/route.ts b/app/api/household/dedication/route.ts new file mode 100644 index 0000000..19f8e7f --- /dev/null +++ b/app/api/household/dedication/route.ts @@ -0,0 +1,35 @@ +import { guardWrite, isResponse } from "@/lib/auth/guard"; +import { fail, json } from "@/lib/auth/http"; +import { withHousehold } from "@/lib/db"; +import { PhotoRejected, removePhoto, storePhoto } from "@/lib/photos"; + +export const dynamic = "force-dynamic"; + +// Widmung pflegen (26.11.35): Name, ein paar Sätze, ein Foto — nur Admins. +// Felder als Formular, damit das Foto in derselben Anfrage mitkommen kann. +export async function PUT(request: Request) { + const session = await guardWrite(request, ["admin"]); + if (isResponse(session)) return session; + const form = await request.formData().catch(() => null); + if (!form) return fail("invalid", 400); + const name = String(form.get("name") ?? "").trim(); + const text = String(form.get("text") ?? "").trim(); + if (name.length > 40 || text.length > 800) return fail("invalid", 400); + const file = form.get("photo"); + const drop = form.get("removePhoto") === "1"; + try { + const result = await withHousehold(session.householdId, async (c) => { + const old = (await c.query("select dedication_photo as photo from households")).rows[0]?.photo as string | null; + let photo = old; + if (file instanceof File && file.size > 0) photo = await storePhoto(session.householdId, "widmung", file); + else if (drop) photo = null; + await c.query("update households set dedication_name = $1, dedication_text = $2, dedication_photo = $3", [name || null, text || null, photo]); + return { old, photo }; + }); + if (result.old && result.old !== result.photo) await removePhoto(result.old); + return json({ ok: true, photo: !!result.photo }); + } catch (error) { + if (error instanceof PhotoRejected) return fail("photo", 400); + throw error; + } +} diff --git a/app/api/widmung/foto/route.ts b/app/api/widmung/foto/route.ts new file mode 100644 index 0000000..577f01e --- /dev/null +++ b/app/api/widmung/foto/route.ts @@ -0,0 +1,23 @@ +import { fail } from "@/lib/auth/http"; +import { currentKitchenDisplay } from "@/lib/auth/kids"; +import { getSession } from "@/lib/auth/session"; +import { withHousehold } from "@/lib/db"; +import { publicDedication } from "@/lib/dedication"; +import { readPhoto } from "@/lib/photos"; + +export const dynamic = "force-dynamic"; + +// Maikes Foto (26.11.35). Mit Sitzung oder Küchendisplay das des eigenen Haushalts; +// ohne — Anmelden und Startbild — das des Haushalts dieser Box. Kai hat das so +// gewollt („Anmelden und Einrichten“): Wer die Adresse kennt, sieht Maike. +export async function GET() { + const session = await getSession(); + const household = session?.householdId ?? (await currentKitchenDisplay())?.householdId; + const photo = household + ? ((await withHousehold(household, async (c) => (await c.query("select dedication_photo as p from households")).rows[0]?.p)) as string | null) + : ((await publicDedication())?.photo ?? null); + if (!photo) return fail("notFound", 404); + const body = await readPhoto(photo).catch(() => null); + if (!body) return fail("notFound", 404); + return new Response(new Uint8Array(body), { headers: { "content-type": "image/webp", "cache-control": "public, max-age=31536000, immutable" } }); +} diff --git a/app/einladung/[token]/page.tsx b/app/einladung/[token]/page.tsx index b332691..594e841 100644 --- a/app/einladung/[token]/page.tsx +++ b/app/einladung/[token]/page.tsx @@ -3,6 +3,7 @@ import { AuthShell } from "@/components/auth/auth-shell"; import { InviteForm } from "@/components/auth/invite-form"; import { findInvitation } from "@/lib/auth/invitations"; import { withAuth } from "@/lib/db"; +import { photoVersion, publicDedication } from "@/lib/dedication"; export const dynamic = "force-dynamic"; // Der Link ist ein Geheimnis: nie als Referrer weitergeben. @@ -14,8 +15,12 @@ export default async function InvitationPage({ params }: { params: Promise<{ tok const invitation = token.length <= 100 ? await withAuth((client) => findInvitation(client, token)) : null; if (!invitation) return ; const isDevice = Boolean(invitation.memberId); + // Wer neu dazukommt, sieht zuerst, wem die App gewidmet ist (26.11.35). + const d = await publicDedication(); + const portrait = d?.photo ? { src: `/api/widmung/foto?v=${photoVersion(d.photo)}`, name: d.name ?? "Maike" } : null; return ( diff --git a/app/fonts/Caveat-OFL.txt b/app/fonts/Caveat-OFL.txt new file mode 100644 index 0000000..5303054 --- /dev/null +++ b/app/fonts/Caveat-OFL.txt @@ -0,0 +1,93 @@ +Copyright 2014 The Caveat Project Authors (https://github.com/googlefonts/caveat) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/app/fonts/Poppins-OFL.txt b/app/fonts/Poppins-OFL.txt new file mode 100644 index 0000000..3c49f41 --- /dev/null +++ b/app/fonts/Poppins-OFL.txt @@ -0,0 +1,93 @@ +Copyright 2020 The Poppins Project Authors (https://github.com/itfoundry/Poppins) Poppins-ThinItalic.ttf: Copyright 2020 The Poppins Project Authors (https://github.com/itfoundry/Poppins) Poppins-ExtraLight.ttf: Copyright 2020 The Poppins Project Authors (https://github.com/itfoundry/Poppins) Poppins-ExtraLightItalic.ttf: Copyright 2020 The Poppins Project Authors (https://github.com/itfoundry/Poppins) Poppins-Light.ttf: Copyright 2020 The Poppins Project Authors (https://github.com/itfoundry/Poppins) Poppins-LightItalic.ttf: Copyright 2020 The Poppins Project Authors (https://github.com/itfoundry/Poppins) Poppins-Regular.ttf: Copyright 2020 The Poppins Project Authors (https://github.com/itfoundry/Poppins) Poppins-Italic.ttf: Copyright 2020 The Poppins Project Authors (https://github.com/itfoundry/Poppins) Poppins-Medium.ttf: Copyright 2020 The Poppins Project Authors (https://github.com/itfoundry/Poppins) Poppins-MediumItalic.ttf: Copyright 2020 The Poppins Project Authors (https://github.com/itfoundry/Poppins) Poppins-SemiBold.ttf: Copyright 2020 The Poppins Project Authors (https://github.com/itfoundry/Poppins) Poppins-SemiBoldItalic.ttf: Copyright 2020 The Poppins Project Authors (https://github.com/itfoundry/Poppins) Poppins-Bold.ttf: Copyright 2020 The Poppins Project Authors (https://github.com/itfoundry/Poppins) Poppins-BoldItalic.ttf: Copyright 2020 The Poppins Project Authors (https://github.com/itfoundry/Poppins) Poppins-ExtraBold.ttf: Copyright 2020 The Poppins Project Authors (https://github.com/itfoundry/Poppins) Poppins-ExtraBoldItalic.ttf: Copyright 2020 The Poppins Project Authors (https://github.com/itfoundry/Poppins) Poppins-Black.ttf: Copyright 2020 The Poppins Project Authors (https://github.com/itfoundry/Poppins) Poppins-BlackItalic.ttf: Copyright 2020 The Poppins Project Authors (https://github.com/itfoundry/Poppins) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/app/fonts/caveat-latin-400-normal.woff2 b/app/fonts/caveat-latin-400-normal.woff2 new file mode 100644 index 0000000..fb050a6 Binary files /dev/null and b/app/fonts/caveat-latin-400-normal.woff2 differ diff --git a/app/fonts/poppins-latin-500-normal.woff2 b/app/fonts/poppins-latin-500-normal.woff2 new file mode 100644 index 0000000..c660336 Binary files /dev/null and b/app/fonts/poppins-latin-500-normal.woff2 differ diff --git a/app/fonts/poppins-latin-700-normal.woff2 b/app/fonts/poppins-latin-700-normal.woff2 new file mode 100644 index 0000000..bf022fc Binary files /dev/null and b/app/fonts/poppins-latin-700-normal.woff2 differ diff --git a/app/globals.css b/app/globals.css index 3b438ff..47dc160 100644 --- a/app/globals.css +++ b/app/globals.css @@ -23,6 +23,7 @@ --ok: oklch(0.58 0.13 155); /* Ampel: im Rahmen */ --warn: oklch(0.75 0.15 75); /* Ampel: knapp darüber */ --over: oklch(0.58 0.19 25); /* Ampel: deutlich darüber */ + --hero: oklch(0.5 0.08 150); /* foodplanhero: „hero“ im Logo, Maikes Ring (26.11.35) */ --radius: 1rem; } @@ -40,6 +41,7 @@ --secondary-foreground: var(--foreground); --accent: oklch(0.84 0.07 300); --ring: oklch(0.84 0.07 300); + --hero: oklch(0.78 0.09 150); } } @@ -60,9 +62,12 @@ --color-ok: var(--ok); --color-warn: var(--warn); --color-over: var(--over); + --color-hero: var(--hero); --radius-xl: var(--radius); --font-sans: var(--font-geist-sans), ui-sans-serif, system-ui, sans-serif; --font-serif: var(--font-newsreader), ui-serif, Georgia, serif; + --font-brand: var(--font-poppins), var(--font-geist-sans), ui-sans-serif, sans-serif; + --font-hand: var(--font-caveat), cursive; } /* Abstand fester Knopfleisten (Speichern, Übernehmen, Weiter) zur unteren Navigation. diff --git a/app/layout.tsx b/app/layout.tsx index 1d0e107..f89268e 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -4,6 +4,7 @@ import localFont from "next/font/local"; import { NextIntlClientProvider } from "next-intl"; import { getLocale, getTranslations } from "next-intl/server"; import "./globals.css"; +import { STARTUP_SIZES } from "@/lib/startup-sizes"; // Überschriften in einer Serifenschrift (E-0009), lokal aus app/fonts — // nie vom CDN. Newsreader, SIL Open Font License (app/fonts/Newsreader-OFL.txt). @@ -14,13 +15,34 @@ const serif = localFont({ display: "swap", }); +// foodplanhero (26.11.35): Logo und Slogan in Poppins, „by Maike“ in Caveat — beide +// SIL Open Font License (app/fonts/Poppins-OFL.txt, Caveat-OFL.txt), lokal. +const brand = localFont({ + src: [ + { path: "./fonts/poppins-latin-500-normal.woff2", weight: "500" }, + { path: "./fonts/poppins-latin-700-normal.woff2", weight: "700" }, + ], + variable: "--font-poppins", + display: "swap", +}); +const hand = localFont({ src: "./fonts/caveat-latin-400-normal.woff2", weight: "400", variable: "--font-caveat", display: "swap" }); + export async function generateMetadata(): Promise { const t = await getTranslations("app"); return { title: t("name"), description: t("tagline"), applicationName: t("name"), - appleWebApp: { capable: true, title: t("name"), statusBarStyle: "default" }, + appleWebApp: { + capable: true, + title: t("name"), + statusBarStyle: "default", + // Startbild mit Maike, solange die Web-App lädt (app/startbild, 26.11.35). + startupImage: STARTUP_SIZES.map(([w, h, cw, ch, dpr]) => ({ + url: `/startbild/${w}x${h}`, + media: `(device-width: ${cw}px) and (device-height: ${ch}px) and (-webkit-device-pixel-ratio: ${dpr}) and (orientation: portrait)`, + })), + }, icons: { icon: "/icon.svg", apple: "/apple-touch-icon.png" }, }; } @@ -38,7 +60,7 @@ export const viewport: Viewport = { export default async function RootLayout({ children }: { children: React.ReactNode }) { const locale = await getLocale(); return ( - + {children} diff --git a/app/startbild/[size]/route.tsx b/app/startbild/[size]/route.tsx new file mode 100644 index 0000000..0b98ad3 --- /dev/null +++ b/app/startbild/[size]/route.tsx @@ -0,0 +1,64 @@ +import { readFile } from "node:fs/promises"; +import path from "node:path"; +import { ImageResponse } from "next/og"; +import sharp from "sharp"; +import { publicDedication } from "@/lib/dedication"; +import { readPhoto } from "@/lib/photos"; +import { STARTUP_SIZES } from "@/lib/startup-sizes"; + +export const dynamic = "force-dynamic"; + +// Startbild der Web-App (26.11.35): iOS zeigt es, solange die App vom +// Home-Bildschirm lädt — keine künstliche Pause. foodplanhero, „PLAN. COOK. +// SMILE.“ und, wenn hochgeladen, Maike im grünen Ring mit „by Maike“. +// +// Farben als Hex, weil der Bildbauer kein OKLCH kennt — umgerechnet aus den +// Token in app/globals.css (--background, --foreground, --hero). +const BG = "#fefdff"; +const FG = "#1d1c23"; +const HERO = "#3f704b"; + +const fonts = (async () => { + const dir = path.join(process.cwd(), "lib", "brand-fonts"); + const [bold, medium, hand] = await Promise.all( + ["poppins-latin-700-normal.woff", "poppins-latin-500-normal.woff", "caveat-latin-400-normal.woff"].map((f) => readFile(path.join(dir, f))), + ); + return [ + { name: "Poppins", data: bold!, weight: 700 as const, style: "normal" as const }, + { name: "Poppins", data: medium!, weight: 500 as const, style: "normal" as const }, + { name: "Caveat", data: hand!, weight: 400 as const, style: "normal" as const }, + ]; +})(); + +export async function GET(_: Request, { params }: { params: Promise<{ size: string }> }) { + const { size } = await params; + const match = STARTUP_SIZES.find(([w, h]) => size === `${w}x${h}`); + if (!match) return new Response("not found", { status: 404 }); + const [width, height, , , dpr] = match; + const unit = dpr; // CSS-Pixel → Bildpixel + const d = await publicDedication().catch(() => null); + let photo: string | null = null; + if (d?.photo) { + const raw = await readPhoto(d.photo).catch(() => null); + if (raw) photo = `data:image/png;base64,${(await sharp(raw).resize(240 * unit, 240 * unit, { fit: "cover" }).png().toBuffer()).toString("base64")}`; + } + const name = d?.name ?? "Maike"; + return new ImageResponse( + ( +

+
+ foodplanhero +
+
PLAN. COOK. SMILE.
+ {photo ? ( +
+ {/* eslint-disable-next-line @next/next/no-img-element -- Bildbauer, kein DOM */} + +
by {name}
+
+ ) : null} +
+ ), + { width, height, fonts: await fonts, headers: { "cache-control": "public, max-age=3600" } }, + ); +} diff --git a/components/auth/auth-shell.tsx b/components/auth/auth-shell.tsx index 7bceddf..188feb9 100644 --- a/components/auth/auth-shell.tsx +++ b/components/auth/auth-shell.tsx @@ -1,11 +1,26 @@ -import Image from "next/image"; +import { Portrait, Slogan, Wordmark } from "@/components/brand/brand"; -// Rahmen für Einrichten, Anmelden und Einladung: Symbol, Titel, Text, Inhalt. -export function AuthShell({ title, intro, children }: { title: string; intro?: string; children?: React.ReactNode }) { +// Rahmen für Einrichten, Anmelden und Einladung: foodplanhero mit Slogan (seit +// 26.11.35 statt des Symbols), wo es eins gibt Maikes Porträt, dann Titel, Text, Inhalt. +export function AuthShell({ + title, + intro, + portrait, + children, +}: { + title: string; + intro?: string; + portrait?: { src: string; name: string } | null; + children?: React.ReactNode; +}) { return (
- +

+ + +

+ {portrait ? : null}

{title}

{intro ?

{intro}

: null}
diff --git a/components/brand/brand.tsx b/components/brand/brand.tsx new file mode 100644 index 0000000..da2772c --- /dev/null +++ b/components/brand/brand.tsx @@ -0,0 +1,40 @@ +import { cn } from "@/lib/utils"; + +// foodplanhero (Kai für Maike, 26.11.35): Wortmarke, Slogan und Maikes Porträt — +// wie in Kais Figma-Entwurf: Poppins Bold, „hero“ in Grün; „PLAN. COOK. SMILE.“ in +// Poppins Medium mit 25 % Abstand; „by Maike“ in Caveat, leicht gedreht. + +export function Wordmark({ className }: { className?: string }) { + return ( + + foodplanhero + + ); +} + +export type SloganStep = "plan" | "cook" | "smile"; +const WORDS: SloganStep[] = ["plan", "cook", "smile"]; + +/** „PLAN. COOK. SMILE.“ — mit active ist das Wort hervorgehoben, das gerade passiert. */ +export function Slogan({ active, className }: { active?: SloganStep; className?: string }) { + return ( + + {WORDS.map((w, i) => ( + + {w}.{i < WORDS.length - 1 ? " " : ""} + + ))} + + ); +} + +/** Maike im Kreis mit grünem Ring, darunter „by Maike“ in Schreibschrift. */ +export function Portrait({ src, name, size = 128, className }: { src: string; name: string; size?: number; className?: string }) { + return ( +
+ {/* eslint-disable-next-line @next/next/no-img-element -- eigenes Foto von der Box */} + {name} +
by {name}
+
+ ); +} diff --git a/components/cooking/rate-card.tsx b/components/cooking/rate-card.tsx index 5ac9a61..e70bd9b 100644 --- a/components/cooking/rate-card.tsx +++ b/components/cooking/rate-card.tsx @@ -7,6 +7,7 @@ import { useRef, useState } from "react"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { cn } from "@/lib/utils"; +import { Slogan } from "@/components/brand/brand"; type ToRate = { slotId: string; dishId: string; title: string; cookName: string | null; isCook: boolean; thanked: boolean }; @@ -43,7 +44,10 @@ export function RateCard({ item }: { item: ToRate }) { return (
-

{t("eyebrow")}

+

+ {t("eyebrow")} + +

{t("question", { title: item.title })}

diff --git a/components/more/dedication-form.tsx b/components/more/dedication-form.tsx new file mode 100644 index 0000000..4e87d07 --- /dev/null +++ b/components/more/dedication-form.tsx @@ -0,0 +1,108 @@ +"use client"; + +import { ImagePlus } from "lucide-react"; +import { useRouter } from "next/navigation"; +import { useTranslations } from "next-intl"; +import { useState } from "react"; +import { Button } from "@/components/ui/button"; +import { Input } from "@/components/ui/input"; +import { Label } from "@/components/ui/label"; +import { ErrorNotice } from "@/components/ui/notice"; + +// Widmung pflegen (nur Admin): Name, ein paar Sätze, ein Foto. Das Foto bleibt auf +// der Box (/app/data), nicht im Code (Kai, 7.11.2026). +export function DedicationForm({ name, text, hasPhoto }: { name: string; text: string; hasPhoto: boolean }) { + const t = useTranslations("more.dedication"); + const router = useRouter(); + const [busy, setBusy] = useState(false); + const [error, setError] = useState(false); + const [saved, setSaved] = useState(false); + const [file, setFile] = useState(null); + + async function send(form: FormData) { + setBusy(true); + setError(false); + setSaved(false); + const res = await fetch("/api/household/dedication", { method: "PUT", body: form }).catch(() => null); + setBusy(false); + if (!res?.ok) return setError(true); + setSaved(true); + setFile(null); + router.refresh(); + } + + return ( +
{ + e.preventDefault(); + void send(new FormData(e.currentTarget)); + }} + > +

{t("edit")}

+
+ + +
+
+ +