From 429c3db056613647e67377c9dbe8e1e02bf76d2b Mon Sep 17 00:00:00 2001 From: Kevin Burchell Date: Wed, 17 Jun 2026 10:55:46 -0700 Subject: [PATCH] Warm & playful redesign + automatic dark mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Visual refresh (her pick: "warm & playful", dark mode "auto"): - Split the green color token into a fill (--green) and a text/icon accent (--green-accent) so accents can brighten in dark mode while button fills keep white-text contrast. - Added a full prefers-color-scheme dark theme via token overrides. Pinned the toast, cook overlay, and cook button to a fixed dark surface so they don't invert. - Warmer cream/ink palette, terracotta accent, larger radii, softer shadows, gradient header with safe-area padding + ๐Ÿฅ• mark. - Chunkier rounded item rows with a per-aisle color stripe (--cat set on each category section), tinted rounded category header bars with an emoji and pill-shaped count. - Per-item emoji guesser (emojiForItem) with category-emoji fallback, shown on both the list and inventory rows. sw.js: bump cache version to v2 so the new shell replaces the old one. Co-Authored-By: Claude Opus 4.8 --- index.html | 159 ++++++++++++++++++++++++++++++++++++++++------------- sw.js | 2 +- 2 files changed, 123 insertions(+), 38 deletions(-) diff --git a/index.html b/index.html index eec95a7..72e5e6b 100644 --- a/index.html +++ b/index.html @@ -15,18 +15,56 @@
-
Kevin & Chey
+
๐Ÿฅ• Kevin & Chey
Live
@@ -516,6 +557,48 @@ const CAT_KEYWORDS = { Beverages:['water','juice','soda','coffee','tea','wine','beer','kombucha','lemonade','almond milk','oat milk','soy milk'], }; +// Emoji used in category headers and as a per-item fallback. +const CAT_EMOJI = {Produce:'๐Ÿฅฌ',Dairy:'๐Ÿฅ›',Meat:'๐Ÿฅฉ',Bakery:'๐Ÿฅ–',Pantry:'๐Ÿฅซ',Frozen:'๐ŸงŠ',Beverages:'๐Ÿฅค',Other:'๐Ÿ›’'}; +function catEmoji(cat){ return CAT_EMOJI[cat] || '๐Ÿท๏ธ'; } +// A best-guess emoji for an item. Ordered most-specific first so e.g. "sweet +// potato" beats "potato" and "peanut butter" beats "butter". Falls back to the +// item's category emoji when nothing matches. +const ITEM_EMOJI = [ + ['sweet potato','๐Ÿ '],['peanut butter','๐Ÿฅœ'],['ice cream','๐Ÿจ'],['olive oil','๐Ÿซ’'], + ['paper towel','๐Ÿงป'],['trash bag','๐Ÿ—‘๏ธ'],['cat food','๐Ÿฑ'],['dog food','๐Ÿถ'], + ['banana','๐ŸŒ'],['apple','๐ŸŽ'],['orange','๐ŸŠ'],['lemon','๐Ÿ‹'],['lime','๐Ÿ‹'], + ['strawberr','๐Ÿ“'],['blueberr','๐Ÿซ'],['raspberr','๐Ÿซ'],['berr','๐Ÿซ'],['grape','๐Ÿ‡'], + ['watermelon','๐Ÿ‰'],['melon','๐Ÿˆ'],['peach','๐Ÿ‘'],['cherr','๐Ÿ’'],['pineapple','๐Ÿ'], + ['mango','๐Ÿฅญ'],['avocado','๐Ÿฅ‘'],['tomato','๐Ÿ…'],['carrot','๐Ÿฅ•'],['popcorn','๐Ÿฟ'], + ['corn','๐ŸŒฝ'],['cucumber','๐Ÿฅ’'],['broccoli','๐Ÿฅฆ'],['lettuce','๐Ÿฅฌ'],['spinach','๐Ÿฅฌ'], + ['kale','๐Ÿฅฌ'],['onion','๐Ÿง…'],['garlic','๐Ÿง„'],['mushroom','๐Ÿ„'],['eggplant','๐Ÿ†'], + ['pepper','๐Ÿซ‘'],['chili','๐ŸŒถ๏ธ'],['ginger','๐Ÿซš'],['herb','๐ŸŒฟ'],['basil','๐ŸŒฟ'], + ['cilantro','๐ŸŒฟ'],['parsley','๐ŸŒฟ'], + ['bagel','๐Ÿฅฏ'],['baguette','๐Ÿฅ–'],['croissant','๐Ÿฅ'],['pretzel','๐Ÿฅจ'],['tortilla','๐ŸŒฏ'], + ['bread','๐Ÿž'],['cheese','๐Ÿง€'],['milk','๐Ÿฅ›'],['butter','๐Ÿงˆ'],['eggplant','๐Ÿ†'], + ['egg','๐Ÿฅš'],['yogurt','๐Ÿฅ›'],['yoghurt','๐Ÿฅ›'],['cream','๐Ÿฅ›'], + ['chicken','๐Ÿ—'],['turkey','๐Ÿ—'],['steak','๐Ÿฅฉ'],['beef','๐Ÿฅฉ'],['pork','๐Ÿฅ“'], + ['bacon','๐Ÿฅ“'],['sausage','๐ŸŒญ'],['ham','๐Ÿ–'],['lamb','๐Ÿ–'],['shrimp','๐Ÿฆ'], + ['salmon','๐ŸŸ'],['tuna','๐ŸŸ'],['fish','๐ŸŸ'],['crab','๐Ÿฆ€'], + ['rice','๐Ÿš'],['spaghetti','๐Ÿ'],['pasta','๐Ÿ'],['noodle','๐Ÿœ'],['ramen','๐Ÿœ'], + ['flour','๐ŸŒพ'],['sugar','๐Ÿฌ'],['salt','๐Ÿง‚'],['oil','๐Ÿซ’'],['honey','๐Ÿฏ'],['jam','๐Ÿ“'], + ['almond','๐Ÿฅœ'],['nut','๐Ÿฅœ'],['oat','๐Ÿฅฃ'],['cereal','๐Ÿฅฃ'],['soup','๐Ÿฅฃ'], + ['pizza','๐Ÿ•'],['fries','๐ŸŸ'],['burger','๐Ÿ”'],['taco','๐ŸŒฎ'],['burrito','๐ŸŒฏ'], + ['sandwich','๐Ÿฅช'],['sushi','๐Ÿฃ'],['waffle','๐Ÿง‡'],['pancake','๐Ÿฅž'], + ['chocolate','๐Ÿซ'],['cookie','๐Ÿช'],['candy','๐Ÿฌ'],['cake','๐Ÿฐ'],['pie','๐Ÿฅง'], + ['donut','๐Ÿฉ'],['chip','๐ŸŸ'],['cracker','๐Ÿ˜'], + ['coffee','โ˜•'],['tea','๐Ÿต'],['juice','๐Ÿงƒ'],['soda','๐Ÿฅค'],['cola','๐Ÿฅค'],['wine','๐Ÿท'], + ['beer','๐Ÿบ'],['water','๐Ÿ’ง'], + ['toilet','๐Ÿงป'],['tissue','๐Ÿงป'],['napkin','๐Ÿงป'],['soap','๐Ÿงผ'],['detergent','๐Ÿงด'], + ['shampoo','๐Ÿงด'],['lotion','๐Ÿงด'],['toothpaste','๐Ÿชฅ'],['toothbrush','๐Ÿชฅ'],['foil','๐ŸŒฏ'], + ['diaper','๐Ÿผ'],['baby','๐Ÿผ'],['battery','๐Ÿ”‹'],['flower','๐Ÿ’'],['ice','๐ŸงŠ'], +]; +function emojiForItem(name, cat){ + const l = String(name||'').toLowerCase(); + for(const [kw, emo] of ITEM_EMOJI){ if(l.includes(kw)) return emo; } + return catEmoji(cat); +} + function storeInfo(name){ return STORES.find(s=>s.name===name)||STORES[STORES.length-1]; } function allCats(){ return [...CATS.filter(c=>c!=='Other'),...customCats.map(c=>c.name),'Other']; } function catColor(name){ return CAT_COLORS[name] || (customCats.find(c=>c.name===name)||{}).color || '#888'; } @@ -742,15 +825,16 @@ function renderList(){ const muted=curStore==='Any'?' muted':''; return `
+ ${emojiForItem(it.name,it.cat)} ${escHtml(it.name)}
${escHtml(it.by)}
${timeAgo(it.addedAt)}
`; }).join(''); - return `
+ return `
-
+ ${catEmoji(cat)} ${escHtml(cat)} ${grouped[cat].length}
@@ -1820,11 +1904,12 @@ function renderInventory(){ filtered.forEach(function(it){ const c=it.cat||'Other'; if(!grouped[c]) grouped[c]=[]; grouped[c].push(it); }); let html=''; Object.keys(grouped).sort().forEach(function(cat){ - html+='
'+escHtml(cat)+''+grouped[cat].length+'
'; + html+='
'+catEmoji(cat)+''+escHtml(cat)+''+grouped[cat].length+'
'; grouped[cat].sort(function(a,b){ return a.name.localeCompare(b.name); }).forEach(function(it){ const qty=it.qty!=null?it.qty:1; const isOut=qty===0, isLow=qty===1; html+='
' + +''+emojiForItem(it.name,cat)+'' +''+escHtml(it.name)+'' +'
' +'' diff --git a/sw.js b/sw.js index 99f483d..d71a597 100644 --- a/sw.js +++ b/sw.js @@ -4,7 +4,7 @@ // own IndexedDB offline layer (persistentLocalCache) that queues writes and // serves cached reads. We only cache the static shell + SDK modules + fonts. -const VERSION = 'v1'; +const VERSION = 'v2'; const SHELL = 'grocery-shell-' + VERSION; const RUNTIME = 'grocery-runtime-' + VERSION; -- 2.54.1