Spaces:
Running
Running
Update log.html
Browse files
log.html
CHANGED
|
@@ -104,21 +104,21 @@ body {
|
|
| 104 |
|
| 105 |
<div class="space-y-4">
|
| 106 |
|
| 107 |
-
<div id="elderly" class="card p-5 rounded-lg">
|
| 108 |
<p class="font-semibold text-lg">π Al Rahma Elderly Home</p>
|
| 109 |
<p class="text-gray-600 text-sm mt-1">
|
| 110 |
2.1 km β’ Capacity: 80 β’ Halal Friendly
|
| 111 |
</p>
|
| 112 |
</div>
|
| 113 |
|
| 114 |
-
<div id="refugee" class="card p-5 rounded-lg">
|
| 115 |
<p class="font-semibold text-lg">π Hope Refugee Center</p>
|
| 116 |
<p class="text-gray-600 text-sm mt-1">
|
| 117 |
4.5 km β’ Capacity: 150 β’ Mixed Distribution
|
| 118 |
</p>
|
| 119 |
</div>
|
| 120 |
|
| 121 |
-
<div id="foodbank" class="card p-5 rounded-lg">
|
| 122 |
<p class="font-semibold text-lg">π Dubai Food Bank</p>
|
| 123 |
<p class="text-gray-600 text-sm mt-1">
|
| 124 |
6.2 km β’ Large Scale β’ Accepts All Types
|
|
@@ -155,37 +155,49 @@ function updateAI() {
|
|
| 155 |
|
| 156 |
portionValue.innerText = p;
|
| 157 |
|
| 158 |
-
//
|
| 159 |
elderly.classList.remove("active-match");
|
| 160 |
refugee.classList.remove("active-match");
|
| 161 |
foodbank.classList.remove("active-match");
|
| 162 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 163 |
let recipient = "";
|
| 164 |
let explanation = "";
|
|
|
|
| 165 |
|
| 166 |
if (p <= 15) {
|
| 167 |
-
recipient = "Elderly Individuals
|
| 168 |
-
elderly
|
| 169 |
-
explanation = `With a small quantity of ${p} portions, this donation is best suited for
|
| 170 |
}
|
| 171 |
else if (p <= 80) {
|
| 172 |
-
recipient = "
|
| 173 |
-
elderly
|
| 174 |
-
explanation = `A medium batch of ${p} portions is ideal for an elderly care home
|
| 175 |
}
|
| 176 |
else if (p <= 150) {
|
| 177 |
-
recipient = "Refugee Center
|
| 178 |
-
refugee
|
| 179 |
-
explanation = `With ${p} portions
|
| 180 |
}
|
| 181 |
else {
|
| 182 |
-
recipient = "
|
| 183 |
-
foodbank
|
| 184 |
-
explanation = `A large surplus of ${p} portions is
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 185 |
}
|
| 186 |
|
| 187 |
-
let urgency = (e === "Less than 6 hours") ? "HIGH
|
| 188 |
-
(e === "Within 24 hours") ? "MEDIUM
|
| 189 |
|
| 190 |
aiText.innerHTML = `
|
| 191 |
<b>Recommended:</b> ${recipient}<br>
|
|
|
|
| 104 |
|
| 105 |
<div class="space-y-4">
|
| 106 |
|
| 107 |
+
<div id="elderly" class="card p-5 rounded-lg hidden">
|
| 108 |
<p class="font-semibold text-lg">π Al Rahma Elderly Home</p>
|
| 109 |
<p class="text-gray-600 text-sm mt-1">
|
| 110 |
2.1 km β’ Capacity: 80 β’ Halal Friendly
|
| 111 |
</p>
|
| 112 |
</div>
|
| 113 |
|
| 114 |
+
<div id="refugee" class="card p-5 rounded-lg hidden">
|
| 115 |
<p class="font-semibold text-lg">π Hope Refugee Center</p>
|
| 116 |
<p class="text-gray-600 text-sm mt-1">
|
| 117 |
4.5 km β’ Capacity: 150 β’ Mixed Distribution
|
| 118 |
</p>
|
| 119 |
</div>
|
| 120 |
|
| 121 |
+
<div id="foodbank" class="card p-5 rounded-lg hidden">
|
| 122 |
<p class="font-semibold text-lg">π Dubai Food Bank</p>
|
| 123 |
<p class="text-gray-600 text-sm mt-1">
|
| 124 |
6.2 km β’ Large Scale β’ Accepts All Types
|
|
|
|
| 155 |
|
| 156 |
portionValue.innerText = p;
|
| 157 |
|
| 158 |
+
// reset all
|
| 159 |
elderly.classList.remove("active-match");
|
| 160 |
refugee.classList.remove("active-match");
|
| 161 |
foodbank.classList.remove("active-match");
|
| 162 |
|
| 163 |
+
// hide all
|
| 164 |
+
elderly.classList.add("hidden");
|
| 165 |
+
refugee.classList.add("hidden");
|
| 166 |
+
foodbank.classList.add("hidden");
|
| 167 |
+
|
| 168 |
let recipient = "";
|
| 169 |
let explanation = "";
|
| 170 |
+
let showCard = null;
|
| 171 |
|
| 172 |
if (p <= 15) {
|
| 173 |
+
recipient = "Elderly Individuals";
|
| 174 |
+
showCard = elderly;
|
| 175 |
+
explanation = `With a small quantity of ${p} portions, this donation is best suited for elderly individuals.`;
|
| 176 |
}
|
| 177 |
else if (p <= 80) {
|
| 178 |
+
recipient = "Al Rahma Elderly Home";
|
| 179 |
+
showCard = elderly;
|
| 180 |
+
explanation = `A medium batch of ${p} portions is ideal for an elderly care home.`;
|
| 181 |
}
|
| 182 |
else if (p <= 150) {
|
| 183 |
+
recipient = "Hope Refugee Center";
|
| 184 |
+
showCard = refugee;
|
| 185 |
+
explanation = `With ${p} portions, this is best for a refugee center.`;
|
| 186 |
}
|
| 187 |
else {
|
| 188 |
+
recipient = "Dubai Food Bank π¦πͺ";
|
| 189 |
+
showCard = foodbank;
|
| 190 |
+
explanation = `A large surplus of ${p} portions is best for a food bank.`;
|
| 191 |
+
}
|
| 192 |
+
|
| 193 |
+
// show only selected
|
| 194 |
+
if (showCard) {
|
| 195 |
+
showCard.classList.remove("hidden");
|
| 196 |
+
showCard.classList.add("active-match");
|
| 197 |
}
|
| 198 |
|
| 199 |
+
let urgency = (e === "Less than 6 hours") ? "HIGH" :
|
| 200 |
+
(e === "Within 24 hours") ? "MEDIUM" : "NORMAL";
|
| 201 |
|
| 202 |
aiText.innerHTML = `
|
| 203 |
<b>Recommended:</b> ${recipient}<br>
|