Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions assets/CodeDump.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/* $(".cocktail-content").html(""

+ response.drinks[DrinkRandom].strIngredient1 + ": " + response.drinks[DrinkRandom].strMeasure1 + "<br>"

+ response.drinks[DrinkRandom].strIngredient2 + ": " + response.drinks[DrinkRandom].strMeasure2 + "<br>"

+ response.drinks[DrinkRandom].strIngredient3 + ": " + response.drinks[DrinkRandom].strMeasure3 + "<br>"

+ response.drinks[DrinkRandom].strIngredient4 + ": " + response.drinks[DrinkRandom].strMeasure4 + "<br>"

+ response.drinks[DrinkRandom].strIngredient5 + ": " + response.drinks[DrinkRandom].strMeasure5 + "<br>"

+ response.drinks[DrinkRandom].strIngredient6 + ": " + response.drinks[DrinkRandom].strMeasure6 + "<br>"

+ response.drinks[DrinkRandom].strIngredient7 + ": " + response.drinks[DrinkRandom].strMeasure7 + "<br>"

+ response.drinks[DrinkRandom].strIngredient8 + ": " + response.drinks[DrinkRandom].strMeasure8 + "<br>"

+ response.drinks[DrinkRandom].strIngredient9 + ": " + response.drinks[DrinkRandom].strMeasure9 + "<br>"

+ response.drinks[DrinkRandom].strIngredient10 + ": " + response.drinks[DrinkRandom].strMeasure10 + "<br>"

+ response.drinks[DrinkRandom].strIngredient11 + ": " + response.drinks[DrinkRandom].strMeasure11 + "<br>"

+ response.drinks[DrinkRandom].strIngredient12 + ": " + response.drinks[DrinkRandom].strMeasure12 + "<br>"

+ response.drinks[DrinkRandom].strIngredient13 + ": " + response.drinks[DrinkRandom].strMeasure13 + "<br>"

+ response.drinks[DrinkRandom].strIngredient14 + ": " + response.drinks[DrinkRandom].strMeasure14 + "<br>"

+ response.drinks[DrinkRandom].strIngredient15 + ": " + response.drinks[DrinkRandom].strMeasure15 + "<br>"

); */

// if ($("<p>") !== null) {
// } else {
// $("<p>").addClass("hide")
// }


// for (i = 0 + 1; i < 15; i++) {
// console.log("string")
// if (response.drinks[DrinkRandom].strIngredient[i] !== null) {
// console.log(response.drinks[DrinkRandom].strIngredient[i])
// }
// console.log(response.drinks[DrinkRandom].strIngredient1)
// if (response.drinks[DrinkRandom].strIngredient[i] === null) {

// }

// }



41 changes: 26 additions & 15 deletions assets/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var foodArray = []
var beef = 0
var chicken = 0
var tofu = 0
var fish = 0
var salmon = 0


