Fix sealed/opened expiry; AI shelf-life cache; redesign waste UI

This commit is contained in:
dadaloop82
2026-04-29 06:42:21 +00:00
parent e002955173
commit 22266cb620
4 changed files with 228 additions and 82 deletions
+66 -43
View File
@@ -376,22 +376,21 @@ body {
.btn-quick-recipe span:last-child { font-size: 1.1rem; opacity: 0.8; }
.btn-quick-recipe:active { transform: scale(0.98); }
/* ── Anti-Waste Report Card ─────────────────────────────── */
/* ── Anti-Waste Report Card — same structure as .alert-section ── */
#waste-chart-section {
background: linear-gradient(160deg, #f0fdf4 0%, var(--bg-card) 70%);
background: #f0fdf4;
border: 2px solid #86efac;
border-left: 4px solid var(--success);
border-radius: var(--radius);
padding: 10px 12px;
margin-bottom: 10px;
padding: 16px;
margin-bottom: 12px;
}
/* Header row */
/* Header row — mirrors .alert-section h3 */
.aw-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 7px;
margin-bottom: 10px;
}
.aw-title-row {
display: flex;
@@ -399,7 +398,7 @@ body {
gap: 6px;
}
.aw-title {
font-size: 0.88rem;
font-size: 1.05rem;
font-weight: 700;
margin: 0;
color: var(--text);
@@ -441,48 +440,71 @@ body {
.aw-grade-c { background: #fb923c; }
.aw-grade-d { background: #dc2626; }
/* ── Single-row comparison bar ──────────────────────────── */
.aw-cmp-wrap { margin-bottom: 7px; }
.aw-cmp-row-labels {
/* ── Dual animated comparison bars ──────────────────────── */
.aw-cmp-wrap { margin-bottom: 10px; }
.aw-cmp-bar-row {
display: flex;
justify-content: space-between;
font-size: 0.72rem;
margin-bottom: 3px;
align-items: center;
gap: 8px;
margin-bottom: 6px;
}
.aw-cmp-lbl-you { color: var(--success); }
.aw-cmp-lbl-you strong { font-size: 0.8rem; }
.aw-cmp-lbl-avg { color: var(--text-light); text-align: right; }
.aw-cmp-lbl-avg strong { color: var(--text); font-size: 0.8rem; }
.aw-cmp-track {
.aw-cmp-bar-label {
font-size: 0.68rem;
font-weight: 700;
width: 42px;
flex-shrink: 0;
text-transform: uppercase;
letter-spacing: 0.04em;
}
.aw-cmp-bar-label-you { color: #16a34a; }
.aw-cmp-bar-label-avg { color: #f97316; }
.aw-cmp-bar-track {
flex: 1;
height: 14px;
background: rgba(0,0,0,.06);
border-radius: 7px;
overflow: hidden;
position: relative;
height: 8px;
background: var(--bg-main);
border-radius: 4px;
margin-bottom: 4px;
}
.aw-cmp-you-fill {
.aw-cmp-bar-fill {
height: 100%;
border-radius: 7px;
width: 0; /* starts at 0 — animated via JS */
transition: width 1.1s cubic-bezier(.4,0,.2,1);
position: relative;
overflow: hidden;
}
/* Shimmer overlay */
.aw-cmp-bar-fill::after {
content: '';
position: absolute;
left: 0; top: 0; bottom: 0;
background: var(--success);
border-radius: 4px;
transition: width 0.7s cubic-bezier(.4,0,.2,1);
min-width: 3px;
inset: 0;
background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.35) 50%, transparent 100%);
animation: aw-shimmer 2.2s ease-in-out infinite;
opacity: 0;
transition: opacity 0.5s 1s;
}
.aw-cmp-avg-tick {
position: absolute;
top: -2px; bottom: -2px;
width: 3px;
background: #f59e0b;
border-radius: 2px;
box-shadow: 0 0 0 2px var(--bg-card);
transform: translateX(-50%);
transition: left 0.7s cubic-bezier(.4,0,.2,1);
.aw-cmp-bar-fill.loaded::after { opacity: 1; }
@keyframes aw-shimmer {
0% { transform: translateX(-100%); }
100% { transform: translateX(100%); }
}
/* Inline status below bar */
.aw-cmp-bar-fill-you { background: linear-gradient(90deg, #4ade80, #16a34a); }
.aw-cmp-bar-fill-avg { background: linear-gradient(90deg, #fdba74, #f97316); }
.aw-cmp-bar-pct {
font-size: 0.8rem;
font-weight: 800;
width: 30px;
text-align: right;
flex-shrink: 0;
}
.aw-cmp-bar-pct-you { color: #16a34a; }
.aw-cmp-bar-pct-avg { color: #f97316; }
/* Inline status below bars */
.aw-status-inline {
font-size: 0.72rem;
font-size: 0.75rem;
font-weight: 600;
margin: 0 0 6px;
margin: 2px 0 8px;
padding: 0;
}
.aw-status-good { color: #16a34a; }
@@ -494,8 +516,9 @@ body {
display: flex;
flex-wrap: nowrap;
overflow: hidden;
gap: 5px;
margin-bottom: 7px;
justify-content: center;
gap: 6px;
margin-bottom: 9px;
transition: opacity 0.38s ease;
}
.aw-badge {