diff --git a/assets/css/styles.css b/assets/css/styles.css index 6c93a5f..2302796 100644 --- a/assets/css/styles.css +++ b/assets/css/styles.css @@ -115,6 +115,10 @@ body{ text-decoration: underline; } +#placesReviewed { + color: #ff8c00; +} + .carousel { max-width: 100%; @@ -138,6 +142,10 @@ body{ border-radius: 0px !important; } +.places-reviewed { + color: #c5761b; + font-weight: bold; +} footer { text-align: center; diff --git a/assets/scripts/scripts.js b/assets/scripts/scripts.js index 3c041de..7441a5f 100644 --- a/assets/scripts/scripts.js +++ b/assets/scripts/scripts.js @@ -25,6 +25,7 @@ document.addEventListener("DOMContentLoaded", function () { // Call a function to display the data displayFoodList(data); populateCategoryFilter(data); + updatePlacesReviewed(data); }) .catch(error => console.error("Error fetching data:", error)); @@ -178,4 +179,19 @@ document.addEventListener("DOMContentLoaded", function () { displayFoodList(foodList); }); } + + function updatePlacesReviewed(foodList) { + const placesReviewedSpan = document.getElementById("placesReviewed"); + placesReviewedSpan.textContent = countReviewedPlaces(foodList); + } + + // Function to count the reviewed places + function countReviewedPlaces(foodList) { + return foodList.reduce((count, item) => { + if (item.category !== "PENDING") { + count++; + } + return count; + }, 0); + } }); \ No newline at end of file diff --git a/index.html b/index.html index d435f00..14eab18 100644 --- a/index.html +++ b/index.html @@ -23,6 +23,7 @@
Places Reviewed: