adding food logging, polish + demo updates

This commit is contained in:
Joren de Graaf
2026-10-03 21:44:38 +02:00
parent 90b21a39fc
commit be49b66dae
7 changed files with 184 additions and 13 deletions
+16 -1
View File
@@ -1,7 +1,22 @@
.food-page{max-width:1180px;margin:0 auto;padding:1.5rem 0 4rem}.food-heading,.food-meal-heading{display:flex;justify-content:space-between;align-items:center;gap:1rem}.food-heading nav{display:flex;gap:.5rem;align-items:center}.food-heading nav a,.food-add-meal{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;border:1px solid currentColor;border-radius:50%;text-decoration:none}.food-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(290px,340px);gap:2rem;align-items:start}.food-sidebar{position:sticky;top:1rem}.food-card{background:var(--surface,#222);border:1px solid var(--border,#555);border-radius:1.2rem;padding:1.2rem;margin-bottom:1rem}.food-card h2,.food-card h3{margin:.1rem 0 .5rem}.food-remaining{font-size:1.45rem;font-weight:700}.food-progress{height:.65rem;background:#7776;border-radius:2rem;overflow:hidden}.food-progress span{display:block;height:100%;background:#62bd70;border-radius:inherit}.food-macros{display:grid;gap:.7rem}.food-macro{display:flex;align-items:center;gap:1rem}.food-macro p{margin:.15rem 0}.food-ring{--accent:#d45b8b;flex:none;width:74px;height:74px;border-radius:50%;display:grid;place-items:center;background:conic-gradient(var(--accent) var(--progress,0%),#7776 0)}.food-ring span{display:grid;place-items:center;width:60px;height:60px;background:var(--surface,#222);border-radius:50%;font-weight:700}.food-macro--blue{--accent:#53a9e7}.food-macro--orange{--accent:#e87952}.food-meal{margin-bottom:1.5rem}.food-meal-heading h2{margin:0}.food-meal-heading p{margin:.1rem 0;color:#62bd70}.food-add-meal{color:#62bd70;font-size:1.8rem}.food-entry-list,.food-product-list{list-style:none;margin:.8rem 0;padding:0}.food-entry,.food-product-list li{background:var(--surface,#222);border:1px solid var(--border,#555);padding:1rem;border-radius:1rem;margin:.4rem 0}.food-entry{display:flex;align-items:center;justify-content:space-between;gap:1rem}.food-entry-main{display:flex;align-items:center;gap:.8rem;min-width:0}.food-entry-main img{width:64px;height:64px;object-fit:contain;background:white;border-radius:.6rem}.food-entry-main strong,.food-entry-main span,.food-entry-main small{display:block}.food-entry-main small,.food-entry-main span,.food-empty{opacity:.75}.food-form-page{max-width:620px;margin:1.5rem auto 4rem}.food-form-page .food-card{margin-top:1rem}.food-search{display:flex;flex-wrap:wrap;gap:.6rem;align-items:center}.food-search input{min-width:180px;flex:1}.food-product-list a{display:block;min-height:44px;align-content:center}.food-form-page details dl{display:grid;grid-template-columns:1fr 1fr;gap:.4rem}.food-form-page details dd{margin:0;text-align:right}@media(max-width:760px){.food-layout{display:flex;flex-direction:column-reverse;gap:1rem}.food-sidebar{position:static;width:100%}.food-macros{grid-template-columns:repeat(3,minmax(0,1fr));gap:.4rem}.food-macro{display:block;padding:.65rem;text-align:center}.food-ring{margin:auto;width:58px;height:58px}.food-ring span{width:46px;height:46px;font-size:.8rem}.food-macro h3{font-size:.9rem;overflow-wrap:anywhere}.food-macro p{font-size:.8rem}.food-heading h1{font-size:1.5rem}.food-page{padding-top:.5rem}}@media(max-width:400px){.food-macros{grid-template-columns:1fr}.food-macro{display:flex;text-align:left}.food-ring{margin:0}}@media(prefers-reduced-motion:reduce){.food-page *{scroll-behavior:auto!important;animation:none!important;transition:none!important}}
/* Food surfaces follow the shared Tasknest light and dark appearance setting. */
body[data-theme="light"]{--food-surface:#fff;--food-border:#dfe4dc;--food-ink:#25292e;--food-muted:#626a70;--food-progress-track:#e2e7e1;--food-ring-track:#e2e7e1;--food-green:#277a46}
body[data-theme="dark"]{--food-surface:#202923;--food-border:#3b473f;--food-ink:#edf5ef;--food-muted:#b8c3bb;--food-progress-track:#48554b;--food-ring-track:#48554b;--food-green:#75cf88}
.food-page{max-width:1180px;margin:0 auto;padding:1.5rem 0 4rem}.food-heading,.food-meal-heading{display:flex;justify-content:space-between;align-items:center;gap:1rem}.food-heading nav{display:flex;gap:.5rem;align-items:center}.food-heading nav a,.food-add-meal{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;border:1px solid currentColor;border-radius:50%;text-decoration:none}.food-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(290px,340px);gap:2rem;align-items:start}.food-sidebar{position:sticky;top:1rem}.food-card{background:var(--food-surface);border:1px solid var(--food-border);border-radius:1.2rem;padding:1.2rem;margin-bottom:1rem}.food-card h2,.food-card h3{margin:.1rem 0 .5rem}.food-remaining{font-size:1.45rem;font-weight:700}.food-progress{height:.65rem;background:var(--food-progress-track);border-radius:2rem;overflow:hidden}.food-progress span{display:block;height:100%;background:#62bd70;border-radius:inherit}.food-macros{display:grid;gap:.7rem}.food-macro{display:flex;align-items:center;gap:1rem}.food-macro p{margin:.15rem 0}.food-ring{--accent:#d45b8b;flex:none;width:74px;height:74px;border-radius:50%;display:grid;place-items:center;background:conic-gradient(var(--accent) var(--progress,0%),var(--food-ring-track) 0)}.food-ring span{display:grid;place-items:center;width:60px;height:60px;background:var(--food-surface);border-radius:50%;font-weight:700}.food-macro--blue{--accent:#53a9e7}.food-macro--orange{--accent:#e87952}.food-meal{margin-bottom:1.5rem}.food-meal-heading h2{margin:0}.food-meal-heading p{margin:.1rem 0;color:#62bd70}.food-add-meal{color:#62bd70;font-size:1.8rem}.food-entry-list,.food-product-list{list-style:none;margin:.8rem 0;padding:0}.food-entry,.food-product-list li{background:var(--food-surface);border:1px solid var(--food-border);padding:1rem;border-radius:1rem;margin:.4rem 0}.food-entry{display:flex;align-items:center;justify-content:space-between;gap:1rem}.food-entry-main{display:flex;align-items:center;gap:.8rem;min-width:0}.food-entry-main img{width:64px;height:64px;object-fit:contain;background:white;border-radius:.6rem}.food-entry-main strong,.food-entry-main span,.food-entry-main small{display:block}.food-entry-main small,.food-entry-main span,.food-empty{opacity:.75}.food-form-page{max-width:620px;margin:1.5rem auto 4rem}.food-form-page .food-card{margin-top:1rem}.food-search{display:flex;flex-wrap:wrap;gap:.6rem;align-items:center}.food-search input{min-width:180px;flex:1}.food-product-list a{display:block;min-height:44px;align-content:center}.food-form-page details dl{display:grid;grid-template-columns:1fr 1fr;gap:.4rem}.food-form-page details dd{margin:0;text-align:right}@media(max-width:760px){.food-layout{display:flex;flex-direction:column-reverse;gap:1rem}.food-sidebar{position:static;width:100%}.food-macros{grid-template-columns:repeat(3,minmax(0,1fr));gap:.4rem}.food-macro{display:block;padding:.65rem;text-align:center}.food-ring{margin:auto;width:58px;height:58px}.food-ring span{width:46px;height:46px;font-size:.8rem}.food-macro h3{font-size:.9rem;overflow-wrap:anywhere}.food-macro p{font-size:.8rem}.food-heading h1{font-size:1.5rem}.food-page{padding-top:.5rem}}@media(max-width:400px){.food-macros{grid-template-columns:1fr}.food-macro{display:flex;text-align:left}.food-ring{margin:0}}@media(prefers-reduced-motion:reduce){.food-page *{scroll-behavior:auto!important;animation:none!important;transition:none!important}}
.food-product-image{display:block;max-width:180px;max-height:180px;object-fit:contain;background:#fff;border-radius:1rem;margin:0 auto 1rem}
.food-tabs,.food-actions{display:flex;gap:.5rem;flex-wrap:wrap;margin:1rem 0}.food-tabs a{padding:.55rem .9rem;border-radius:2rem;border:1px solid currentColor;text-decoration:none}.food-tabs a[aria-current=page]{background:#62bd70;color:#111;border-color:#62bd70}.food-product-list a,.food-result-button{display:flex;align-items:center;gap:.8rem;width:100%;text-align:left}.food-product-list img{width:58px;height:58px;object-fit:contain;background:#fff;border-radius:.6rem}.food-product-list strong,.food-product-list small{display:block}.food-result-button{border:0;background:none;color:inherit;font:inherit;cursor:pointer;min-height:44px}.food-barcode-form{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;margin:1rem 0}.food-barcode-form input{min-width:130px;flex:1}.food-attribution{font-size:.85rem;opacity:.8}
.food-scanner{max-width:620px;margin:1.5rem auto 6rem}.food-scanner-header{display:flex;align-items:center;gap:1rem}.food-scanner-header a{display:grid;place-items:center;min-width:44px;min-height:44px;font-size:2rem;text-decoration:none}.food-camera-frame{position:relative;aspect-ratio:4/3;background:#111;border-radius:1rem;overflow:hidden}.food-camera-frame video{width:100%;height:100%;object-fit:cover}.food-scan-guide{position:absolute;inset:25% 10%;border:3px solid #62bd70;border-radius:.8rem;pointer-events:none}.food-mobile-switch{display:none}@media(max-width:760px){.food-mobile-switch{position:fixed;bottom:env(safe-area-inset-bottom,0px);left:50%;transform:translateX(-50%);display:flex;gap:.3rem;background:#222;color:#fff;padding:.35rem;border-radius:2rem;z-index:20;box-shadow:0 2px 15px #0008}.food-mobile-switch a,.food-mobile-switch span{display:grid;place-items:center;min-width:110px;min-height:44px;padding:.2rem 1rem;border-radius:2rem;color:inherit;text-decoration:none}.food-mobile-switch [aria-current=page]{background:#555}}
.food-detail-title{display:flex;align-items:center;justify-content:space-between;gap:1rem}.food-favourite-form{flex:none}.food-favourite{min-width:44px;min-height:44px;border:0;background:none;color:#62bd70;font-size:2rem;cursor:pointer}.food-product-list li{display:flex;align-items:center;justify-content:space-between;gap:.5rem}.food-product-list li>a{flex:1;min-width:0}.food-product-list li>.food-favourite-form{margin:0}
/* V1 polish: keep the date and search titles from crowding the useful content. */
.food-heading{align-items:end;margin-bottom:1.1rem}.food-heading h1{font-size:clamp(2rem,3.2vw,3.2rem);line-height:1.08;margin:.25rem 0 0}.food-heading nav a:nth-child(2){border-radius:999px;padding:0 1rem}.food-form-page h1{font-size:clamp(2.3rem,4vw,3.8rem);line-height:1.05;margin:.45rem 0 1rem;overflow-wrap:anywhere}.food-product-list li>a{text-decoration:none}.food-product-list li>a:hover strong,.food-product-list li>a:focus-visible strong{text-decoration:underline}.food-list-empty{border-style:dashed!important;opacity:.72}.food-entry>a{min-width:44px;min-height:44px;display:grid;place-items:center}.food-entry-main strong{overflow-wrap:anywhere}.food-export{margin-top:1.25rem}.food-export p{margin:.3rem 0 1rem;opacity:.75}.food-export-actions{display:flex;gap:.6rem;flex-wrap:wrap}.food-export-actions a{display:inline-flex;align-items:center;min-height:44px;padding:.55rem .8rem;border:1px solid currentColor;border-radius:999px;text-decoration:none}.food-export-actions a:hover,.food-export-actions a:focus-visible{background:#62bd7028}.food-entry-form{display:grid;gap:1rem}.food-entry-form [data-food-custom-fields],.food-entry-form [data-food-save-fields]{display:grid;gap:1rem}.food-entry-form .settings-switch-row{margin:.25rem 0}.food-edit-nutrition p{line-height:1.55}.food-edit-nutrition details{margin-top:.7rem}.food-entry-form .settings-switch input[type=checkbox]{min-height:0;padding:0;border:0;border-radius:0}.food-entry-form .settings-switch__copy strong{font-weight:700}.food-form-page .food-card .form-field label{line-height:1.35}@media(max-width:760px){.food-heading{align-items:start}.food-heading nav{flex:none}.food-heading nav a:nth-child(2){padding:0 .6rem}.food-heading h1{font-size:clamp(1.55rem,6vw,2.2rem)}.food-export{margin-top:.5rem}}
.food-card,.food-entry,.food-product-list li{color:var(--food-ink);background:var(--food-surface);border-color:var(--food-border)}
.food-ring span{color:var(--food-ink);background:var(--food-surface)}
.food-meal-heading p,.food-add-meal,.food-favourite{color:var(--food-green)}
.food-progress span{background:var(--food-green)}
.food-entry-main span,.food-entry-main small,.food-card>p:not(.food-remaining),.food-attribution{color:var(--food-muted);opacity:1}
.food-entry-main strong,.food-card h2,.food-card h3,.food-remaining{color:var(--food-ink)}
.food-tabs a[aria-current=page]{background:var(--food-green);border-color:var(--food-green);color:#fff}
.food-export-actions a{color:var(--food-ink);border-color:var(--food-border)}
.food-export-actions a:hover,.food-export-actions a:focus-visible{background:var(--food-progress-track)}
.food-macro p,.food-product-list small{color:var(--food-muted)}
body[data-theme="dark"] .food-tabs a[aria-current=page]{color:#102317}