diff --git a/stacks/recipe/Dockerfile b/stacks/recipe/Dockerfile index 3170de3..3a490c9 100644 --- a/stacks/recipe/Dockerfile +++ b/stacks/recipe/Dockerfile @@ -3,6 +3,9 @@ FROM nginx:alpine COPY nginx/default.conf /etc/nginx/conf.d/default.conf COPY index.html /usr/share/nginx/html/ +COPY manifest.webmanifest /usr/share/nginx/html/ +COPY sw.js /usr/share/nginx/html/ +COPY icons /usr/share/nginx/html/icons COPY js /usr/share/nginx/html/js COPY css /usr/share/nginx/html/css diff --git a/stacks/recipe/icons/apple-touch-icon.png b/stacks/recipe/icons/apple-touch-icon.png new file mode 100644 index 0000000..31e470b Binary files /dev/null and b/stacks/recipe/icons/apple-touch-icon.png differ diff --git a/stacks/recipe/icons/icon-192.png b/stacks/recipe/icons/icon-192.png new file mode 100644 index 0000000..f31fa2b Binary files /dev/null and b/stacks/recipe/icons/icon-192.png differ diff --git a/stacks/recipe/icons/icon-512.png b/stacks/recipe/icons/icon-512.png new file mode 100644 index 0000000..ca5c9ef Binary files /dev/null and b/stacks/recipe/icons/icon-512.png differ diff --git a/stacks/recipe/index.html b/stacks/recipe/index.html index 28899df..52c5a01 100644 --- a/stacks/recipe/index.html +++ b/stacks/recipe/index.html @@ -3,7 +3,14 @@ + + + + Recipe App - Modular + + + - + -
+
+ \ No newline at end of file diff --git a/stacks/recipe/js/views/Pantry.js b/stacks/recipe/js/views/Pantry.js index 4700971..27a8da6 100644 --- a/stacks/recipe/js/views/Pantry.js +++ b/stacks/recipe/js/views/Pantry.js @@ -2,586 +2,462 @@ import { INGREDIENTS, CATEGORY_LABELS, pantryQtyStep, - splitStockIntoPacks, } from '../data/catalog.js'; import { addIngredientToKitchenList, categoryLabel, loadPantry, setPantryQty } from '../services/pantryShopping.js'; import { showAppToast } from '../ui/toast.js'; -function escapeHtml(s) { - return String(s) - .replace(/&/g, '&') - .replace(//g, '>') - .replace(/"/g, '"'); +/* ── helpers ── */ + +function esc(s) { + return String(s).replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"'); } -function pantryUnitLabel(u) { - if (u === 'szt') return 'szt.'; - return u; +function unitLabel(u) { + return u === 'szt' ? 'szt.' : u; } function normalizeSearch(q) { return String(q).trim().toLowerCase(); } -const PANTRY_SHOP_BOTTOM = '5.25rem'; -const PANTRY_SHOP_OFF = `translateY(calc(100% + ${PANTRY_SHOP_BOTTOM}))`; +const CATEGORY_ICONS = { + pieczywo: 'fa-bread-slice', + nabial: 'fa-cheese', + mieso_ryby: 'fa-drumstick-bite', + warzywa: 'fa-carrot', + owoce: 'fa-apple-whole', + suche: 'fa-wheat-awn', + przyprawy: 'fa-leaf', + inne: 'fa-jar', +}; -/** @type {string | null} */ -let shopPickerIngredientId = null; -/** @type {number} */ -let shopPickerStep = 1; -/** Czy licznik w arkuszu to liczba opakowań (vs. jednostki magazynowe). */ -let shopPickerUsesPacks = false; +/* ── state ── */ + +let showOnlyStock = false; +let editingId = null; +/** @type {Set} */ +const selectedCategories = new Set(); + +let editShopStep = 1; +let editShopUsesPacks = false; + +const BOTTOM = '5.25rem'; +const HIDDEN_Y = `translateY(calc(100% + ${BOTTOM}))`; + +/* ══════════════════════ HTML SHELL ══════════════════════ */ export function getPantryHTML() { return `