From 56d651246150e83ec4979118d29217c5d89afe56 Mon Sep 17 00:00:00 2001 From: kobold-ai Date: Thu, 15 Oct 2026 16:24:45 +0200 Subject: [PATCH] =?UTF-8?q?UI:=20Minimalistisches=205-Kachel-Men=C3=BC,=20?= =?UTF-8?q?1-seitiges=20Inhaltsverzeichnis=20&=20schlanker=20mobiler=20Ein?= =?UTF-8?q?kaufslisten-Header?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/main.py | 18 +- app/templates/cookbook.html | 2 +- app/templates/home.html | 733 ++++++++++++------------------- app/templates/shopping_list.html | 150 +++++-- 4 files changed, 404 insertions(+), 499 deletions(-) diff --git a/app/main.py b/app/main.py index 28af26b..89e20ee 100755 --- a/app/main.py +++ b/app/main.py @@ -326,9 +326,9 @@ async def cookbook_view( # --- Seitenzahlen & Inhaltsverzeichnis (TOC) berechnen --- # Seite 1: Cover - # TOC: 1 oder 2 Seiten (wenn > 20 Rezepte vorhanden sind) + # TOC: 1 Seite (bis ca. 55 Rezepte passt alles wunderbar auf 1 A4-Seite in 2 Spalten), 2 Seiten erst bei sehr vielen Rezepten total_display_recipes = len(all_recipes) - toc_page_count = 2 if total_display_recipes > 20 else (1 if total_display_recipes > 0 else 0) + toc_page_count = 2 if total_display_recipes > 55 else (1 if total_display_recipes > 0 else 0) current_page = 1 + toc_page_count + 1 display_chapters_data = [] @@ -349,23 +349,25 @@ async def cookbook_view( chap_copy["recipes"] = chap_recipes display_chapters_data.append(chap_copy) - # Inhaltsverzeichnis auf 2 Seiten aufteilen + # Inhaltsverzeichnis aufteilen (falls 2 Seiten: gleichmäßige 50/50 Balance) + active_chapters = [c for c in display_chapters_data if recipes_by_chapter.get(c["number"], [])] + total_weight = sum(len(recipes_by_chapter.get(c["number"], [])) + 2 for c in active_chapters) + half_weight = total_weight / 2 + toc_p1 = [] toc_p2 = [] if toc_page_count == 2: accum = 0 - for c in display_chapters_data: + for c in active_chapters: c_recs = recipes_by_chapter.get(c["number"], []) - if not c_recs: - continue item_weight = len(c_recs) + 2 - if accum < 28 or not toc_p1: + if accum < half_weight or not toc_p1: toc_p1.append(c) accum += item_weight else: toc_p2.append(c) else: - toc_p1 = [c for c in display_chapters_data if recipes_by_chapter.get(c["number"], [])] + toc_p1 = active_chapters # User Agent Check für Apple iOS user_agent = request.headers.get("user-agent", "").lower() diff --git a/app/templates/cookbook.html b/app/templates/cookbook.html index 509cd8a..83ae8be 100755 --- a/app/templates/cookbook.html +++ b/app/templates/cookbook.html @@ -618,7 +618,7 @@ - + {% if toc_page_count > 1 %}
diff --git a/app/templates/home.html b/app/templates/home.html index fdf64fa..4eb7d7f 100644 --- a/app/templates/home.html +++ b/app/templates/home.html @@ -2,507 +2,346 @@ - - What To Cook? – Hauptmenü - + + What To Cook? – Menü + - + - -
- - 📖 -
-

What To Cook?

-

Privates Kochbuch & Menüplaner

-
+ +
- -
- - -
+ +
-
diff --git a/app/templates/shopping_list.html b/app/templates/shopping_list.html index 2fccaa4..5fa3d0d 100644 --- a/app/templates/shopping_list.html +++ b/app/templates/shopping_list.html @@ -21,60 +21,80 @@ } /* Top Nav */ + /* Schlanker, mobiler Top Nav */ .shop-nav { background-color: var(--creme); border-bottom: 2px solid var(--schwarz); - padding: 10px 18px; + padding: 8px 16px; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 100; - box-shadow: 0 4px 10px rgba(0,0,0,0.08); + box-shadow: 0 3px 8px rgba(0,0,0,0.06); } - .shop-nav-brand { + .shop-nav-back { + display: inline-flex; + align-items: center; + gap: 6px; + background: #ffffff; + border: 1.5px solid var(--schwarz); + border-radius: 8px; + padding: 6px 12px; + font-size: 0.88rem; + font-weight: 700; + color: var(--schwarz); + text-decoration: none; + box-shadow: 2px 2px 0px rgba(0,0,0,0.12); + transition: all 0.15s ease; + cursor: pointer; + } + .shop-nav-back:hover { + background: rgba(30, 77, 59, 0.08); + transform: translateY(-1px); + } + .shop-nav-back:active { + transform: translate(1px, 1px); + box-shadow: none; + } + + .shop-nav-center { display: flex; align-items: center; - gap: 10px; - text-decoration: none; - color: inherit; + gap: 8px; } .shop-nav-title { font-family: var(--font-hand); - font-size: 1.6rem; + font-size: 1.7rem; font-weight: 700; color: var(--tannengruen); margin: 0; line-height: 1; } - .shop-nav-links { - display: flex; - align-items: center; - gap: 8px; - } - - .shop-nav-btn { + .shop-nav-close { display: inline-flex; align-items: center; - gap: 6px; - background: var(--creme); + justify-content: center; + width: 34px; + height: 34px; + background: #ffffff; border: 1.5px solid var(--schwarz); - border-radius: 8px; - padding: 6px 12px; - font-size: 0.88rem; - font-weight: 600; - color: var(--schwarz); + border-radius: 50%; + font-size: 1.15rem; + font-weight: 700; + color: #555; text-decoration: none; - box-shadow: 2px 2px 0px rgba(0,0,0,0.12); - transition: all 0.15s; + box-shadow: 2px 2px 0px rgba(0,0,0,0.1); + transition: all 0.15s ease; } - .shop-nav-btn:hover { - background: #fff; - transform: translateY(-1px); + .shop-nav-close:hover { + background: #fdf2f2; + color: #b00; + border-color: #b00; } /* Hauptbereich Notizblock */ @@ -360,30 +380,74 @@ transform: translateX(-50%) translateY(0); opacity: 1; } + @media (max-width: 600px) { + .shop-nav { + padding: 6px 12px; + } + .shop-nav-title { + font-size: 1.4rem; + } + .shop-main { + margin: 10px auto 30px auto; + padding: 0 8px; + } + .notepad-card { + padding: 14px 10px; + border-width: 2px; + border-radius: 10px; + } + .notepad-card::before { + left: 24px; + } + .notepad-header { + margin-bottom: 14px; + padding-bottom: 10px; + gap: 6px; + } + .notepad-title-group h2 { + font-size: 1.7rem; + } + .notepad-counter { + font-size: 0.9rem; + padding: 2px 6px; + } + .shop-add-form { + padding: 6px; + gap: 6px; + margin-bottom: 14px; + } + .shop-input { + font-size: 0.9rem; + padding: 6px 6px; + } + .shop-add-btn { + padding: 6px 10px; + font-size: 0.85rem; + } + .shopping-item-row { + padding: 8px 8px 8px 30px; + gap: 8px; + } + .item-text { + font-size: 0.95rem; + } + } - +
- - 🛒 -
-

Einkaufsliste

-
+
+ ⬅️ Zurück -
@@ -463,7 +527,7 @@
🎉

Alles eingekauft!

Deine Einkaufsliste ist momentan leer. Füge oben neue Dinge hinzu oder übernimm Zutaten direkt aus deinem Wochenplan.

- + 📅 Zutaten aus Wochenplan holen