forked from udacity/mws-restaurant-stage-2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
232 lines (221 loc) · 6.13 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
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="manifest" href="/manifest.webmanifest">
<link rel="icon" href="favicon.ico" type="image/x-icon" />
<meta name="theme-color" content="#252831"/>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8">
<link rel="preload" href="css/main6.css" as="style">
<link rel="preload" href="css/css2.css" media="screen and (min-width: 600px)" as="style">
<link rel="preload" href="css/main3.css" media="screen and (min-width: 530px)" as="style">
<link rel="preload" href="css/main4.css" media="screen and (min-width: 550px)" as="style">
<link rel="preload" href="css/main5.css" media="screen and (min-width: 710px) and (max-width: 999px)" as="style">
<style>
html {
font-size: 16px;
}
body {
font-family: Arial, Helvetica, sans-serif;
color: #333;
line-height: 1.5;
background-color: #fdfdfd;
margin: 0;
position: relative;
}
a {
color: #9E3314;
text-decoration: none;
}
a:hover,
a:focus {
color: #3397db;
text-decoration: none;
}
h1 {
font-family: Arial, Helvetica, sans-serif;
margin: 0 0.2em;
}
footer,
header,
nav,
section {
display: block;
}
#maincontent {
background-color: #f3f3f3;
min-height: 100%;
}
footer#footer {
background-color: #444;
color: #D9D9D9;
font-size: 0.6rem;
letter-spacing: 1px;
padding: 15px;
text-align: center;
text-transform: uppercase;
max-width: 100%;
}
footer#footer a {
color: whitesmoke;
}
#toggle-map {
background-color: #9E3314;
color: #fff;
display: block;
font-size: 1.5rem;
padding: 10px 30px 10px;
margin: 3px;
text-align: center;
text-decoration: none;
text-transform: uppercase;
border-radius: 5px;
border: unset;
float: right;
}
nav {
width: 100%;
height: 80px;
display: flex;
justify-content: center;
background-color: #252831;
text-align: center;
}
nav h1 {
margin: auto;
}
nav h1 a {
color: #fff;
font-size: 1.2rem;
font-weight: 200;
letter-spacing: 10px;
text-transform: uppercase;
}
#map {
height: 400px;
width: 100vw;
background-color: #ccc;
}
#map-container {
display: none;
}
#main-section {
display: flex;
flex-direction: column;
}
#toggle-container {
max-width: 100%;
padding-right: 15px;
}
/* ====================== Filters ====================== */
.filter-options {
width: 100%;
background-color: #165C92;
align-items: center;
display: flex;
/*allow content to flow*/
flex-wrap: wrap;
/*let elements wrap*/
}
.filter-options div {
width: 100%;
padding: 10px;
}
.filter-options h2 {
color: white;
font-size: 1.2rem;
white-space: nowrap;
/*show text in one line*/
font-weight: normal;
line-height: 1;
margin: 0;
width: 100%;
}
.filter-options select {
background-color: white;
border: 1px solid #fff;
font-family: Arial, sans-serif;
font-size: 1rem;
height: 35px;
letter-spacing: 0;
padding: 0 10px;
min-width: 100%;
max-width: 100%;
border-radius: 5px;
}
/* ====================== Skip Link ====================== */
.skip-link {
position: absolute;
top: -40px;
left: 0;
color: white;
padding: 8px;
z-index: 100;
}
.skip-link:focus {
top: 0px;
}
</style>
<link rel="stylesheet" src="//normalize-css.googlecode.com/svn/trunk/normalize.css" />
<link rel="stylesheet" href="css/main6.css">
<link rel="stylesheet" href="css/css1.css" media="screen and (min-width: 600px)">
<link rel="stylesheet" href="css/main3.css" media="screen and (min-width: 530px)">
<link rel="stylesheet" href="css/main4.css" media="screen and (min-width: 550px)">
<link rel="stylesheet" href="css/main5.css" media="screen and (min-width: 710px) and (max-width: 999px)">
<link rel="stylesheet" href="css/main1.css" media="screen and (min-width: 1000px)">
<link rel="stylesheet" href="css/main2.css" media="screen and (min-width: 1800px)">
<title>Restaurant Reviews</title>
</head>
<body>
<header>
<a href="#maincontent" class="skip-link">Skip to main content</a>
<nav>
<h1>
<a href="/">Restaurant Reviews</a>
</h1>
</nav>
</header>
<main id="maincontent" tabindex="-1">
<section id="map-container">
<div id="map" role="application" aria-label="Google map with restaurant locations"></div>
</section>
<section id="main-section">
<div class="filter-options">
<div>
<h2>Filter Results</h2>
</div>
<div>
<select id="neighborhoods-select" aria-label="Neighborhoods" name="neighborhoods" onchange="self.updateRestaurants()">
<option value="all">All Neighborhoods</option>
</select>
</div>
<div>
<select id="cuisines-select" aria-label="Cusines" name="cuisines" onchange="self.updateRestaurants()">
<option value="all">All Cuisines</option>
</select>
</div>
</div>
<div id="toggle-container">
<button id="toggle-map" onclick="toggleMap()">Show on Map</button>
</div>
<ul id="restaurants-list"></ul>
</section>
</main>
<footer id="footer">
<a href="/">
<strong>Restaurant Reviews</strong>
</a> All Rights Reserved.
</footer>
<script async defer type="module" charset="utf-8" src="js/main.js"></script>
<script>
function toggleMap() {
window.addGMapsToDom();
const opened = !!self.opened;
const newStyle = (opened === true) ? 'display:none;' : 'display:inline-block;';
document.getElementById('map-container').style = newStyle;
document.getElementById('toggle-map').innerText = (opened === true) ? 'Show on Map' : 'Close Map';
self.opened = !opened;
}
</script>
</body>
</html>