forked from mlcit/restaurant
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
134 lines (121 loc) · 3.65 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Restaurant</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="/restaurant/favicon.ico">
<link rel="manifest" href="/restaurant/manifest.json">
<meta name="description" content="Restaurant">
<meta name="theme-color" content="#212529" />
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO"
crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
crossorigin="anonymous"></script>
<script type="text/javascript">
if ('serviceWorker' in navigator) {
window.addEventListener('load', function () {
navigator.serviceWorker.register('/restaurant/sw.js').then(function (registration) {
// Registration was successful
console.log('ServiceWorker registration successful with scope: ', registration.scope);
}, function (err) {
// registration failed :(
console.log('ServiceWorker registration failed: ', err);
});
});
}
const sites = [
{
name: 'Al Capone',
link: 'https://www.menicka.cz/api/iframe/?id=2609',
},
{
name: 'Bastardo',
link: 'https://www.arabika.cz/dorucovani-jidla-a-zbozi/?filter3=brno&search=bistro-bastardo-stefanikova&filter2=restaurant',
},
{
name: 'Caruso',
link: 'https://www.carusorestaurant.cz/denni-obedove-menu/',
},
{
name: 'Divá Bára',
link: 'https://www.menicka.cz/api/iframe/?id=6468',
},
{
name: 'U Karla',
link: 'https://www.menicka.cz/api/iframe/?id=6695',
},
{
name: 'Padagali',
link: 'https://www.menicka.cz/api/iframe/?id=4116',
},
{
name: 'Light of India',
link: 'https://www.menicka.cz/api/iframe/?id=5448',
},
{
name: 'U Dřeváka',
link: 'https://www.menicka.cz/api/iframe/?id=2752',
},
{
name: 'Montenegro pub',
link: 'https://www.menicka.cz/api/iframe/?id=4986',
},
{
name: 'Šelepka',
link: 'https://www.menicka.cz/api/iframe/?id=2721',
},
];
$("body").ready(function () {
sites.forEach((x, i) => {
$("#menu-buttons").append('<input id="btn_' + i + '" type="button" class="btn btn-outline-light m-2 mt-4" value="' + x.name + '" onClick="setSite(\'' + i + '\')" />');
});
setSite(Math.floor(Math.random() * sites.length));
});
function setSite(i) {
document.getElementById('myIframe').src = sites[i].link;
$('input').blur();
$('input').removeClass('active');
$('#btn_' + i).addClass('active');
}
</script>
<style type="text/css">
.menu {
position: absolute;
left: 0;
right: 0;
bottom: 0;
height: 100px;
white-space: nowrap;
overflow-x: auto;
}
.iframe {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
width: 100%;
height: calc(100% - 100px);
border: 0;
}
@media (min-width: 800px) {
.iframe {
top: 100px;
}
.menu {
top: 0;
}
}
</style>
</head>
<body>
<div id="menu" class="container-fluid text-center bg-dark menu">
<div id="menu-buttons"></div>
</div>
<div class="">
<iframe id="myIframe" src="" class="iframe"></iframe>
</div>
</body>
</html>