Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
298 lines (296 loc) · 9.46 KB
/
Copy pathindex.html
File metadata and controls
298 lines (296 loc) · 9.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="author" content="Naman Agarwal" />
<meta charset="utf-8" />
<!-- stop the web browser from ever caching this page or its images -->
<meta http-equiv="Cache-Control" content="no-cache" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<link
rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm"
crossorigin="anonymous"
/>
<script src="https://unpkg.com/vue"></script>
<script src="https://unpkg.com/http-vue-loader"></script>
<script
defer
src="https://use.fontawesome.com/releases/v5.0.8/js/all.js"
></script>
<script src="https://www.gstatic.com/firebasejs/4.11.0/firebase.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vuefire/1.4.5/vuefire.js"></script>
<meta
name="viewport"
content="width=device-width, initial-scale=1, minimal-ui"
/>
<title>MegaCook</title>
</head>
<body>
<!-- root element that connects to Vue :style="{ backgroundColor: backgroundColor['.value'], backgroundImage: 'url(' + backgroundImage['.value'] + ')' }" -->
<div id="my-app" :style="{ backgroundColor: backgroundColor['.value'], backgroundImage: 'url(' + backgroundImage['.value'] + ')' }">
<!-- nav bar -->
<nav class="navbar navbar-expand-lg navbar-dark fixed-top bg-dark">
<a class="navbar-brand" href="#"
><i class="fa fa-adjust" aria-hidden="true"></i> MegaCook</a
>
<div class="collapse navbar-collapse">
<h5 class="navbar-nav mr-auto mt-2 mt-lg-0">
<img
v-if="this.loggedInUser.name.length > 0"
:src="loggedInUser.image"
id="propic"
/>
<!-- <p v-if="this.loggedInUser.name.length > 0" style="color: white">Welcome, {{ loggedInUser.name }}</p> -->
</h5>
<button
v-if="this.loggedInUser.name.length == 0"
class="btn btn-info my-2 my-lg-0 mr-3"
type="button"
@click="openSignIn"
>
Sign In
</button>
<button
v-if="this.loggedInUser.name.length == 0"
class="btn btn-success my-2 my-lg-0 mr-3"
type="button"
@click="openRegister"
>
Register
</button>
<button
v-if="this.loggedInUser.name.length > 0"
class="btn btn-primary my-2 my-lg-0 mr-3"
type="button"
@click="openUserProfile"
>
User Profile
</button>
<button
v-if="this.loggedInUser.name.length > 0"
class="btn btn-primary my-2 my-lg-0 mr-3"
type="button"
@click="openCreateRecipe"
>
Create a Recipe
</button>
<label
v-if="this.loggedInUser.name.length > 0"
class="btn btn-primary my-2 my-lg-0 mr-3"
>Change Background Color
<input
type="color"
value="#ff0000"
@change="setColor($event)"
hidden
/>
</label>
<label
v-if="this.loggedInUser.name.length > 0"
class="btn btn-primary my-2 my-lg-0 mr-3"
>Set Background Image
<input
type="file"
@change="backgroundImageUpload($event)"
class="custom-file-input"
hidden
/>
</label>
<button
v-if="this.loggedInUser.name.length > 0"
class="btn btn-danger my-2 my-lg-0"
type="button"
@click="logout"
>
Log Out
</button>
</div>
<!-- nav bar modals for login, register, categories handled by the above functions -->
<login
:users="users"
:show="showSignIn"
@close="closeSignIn"
@login="login"
></login>
<register
:show="showRegister"
@close="closeRegister"
@create-user="createUser"
></register>
<userprofile
:show="showUserProfile"
:user="this.loggedInUser"
@close="closeUserProfile"
@edit-info = "editInfo"
></userprofile>
<createrecipe
:show="showCreateRecipe"
:author="this.loggedInUser.name"
@close="closeCreateRecipe"
@add-recipe="addRecipe"
></createrecipe>
</nav>
<!-- div that controls the background color/image using the style bindings from the header buttons -->
<div v-if="this.loggedInUser.name.length" class="backgroundwrapper">
<div class="row board headings">
<div class="col-2">
<h2>Ingredients</h2>
</div>
<div class="col-10">
<span>
<h2 style="display: inline-block;">Recipes</h2>
<input
type="text"
id="recSearch"
v-model="recipeSearch"
placeholder="Search by name or author"
/>
</span>
</div>
</div>
<div class="row">
<div class="col-2">
<div class="row-fluid">
<input
type="text"
id="searchbar"
v-model="searchQuery"
placeholder="Search by name or category (e.g., dairy)"
/>
<ul id="ing-list">
<li v-for="(ingredient, index) in filteredIngredients">
<input
type="checkbox"
v-model="checkedIngredients"
:id="index"
v-bind:value="ingredient.name"
/>
<label :for="index">{{ ingredient.name }}</label>
</li>
</ul>
</div>
</div>
<div class="col-10" id="recipe-grid">
<!-- generates Recipe components and handles its methods -->
<ul class="card-list" :style="gridStyle">
<li v-for="(recipe, index) in searchRecipes" class="card-item">
<Recipe :recipe="recipe"></Recipe>
</li>
</ul>
</div>
</div>
</div>
<div v-else class="row board">
<div class="col-4 offset-1 my-auto" id="message-container">
<h1 id="landing-message">
With MegaCook, <br />
manage your recipes together, seamlessly
</h1>
</div>
<div class="col-1"></div>
<div class="col-6">
<img src="./assets/image.png" id="landing-img" />
</div>
</div>
</div>
<style>
/* helps with responsiveness of the page */
html,
div {
max-width: 100%;
}
#my-app {
min-height: 100vh;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
background-size: 100%;
}
.row {
max-width: 100%;
}
.headings {
margin-left: 1em;
}
#searchbar {
margin-left: 1.75em;
margin-bottom: 0.5em;
margin-top: 0.1em;
width: 12em;
}
#recSearch {
width: 20em;
margin-left: 1em;
display: inline-block;
}
#ing-list {
max-height: 100vh;
overflow-y: scroll;
}
#recipe-grid {
max-height: 100vh;
overflow-y: scroll;
}
[hidden] {
display: none !important;
}
.board {
padding-top: 5% !important;
}
.card-list {
display: grid;
grid-gap: 0.1em;
}
.card-item {
padding: 0.5em;
height: 33% !important;
width: 25% !important;
}
ul {
list-style-type: none;
}
#propic {
display: inline;
object-fit: cover;
overflow: hidden;
height: 2.5em;
width: 2.5em;
border-radius: 50%;
border-spacing: 2.5em;
}
#landing-img {
margin-top: 10%;
height: 80%;
width: 100%;
}
#landing-message {
font-size: 2.75rem;
line-height: 1.18181818;
}
#privacy-link {
position: absolute;
text-align: center;
width: 100%;
}
</style>
<script src="app.js"></script>
<script
src="https://code.jquery.com/jquery-3.2.1.slim.min.js"
integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN"
crossorigin="anonymous"
></script>
<script
src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"
integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q"
crossorigin="anonymous"
></script>
<script
src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"
integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl"
crossorigin="anonymous"
></script>
</body>
</html>