From fd3686650fe30cc387a7beaab39d47c628861847 Mon Sep 17 00:00:00 2001 From: Ionel Andrei Cataon Date: Wed, 18 Feb 2026 17:07:26 +0200 Subject: [PATCH] s --- .../src/main/webapp/index.html | 43 ++++++++++++------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/proiect-nutritie-java/src/main/webapp/index.html b/proiect-nutritie-java/src/main/webapp/index.html index 9b182c3..3e972c8 100644 --- a/proiect-nutritie-java/src/main/webapp/index.html +++ b/proiect-nutritie-java/src/main/webapp/index.html @@ -3,7 +3,7 @@ - NutriAI Elite v19.0 + NutriAI Elite v20.0 @@ -19,7 +19,6 @@ body { background-color: var(--bg); color: var(--text); font-family: 'Outfit', sans-serif; height: 100dvh; overflow: hidden; transition: 0.3s; } - /* Mobile Responsive Layout */ .main-wrapper { display: flex; height: 100dvh; flex-direction: row; } @media (max-width: 991px) { .main-wrapper { flex-direction: column; overflow-y: auto; height: auto; } @@ -28,13 +27,14 @@ body { overflow-y: auto; } } - .sidebar { width: 350px; background: var(--sidebar); border-right: 1px solid rgba(255,255,255,0.1); padding: 1.5rem; overflow-y: auto; flex-shrink: 0; } + .sidebar { width: 360px; background: var(--sidebar); border-right: 1px solid rgba(255,255,255,0.1); padding: 1.5rem; overflow-y: auto; flex-shrink: 0; } .chat-section { flex-grow: 1; display: flex; flex-direction: column; background: rgba(0,0,0,0.2); position: relative; } .label-pro { color: var(--accent); font-weight: 800; font-size: 0.75rem; text-transform: uppercase; margin-bottom: 5px; display: block; } .glass-input { background: #fff !important; color: #000 !important; border: 3px solid var(--primary) !important; border-radius: 12px; font-weight: 800 !important; } .stat-panel { background: linear-gradient(145deg, var(--primary), #1e3a8a); border-radius: 20px; padding: 1rem; margin: 10px 0; text-align: center; } + .water-hub { background: rgba(59, 130, 246, 0.1); border: 2px solid var(--primary); border-radius: 15px; padding: 12px; margin: 10px 0; text-align: center; } .macro-hub { background: rgba(255,255,255,0.05); border-radius: 20px; padding: 15px; margin-top: 10px; } .chat-container { flex-grow: 1; overflow-y: auto; padding: 1.5rem; display: flex; flex-direction: column; } @@ -43,12 +43,13 @@ .user { background: var(--primary); align-self: flex-end; } .top-ctrl { padding: 10px; display: flex; justify-content: flex-end; gap: 8px; background: rgba(0,0,0,0.3); } - .input-area { padding: 15px; background: var(--sidebar); border-top: 1px solid rgba(255,255,255,0.1); } + .input-area { padding: 15px; background: var(--sidebar); border-top: 1px solid rgba(255,255,255,0.1); display: flex; gap: 10px; } + .btn-shop { background: #f59e0b; color: #000; font-weight: 800; border: none; border-radius: 12px; padding: 0 15px; white-space: nowrap; } .btn-reset { background: rgba(239, 68, 68, 0.15); color: #fca5a5; border: 1px solid #ef4444; border-radius: 12px; padding: 8px; font-weight: 700; width: 100%; margin-top: 15px; } - /* Table fixes for mobile */ - .msg table { width: 100%; display: block; overflow-x: auto; } + table { width: 100%; display: block; overflow-x: auto; color: #fff; border-collapse: collapse; margin-top: 10px; } + th, td { border: 1px solid rgba(255,255,255,0.2); padding: 8px; text-align: left; } @@ -85,6 +86,11 @@

Target Calories

+
+

0.0L

+ Daily Hydration +
+
@@ -114,16 +120,19 @@
-
Mobile Engine Synced.
- The dashboard is now fully responsive. Input your data to begin. +
System Unified.
+ Shopping list and Water tracker are back. All fields reset on load.
-
+
+
@@ -146,6 +155,7 @@ const total = Math.round((bmr * act) + agg); document.getElementById('kcal').innerText = total; + document.getElementById('h2o').innerText = (wc * 0.035).toFixed(1) + "L"; document.getElementById('aggDisp').innerText = (agg>0?'+':'')+agg+" kcal"; const pG = Math.round((total * 0.3)/4), cG = Math.round((total * 0.4)/4), fG = Math.round((total * 0.3)/9); document.getElementById('pG').innerText = pG+"g"; document.getElementById('cG').innerText = cG+"g"; document.getElementById('fG').innerText = fG+"g"; @@ -156,15 +166,16 @@ ['w','t','h','age','agg'].forEach(id => document.getElementById(id).value = id === 'agg' ? 0 : ""); document.getElementById('act').selectedIndex = 0; document.getElementById('kcal').innerText = "0"; - document.getElementById('chat').innerHTML = `
System reset. All fields cleared.
`; + document.getElementById('h2o').innerText = "0.0L"; + document.getElementById('chat').innerHTML = `
System reset. Ready for new inputs.
`; if(mChart) { mChart.data.datasets[0].data = [1,1,1]; mChart.update(); } } - async function talk() { + async function talk(custom) { const box = document.getElementById('chat'), input = document.getElementById('uIn'); - const text = input.value; if(!text) return; - box.innerHTML += `
${text}
`; input.value=""; - const id = 'ai-'+Date.now(); box.innerHTML += `
Thinking...
`; + const text = custom || input.value; if(!text) return; + if(!custom) { box.innerHTML += `
${text}
`; input.value=""; } + const id = 'ai-'+Date.now(); box.innerHTML += `
Processing...
`; box.scrollTop = box.scrollHeight; try { const res = await fetch("https://api.groq.com/openai/v1/chat/completions", { @@ -176,7 +187,7 @@ }); const d = await res.json(); document.getElementById(id).innerHTML = marked.parse(d.choices[0].message.content); - } catch(e) { document.getElementById(id).innerText = "Connection Error."; } + } catch(e) { document.getElementById(id).innerText = "Error connecting to coach."; } box.scrollTop = box.scrollHeight; } @@ -185,7 +196,7 @@ type: 'doughnut', data: { datasets: [{ data: [1,1,1], backgroundColor: ['#0dcaf0','#dc3545','#ffc107'], borderWeight:0 }] }, options: { plugins: { legend: { display: false } }, cutout: '75%' } }); - resetAll(); // Ensures empty fields on page load + resetAll(); }