Spaces:
Running
Running
Update log.html
Browse files33 unmodified lines3435363738394041424344454647484950515237 unmodified lines9091929394959631 unmodified lines12812913013113213313458 unmodified lines19319419519619719819920020120220320420520620720820921021121221321421 unmodified lines23623723823924024124224324424524624724824925025125225325425525625725833 unmodified lines.medium{background:#f59e0b;color:white;}.low{background:#10b981;color:white;}.title{font-size:22px;font-weight:800;}.big{font-size:18px;}.small{font-size:14px;color:#6b7280;}</style></head>37 unmodified lines<h2 class="title mb-4">AI Recommendations</h2><div id="aiBox" class="text-gray-600">Click Ask AI</div><button onclick="runAI()" class="mt-4 bg-emerald-600 text-white px-6 py-2 rounded-full">Ask AI31 unmodified linesdocument.getElementById("portionValue").innerText = e.target.value;};/* RUN AI */async function runAI(){const res = await fetch(API_URL,{58 unmodified lines/* ACCEPT */function accept(i){accepted.push(current[i]);current.splice(i,1);renderAI();renderAccepted();}/* REJECT AI */function rejectAI(i){current.splice(i,1);renderAI();}/* MATCHED LIST */function renderAccepted(){if(accepted.length === 0){21 unmodified lines`).join("");}/* REMOVE FROM MATCHED */function rejectFromMatched(i){accepted.splice(i,1);renderAccepted();}/* CONFIRM */function confirmDonation(){if(accepted.length === 0){alert("❌ Please select at least one recipient before confirming donation.");return;}localStorage.setItem("donationData", JSON.stringify({portions: document.getElementById("portions").value,accepted}));window.location.href = "confirmation.html";33 unmodified lines34353637383940414237 unmodified lines8081828384858631 unmodified lines11811912012112212312458 unmodified lines18318418518618718818919019119219319419519619719819920020121 unmodified lines22322422522622722822923023123223323423523623723823924024124224324424524624733 unmodified lines.medium{background:#f59e0b;color:white;}.low{background:#10b981;color:white;}.title{font-size:22px;font-weight:800;}.big{font-size:18px;}.small{font-size:14px;color:#6b7280;}</style></head>37 unmodified lines<h2 class="title mb-4">AI Recommendations</h2><div id="aiBox">Click Ask AI</div><button onclick="runAI()" class="mt-4 bg-emerald-600 text-white px-6 py-2 rounded-full">Ask AI31 unmodified linesdocument.getElementById("portionValue").innerText = e.target.value;};/* AI CALL */async function runAI(){const res = await fetch(API_URL,{58 unmodified lines/* ACCEPT */function accept(i){accepted.push(current[i]);current.splice(i,1);renderAI();renderAccepted();}/* REJECT AI */function rejectAI(i){current.splice(i,1);renderAI();}/* MATCHED */function renderAccepted(){if(accepted.length === 0){21 unmodified lines`).join("");}/* REMOVE MATCHED */function rejectFromMatched(i){accepted.splice(i,1);renderAccepted();}/* CONFIRM FIXED */function confirmDonation(){if(accepted.length === 0){alert("Please select at least one recipient.");return;}localStorage.setItem("donationData", JSON.stringify({portions: document.getElementById("portions").value,foodType: document.getElementById("foodType").value,expiry: document.getElementById("expiry").value,accepted: accepted}));window.location.href = "confirmation.html";
log.html+12-23