Skip to content

Commit c6a98e5

Browse files
Merge branch 'master' into Feature/js-fixes-vic
2 parents de4ad2e + 3957e9f commit c6a98e5

17 files changed

+216
-71
lines changed

public/.DS_Store

0 Bytes
Binary file not shown.

public/assets/.DS_Store

0 Bytes
Binary file not shown.

public/assets/heart.png

13.3 KB
Loading

public/assets/stopwatch.png

17.4 KB
Loading

public/css/home.css

+37-19
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,41 @@
22

33
body {
44
margin: 0;
5-
font-family: 'Overlock', cursive;
6-
5+
font-family: 'Nobile', sans-serif;
6+
font-size: 1em;
7+
font-weight: bold;
78
}
89

910
.btn {
10-
background-color:#814256;
11+
font-family: 'Nobile', sans-serif;
12+
cursor:pointer;
13+
box-shadow: 1px 2px 4px rgba(0, 0, 0, .5);
14+
background-color:#F26157;
1115
width: 10em;
12-
height: 5em;
13-
border-radius: 20%;
16+
height: 3em;
17+
border-radius: 1em;
1418
border-style: none;
1519
color: #F7F4F3;
20+
font-size: 1em;
21+
font-weight: bold;
22+
}
23+
24+
.btn:hover{
25+
transform:translateY(-3px);
1626

1727
}
1828

29+
1930
.header {
20-
margin-top:0;
31+
font-family: "Nobile", sans-serif;
32+
margin-top: 0;
2133
padding-top: 1em;
22-
font-size: 3em;
34+
font-size: 2.5em;
2335
font-weight: bold;
2436
text-align: center;
25-
26-
2737
}
2838

