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 @@
@@ -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();
}