diff --git a/data.js b/data.js
new file mode 100644
index 000000000..30e6f8dd0
--- /dev/null
+++ b/data.js
@@ -0,0 +1,16 @@
+async function getRecipes() {
+ const url = "https://api.spoonacular.com/recipes/random?apiKey=24c0ad763b794214b472e5a5e70fac09&number=20&includeNutrition=false";
+ try {
+ const response = await fetch(url);
+ if (!response.ok) {
+ if (response.status === 402) {
+ return { recipes: [], error: "Daily quota reached. Please try again tomorrow." };
+ }
+ return { recipes: [], error: "Something went wrong. Please try again later." };
+ }
+ const data = await response.json();
+ return { recipes: data.recipes, error: null };
+ } catch (error) {
+ return { recipes: [], error: "Something went wrong. Please try again later." };
+ }
+}
\ No newline at end of file
diff --git a/images/ruth-georgiev-Q4CLQ1BDybU-unsplash.jpg b/images/ruth-georgiev-Q4CLQ1BDybU-unsplash.jpg
new file mode 100644
index 000000000..74b58975f
Binary files /dev/null and b/images/ruth-georgiev-Q4CLQ1BDybU-unsplash.jpg differ
diff --git a/index.html b/index.html
new file mode 100644
index 000000000..fee1bdee4
--- /dev/null
+++ b/index.html
@@ -0,0 +1,94 @@
+
+
+
+
+
+ Recipe Library
+
+
+
+
+
+
+
Recipe Library
+
+
+
+
Dietary Preference
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Sort by Time
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Not sure?
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/response.json b/response.json
new file mode 100644
index 000000000..c1a1de357
--- /dev/null
+++ b/response.json
@@ -0,0 +1 @@
+{"recipes":[{"id":657710,"image":"https://img.spoonacular.com/recipes/657710-556x370.jpg","imageType":"jpg","title":"Rack of Lamb With Parsley","readyInMinutes":45,"servings":4,"sourceUrl":"https://www.foodista.com/recipe/4VJNDXD2/happy-anniversary-giangi-s-kitchen","vegetarian":false,"vegan":false,"glutenFree":false,"dairyFree":false,"veryHealthy":false,"cheap":false,"veryPopular":false,"sustainable":false,"lowFodmap":false,"weightWatcherSmartPoints":20,"gaps":"no","preparationMinutes":null,"cookingMinutes":null,"aggregateLikes":4,"healthScore":6.0,"creditsText":"foodista.com","license":null,"sourceName":"foodista.com","pricePerServing":355.9,"extendedIngredients":[{"id":17029,"aisle":"Meat","image":"racks-of-lamb.jpg","consistency":"SOLID","name":"lamb","nameClean":"lamb","original":"1 rack of lamb, about 1 ¼ pounds","originalName":"lamb, about 1 ¼ pounds","amount":1.0,"unit":"","meta":["rack of"],"measures":{"us":{"amount":1.0,"unitShort":"","unitLong":""},"metric":{"amount":1.0,"unitShort":"","unitLong":""}}},{"id":4042,"aisle":"Oil, Vinegar, Salad Dressing","image":"peanut-oil.jpg","consistency":"LIQUID","name":"peanut oil","nameClean":"peanut oil","original":"1 tablespoon peanut oil","originalName":"peanut oil","amount":1.0,"unit":"tablespoon","meta":[],"measures":{"us":{"amount":1.0,"unitShort":"Tbsp","unitLong":"Tbsp"},"metric":{"amount":1.0,"unitShort":"Tbsp","unitLong":"Tbsp"}}},{"id":2047,"aisle":"Spices and Seasonings","image":"salt.jpg","consistency":"SOLID","name":"salt","nameClean":"salt","original":"Salt","originalName":"Salt","amount":4.0,"unit":"servings","meta":[],"measures":{"us":{"amount":4.0,"unitShort":"servings","unitLong":"servings"},"metric":{"amount":4.0,"unitShort":"servings","unitLong":"servings"}}},{"id":1002030,"aisle":"Spices and Seasonings","image":"pepper.jpg","consistency":"SOLID","name":"pepper","nameClean":"pepper","original":"Pepper, fresh ground","originalName":"Pepper, fresh ground","amount":4.0,"unit":"servings","meta":["fresh"],"measures":{"us":{"amount":4.0,"unitShort":"servings","unitLong":"servings"},"metric":{"amount":4.0,"unitShort":"servings","unitLong":"servings"}}},{"id":1032046,"aisle":"Condiments","image":"dijon-mustard.jpg","consistency":"LIQUID","name":"dijon mustard","nameClean":"dijon mustard","original":"1 tablespoon Dijon mustard","originalName":"Dijon mustard","amount":1.0,"unit":"tablespoon","meta":[],"measures":{"us":{"amount":1.0,"unitShort":"Tbsp","unitLong":"Tbsp"},"metric":{"amount":1.0,"unitShort":"Tbsp","unitLong":"Tbsp"}}},{"id":18069,"aisle":"Bakery/Bread","image":"white-bread.jpg","consistency":"SOLID","name":"bread","nameClean":"bread","original":"1 slice white bread, process to crumbs in the food processor","originalName":"white bread, process to crumbs in the food processor","amount":1.0,"unit":"slice","meta":["white"],"measures":{"us":{"amount":1.0,"unitShort":"slice","unitLong":"slice"},"metric":{"amount":1.0,"unitShort":"slice","unitLong":"slice"}}},{"id":11297,"aisle":"Produce","image":"parsley.jpg","consistency":"SOLID","name":"parsley","nameClean":"parsley","original":"2 tablespoons chopped parsley","originalName":"chopped parsley","amount":2.0,"unit":"tablespoons","meta":["chopped"],"measures":{"us":{"amount":2.0,"unitShort":"Tbsps","unitLong":"Tbsps"},"metric":{"amount":2.0,"unitShort":"Tbsps","unitLong":"Tbsps"}}},{"id":10211215,"aisle":"Produce","image":"garlic.jpg","consistency":"SOLID","name":"garlic clove","nameClean":"garlic clove","original":"1 small garlic clove, peeled, green germ removed, and chopped fine","originalName":"garlic clove, peeled, green germ removed, and chopped fine","amount":1.0,"unit":"small","meta":["green","peeled","chopped","fine"],"measures":{"us":{"amount":1.0,"unitShort":"small","unitLong":"small"},"metric":{"amount":1.0,"unitShort":"small","unitLong":"small"}}},{"id":11677,"aisle":"Produce","image":"shallots.jpg","consistency":"SOLID","name":"shallot","nameClean":"shallot","original":"1 shallot minced","originalName":"shallot minced","amount":1.0,"unit":"","meta":["minced"],"measures":{"us":{"amount":1.0,"unitShort":"","unitLong":""},"metric":{"amount":1.0,"unitShort":"","unitLong":""}}},{"id":1012042,"aisle":"Spices and Seasonings","image":"dried-herbs.png","consistency":"SOLID","name":"herbes de province","nameClean":"herbes de province","original":"1/8 teaspoon thyme, or herbes de Province","originalName":"thyme, or herbes de Province","amount":0.125,"unit":"teaspoon","meta":[],"measures":{"us":{"amount":0.125,"unitShort":"tsps","unitLong":"teaspoons"},"metric":{"amount":0.125,"unitShort":"tsps","unitLong":"teaspoons"}}},{"id":1145,"aisle":"Milk, Eggs, Other Dairy","image":"butter-sliced.jpg","consistency":"SOLID","name":"butter","nameClean":"butter","original":"2 teaspoons unsalted butter melted","originalName":"unsalted butter melted","amount":2.0,"unit":"teaspoons","meta":["unsalted","melted"],"measures":{"us":{"amount":2.0,"unitShort":"tsps","unitLong":"teaspoons"},"metric":{"amount":2.0,"unitShort":"tsps","unitLong":"teaspoons"}}}],"summary":"Rack of Lamb With Parsley might be just the main course you are searching for. This recipe serves 4. One portion of this dish contains approximately 19g of protein, 49g of fat, and a total of 536 calories. For $3.56 per serving, this recipe covers 14% of your daily requirements of vitamins and minerals. From preparation to the plate, this recipe takes roughly 45 minutes. It is brought to you by Foodista. 4 people were glad they tried this recipe. A mixture of dijon mustard, peanut oil, shallot, and a handful of other ingredients are all it takes to make this recipe so tasty. All things considered, we decided this recipe deserves a spoonacular score of 38%. This score is rather bad. Roasted Rack of Lamb with Parsley, Dijon, and Chives, Herbed Rack of Lamb with Parsley, Mint, and Walnut Sauté, and Lamb Chops With a Curry Cream Sauce or Rack of Lamb are very similar to this recipe.","cuisines":[],"dishTypes":["lunch","main course","main dish","dinner"],"diets":[],"occasions":[],"instructions":"1. Preheat the oven to 400.\n2. Brush the rack with oil, and sprinkle it with salt and pepper. Put the rack in a roasting pan, and roast it in the preheated oven for 12 minutes\n3. remove the meat from the oven, and coat it with the mustard\n4. lower the oven temperature to 350\n5. Combine the bread crumbs, parsley, shallot, garlic, thyme and melted butter. Spread this mixture over the top of the rack. Put the rack in the 350 oven, and roast for another 15 minutes.\n6. Remove the rack from the oven, and let it rest for 10 minutes before carving it into chops. The lamb will medium rare.","analyzedInstructions":[{"name":"","steps":[{"number":1,"step":"Preheat the oven to 40","ingredients":[],"equipment":[{"id":404784,"name":"oven","localizedName":"oven","image":"https://spoonacular.com/cdn/equipment_100x100/oven.jpg"}]},{"number":2,"step":"Brush the rack with oil, and sprinkle it with salt and pepper.","ingredients":[{"id":1102047,"name":"salt and pepper","localizedName":"salt and pepper","image":"salt-and-pepper.jpg"},{"id":4582,"name":"cooking oil","localizedName":"cooking oil","image":"vegetable-oil.jpg"}],"equipment":[]},{"number":3,"step":"Put the rack in a roasting pan, and roast it in the preheated oven for 12 minutes","ingredients":[],"equipment":[{"id":404629,"name":"roasting pan","localizedName":"roasting pan","image":"https://spoonacular.com/cdn/equipment_100x100/roasting-pan.jpg"},{"id":404784,"name":"oven","localizedName":"oven","image":"https://spoonacular.com/cdn/equipment_100x100/oven.jpg"}]},{"number":4,"step":"remove the meat from the oven, and coat it with the mustard","ingredients":[{"id":2046,"name":"mustard","localizedName":"mustard","image":"regular-mustard.jpg"},{"id":1065062,"name":"meat","localizedName":"meat","image":"whole-chicken.jpg"}],"equipment":[{"id":404784,"name":"oven","localizedName":"oven","image":"https://spoonacular.com/cdn/equipment_100x100/oven.jpg"}]},{"number":5,"step":"lower the oven temperature to 350","ingredients":[],"equipment":[{"id":404784,"name":"oven","localizedName":"oven","image":"https://spoonacular.com/cdn/equipment_100x100/oven.jpg"}]},{"number":6,"step":"Combine the bread crumbs, parsley, shallot, garlic, thyme and melted butter.","ingredients":[{"id":18079,"name":"breadcrumbs","localizedName":"breadcrumbs","image":"breadcrumbs.jpg"},{"id":11297,"name":"parsley","localizedName":"parsley","image":"parsley.jpg"},{"id":11677,"name":"shallot","localizedName":"shallot","image":"shallots.jpg"},{"id":1001,"name":"butter","localizedName":"butter","image":"butter-sliced.jpg"},{"id":11215,"name":"garlic","localizedName":"garlic","image":"garlic.png"},{"id":2049,"name":"thyme","localizedName":"thyme","image":"thyme.jpg"}],"equipment":[]},{"number":7,"step":"Spread this mixture over the top of the rack.","ingredients":[{"id":0,"name":"spread","localizedName":"spread","image":""}],"equipment":[]},{"number":8,"step":"Put the rack in the 350 oven, and roast for another 15 minutes.","ingredients":[],"equipment":[{"id":404784,"name":"oven","localizedName":"oven","image":"https://spoonacular.com/cdn/equipment_100x100/oven.jpg"}],"length":{"number":15,"unit":"minutes"}},{"number":9,"step":"Remove the rack from the oven, and let it rest for 10 minutes before carving it into chops. The lamb will medium rare.","ingredients":[{"id":10017224,"name":"lamb","localizedName":"lamb","image":"lamb-shanks.jpg"}],"equipment":[{"id":404784,"name":"oven","localizedName":"oven","image":"https://spoonacular.com/cdn/equipment_100x100/oven.jpg"}],"length":{"number":10,"unit":"minutes"}}]}],"originalId":null,"spoonacularScore":47.14781188964844,"spoonacularSourceUrl":"https://spoonacular.com/rack-of-lamb-with-parsley-657710"},{"id":657341,"image":"https://img.spoonacular.com/recipes/657341-556x370.jpg","imageType":"jpg","title":"Pumpkin Pecan Streusel Cake - gluten free, soy free, vegan","readyInMinutes":45,"servings":8,"sourceUrl":"https://www.foodista.com/recipe/RLJJN5LT/pumpkin-pecan-streusel-cake-gluten-free-soy-free-vegan","vegetarian":false,"vegan":false,"glutenFree":true,"dairyFree":false,"veryHealthy":false,"cheap":false,"veryPopular":false,"sustainable":false,"lowFodmap":false,"weightWatcherSmartPoints":23,"gaps":"no","preparationMinutes":null,"cookingMinutes":null,"aggregateLikes":2,"healthScore":6.0,"creditsText":"Foodista.com – The Cooking Encyclopedia Everyone Can Edit","license":"CC BY 3.0","sourceName":"Foodista","pricePerServing":119.68,"extendedIngredients":[{"id":18370,"aisle":"Baking","image":"white-powder.jpg","consistency":"SOLID","name":"aluminum free baking soda","nameClean":"aluminum free baking soda","original":"1/2 teaspoon aluminum free baking soda","originalName":"aluminum free baking soda","amount":0.5,"unit":"teaspoon","meta":[],"measures":{"us":{"amount":0.5,"unitShort":"tsps","unitLong":"teaspoons"},"metric":{"amount":0.5,"unitShort":"tsps","unitLong":"teaspoons"}}},{"id":18370,"aisle":"Baking","image":"white-powder.jpg","consistency":"SOLID","name":"aluminum free baking powder","nameClean":"aluminum free baking powder","original":"2 teaspoons aluminum free baking powder","originalName":"aluminum free baking powder","amount":2.0,"unit":"teaspoons","meta":[],"measures":{"us":{"amount":2.0,"unitShort":"tsps","unitLong":"teaspoons"},"metric":{"amount":2.0,"unitShort":"tsps","unitLong":"teaspoons"}}},{"id":2048,"aisle":"Oil, Vinegar, Salad Dressing","image":"apple-cider-vinegar.jpg","consistency":"LIQUID","name":"apple cider vinegar","nameClean":"apple cider vinegar","original":"1 teaspoon apple cider vinegar","originalName":"apple cider vinegar","amount":1.0,"unit":"teaspoon","meta":[],"measures":{"us":{"amount":1.0,"unitShort":"tsp","unitLong":"teaspoon"},"metric":{"amount":1.0,"unitShort":"tsp","unitLong":"teaspoon"}}},{"id":9040,"aisle":"Produce","image":"bananas.jpg","consistency":"SOLID","name":"bananas","nameClean":"bananas","original":"2 medium ripe bananas, mashed","originalName":"ripe bananas, mashed","amount":2.0,"unit":"medium","meta":["ripe","mashed"],"measures":{"us":{"amount":2.0,"unitShort":"medium","unitLong":"mediums"},"metric":{"amount":2.0,"unitShort":"medium","unitLong":"mediums"}}},{"id":20090,"aisle":"Health Foods","image":"brown-flour.jpg","consistency":"SOLID","name":"brown rice flour","nameClean":"brown rice flour","original":"1/4 cup brown rice flour (Bob's Red Mill flours)","originalName":"brown rice flour (Bob's Red Mill flours)","amount":0.25,"unit":"cup","meta":["red","(Bob's Mill flours)"],"measures":{"us":{"amount":0.25,"unitShort":"cups","unitLong":"cups"},"metric":{"amount":39.5,"unitShort":"g","unitLong":"grams"}}},{"id":19334,"aisle":"Baking","image":"light-brown-sugar.jpg","consistency":"SOLID","name":"firmly brown sugar","nameClean":"firmly brown sugar","original":"3/4 cup firmly packed light brown sugar","originalName":"firmly packed light brown sugar","amount":0.75,"unit":"cup","meta":["light","packed"],"measures":{"us":{"amount":0.75,"unitShort":"cups","unitLong":"cups"},"metric":{"amount":165.0,"unitShort":"g","unitLong":"grams"}}},{"id":10019146,"aisle":"Baking","image":"chocolate-chips.jpg","consistency":"SOLID","name":"enjoy life brand chocolate chips","nameClean":"enjoy life brand chocolate chips","original":"1 bag Enjoy Life brand mini chocolate chips","originalName":"Enjoy Life brand mini chocolate chips","amount":1.0,"unit":"bag","meta":["mini"],"measures":{"us":{"amount":1.0,"unitShort":"bag","unitLong":"bag"},"metric":{"amount":1.0,"unitShort":"bag","unitLong":"bag"}}},{"id":2021,"aisle":"Spices and Seasonings","image":"ginger.png","consistency":"SOLID","name":"ground ginger","nameClean":"ground ginger","original":"1 teaspoon ground ginger","originalName":"ground ginger","amount":1.0,"unit":"teaspoon","meta":[],"measures":{"us":{"amount":1.0,"unitShort":"tsp","unitLong":"teaspoon"},"metric":{"amount":1.0,"unitShort":"tsp","unitLong":"teaspoon"}}},{"id":2025,"aisle":"Spices and Seasonings","image":"ground-nutmeg.jpg","consistency":"SOLID","name":"ground nutmeg","nameClean":"ground nutmeg","original":"1/2 teaspoon ground nutmeg","originalName":"ground nutmeg","amount":0.5,"unit":"teaspoon","meta":[],"measures":{"us":{"amount":0.5,"unitShort":"tsps","unitLong":"teaspoons"},"metric":{"amount":0.5,"unitShort":"tsps","unitLong":"teaspoons"}}},{"id":1082047,"aisle":"Spices and Seasonings","image":"salt.jpg","consistency":"SOLID","name":"kosher salt","nameClean":"kosher salt","original":"1/2 teaspoon kosher salt","originalName":"kosher salt","amount":0.5,"unit":"teaspoon","meta":[],"measures":{"us":{"amount":0.5,"unitShort":"tsps","unitLong":"teaspoons"},"metric":{"amount":0.5,"unitShort":"tsps","unitLong":"teaspoons"}}},{"id":20132,"aisle":"Health Foods","image":"brown-flour.jpg","consistency":"SOLID","name":"oat flour","nameClean":"oat flour","original":"1/4 cup gluten free oat flour","originalName":"gluten free oat flour","amount":0.25,"unit":"cup","meta":["gluten free"],"measures":{"us":{"amount":0.25,"unitShort":"cups","unitLong":"cups"},"metric":{"amount":30.0,"unitShort":"g","unitLong":"grams"}}},{"id":12142,"aisle":"Baking","image":"pecans.jpg","consistency":"SOLID","name":"pecans","nameClean":"pecans","original":"1/2 cup pecans, chopped","originalName":"pecans, chopped","amount":0.5,"unit":"cup","meta":["chopped"],"measures":{"us":{"amount":0.5,"unitShort":"cups","unitLong":"cups"},"metric":{"amount":49.5,"unitShort":"g","unitLong":"grams"}}},{"id":11424,"aisle":"Baking","image":"pumpkin-puree.jpg","consistency":"SOLID","name":"roasted pumpkin puree","nameClean":"roasted pumpkin puree","original":"1 cup roasted pumpkin puree","originalName":"roasted pumpkin puree","amount":1.0,"unit":"cup","meta":[],"measures":{"us":{"amount":1.0,"unitShort":"cup","unitLong":"cup"},"metric":{"amount":245.0,"unitShort":"g","unitLong":"grams"}}},{"id":20061,"aisle":"Baking","image":"white-powder.jpg","consistency":"SOLID","name":"rice flour","nameClean":"rice flour","original":"3/4 cup white rice flour","originalName":"white rice flour","amount":0.75,"unit":"cup","meta":["white"],"measures":{"us":{"amount":0.75,"unitShort":"cups","unitLong":"cups"},"metric":{"amount":120.0,"unitShort":"g","unitLong":"grams"}}},{"id":20648,"aisle":"Health Foods","image":"brown-flour.jpg","consistency":"SOLID","name":"sorghum flour","nameClean":"sorghum flour","original":"1/4 cup sorghum flour","originalName":"sorghum flour","amount":0.25,"unit":"cup","meta":[],"measures":{"us":{"amount":0.25,"unitShort":"cups","unitLong":"cups"},"metric":{"amount":30.0,"unitShort":"g","unitLong":"grams"}}},{"id":4673,"aisle":"Milk, Eggs, Other Dairy","image":"light-buttery-spread.png","consistency":"SOLID","name":"earth balance soy free spread","nameClean":"earth balance soy free spread","original":"1/4 cup Earth Balance Soy Free Spread","originalName":"Earth Balance Soy Free Spread","amount":0.25,"unit":"cup","meta":[],"measures":{"us":{"amount":0.25,"unitShort":"cups","unitLong":"cups"},"metric":{"amount":56.5,"unitShort":"ml","unitLong":"milliliters"}}},{"id":93696,"aisle":"Baking","image":"white-powder.jpg","consistency":"SOLID","name":"tapioca flour","nameClean":"tapioca flour","original":"1/2 cup tapioca flour","originalName":"tapioca flour","amount":0.5,"unit":"cup","meta":[],"measures":{"us":{"amount":0.5,"unitShort":"cups","unitLong":"cups"},"metric":{"amount":60.0,"unitShort":"g","unitLong":"grams"}}},{"id":1116,"aisle":"Milk, Eggs, Other Dairy","image":"plain-yogurt.jpg","consistency":"SOLID","name":"coconut yogurt","nameClean":"coconut yogurt","original":"1/2 cup coconut yogurt, vanilla flavor (So Delicious brand)","originalName":"coconut yogurt, vanilla flavor (So Delicious brand)","amount":0.5,"unit":"cup","meta":["(So Delicious brand)"],"measures":{"us":{"amount":0.5,"unitShort":"cups","unitLong":"cups"},"metric":{"amount":122.5,"unitShort":"ml","unitLong":"milliliters"}}}],"summary":"Pumpkin Pecan Streusel Cake - gluten free, soy free, vegan takes around 45 minutes from beginning to end. One serving contains 550 calories, 6g of protein, and 20g of fat. This gluten free recipe serves 8 and costs $1.2 per serving. 2 people have made this recipe and would make it again. A mixture of coconut yogurt, kosher salt, firmly brown sugar, and a handful of other ingredients are all it takes to make this recipe so scrumptious. It works well as a reasonably priced dessert. It is brought to you by Foodista. All things considered, we decided this recipe deserves a spoonacular score of 40%. This score is solid. Users who liked this recipe also liked Rich Pumpkin Coffee Cake (gluten-free, Vegan, Soy-free), Pumpkin Butter (Vegan, Gluten-Free, Nut-Free, Soy-Free), and Creamy Vegan Corn and Red Pepper Blender Soup (gluten-free, soy-free, nut-free, grain-free, salt-free).","cuisines":[],"dishTypes":["dessert"],"diets":["gluten free"],"occasions":[],"instructions":"
Preheat oven to 350F.
Grease and flour a 9-inch spring form pan or a 9-inch cake pan with 3-inch sides (recommended by Williams Sonoma). I used an Angel Food Cake Pan.
For the streusel:
Combine the flours, brown sugar, cinnamon and kosher salt in a small bowl.
Add Earth Balance Soy Free Spread into the dry ingredients.
Work the spread into the mixture with your hands until the mixture looks like coarse crumbs.
Add the pecans, combine. Set aside.
For the batter:
Measure your coconut milk and add the apple cider vinegar to it.
Let it sit without mixing to become sour-creamy looking. Set aside.
In a medium bowl, sift together, or whisk the flours, baking powder, baking soda, cinnamon, ginger, nutmeg and kosher salt.
In the bowl of an electric mixer fitted with the flat beater, beat together the butter and brown sugar on medium-high speed until well combined.
Add the mashed banana, scraping down the sides of the bowl with a rubber spatula when needed.
Add the pumpkin puree and sour cream mixture and continue to mix on low speed.
Add in the flour mixture.
The batter will be quite thick which is how it should be.
Note: If your batter is not thick for some reason add 1/4 cup of white rice flour.
Spread half of the thick batter into the prepared pan.
Sprinkle half of the streusel over the batter.
Add the remaining batter over the streusel and spread the thick batter evenly.
Evenly spread the remaining streusel over the batter.
Bake 55-60 minutes, or until a toothpick inserted into the center of the cake comes out clean.
Transfer the cake in the pan to your stovetop and let it cool for about 40 minutes.
When cooled, remove the sides of the cake from the pan using a spreader type knife, or something that will not scratch your cake pan.
Gently lift up the cake by pressing the removable bottom upwards.
I then refrigerated the cake with the bottom part still holding the cake for about an hour.
Transfer the chilled cake to a cake platter.
Put pieces of wax or parchment paper under the edges of the cake to keep the glaze drips from making a mess of your platter.
For the glaze:
In a glass bowl set over a small saucepan with simmering water, combine mini chips with Earth Balance spread.
Mix often to get a glossy sheen.
When completely melted take off the saucepan and let it cool for 5 minutes before glazing the cake.
Using a large spoon drizzle melted chocolate over the top of the cake.
Slowly pull out the papers along the cake.
Serve chilled, or room temperature.
","analyzedInstructions":[{"name":"Preheat oven to 350F.Grease and flour a 9-inch spring form pan or a 9-inch cake pan with 3-inch sides (recommended by Williams Sonoma). I used an Angel Food Cake Pan.For the streusel","steps":[{"number":1,"step":"Combine the flours, brown sugar, cinnamon and kosher salt in a small bowl.","ingredients":[{"id":19334,"name":"brown sugar","localizedName":"brown sugar","image":"dark-brown-sugar.png"},{"id":1082047,"name":"kosher salt","localizedName":"kosher salt","image":"salt.jpg"},{"id":2010,"name":"cinnamon","localizedName":"cinnamon","image":"https://spoonacular.com/cdn/ingredients_100x100/cinnamon.jpg"}],"equipment":[{"id":404783,"name":"bowl","localizedName":"bowl","image":"https://spoonacular.com/cdn/equipment_100x100/bowl.jpg"}]},{"number":2,"step":"Add Earth Balance Soy Free","ingredients":[],"equipment":[]},{"number":3,"step":"Spread into the dry ingredients.Work the spread into the mixture with your hands until the mixture looks like coarse crumbs.","ingredients":[{"id":0,"name":"spread","localizedName":"spread","image":""}],"equipment":[]},{"number":4,"step":"Add the pecans, combine. Set aside.For the batter:Measure your coconut milk and add the apple cider vinegar to it.","ingredients":[{"id":2048,"name":"apple cider vinegar","localizedName":"apple cider vinegar","image":"apple-cider-vinegar.jpg"},{"id":12118,"name":"coconut milk","localizedName":"coconut milk","image":"coconut-milk.png"},{"id":12142,"name":"pecans","localizedName":"pecans","image":"pecans.jpg"}],"equipment":[]},{"number":5,"step":"Let it sit without mixing to become sour-creamy looking. Set aside.In a medium bowl, sift together, or whisk the flours, baking powder, baking soda, cinnamon, ginger, nutmeg and kosher salt.In the bowl of an electric mixer fitted with the flat beater, beat together the butter and brown sugar on medium-high speed until well combined.","ingredients":[{"id":18369,"name":"baking powder","localizedName":"baking powder","image":"white-powder.jpg"},{"id":18372,"name":"baking soda","localizedName":"baking soda","image":"white-powder.jpg"},{"id":19334,"name":"brown sugar","localizedName":"brown sugar","image":"dark-brown-sugar.png"},{"id":1082047,"name":"kosher salt","localizedName":"kosher salt","image":"salt.jpg"},{"id":2010,"name":"cinnamon","localizedName":"cinnamon","image":"https://spoonacular.com/cdn/ingredients_100x100/cinnamon.jpg"},{"id":1001,"name":"butter","localizedName":"butter","image":"butter-sliced.jpg"},{"id":11216,"name":"ginger","localizedName":"ginger","image":"ginger.png"},{"id":2025,"name":"nutmeg","localizedName":"nutmeg","image":"ground-nutmeg.jpg"}],"equipment":[{"id":404628,"name":"hand mixer","localizedName":"hand mixer","image":"https://spoonacular.com/cdn/equipment_100x100/hand-mixer.png"},{"id":404661,"name":"whisk","localizedName":"whisk","image":"https://spoonacular.com/cdn/equipment_100x100/whisk.png"},{"id":404783,"name":"bowl","localizedName":"bowl","image":"https://spoonacular.com/cdn/equipment_100x100/bowl.jpg"}]},{"number":6,"step":"Add the mashed banana, scraping down the sides of the bowl with a rubber spatula when needed.","ingredients":[{"id":1009040,"name":"mashed banana","localizedName":"mashed banana","image":"https://spoonacular.com/cdn/ingredients_100x100/bananas.jpg"}],"equipment":[{"id":404642,"name":"spatula","localizedName":"spatula","image":"https://spoonacular.com/cdn/equipment_100x100/spatula-or-turner.jpg"},{"id":404783,"name":"bowl","localizedName":"bowl","image":"https://spoonacular.com/cdn/equipment_100x100/bowl.jpg"}]},{"number":7,"step":"Add the pumpkin puree and sour cream mixture and continue to mix on low speed.","ingredients":[{"id":11424,"name":"canned pumpkin","localizedName":"canned pumpkin","image":"pumpkin-puree.jpg"},{"id":1056,"name":"sour cream","localizedName":"sour cream","image":"sour-cream.jpg"}],"equipment":[]},{"number":8,"step":"Add in the flour mixture.The batter will be quite thick which is how it should be.Note: If your batter is not thick for some reason add 1/4 cup of white rice flour.","ingredients":[{"id":0,"name":"white rice flour","localizedName":"white rice flour","image":"white-powder.jpg"},{"id":20081,"name":"all purpose flour","localizedName":"all purpose flour","image":"flour.png"}],"equipment":[]},{"number":9,"step":"Spread half of the thick batter into the prepared pan.","ingredients":[{"id":0,"name":"spread","localizedName":"spread","image":""}],"equipment":[{"id":404645,"name":"frying pan","localizedName":"frying pan","image":"https://spoonacular.com/cdn/equipment_100x100/pan.png"}]},{"number":10,"step":"Sprinkle half of the streusel over the batter.","ingredients":[],"equipment":[]},{"number":11,"step":"Add the remaining batter over the streusel and spread the thick batter evenly.Evenly spread the remaining streusel over the batter.","ingredients":[{"id":0,"name":"spread","localizedName":"spread","image":""}],"equipment":[]},{"number":12,"step":"Bake 55-60 minutes, or until a toothpick inserted into the center of the cake comes out clean.","ingredients":[],"equipment":[{"id":404644,"name":"toothpicks","localizedName":"toothpicks","image":"https://spoonacular.com/cdn/equipment_100x100/toothpicks.jpg"},{"id":404784,"name":"oven","localizedName":"oven","image":"https://spoonacular.com/cdn/equipment_100x100/oven.jpg"}],"length":{"number":60,"unit":"minutes"}},{"number":13,"step":"Transfer the cake in the pan to your stovetop and let it cool for about 40 minutes.When cooled, remove the sides of the cake from the pan using a spreader type knife, or something that will not scratch your cake pan.Gently lift up the cake by pressing the removable bottom upwards.I then refrigerated the cake with the bottom part still holding the cake for about an hour.","ingredients":[],"equipment":[{"id":404747,"name":"cake form","localizedName":"cake form","image":"https://spoonacular.com/cdn/equipment_100x100/cake-pan.png"},{"id":404794,"name":"stove","localizedName":"stove","image":"https://spoonacular.com/cdn/equipment_100x100/oven.jpg"},{"id":404745,"name":"knife","localizedName":"knife","image":"https://spoonacular.com/cdn/equipment_100x100/chefs-knife.jpg"}],"length":{"number":40,"unit":"minutes"}},{"number":14,"step":"Transfer the chilled cake to a cake platter.Put pieces of wax or parchment paper under the edges of the cake to keep the glaze drips from making a mess of your platter.For the glaze:In a glass bowl set over a small saucepan with simmering water, combine mini chips with Earth Balance spread.","ingredients":[{"id":0,"name":"spread","localizedName":"spread","image":""},{"id":11408,"name":"french fries","localizedName":"french fries","image":"french-fries-isolated.jpg"},{"id":0,"name":"glaze","localizedName":"glaze","image":""},{"id":14412,"name":"water","localizedName":"water","image":"water.png"}],"equipment":[{"id":404770,"name":"baking paper","localizedName":"baking paper","image":"https://spoonacular.com/cdn/equipment_100x100/baking-paper.jpg"},{"id":404669,"name":"sauce pan","localizedName":"sauce pan","image":"https://spoonacular.com/cdn/equipment_100x100/sauce-pan.jpg"},{"id":404783,"name":"bowl","localizedName":"bowl","image":"https://spoonacular.com/cdn/equipment_100x100/bowl.jpg"}]},{"number":15,"step":"Mix often to get a glossy sheen.When completely melted take off the saucepan and let it cool for 5 minutes before glazing the cake.Using a large spoon drizzle melted chocolate over the top of the cake.Slowly pull out the papers along the cake.","ingredients":[{"id":19081,"name":"chocolate","localizedName":"chocolate","image":"milk-chocolate.jpg"}],"equipment":[{"id":404669,"name":"sauce pan","localizedName":"sauce pan","image":"https://spoonacular.com/cdn/equipment_100x100/sauce-pan.jpg"}],"length":{"number":5,"unit":"minutes"}},{"number":16,"step":"Serve chilled, or room temperature.","ingredients":[],"equipment":[]}]}],"originalId":null,"spoonacularScore":4.624910831451416,"spoonacularSourceUrl":"https://spoonacular.com/pumpkin-pecan-streusel-cake-gluten-free-soy-free-vegan-657341"}]}
\ No newline at end of file
diff --git a/script.js b/script.js
new file mode 100644
index 000000000..87b16b0d5
--- /dev/null
+++ b/script.js
@@ -0,0 +1,95 @@
+document.addEventListener("DOMContentLoaded", async () => {
+ // fetches recipes and sets globals before rendering/adding listeners
+ const apiResult = await getRecipes();
+ let recipes = apiResult.recipes || [];
+ let apiErrorMessage = apiResult.error || null;
+
+ // Function to filter and sort recipes, then render them
+ function filterAndSortRecipes() {
+ const dietInput = document.querySelector('input[name="diet"]:checked');
+ const sortInput = document.querySelector('input[name="sort-time"]:checked');
+ const diet = dietInput ? dietInput.value : "all";
+ const sort = sortInput ? sortInput.value : "desc";
+
+ // Filter
+ let filtered = recipes;
+ if (diet !== "all") {
+ filtered = recipes.filter(recipe => recipe.diets.includes(diet));
+ }
+
+ // Sort
+ if (sort === "asc") {
+ filtered = filtered.slice().sort((a, b) => a.readyInMinutes - b.readyInMinutes);
+ } else {
+ filtered = filtered.slice().sort((a, b) => b.readyInMinutes - a.readyInMinutes);
+ }
+
+ renderRecipes(filtered);
+ }
+
+ // Event listeners to all filter and sort radio buttons
+ document.querySelectorAll('input[name="diet"], input[name="sort-time"]').forEach(input => {
+ input.addEventListener("change", filterAndSortRecipes);
+ });
+
+ // Render recipes initially
+ filterAndSortRecipes();
+
+ // Event listener for random recipe button
+ const randomBtn = document.getElementById('random-recipe-btn');
+ if (randomBtn) {
+ if (recipes.length === 0) {
+ randomBtn.disabled = true; // Disable button if no recipes
+ } else {
+ randomBtn.addEventListener('click', () => {
+ // Pick a random recipe from the array
+ const randomRecipe = recipes[Math.floor(Math.random() * recipes.length)];
+ // Render only the random recipe
+ renderRecipes([randomRecipe]);
+ });
+ }
+ }
+});
+
+// Function to render recipe cards
+function renderRecipes(recipesArray) {
+ const container = document.querySelector('.recipe-card-container');
+ container.innerHTML = ""; // Clear previous cards
+
+ // Shows message when no recipes to display
+ if (!recipesArray || recipesArray.length === 0) {
+ const message = apiErrorMessage
+ ? apiErrorMessage
+ : "No recipes found — try different filters or try again later.";
+ container.innerHTML = `