29-
.background{
39+
.background {
3040
height: 20vh;
3141
background-image: url("../assets/food-background.jpeg");
3242
background-size: 100%;
@@ -38,25 +48,23 @@ body {
3848
grid-template-columns: repeat(6, 1fr);
3949
grid-template-rows: repeat(8, 1fr);
4050
height: 75vh;
41-
background-color: #F7F4F3;
51+
background-color: #f7f4f3;
4252
padding-bottom: 2em;
43-
44-
4553
}
4654
/* .onboarding__logo{
4755
grid-column: 2/span 4;
4856
grid-row: 1/span 1;
4957
width: 80%;
5058
} */
5159

52-
.header__onboarding{
60+
.header__onboarding {
5361
grid-column: 3 / span 2;
5462
grid-row: 1 / span 1;
5563
justify-self: center;
5664
font-size: 2.5em;
5765
}
5866

59-
.paragraph__onboarding__one{
67+
.paragraph__onboarding__one {
6068
justify-self: right;
6169
grid-column: 1 / span 2;
6270
grid-row: 2 / span 1;
@@ -67,22 +75,32 @@ body {
6775
grid-row: 4 / span 1;
6876
}
6977

70-
.paragraph__onboarding__three{
78+
.paragraph__onboarding__three {
7179
grid-column: 3 / span 2;
7280
grid-row: 6 / span 1;
7381
justify-self: center;
7482
}
7583

76-
77-
.form__onboarding__form{
84+
.form__onboarding__form {
7885
display: flex;
79-
justify-content: space-between;
86+
justify-content: space-around;
8087
align-items: center;
8188
grid-column: 2 / span 4;
8289
grid-row: 8 / span 1;
8390
}
8491

8592

93+
.btn__onboarding__view-plans{
94+
margin: 0.5em;
95+
font-size: 0.8em;
96+
width: 15em;
97+
}
98+
99+
.btn__onboarding__new-plan{
100+
margin: 0.5em;
101+
font-size: 0.8em;
102+
width: 15em;
103+
}
86104

87105
/* all meal plans page */
88106

public/css/mealplans.css

+18-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
.meal-plan-container {
2-
background-color: #D8D8D8;
2+
background-color: #f2edeb;
3+
box-shadow: 1px 2px 4px rgba(0, 0, 0, .5);
34
display: flex;
45
height: 18vh;
56
margin: 1em;
6-
border-radius: 10%;
7+
border-radius: 1em;
78
padding: 1em;
89

910
}
@@ -23,10 +24,13 @@
2324

2425
.btn__meal-plans__new-plan {
2526
width: 5em;
27+
height: 3.5em;
2628
font-size: 1em;
2729
font-weight: bold;
28-
2930
}
31+
/* .btn__back__new-plan{
32+
33+
} */
3034

3135
.meal-plan-container {
3236
display: flex;
@@ -40,14 +44,21 @@
4044
justify-content: space-around;
4145
flex-direction:row;
4246
}
43-
.paragraph__ meal-plan__days{
44-
width:2em;
47+
.paragraph__meal-plan__days{
48+
margin-top: 0.5em;
49+
50+
text-decoration: italic;
4551
}
4652

4753
.header__meal-plan{
48-
49-
font-size: 2em;
54+
/* font-size: 1.8em; */
5055
padding-right:1em;
5156
margin:0;
57+
}
5258

59+
.link__meal-plan{
60+
text-align: center;
61+
text-decoration: none;
62+
height: 2em;
63+
width: 8em
5364
}

public/css/newPlan.css

+39-8
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,17 @@
44
grid-template-columns: repeat(6, 1fr);
55
grid-template-rows: repeat(4, 1fr);
66
margin: 2em;
7-
border: solid black 2px;
8-
border-radius: 20%;
7+
background-color: #f2edeb;
8+
box-shadow: 1px 2px 4px rgba(0, 0, 0, .5);
9+
border-radius: 1em;
910
padding-bottom: 1em;
11+
padding-left: 1em;
1012
}
1113

1214
.recipe-image__newplan{
1315
position: relative;
14-
max-width: 100px;
15-
border-radius: 20%;
16+
max-width: 6em;
17+
border-radius: 1em;
1618
grid-column: 1/span 2;
1719
grid-row: 2/span 2;
1820
align-self: center;
@@ -27,28 +29,56 @@
2729
}
2830

2931
.recipe-time__newplan{
30-
grid-column: 5/span 2;
32+
grid-column: 6/span 1;
3133
grid-row: 2/span 2;
3234
align-self: center;
3335
justify-self: center;
36+
font-size:1.5em;
3437
}
3538

3639
.recipe-health__newplan{
37-
grid-column: 3/ span 2;
40+
grid-column: 4/ span 1;
3841
grid-row: 2/span 2;
3942
align-self: center;
4043
justify-self: center;
44+
font-size:1.5em;
4145
}
4246

4347
.btn__newplan-select{
4448
grid-column: 3/span 3;
4549
grid-row: 4/span 1;
46-
width: 10em;
50+
width: 8em;
51+
height: 3em;
4752
align-self: center;
4853
justify-self: center;
4954

5055
}
5156

57+
.image__timer-icon{
58+
max-width: 2em;
59+
grid-column: 5/span 1;
60+
grid-row: 2/span 2;
61+
align-self: center;
62+
justify-self: center;
63+
}
64+
.image__health-icon{
65+
margin-left: 1em;
66+
grid-column: 3/ span 1;
67+
grid-row: 2/span 2;
68+
max-width: 2em;
69+
align-self: center;
70+
justify-self: center;
71+
}
72+
73+
.btn__back__new-plan{
74+
height:3em;
75+
width:8em;
76+
}
77+
78+
.btn__next__new-plan{
79+
height:3em;
80+
width:8em;
81+
}
5282
.container__next-back-buttons{
5383
display: flex;
5484
justify-content: space-around;
@@ -57,5 +87,6 @@
5787
.form__newplan__load-more{
5888
display: flex;
5989
justify-content: center;
60-
padding-top: 1em;
90+
padding-top: 2em;
91+
padding-bottom:2em;
6192
}

public/css/newplanAdditionalChoices.css

+34-9
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,25 @@
1+
2+
.container__newplan-additional-main{
3+
background-color: white;
4+
}
15
.container__pick-more-recipes{
26
height: 30vh;
37
display: grid;
48
grid-template-columns: repeat(6, 1fr);
59
grid-template-rows: repeat(4, 1fr);
610
margin: 2em;
7-
border: solid black 2px;
8-
border-radius: 20%;
11+
padding-left: 1em;
12+
background-color: #f2edeb;
13+
box-shadow: 1px 2px 4px rgba(0, 0, 0, .5);
14+
border-radius: 1em;
915
padding-bottom: 1em;
1016
}
1117

18+
1219
.recipe-image__additional-plan{
1320
position: relative;
14-
max-width: 100px;
15-
border-radius: 20%;
21+
max-width: 6em;
22+
border-radius: 1em;
1623
grid-column: 1/span 2;
1724
grid-row: 2/span 2;
1825
align-self: center;
@@ -43,23 +50,41 @@
4350
.recipe__select{
4451
grid-column: 3/span 3;
4552
grid-row: 4/span 1;
46-
width: 10em;
53+
width: 8em;
54+
height: 3em;
4755
align-self: center;
4856
justify-self: center;
4957

5058
}
5159

5260
.second-choices__back-button{
53-
display: flex;
54-
justify-content: space-around;
61+
margin: 1em;
62+
height: 3em;
63+
width:7em;
64+
65+
}
66+
.second-choices__save-button{
67+
margin:1em;
68+
height: 3em;
69+
width: 7em;
5570
}
5671

72+
5773
.second-choices__form{
5874
display: flex;
5975
justify-content: center;
60-
padding-top: 1em;
76+
flex-wrap: wrap;
77+
}
78+
79+
.second-choices__name-plan{
80+
width: 80%;
81+
height:3.5em;
82+
text-align: center;
83+
border-radius: 1em;
84+
box-shadow: 1px 2px 4px rgba(0, 0, 0, .5);
85+
6186
}
6287

6388
/* .second-choices__name-plan{
64-
89+
6590
} */

src/controllers/routes.js

+33-1
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,42 @@ exports.individualRecipe = (req, res) => {
113113
// route to make a db call for shopping list page
114114

115115
exports.shoppingList = (req, res) => {
116+
let ingredientsArray = [];
117+
let ingredientsObject = {};
118+
let uniqueIngredients = [];
119+
let duplicateIngredients = [];
116120
queries
117121
.getShoppingList(req.params.id)
118122
.then(result => {
119-
res.render("shoppingList", { ingredients: result.rows });
123+
result.rows.forEach(e => {
124+
ingredientsArray.push(e.ingredient_name);
125+
});
126+
return ingredientsArray;
127+
})
128+
.then(ingredientsArray => {
129+
ingredientsArray.forEach(e => {
130+
if (Object.keys(ingredientsObject).includes(e)) {
131+
ingredientsObject[e] = true;
132+
} else {
133+
ingredientsObject[e] = false;
134+
}
135+
});
136+
return ingredientsObject;
137+
})
138+
.then(ingredientsObject => {
139+
Object.entries(ingredientsObject).forEach((e, i) => {
140+
if (e.includes(true)) {
141+
duplicateIngredients.push(e[0]);
142+
} else {
143+
uniqueIngredients.push(e[0]);
144+
}
145+
});
146+
})
147+
.then(ingredientsObject => {
148+
res.render("shoppingList", {
149+
uniqueIngredients: uniqueIngredients,
150+
duplicateIngredients: duplicateIngredients
151+
});
120152
})
121153
.catch(err => {
122154
res.render("error", {

0 commit comments

Comments
 (0)