-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
379 lines (368 loc) · 15.6 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
<!DOCTYPE html>
<html lang="pt">
<head>
<title>Pedido Anotado</title>
<meta charset="utf-8">
<meta name="description" content="Pedido Anotado é um site que levará informações sobre estabelecimentos que oferecem entregas de produtos aos seu clientes, assim o cliente visitando o nosso site poderá fazer um pedido e aguardar o seu produto em sua casa." />
<meta name="keywords" content="pedido, anotado, menu, alimentos, pizza, hamburger, comidas" />
<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<link href="http://fonts.googleapis.com/css?family=PT+Sans+Narrow:regular,bold" rel="stylesheet"
type="text/css" />
</head>
<body>
<div id="ac_background" class="ac_background">
<img class="ac_bgimage" src="images/Default.jpg" alt="Background" />
<div class="ac_overlay">
</div>
<div class="ac_loading">
</div>
</div>
<div id="ac_content" class="ac_content">
<a href="index.html">
<h1>
<span>Pedido</span>Anotado</h1>
</a>
<div class="ac_menu">
<ul>
<li><a href="images/Appetizers.jpg">Parceiros</a>
<div class="ac_subitem">
<span class="ac_close"></span>
<h2>
Paceiros</h2>
<ul>
<li>Conheça os estabelecimentos cadastrados em nosso site</li>
<li>Minas Cervejaria</li>
<li>Celeiro de Minas</li>
<li>Boquinha Lanches</li>
<li>Pizzaiollo Barreiro</li>
<li><a style="opacity:1; font-weight:normal; font-size:16px; text-align:left; margin-top:20px; line-height:0px; padding:0px;" href="restaurantex.html">Bar do tonim</a></li>
<a href="images/Appetizers.jpg">Parceiros</a>
</ul>
</div>
</li>
<li><a href="images/MainCourse.jpg">Login</a>
<div class="ac_subitem">
<span class="ac_close"></span>
<h2>
Login</h2>
<form id="form_login">
<ul>
<li>Entre e aproveite</li>
<li>Email:
<input type="text" name="txtemailusu" maxlength="50" /></li>
<li>Senha:
<input type="password" name="txtsenhausu" maxlength="20" /></li>
<li><input type="submit" name="entrar" value="entrar" /></li>
</ul>
</form>
</div>
<li><a href="images/MainCourse.jpg">Cadastre-se</a>
<div class="ac_subitem">
<span class="ac_close"></span>
<h2>
Cadastro</h2>
<form name="cadastro">
<ul>
<li>Seja um membro do Pedido Anotado e aproveite!</li>
<li>Nome:<input style="margin-left:60px" type="text" name="txtnomeusu" maxlength="30" /></li>
<li>Email:<input style="margin-left:60px" type="text" name="txtemailusu" maxlength="50"/></li>
<li>Senha:<input style="margin-left:56px" type="text" name="txtsenhausu" maxlength="20"/></li>
<li>Telefone:<input type="text" style="margin-left:35px" name="txttelusu" maxlength="10"/></li>
<li>Endereço:<input type="text" style="margin-left:33px" name="txtend" maxlength="30"/></li>
<li>Número:<input type="text" style="margin-left:44px" name="txtnumeroend" maxlength="5"/></li>
<li>Bairro:<input type="text" style="margin-left:50px" name="txtbairroend" maxlength="10"/></li>
<li>CEP:<input type="text" style="margin-left:70px" name="txtceprroend" maxlength="11"/></li>
<li>Complemento:<input type="text" style="margin-left:3px" name="txtcompend" maxlength="10"/></li>
<div align="center"><input type="submit" name="cadastrar" value="cadastrar" /></div>
</ul>
</form>
</div>
</li>
<li><a href="images/Specials.jpg">Avalie</a>
<div class="ac_subitem">
<span class="ac_close"></span>
<h2>
Avaliação</h2>
<ul>
<li>Elogie ou critique os pratos</li>
<li><select style="width:180px" name="restaurantes">
<option value="1" selected="selected">Celeiro de Minas</option>
<option value="2">Bar do Tonim</option>
<option value="3">Bar do Zezé</option>
<option value="4">Bar do Ferreira</option>
<option value="2">Bar do Tonim</option>
<option value="3">Bar do Zezé</option>
<option value="4">Bar do Ferreira</option>
<option value="2">Bar do Tonim</option>
<option value="3">Bar do Zezé</option>
<option value="4">Bar do Ferreira</option>
</select>
</li>
<li><select style="width:180px" name="pratos">
<option value="1" selected="selected">Bolinho de Chuva</option>
<option value="2">Fritas</option>
<option value="3">Trupico Mineiro</option>
<option value="4">Alitas Recheadas</option>
</select></li>
</select>
<li><select style="width:180px" name="pratos">
<option value="1" selected="selected">Ótimo</option>
<option value="2">Bom</option>
<option value="3">Mais ou menos</option>
<option value="4">Não gostou</option>
</select></li>
<li><input type="submit" name="enviar" value="enviar" /></li>
</ul>
</div>
</li>
<li><a href="images/Specials.jpg">Promoções</a>
<div class="ac_subitem">
<span class="ac_close"></span>
<h2>
Promoções</h2>
<ul>
<li><a style="opacity:1; font-weight:normal; font-size:16px; text-align:left; margin-top:20px; line-height:0px; padding:0px;" href="promocoes.html">Promoções</a></li>
</ul>
</div>
</li>
<li><a href="images/Desserts.jpg">Estatísticas</a>
<div class="ac_subitem">
<span class="ac_close"></span>
<h2>
Estatísticas</h2>
<ul>
<li>Veja como estão sendo avaliados os restaurantes e seus pratos</li>
<li><a style="opacity:1; font-weight:normal; font-size:16px; text-align:left; margin-top:20px; line-height:0px; padding:0px;" href="estatisticas.html">Confira</a></li>
</ul>
</div>
</li>
</ul>
</div>
</div>
<!-- The JavaScript -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.easing.1.3.js"></script>
<script type="text/javascript">
$(function () {
var $ac_background = $('#ac_background'),
$ac_bgimage = $ac_background.find('.ac_bgimage'),
$ac_loading = $ac_background.find('.ac_loading'),
$ac_content = $('#ac_content'),
$title = $ac_content.find('h1'),
$menu = $ac_content.find('.ac_menu'),
$mainNav = $menu.find('ul:first'),
$menuItems = $mainNav.children('li'),
totalItems = $menuItems.length,
$ItemImages = new Array();
/*
for this menu, we will preload all the images.
let's add all the image sources to an array,
including the bg image
*/
$menuItems.each(function (i) {
$ItemImages.push($(this).children('a:first').attr('href'));
});
$ItemImages.push($ac_bgimage.attr('src'));
var Menu = (function () {
var init = function () {
loadPage();
initWindowEvent();
},
loadPage = function () {
/*
1- loads the bg image and all the item images;
2- shows the bg image;
3- shows / slides out the menu;
4- shows the menu items;
5- initializes the menu items events
*/
$ac_loading.show(); //show loading status image
$.when(loadImages()).done(function () {
$.when(showBGImage()).done(function () {
//hide the loading status image
$ac_loading.hide();
$.when(slideOutMenu()).done(function () {
$.when(toggleMenuItems('up')).done(function () {
initEventsSubMenu();
});
});
});
});
},
showBGImage = function () {
return $.Deferred(
function (dfd) {
//adjusts the dimensions of the image to fit the screen
adjustImageSize($ac_bgimage);
$ac_bgimage.fadeIn(1000, dfd.resolve);
}
).promise();
},
slideOutMenu = function () {
/* calculate new width for the menu */
var new_w = $(window).width() - $title.outerWidth(true);
return $.Deferred(
function (dfd) {
//slides out the menu
$menu.stop()
.animate({
width: new_w + 'px'
}, 700, dfd.resolve);
}
).promise();
},
/* shows / hides the menu items */
toggleMenuItems = function (dir) {
return $.Deferred(
function (dfd) {
/*
slides in / out the items.
different animation time for each one.
*/
$menuItems.each(function (i) {
var $el_title = $(this).children('a:first'),
marginTop, opacity, easing;
if (dir === 'up') {
marginTop = '0px';
opacity = 1;
easing = 'easeOutBack';
}
else if (dir === 'down') {
marginTop = '60px';
opacity = 0;
easing = 'easeInBack';
}
$el_title.stop()
.animate({
marginTop: marginTop,
opacity: opacity
}, 200 + i * 200, easing, function () {
if (i === totalItems - 1)
dfd.resolve();
});
});
}
).promise();
},
initEventsSubMenu = function () {
$menuItems.each(function (i) {
var $item = $(this), // the <li>
$el_title = $item.children('a:first'),
el_image = $el_title.attr('href'),
$sub_menu = $item.find('.ac_subitem'),
$ac_close = $sub_menu.find('.ac_close');
/* user clicks one item : appetizers | main course | desserts | wines | specials */
$el_title.bind('click.Menu', function (e) {
$.when(toggleMenuItems('down')).done(function () {
openSubMenu($item, $sub_menu, el_image);
});
return false;
});
/* closes the submenu */
$ac_close.bind('click.Menu', function (e) {
closeSubMenu($sub_menu);
return false;
});
});
},
openSubMenu = function ($item, $sub_menu, el_image) {
$sub_menu.stop()
.animate({
height: '500px',
marginTop: '-200px'
}, 400, function () {
//the bg image changes
showItemImage(el_image);
});
},
/* changes the background image */
showItemImage = function (source) {
//if its the current one return
if ($ac_bgimage.attr('src') === source)
return false;
var $itemImage = $('<img src="' + source + '" alt="Background" class="ac_bgimage"/>');
$itemImage.insertBefore($ac_bgimage);
adjustImageSize($itemImage);
$ac_bgimage.fadeOut(1500, function () {
$(this).remove();
$ac_bgimage = $itemImage;
});
$itemImage.fadeIn(1500);
},
closeSubMenu = function ($sub_menu) {
$sub_menu.stop()
.animate({
height: '0px',
marginTop: '0px'
}, 400, function () {
//show items
toggleMenuItems('up');
});
},
/*
on window resize, ajust the bg image dimentions,
and recalculate the menus width
*/
initWindowEvent = function () {
/* on window resize set the width for the menu */
$(window).bind('resize.Menu', function (e) {
adjustImageSize($ac_bgimage);
/* calculate new width for the menu */
var new_w = $(window).width() - $title.outerWidth(true);
$menu.css('width', new_w + 'px');
});
},
/* makes an image "fullscreen" and centered */
adjustImageSize = function ($img) {
var w_w = $(window).width(),
w_h = $(window).height(),
r_w = w_h / w_w,
i_w = $img.width(),
i_h = $img.height(),
r_i = i_h / i_w,
new_w, new_h,
new_left, new_top;
if (r_w > r_i) {
new_h = w_h;
new_w = w_h / r_i;
}
else {
new_h = w_w * r_i;
new_w = w_w;
}
$img.css({
width: new_w + 'px',
height: new_h + 'px',
left: (w_w - new_w) / 2 + 'px',
top: (w_h - new_h) / 2 + 'px'
});
},
/* preloads a set of images */
loadImages = function () {
return $.Deferred(
function (dfd) {
var total_images = $ItemImages.length,
loaded = 0;
for (var i = 0; i < total_images; ++i) {
$('<img/>').load(function () {
++loaded;
if (loaded === total_images)
dfd.resolve();
}).attr('src', $ItemImages[i]);
}
}
).promise();
};
return {
init: init
};
})();
/*
call the init method of Menu
*/
Menu.init();
});
</script>
</body>
</html>