Project Right Now

  • Currently the section of my project I was planning to use for CPT, the recipe generator, only take one input and one output. I plan to expand that.

  • Changes

    • Image display: when the recipe is generated, an image will be outputted as well
    • Because I am not using the sqlite table for CPT, I need to make sure all by input cleaning is in frontend
    • Add another field option
      • User can either enter mood or food group
function generateLink() {
    const recipeLinks = [
      "https://www.foodnetwork.com/recipes/ina-garten/roast-chicken-recipe-1940592",
      "https://www.allrecipes.com/recipe/27010/classic-beef-stroganoff/",
      "https://www.epicurious.com/recipes/food/views/pork-tacos-with-pineapple-salsa-56389926",
      "https://www.delish.com/uk/cooking/recipes/a31010080/chicken-alfredo-pasta-bake-recipe/",
      "https://www.bbcgoodfood.com/recipes/ultimate-spaghetti-carbonara-recipe",
      "https://www.simplyrecipes.com/recipes/banana_bread/",
      "https://joyfoodsunshine.com/the-most-amazing-chocolate-chip-cookies/",
      "https://www.abeautifulplate.com/the-best-homemade-margherita-pizza/",
      "https://www.modernhoney.com/the-best-snickerdoodle-cookie-recipe/",
      "https://www.allrecipes.com/recipe/82659/old-fashioned-onion-rings/",
      "https://www.modernhoney.com/fettuccine-alfredo/",
    ];

    const happy = [
      "https://www.foodnetwork.com/recipes/ina-garten/roast-chicken-recipe-1940592",
      "https://www.allrecipes.com/recipe/27010/classic-beef-stroganoff/",
      "https://www.epicurious.com/recipes/food/views/pork-tacos-with-pineapple-salsa-56389926",
      "https://www.delish.com/uk/cooking/recipes/a31010080/chicken-alfredo-pasta-bake-recipe/",
      "https://www.bbcgoodfood.com/recipes/ultimate-spaghetti-carbonara-recipe",
      "https://www.simplyrecipes.com/recipes/banana_bread/",
      "https://joyfoodsunshine.com/the-most-amazing-chocolate-chip-cookies/",
      "https://www.abeautifulplate.com/the-best-homemade-margherita-pizza/",
      "https://www.modernhoney.com/the-best-snickerdoodle-cookie-recipe/",
      "https://www.allrecipes.com/recipe/82659/old-fashioned-onion-rings/",
      "https://www.modernhoney.com/fettuccine-alfredo/",
    ];

    const sad = [
      "https://www.foodnetwork.com/recipes/ina-garten/roast-chicken-recipe-1940592",
      "https://www.allrecipes.com/recipe/27010/classic-beef-stroganoff/",
      "https://www.epicurious.com/recipes/food/views/pork-tacos-with-pineapple-salsa-56389926",
      "https://www.delish.com/uk/cooking/recipes/a31010080/chicken-alfredo-pasta-bake-recipe/",
      "https://www.bbcgoodfood.com/recipes/ultimate-spaghetti-carbonara-recipe",
      "https://www.simplyrecipes.com/recipes/banana_bread/",
      "https://joyfoodsunshine.com/the-most-amazing-chocolate-chip-cookies/",
      "https://www.abeautifulplate.com/the-best-homemade-margherita-pizza/",
      "https://www.modernhoney.com/the-best-snickerdoodle-cookie-recipe/",
      "https://www.allrecipes.com/recipe/82659/old-fashioned-onion-rings/",
      "https://www.modernhoney.com/fettuccine-alfredo/",
    ];

    const stressed = [
      "https://www.foodnetwork.com/recipes/ina-garten/roast-chicken-recipe-1940592",
      "https://www.allrecipes.com/recipe/27010/classic-beef-stroganoff/",
      "https://www.epicurious.com/recipes/food/views/pork-tacos-with-pineapple-salsa-56389926",
      "https://www.delish.com/uk/cooking/recipes/a31010080/chicken-alfredo-pasta-bake-recipe/",
      "https://www.bbcgoodfood.com/recipes/ultimate-spaghetti-carbonara-recipe",
      "https://www.simplyrecipes.com/recipes/banana_bread/",
      "https://joyfoodsunshine.com/the-most-amazing-chocolate-chip-cookies/",
      "https://www.abeautifulplate.com/the-best-homemade-margherita-pizza/",
      "https://www.modernhoney.com/the-best-snickerdoodle-cookie-recipe/",
      "https://www.allrecipes.com/recipe/82659/old-fashioned-onion-rings/",
      "https://www.modernhoney.com/fettuccine-alfredo/",
    ];

    const angry = [
      "https://www.foodnetwork.com/recipes/ina-garten/roast-chicken-recipe-1940592",
      "https://www.allrecipes.com/recipe/27010/classic-beef-stroganoff/",
      "https://www.epicurious.com/recipes/food/views/pork-tacos-with-pineapple-salsa-56389926",
      "https://www.delish.com/uk/cooking/recipes/a31010080/chicken-alfredo-pasta-bake-recipe/",
      "https://www.bbcgoodfood.com/recipes/ultimate-spaghetti-carbonara-recipe",
      "https://www.simplyrecipes.com/recipes/banana_bread/",
      "https://joyfoodsunshine.com/the-most-amazing-chocolate-chip-cookies/",
      "https://www.abeautifulplate.com/the-best-homemade-margherita-pizza/",
      "https://www.modernhoney.com/the-best-snickerdoodle-cookie-recipe/",
      "https://www.allrecipes.com/recipe/82659/old-fashioned-onion-rings/",
      "https://www.modernhoney.com/fettuccine-alfredo/",
    ];

    // Generate a  recipe link based on what emotion user picked
    const randomLink = recipeLinks[Math.floor(Math.random() * recipeLinks.length)];

    // Display the  recipe link
    const recipeLink = document.getElementById("recipe-link");
    recipeLink.innerHTML = "Here's a recipe perfect for your mood!---_>"+"<a href='" + randomLink + "'>" + randomLink + "</a>";
}