From bfe3074a26872ad9ae2092aa6a919e2ddecd8145 Mon Sep 17 00:00:00 2001 From: ulfrxdev Date: Sat, 4 Apr 2026 21:49:00 +0200 Subject: [PATCH] Redesign meal plan editor --- js/data/catalog.js | 9 +- js/services/pantryShopping.js | 2 +- js/services/planIngredients.js | 2 +- js/services/planStore.js | 2 +- js/ui/mealCalendar.js | 4 +- js/ui/mealPlanEditor.js | 146 +++++++++++++++++++++++---------- js/views/Filter.js | 2 +- js/views/MealPlanner.js | 8 +- js/views/Pantry.js | 2 +- js/views/RecipeDetail.js | 2 +- js/views/RecipeDetailV2.js | 6 +- js/views/RecipeList.js | 6 +- 12 files changed, 129 insertions(+), 62 deletions(-) diff --git a/js/data/catalog.js b/js/data/catalog.js index a16ec00..0fc297f 100644 --- a/js/data/catalog.js +++ b/js/data/catalog.js @@ -177,6 +177,13 @@ export const INGREDIENTS = { pantryUnit: 'g', nutritionPer100g: { kcal: 44, protein: 0.7, fat: 0.4, carbs: 10 }, }, + rokitnik_zwyczajny: { + id: 'rokitnik_zwyczajny', + name: 'Rokitnik zwyczajny - rokitnik pospolity (Hippophae rhamnoides)', + category: 'owoce', + pantryUnit: 'g', + nutritionPer100g: { kcal: 82, protein: 1.2, fat: 5.4, carbs: 5.5 }, + }, /* ── Suche i kasze ────────────────────────────────── */ makaron_suchy: { id: 'makaron_suchy', @@ -430,7 +437,7 @@ export const RECIPES = { { ingredientId: 'miod', amount: 10, unit: 'g' }, { ingredientId: 'orzechy_wloskie', amount: 50, unit: 'g', alternatives: ['orzechy_laskowe', 'orzechy_nerkowca', 'migdaly', 'orzechy_pekan'] }, { ingredientId: 'truskawki', amount: 100, unit: 'g', alternatives: ['banany'] }, - { ingredientId: 'borowki_amerykanskie', amount: 80, unit: 'g', alternatives: ['jagody'] }, + { ingredientId: 'borowki_amerykanskie', amount: 80, unit: 'g', alternatives: ['jagody', 'rokitnik_zwyczajny'] }, ], steps: [ 'Przełóż serek wiejski do miseczki.', diff --git a/js/services/pantryShopping.js b/js/services/pantryShopping.js index 792100d..2bcef1f 100644 --- a/js/services/pantryShopping.js +++ b/js/services/pantryShopping.js @@ -1,4 +1,4 @@ -import { INGREDIENTS, CATEGORY_LABELS } from '../data/catalog.js'; +import { INGREDIENTS, CATEGORY_LABELS } from '../data/catalog.js?v=2'; import { PANTRY_STORAGE_KEY, SHOPPING_STORAGE_KEY } from '../storageKeys.js'; export const KITCHEN_LIST_ID = 'kitchen'; diff --git a/js/services/planIngredients.js b/js/services/planIngredients.js index 9a49a1c..0450fd4 100644 --- a/js/services/planIngredients.js +++ b/js/services/planIngredients.js @@ -1,4 +1,4 @@ -import { INGREDIENTS, RECIPES } from '../data/catalog.js'; +import { INGREDIENTS, RECIPES } from '../data/catalog.js?v=2'; import { MEAL_SLOTS } from '../planner/mealSlots.js'; import { addDays } from './dateUtils.js'; import { getDayPlan } from './planStore.js'; diff --git a/js/services/planStore.js b/js/services/planStore.js index 6432a39..6b731f2 100644 --- a/js/services/planStore.js +++ b/js/services/planStore.js @@ -1,4 +1,4 @@ -import { INGREDIENTS, RECIPES } from '../data/catalog.js'; +import { INGREDIENTS, RECIPES } from '../data/catalog.js?v=2'; import { MEAL_SLOTS } from '../planner/mealSlots.js'; import { PLANS_STORAGE_KEY } from '../storageKeys.js'; import { startOfDay } from './dateUtils.js'; diff --git a/js/ui/mealCalendar.js b/js/ui/mealCalendar.js index eacd75e..6c6d9da 100644 --- a/js/ui/mealCalendar.js +++ b/js/ui/mealCalendar.js @@ -32,11 +32,11 @@ function getCalendarDayHTML(day, meta, dayState, dayAttr) { const text = isSelected ? '#f2efe8' : (isDimmed ? '#7d7a74' : '#d7d2c8'); const dot = isSelected ? '#f2efe8' : '#a59f92'; const opacity = isDimmed ? '0.72' : '1'; - const outerClass = `${mode === 'month' ? 'mx-auto ' : ''}flex h-[2.3rem] w-full min-w-0 max-w-full items-center justify-center rounded-full border text-xs font-medium transition-colors leading-tight overflow-hidden`; + const outerClass = `${mode === 'month' ? 'mx-auto ' : ''}flex h-[2.05rem] w-full min-w-0 max-w-full items-center justify-center rounded-full border text-xs font-medium transition-colors leading-tight overflow-hidden`; const innerClass = mode === 'month' ? 'relative flex h-full w-full flex-col items-center justify-center' : 'relative flex h-full w-full items-center justify-center'; - const dotBottom = mode === 'month' ? '0.18rem' : '0.15rem'; + const dotBottom = mode === 'month' ? '0.24rem' : '0.2rem'; const tagName = isDisabled ? 'div' : 'button'; const buttonAttrs = isDisabled ? '' : ` type="button" ${dayAttr}="${day.getTime()}"`; diff --git a/js/ui/mealPlanEditor.js b/js/ui/mealPlanEditor.js index 5bb309a..ea6bb06 100644 --- a/js/ui/mealPlanEditor.js +++ b/js/ui/mealPlanEditor.js @@ -1,4 +1,4 @@ -import { INGREDIENTS, RECIPES } from '../data/catalog.js'; +import { INGREDIENTS, RECIPES } from '../data/catalog.js?v=2'; import { MEAL_SLOTS } from '../planner/mealSlots.js'; import { addDays, @@ -38,8 +38,8 @@ const slotLabel = Object.fromEntries(MEAL_SLOTS.map((s) => [s.id, s.label])); export function getMealPlanEditorHTML() { return `