$("#resultsCalc").on("click", function () {
Expand All @@ -16,8 +16,8 @@ $("#resultsCalc").on("click", function () {
if (foodArray[i] === 'chicken') {
chicken++;
}
if (foodArray[i] === 'fish') {
fish++;
if (foodArray[i] === 'salmon') {
salmon++;
}
if (foodArray[i] === 'tofu') {
tofu++;
Expand All @@ -33,24 +33,25 @@ $("#resultsCalc").on("click", function () {
$("#foodImg").attr("src", jsonResponse.results[foodRandom].thumbnail);
$("#foodTitle").text(jsonResponse.results[foodRandom].title);
$("#foodLink").text(jsonResponse.results[foodRandom].ingredients);
$(".recipe-content").html("<a href='" + jsonResponse.results[foodRandom].href + "'>Link to Recipe.</a>")
})
GetDrink()
})

function winnerPick() {
if (beef > chicken && beef > fish && beef > tofu) {
if (beef > chicken && beef > salmon && beef > tofu) {
chosenIngredient = "beef"
chosenAlcohol = "tequila"
}
else if (chicken > beef && chicken > fish && chicken > tofu) {
else if (chicken > beef && chicken > salmon && chicken > tofu) {
chosenIngredient = "chicken"
chosenAlcohol = "rum"
}
else if (fish > chicken && fish > beef && fish > tofu) {
chosenIngredient = "fish"
else if (salmon > chicken && salmon > beef && salmon > tofu) {
chosenIngredient = "salmon"
chosenAlcohol = "vodka"
}
else if (tofu > chicken && tofu > beef && tofu > fish) {
else if (tofu > chicken && tofu > beef && tofu > salmon) {
chosenIngredient = "tofu"
chosenAlcohol = "gin"
}
Expand Down Expand Up @@ -79,6 +80,7 @@ function fetchRecipes(ingredients) {
}
}
return $.ajax(settings)

}

function GetDrink(baseAlcohol) {
Expand All @@ -100,7 +102,22 @@ function GetDrink(baseAlcohol) {
$("#drinkImg").attr("src", response.drinks[DrinkRandom].strDrinkThumb);
console.log(response.drinks[DrinkRandom].strDrinkThumb)
$("#drinkTitle").text(response.drinks[DrinkRandom].strDrink);

$(".cocktail-content").html("Top three Ingredients:<br>" + response.drinks[DrinkRandom].strIngredient1 + ": " + response.drinks[DrinkRandom].strMeasure1 + "<br>"
+ response.drinks[DrinkRandom].strIngredient2 + ": " + response.drinks[DrinkRandom].strMeasure2 + "<br>"
+ response.drinks[DrinkRandom].strIngredient3 + ": " + response.drinks[DrinkRandom].strMeasure3 + "<br>"
/* + response.drinks[DrinkRandom].strIngredient4 + ": " + response.drinks[DrinkRandom].strMeasure4 + "<br>"
+ response.drinks[DrinkRandom].strIngredient5 + ": " + response.drinks[DrinkRandom].strMeasure5 + "<br>"
+ response.drinks[DrinkRandom].strIngredient6 + ": " + response.drinks[DrinkRandom].strMeasure6 + "<br>"
+ response.drinks[DrinkRandom].strIngredient7 + ": " + response.drinks[DrinkRandom].strMeasure7 + "<br>"
+ response.drinks[DrinkRandom].strIngredient8 + ": " + response.drinks[DrinkRandom].strMeasure8 + "<br>"
+ response.drinks[DrinkRandom].strIngredient9 + ": " + response.drinks[DrinkRandom].strMeasure9 + "<br>"
+ response.drinks[DrinkRandom].strIngredient10 + ": " + response.drinks[DrinkRandom].strMeasure10 + "<br>"
+ response.drinks[DrinkRandom].strIngredient11 + ": " + response.drinks[DrinkRandom].strMeasure11 + "<br>"
+ response.drinks[DrinkRandom].strIngredient12 + ": " + response.drinks[DrinkRandom].strMeasure12 + "<br>"
+ response.drinks[DrinkRandom].strIngredient13 + ": " + response.drinks[DrinkRandom].strMeasure13 + "<br>"
+ response.drinks[DrinkRandom].strIngredient14 + ": " + response.drinks[DrinkRandom].strMeasure14 + "<br>"
+ response.drinks[DrinkRandom].strIngredient15 + ": " + response.drinks[DrinkRandom].strMeasure15 + "<br>" */);

});

}
Expand All @@ -111,9 +128,3 @@ $(".button1").click(function() {
$(this).siblings(`.button1[value=${otherButton}]`).css({'background':'transparent', 'color':'#808080'});
$(this).siblings(".answer").val(this.value);
});


});

}

18 changes: 9 additions & 9 deletions assets/style.css
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
@import url('https://fonts.googleapis.com/css?family=Codystar:300&display=swap');

body {

display: flex;
justify-content: center;
align-items: center;
background: black;
background-image: url('data:image/svg+xml,%3Csvg width="42" height="44" viewBox="0 0 42 44" xmlns="http://www.w3.org/2000/svg"%3E%3Cg id="Page-1" fill="none" fill-rule="evenodd"%3E%3Cg id="brick-wall" fill="%239C92AC" fill-opacity="0.4"%3E%3Cpath d="M0 0h42v44H0V0zm1 1h40v20H1V1zM0 23h20v20H0V23zm22 0h20v20H22V23z"/%3E%3C/g%3E%3C/g%3E%3C/svg%3E');

}

.neons {
margin-top: 10rem;
text-align: center;
font-family: 'Codystar';
}
Expand All @@ -30,7 +27,7 @@ body {
color: #fff;
text-shadow: 0 0 10px #00fff2, 0 0 20px #00fff2, 0 0 30px #00fff2, 0 0 40px #00fff2, 0 0 50px #00fff2, 0 0 60px #00fff2, 0 0 70px #00fff2, 0 0 90px #00fff2;
}

to {
color: gray;
text-shadow: 0 0 20px #00fff2, 0 0 30px #00fff2, 0 0 40px #00fff2, 0 0 50px #00fff2, 0 0 60px #00fff2, 0 0 70px #00fff2, 0 0 80px #00fff2, 0 1 90px #00fff2;
Expand All @@ -50,8 +47,6 @@ main {
}

p {
font-size: 20px;
font-weight: bold;
color: white;
}

Expand All @@ -64,11 +59,14 @@ hr {
label {
margin-left: 1.5rem;
color: black;

}

.question {
padding-left: 40px;
font-size: 20px;
font-weight: bold;
color: white;
}

.center-cols > .col {
Expand All @@ -94,6 +92,7 @@ label {
padding-left: 5rem;
padding-right: 5rem;
font-weight: bold;
border: 2px solid #e7e7e7;
}

.buttonRes:active {
Expand All @@ -102,6 +101,8 @@ label {

.pumpkin {
background-color: #e9724c;
font-size: 20px;
font-weight: bold;
}

.darkRed {
Expand All @@ -122,7 +123,6 @@ label {

#nameTag {
margin-left: 46rem;

}

.button {
Expand Down Expand Up @@ -165,4 +165,4 @@ th {

tr:nth-child(even) {
background-color: #f2f2f2;
}
}
Loading