forked from chnhaoli/DH2642_DinnerPlanner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
executable file
·397 lines (366 loc) · 13.2 KB
/
index.html
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
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Homelette</title>
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css">
<!-- For tooltips. -->
<style type="text/css">
.tool {
width: 300px;
overflow:hidden;
white-space:nowrap;
text-overflow:ellipsis;
text-align: center;
}
</style>
<!-- For loading widgets. -->
<style type="text/css">
/* Start by setting display:none to make this hidden.
Then we position it in relation to the viewport window with position:fixed.
Width, height, top and left speak for themselves.
Background we set to 80% white with our animation centered, and no-repeating */
.modal {
display: none;
position: fixed;
z-index: 1000;
top: 0;
left: 0;
height: 100%;
width: 100%;
background: rgba( 255, 255, 255, .8 )
url('images/loader.gif')
50% 50%
no-repeat;
}
/* When the body has the loading class, we turn the scrollbar off with overflow:hidden */
body.loading {
overflow: hidden;
}
/* Anytime the body has the loading class, our modal element will be visible */
body.loading .modal {
display: block;
}
</style>
<!-- For error page. -->
<style type="text/css">
.err {
display: none;
position: fixed;
z-index: 1000;
top: 0;
left: 0;
height: 100%;
width: 100%;
background: rgba( 255, 255, 255, .8 )
url('images/error.png')
50% 50%
no-repeat;
}
/* When the body has the loading class, we turn the scrollbar off with overflow:hidden */
body.erroring {
overflow: hidden;
}
/* Anytime the body has the loading class, our modal element will be visible */
body.erroring .err {
display: block;
}
</style>
</head>
<body style="background-image: url('bg.jpg'); height:100%; background-size: cover;">
<!-- Heading panel {All pages} -->
<div >
<div id="headingPanel" class="col-md-12" style="background-color: rgba(48,48,48,0.9);">
<div class="col-md-3 panel-body text-center" ><h1 style="color: white;">HOMELETTE</h1></div>
<div class="col-md-9 panel-body"><br></br><p><em style="color: white;">From the best chefs in the world directly into your kitchen</em></p></div>
</div>
</div>
<!-- * * * * * * Home view {Homepage} * * * * * * -->
<div id="homeView" class="container-fluid" >
<!-- intro panel -->
<div id="introPanel" class=" col-md-5" style="background-color:rgba(255,255,255,0.8); top:100px; left:50px;">
<div class="panel-body">
<h2>A Home Dinner Service</h2>
<div>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam ac eros massa. Cras quis faucibus urna, in malesuada massa. Interdum et malesuada fames ac ante ipsum primis in faucibus. Aliquam sed malesuada risus. Duis tempor dapibus metus, at convallis lorem consectetur eu. Aenean eu dolor in lacus dignissim auctor. Proin a lacinia eros. Nulla augue nunc, placerat ut semper et, molestie eget elit. Mauris facilisis elit at ultrices fermentum. Quisque euismod odio lectus, id fermentum est tempus a. Morbi nec lacinia odio.
</div>
<div id="quickStart">
<br></br>
<div>Start quickly<p></p></div>
<!-- Button here to go to a new dinner -->
<button id="newDinnerButton" class="btn btn-warning">Create new dinner</button>
</div>
</div>
</div>
</div>
<!-- * * * * * * Menu list view {Select menu page; dish detail page} * * * * * * -->
<!-- list of selected menu on the left -->
<div id="menuListView" class="col-md-3 panel-body" style=" max-height: 750px; background-color: rgba(247,232,218,0.7); display: none;">
<h4>My Dinner</h4>
<div class="panel-body">
<div style="font-weight: bold; text-align: center;">Number of Guest(s): </div>
<div class="input-group" style="width: 160px; margin: auto;">
<span class="input-group-btn">
<button id="minusGuestButton" type="button" class="btn btn-warning btn-number" >
<span class="glyphicon glyphicon-minus"></span>
</button>
</span>
<input id="guestNumberInput" type="text" class="form-control input-number" min="0" max="100" onkeypress='return event.charCode >= 48 && event.charCode <= 57'>
<span class="input-group-btn">
<button id="plusGuestButton" type="button" class="btn btn-warning btn-number">
<span class="glyphicon glyphicon-plus"></span>
</button>
</span>
</div>
</div>
<div id="selectedDish" class="panel-header" style=" max-height: 450px; width: 100%; overflow: auto;">
<table class="table">
<thead>
<tr>
<th class="col-md-5">Dishes Name</th>
<th class="col-md-2">Cost</th>
</tr>
</thead>
<tbody>
<!-- Where the menu list locates. -->
</tbody>
</table>
</div>
<div id="totalCost" class="panel-header">
<table class="table">
<thead>
<tr>
<th class="col-md-5"></th>
<th class="col-md-2"></th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: right;">SEK</td>
<td id="totalMenuPrice">
<!-- Where the total price locates. -->
</td>
</tr>
</tbody>
</table>
</div>
<div class="container-fluid">
<!-- Button here to confirm the dinner menu. -->
<button id="confirmDinnerButton" type="button" class="btn btn-warning btn-md col-md-12">Confirm Dinner</button>
</div>
</div>
<!-- * * * * * * Menu thumbnail view {Select menu page} * * * * * * -->
<!--Thumbnails of dishes on the right-->
<div id="menuThumbnailView" class="col-md-9 panel-body panel-group" style="background-color: rgba(222,208,196,0.8); max-height: 750px; display: none;">
<div class="col-md-12 panel-header">
<h4>Select Dishes</h4>
</div>
<div id="searchPanel">
<div class="col-md-4 panel-body">
<input id="filterKeyword" class="form-control" type="text" placeholder="Enter key words to search">
</div>
<div class="col-md-4 panel-body"><button id="searchButton" type="button" class="btn btn-default">Search</button>
</div>
</div>
<div class="col-md-4 panel-body">
<select id="searchType" class="form-control">
<option value="all">All</option>
<option value="appetizer">Appetizer</option>
<option value="beverage">Beverage</option>
<option value="bread">Bread</option>
<option value="breakfast">Breakfast</option>
<option value="dessert">Dessert</option>
<option value="drink">Drink</option>
<option value="main course">Main course</option>
<option value="salad">Salad</option>
<option value="sauce">Sauce</option>
<option value="side dish">Side dish</option>
<option value="soup">Soup</option>
</select>
</div>
<div id="menu" class="row" style="overflow: auto; max-height: 625px; width: 100%; ">
<!-- Where the search results locates. -->
</div>
</div>
<!-- * * * * * * Dish detail view {Dish detail page} * * * * * * -->
<!--detailed info of a dish on the right-->
<div id="dishDetailView" class="col-md-9 panel-group panel-body" style="background-color: rgba(222,208,196,0.8); max-height:750px; overflow: auto; display: none;">
<!--thumbnail-->
<div class="col-md-6 panel-group">
<div class="col-md-12 panel-header">
<h4 id="dishName">
<!-- Where the dish name locates. -->
</h4>
</div>
<div id="dishImage" class="col-md-12 panel-body">
<!-- Where the dish image locates. -->
</div>
<div id="dishSummary" class="col-md-12 panel-body">
<!-- Where the dish description locates. -->
</div>
<div class="col-md-12 panel-body">
<!-- Button here to go back to dish searching page. -->
<button id="goBackButton" type="button" class="btn btn-warning">Back to Select Dish</button>
</div>
</div>
<!--Ingredient facts-->
<div class="col-md-6 panel-group" style="background-color: rgba(252,159,77,0.5);">
<div class="col-md-12 panel-header">
<h4>Ingredients for
<span id="guestNumberOutput">
<!-- Where the number of guests locates. -->
</span>
people
</h4>
</div>
<div>
<table class="table">
<thead>
<tr>
<th class="col-md-4"></th>
<th class="col-md-5"></th>
<th class="col-md-1"></th>
<th class="col-md-2"></th>
</tr>
</thead>
<tbody id="dishIngredients">
<!-- Where the dish ingredients locate. -->
</tbody>
</table>
</div>
<div>
<table class="table">
<thead>
<tr>
<th class="col-md-9"></th>
<th class="col-md-1"></th>
<th class="col-md-2"></th>
</tr>
</thead>
<tbody>
<tr>
<td>
<!-- Button here to add the dish into the menu. -->
<button id="setDishButton" type="button" class="btn btn-warning"></button>
</td>
<td>SEK</td>
<td id="dishPrice">
<!-- Where the dish price locates. -->
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!-- Preparation -->
<div class="col-md-12 panel-body ">
<div class="col-md-12 panel-header"><h4>PREPARATION</h4></div>
<div id="dishPreparation" class="panel-body"></div>
</div>
</div>
<!-- * * * * * * Dinner facts banner view {Overview page; Preparation page} * * * * * * -->
<!-- banner of dinner facts and go back portal on the top -->
<div id="dinnerFactsBannerView" class="panel-body" style="background-color:rgba(255,255,255,0.8); display: none;">
<div class="col-md-9 panel-body" style="font-size: xx-large;">
<span>My Dinner: </span>
<span id = "guestNumberOutput"></span>
<span> people</span>
</div>
<div class="col-md-3 panel-body" style="text-align: right;">
<button id="editDinnerButton" class="btn btn-warning">Go back and edit dinner</button>
</div>
<div class="col-md-12">
<hr style="border: 1px solid #aaa;">
</div>
</div>
<!-- * * * * * * Menu summary view {Overview page} * * * * * * -->
<!-- the summary of dinner menu on the bottom -->
<div id="menuSummaryView" class="col-md-12 panel-group" style="background-color:rgba(255,255,255,0.8); display: none;">
<!-- Menu summary -->
<div id="menuSummary" class="col-md-12 panel-body">
<!-- Where the menu summary locates. -->
</div>
<!-- Total price -->
<div class="col-md-12 panel-body">
<div style="font-size: x-large; text-align: center;">
<span>Total: </span>
<span id="totalPrice">
<!-- Where the total price locates. -->
</span>
<span> SEK</span>
</div>
</div>
<div class="col-md-12 panel-body" style="text-align: center;">
<hr style="border: 1px solid #aaa;">
<!-- Button here to view the full preparation receipe. -->
<button id="fullRecipeButton" class="btn btn-warning" role="button" >Print Full Recipe</button>
</div>
</div>
<!-- * * * * * * Preparation view {Preparation page} * * * * * * -->
<!-- the preparations on the bottom -->
<div id="preparationView" class="col-md-12 panel-group" style="background-color:rgba(255,255,255,0.8); display: none;">
<div id="preparation">
<!-- Where the preparation panel locates. -->
</div>
</div>
<!-- Loading widget. -->
<div class="modal"><!-- Place at bottom of page --></div>
<!-- Error page. -->
<div class="err">
</div>
<!-- jQuery -->
<script src="https://code.jquery.com/jquery.js"></script>
<!-- Bootstrap JavaScript, needed if you want for instance tabs, models, popovers etc. -->
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.1.0/js/bootstrap.min.js"></script>
<!-- For loading widget. -->
<script type="text/javascript">
$body = $("body");
$(document).on({
ajaxStart: function() { $body.addClass("loading");},
ajaxStop: function() { $body.removeClass("loading");},
ajaxError: function() { $body.addClass("erroring");}
});
$body.on('click', function(){ $body.removeClass("erroring"); })
</script>
<!-- For tooltips. -->
<script type="text/javascript">
$(document).on('mouseenter', ".tool", function () {
var $this = $(this);
if (this.offsetWidth < this.scrollWidth && !$this.attr('title')) {
$this.tooltip({
title: $this.text(),
placement: "bottom"
});
$this.tooltip('show');
}
});
</script>
<!-- The application JavaScript code -->
<script src="js/app.js"></script>
<!-- Model -->
<script src="js/model/dinnerModel.js"></script>
<!-- Views -->
<script src="js/view/homeView.js"></script>
<script src="js/view/menuListView.js"></script>
<script src="js/view/menuThumbnailView.js"></script>
<script src="js/view/dishDetailView.js"></script>
<script src="js/view/dinnerFactsBannerView.js"></script>
<script src="js/view/menuSummaryView.js"></script>
<script src="js/view/preparationView.js"></script>
<!-- Controllers -->
<script src="js/view/homeController.js"></script>
<script src="js/view/menuListController.js"></script>
<script src="js/view/menuThumbnailController.js"></script>
<script src="js/view/dishDetailController.js"></script>
<script src="js/view/dinnerFactsBannerController.js"></script>
<script src="js/view/menuSummaryController.js"></script>
<script src="js/view/preparationController.js"></script>
<!-- Browser-sync scripts -->
<script id="__bs_script__">//<![CDATA[
document.write("<script async src='http://HOST:3000/browser-sync/browser-sync-client.js?v=2.17.0'><\/script>".replace("HOST", location.hostname));
//]]></script>
</body>
</html>