diff --git a/Html-files/MenuAPI.js b/Html-files/MenuAPI.js index 4e0c6f7d..b8ef2d2a 100644 --- a/Html-files/MenuAPI.js +++ b/Html-files/MenuAPI.js @@ -337,4 +337,22 @@ function filterMenu() { item.style.display = 'none'; } }); +} + +async function getMealsByCategory(category) { + if (category.toLowerCase() === 'chinese') { + return [ + { strMeal: "Kung Pao Chicken", strMealThumb: "../Images/chinesefood/image.png", idMeal: "c1" }, + { strMeal: "Mapo Tofu", strMealThumb: "../Images/chinesefood/download (3).jpeg", idMeal: "c2" }, + { strMeal: "Dim Sum", strMealThumb: "../Images/chinesefood/download (4).jpeg", idMeal: "c3" }, + { strMeal: "Peking Duck", strMealThumb: "../Images/chinesefood/download (5).jpeg", idMeal: "c4" }, + { strMeal: "Hot and Sour Soup", strMealThumb: "../Images/chinesefood/download (6).jpeg", idMeal: "c5" }, + { strMeal: "Spring Rolls", strMealThumb: "../Images/chinesefood/download (7).jpeg", idMeal: "c6" }, + ]; + } else { + const url = `https://www.themealdb.com/api/json/v1/1/filter.php?c=${category}`; + const response = await fetch(url); + const data = await response.json(); + return data.meals || []; + } } \ No newline at end of file diff --git a/Images/chinesefood/download (3).jpeg b/Images/chinesefood/download (3).jpeg new file mode 100644 index 00000000..5f292cfc Binary files /dev/null and b/Images/chinesefood/download (3).jpeg differ diff --git a/Images/chinesefood/download (4).jpeg b/Images/chinesefood/download (4).jpeg new file mode 100644 index 00000000..c8ed2a05 Binary files /dev/null and b/Images/chinesefood/download (4).jpeg differ diff --git a/Images/chinesefood/download (5).jpeg b/Images/chinesefood/download (5).jpeg new file mode 100644 index 00000000..b9a6d5f6 Binary files /dev/null and b/Images/chinesefood/download (5).jpeg differ diff --git a/Images/chinesefood/download (6).jpeg b/Images/chinesefood/download (6).jpeg new file mode 100644 index 00000000..17d3a9f3 Binary files /dev/null and b/Images/chinesefood/download (6).jpeg differ diff --git a/Images/chinesefood/download (7).jpeg b/Images/chinesefood/download (7).jpeg new file mode 100644 index 00000000..573ca728 Binary files /dev/null and b/Images/chinesefood/download (7).jpeg differ diff --git a/Images/chinesefood/image.png b/Images/chinesefood/image.png new file mode 100644 index 00000000..53cd1da7 Binary files /dev/null and b/Images/chinesefood/image.png differ