-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
381 lines (351 loc) · 14.7 KB
/
index.html
File metadata and controls
381 lines (351 loc) · 14.7 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
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
<html>
<head>
<script async defer src="https://buttons.github.io/buttons.js"></script>
<style>
/* Set the size of the div element that contains the map */
#map {
height: 400px; /* The height is 400 pixels */
width: 100%; /* The width is the width of the web page */
}
</style>
<style>
/* Alignment of items on page */
#container {
width: 100%;
margin: auto;}
#first {
width: 50%;
float: left;
height: 300px;}
#second {
width: 5%;
float: left;
height: 300px;}
#third {
width: 45%;
float: right;
height: 300px;}
#clear {
clear: both;}
#vh {
display: table-cell;
height: 100vh;
text-align: center;
width: 100vh;
vertical-align: top;}
#column {
display: table-cell;
height: 100vh;
text-align: right;
width: 100vh;
vertical-align: top;}
#left {
width: 43%;
float: left;
height: 300px;}
#middle {
width: 10%;
float: left;
height: 300px;}
#right {
width: 47%;
float: right;
height: 300px;}
/* DROPDOWN BUTTON */
.dropbtn {
background-color: #BFECEC;
padding: 8px;
border: none;}
/* Position the dropdown content */
.dropdown {
position: relative;
display: inline-block;}
/* Dropdown Content (Hidden by Default) */
.dropdown-content {
display: none;
position: absolute;
background-color: #DFFAFA;
min-width: 104px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;}
/* Links inside the dropdown */
.dropdown-content a {
text-align: right;
color: black;
padding: 9px 2px;
text-decoration: none;
display: block;}
/* Change color of dropdown links on hover */
.dropdown-content a:hover {background-color: #CBF6F6;}
/* Show the dropdown menu on hover */
.dropdown:hover .dropdown-content {display: block;}
/* Change the background color of the dropdown button when the dropdown content is shown */
.dropdown:hover .dropbtn {background-color: #8DE4E4;}
/* Toggle switch for setting check box values for all restaurants */
.switch { /* The switch - the box around the slider */
float: right;
position: relative;
display: inline-block;
width: 25px;
height: 12px;}
.switch input { /* Hide default HTML checkbox */
opacity: 0;
width: 0;
height: 0;}
.slider { /* The slider */
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ccc;
-webkit-transition: .4s;
transition: .4s;}
/* Slider appearance when toggled */
.slider:before {
position: absolute;
content: "";
height: 9px;
width: 9px;
left: 2px;
bottom: 1.5px;
background-color: white;
-webkit-transition: .4s;
transition: .4s;}
input:checked + .slider {
background-color: #2196F3;}
input:focus + .slider {
box-shadow: 0 0 1px #2196F3;}
input:checked + .slider:before {
-webkit-transform: translateX(12px);
-ms-transform: translateX(12px);
transform: translateX(12px);}
</style>
</head>
<body>
<body bgcolor="#FACCA3">
<div id="container">
<div id="first">
<div id="vh">
<br>
<b>
Select the restaurants you want to include in the shuffle (click Options to filter restaurants by category) and then hit "Click Me!" to randomly pick a place to eat!
</b>
<br>
<b><p id="demo" style="font-size:280%"></p></b> <!-- Result display -->
<!-- Thayer Shuffle button -->
<button style="color:white;font-size:20px;font-weight:normal;background-color:#800000;padding: 12px 20px;border: 1px solid #800000" onclick="thayerShuffle()">Click Me!</button>
<br>
<br>
<!-- Github star button -->
<a class="github-button" href="https://github.com/thayershuffle/thayershuffle.github.io" data-icon="octicon-star" aria-label="Star ntkme/github-buttons on GitHub">About</a>
<!-- Dropdown menu button -->
<div class="dropdown">
<button onclick="drop()" class="dropbtn">Options</button>
<div id="myDropdown" class="dropdown-content">
<a>Select all<input type="checkbox" checked=true id="toggle switch" onchange="setSelect(this.checked)"></a>
<!-- Toggle switch for price ranges -->
<a>Inexpensive<input type="checkbox" id="$" onchange="restaurantOption()"></a>
<!-- Food options -->
<a>Vegetarian<input type="checkbox" id="vegetarian" onchange="restaurantOption()"></a>
<a>Vegan<input type="checkbox" id="vegan" onchange="restaurantOption()"></a>
<a>Gluten free<input type="checkbox" id="gluten_free" onchange="restaurantOption()"></a>
<a>Halal<input type="checkbox" id="halal" onchange="restaurantOption()"></a>
</div>
</div>
<br>
<br>
<br>
<div id = "left">
<div id="column">
<br>
Mike's Calzones & Deli: <input type="checkbox" id="Mike's Calzones & Deli" checked="true">
<br>
<br>
Bagel Gourmet Ole: <input type="checkbox" id="Bagel Gourmet Ole" checked="true">
<br>
<br>
Shaking Crab: <input type="checkbox" id="Shaking Crab" checked="true">
<br>
<br>
East Side Pockets: <input type="checkbox" id="East Side Pockets" checked="true">
<br>
<br>
Tropical Smoothie Cafe: <input type="checkbox" id="Tropical Smoothie Cafe" checked="true">
<br>
<br>
Soban Korean Eatery: <input type="checkbox" id="Soban Korean Eatery" checked="true">
<br>
<br>
Meeting Street Cafe: <input type="checkbox" id="Meeting Street Cafe" checked="true">
<br>
<br>
Andreas: <input type="checkbox" id="Andreas" checked="true">
<br>
<br>
Antonio's Pizza: <input type="checkbox" id="Antonio's Pizza" checked="true">
<br>
<br>
Heng Thai & Rotisserie: <input type="checkbox" id="Heng Thai & Rotisserie" checked="true">
<br>
</div></div>
<div id="middle"></div>
<div id="right">
<div id="column">
<br>
Flatbread Company: <input type="checkbox" id="Flatbread Company" checked="true">
<br>
SUSHI X-PRESS: <input type="checkbox" id="SUSHI X-PRESS" checked="true">
<br>
Chinatown: <input type="checkbox" id="Chinatown" checked="true">
<br>
Durk BarBQ: <input type="checkbox" id="Durk BarBQ" checked="true">
<br>
Bajas Tex Mex Grill: <input type="checkbox" id="Baja's Tex Mex Grill" checked="true">
<br>
B.GOOD: <input type="checkbox" id="B.GOOD" checked="true">
<br>
Caliente Mexican Grill: <input type="checkbox" id="Caliente Mexican Grill" checked="true">
<br>
Kabob and Curry: <input type="checkbox" id="Kabob and Curry" checked="true">
<br>
Shake Shack: <input type="checkbox" id="Shake Shack" checked="true">
<br>
Chipotle Mexican Grill: <input type="checkbox" id="Chipotle Mexican Grill" checked="true">
<br>
Den Den Korean Fried Chicken: <input type="checkbox" id="Den Den Korean Fried Chicken" checked="true">
<br>
Wow Barbecue: <input type="checkbox" id="Wow Barbecue" checked="true">
<br>
Baja's Taqueria: <input type="checkbox" id="Baja's Taqueria" checked="true">
<br>
by CHLOE: <input type="checkbox" id="by CHLOE" checked="true">
<br>
La Creperie: <input type="checkbox" id="La Creperie" checked="true">
<br>
Ganko Ittetsu Ramen: <input type="checkbox" id="Ganko Ittetsu Ramen" checked="true">
<br>
Pokeworks: <input type="checkbox" id="Pokeworks" checked="true">
<br>
Wongs Kitchen: <input type="checkbox" id="Wongs Kitchen" checked="true">
<br>
Subway: <input type="checkbox" id="Subway" checked="true">
<br>
</div></div>
</div>
</div>
<div id="second"></div>
<div id="third">
<!-- <img src="thayer.png"> -->
<div id="map"></div>
</div>
<div id="clear"></div>
</div>
<script>
// Randomly pick an item from the list of restaurants
function thayerShuffle() {
var myArray = ["Bagel Gourmet Ole", "Tropical Smoothie Cafe", "La Creperie", "East Side Pockets", "Antonio\'s Pizza", "Baja\'s Tex Mex Grill", "Soban Korean Eatery", "Durk BarBQ","by CHLOE","Kabob and Curry","Chinatown","Pokeworks","Baja\'s Taqueria","Den Den Korean Fried Chicken","B.GOOD","Ganko Ittetsu Ramen","Shaking Crab","Flatbread Company","Wow Barbecue","SUSHI X-PRESS","Chipotle Mexican Grill", "Wongs Kitchen","Caliente Mexican Grill","Heng Thai & Rotisserie","Shake Shack","Meeting Street Cafe","Andreas","Subway","Mike\'s Calzones & Deli"];
var rand = myArray[Math.floor(Math.random() * myArray.length)];
var newArray = [];
var i;
for (i = 0; i < myArray.length; i++){
if (document.getElementById(myArray[i]).checked){
console.log("hey");
newArray.push(myArray[i]);
}
}
var rand2 = newArray[Math.floor(Math.random() * newArray.length)];
document.getElementById("demo").innerHTML = rand2;
document.getElementById("demo").style.color ="black";
if (rand2 == undefined){//show reminder message if no item is selected for the shuffle
document.getElementById("demo").innerHTML = "Pick a restaurant ;)";
document.getElementById("demo").style.color ="red";
}
}
// Set checkbox value for all restaurants
function setSelect(val) {
var myArray = ["Bagel Gourmet Ole", "Tropical Smoothie Cafe", "La Creperie", "East Side Pockets", "Antonio\'s Pizza", "Baja\'s Tex Mex Grill", "Soban Korean Eatery", "Durk BarBQ","by CHLOE","Kabob and Curry","Chinatown","Pokeworks","Baja\'s Taqueria","Den Den Korean Fried Chicken","B.GOOD","Ganko Ittetsu Ramen","Shaking Crab","Flatbread Company","Wow Barbecue","SUSHI X-PRESS","Chipotle Mexican Grill", "Wongs Kitchen","Caliente Mexican Grill","Heng Thai & Rotisserie","Shake Shack","Meeting Street Cafe","Andreas","Subway","Mike\'s Calzones & Deli"];
var i;
for (i = 0; i < myArray.length; i++){
document.getElementById(myArray[i]).checked = val;
}
}
// Return list of restaurants for the corresponding food restriction if selected,
// or the selected price range, otherwise return list of all restaurants
function helper(id){
//list of all restaurants
var myArray = ["Bagel Gourmet Ole", "Tropical Smoothie Cafe", "La Creperie", "East Side Pockets", "Antonio\'s Pizza", "Baja\'s Tex Mex Grill", "Soban Korean Eatery", "Durk BarBQ","by CHLOE","Kabob and Curry","Chinatown","Pokeworks","Baja\'s Taqueria","Den Den Korean Fried Chicken","B.GOOD","Ganko Ittetsu Ramen","Shaking Crab","Flatbread Company","Wow Barbecue","SUSHI X-PRESS","Chipotle Mexican Grill", "Wongs Kitchen","Caliente Mexican Grill","Heng Thai & Rotisserie","Shake Shack","Meeting Street Cafe","Andreas","Subway","Mike\'s Calzones & Deli"];
//lists of restaurants for each food restriction and price range
var dict = {
"$": ["Caliente Mexican Grill","Subway","B.GOOD","Mike\'s Calzones & Deli","Chipotle Mexican Grill","Chipotle Mexican Grill","East Side Pockets","Baja\'s Tex Mex Grill","Bagel Gourmet Ole","Wongs Kitchen","Baja\'s Taqueria","Antonio\'s Pizza","SUSHI X-PRESS","La Creperie","Tropical Smoothie Cafe"],
"vegetarian": ["Shake Shack","Caliente Mexican Grill","Subway","by CHLOE","Pokeworks","Andreas","Heng Thai & Rotisserie","Wow Barbecue","Ganko Ittetsu Ramen","Kabob and Curry","Den Den Korean Fried Chicken","Flatbread Company","Meeting Street Cafe","Soban Korean Eatery","B.GOOD","Mike\'s Calzones & Deli","Chipotle Mexican Grill","East Side Pockets","Chinatown","Baja\'s Tex Mex Grill","Bagel Gourmet Ole","Wongs Kitchen","Baja\'s Taqueria","Antonio\'s Pizza","SUSHI X-PRESS","La Creperie","Tropical Smoothie Cafe","Durk BarBQ"],
"vegan": ["Pokeworks","Heng Thai & Rotisserie","Wow Barbecue","Kabob and Curry","Den Den Korean Fried Chicken","Flatbread Company","Soban Korean Eatery","by CHLOE","B.GOOD","Chipotle Mexican Grill","East Side Pockets","Chinatown","Baja\'s Tex Mex Grill","Wongs Kitchen","SUSHI X-PRESS","Tropical Smoothie Cafe"],
"gluten_free": ["Mike\'s Calzones & Deli","Shake Shack","by CHLOE","Pokeworks","Andreas","Heng Thai & Rotisserie","Wow Barbecue","Kabob and Curry","Den Den Korean Fried Chicken","Shaking Crab","Meeting Street Cafe","Soban Korean Eatery","Chinatown","B.GOOD","Chipotle Mexican Grill","Baja\'s Tex Mex Grill","Bagel Gourmet Ole","Wongs Kitchen","SUSHI X-PRESS","Tropical Smoothie Cafe","Durk BarBQ"],
"halal": ["Mike\'s Calzones & Deli","Kabob and Curry"]
};
if (document.getElementById(id).checked) {
return dict[id];
} else {
return myArray;
}
}
// Display (set as checked) restaurant(s) that satisfy the selected food restriction(s) and price range
function restaurantOption() {
//list of all restaurants
var myArray = ["Bagel Gourmet Ole", "Tropical Smoothie Cafe", "La Creperie", "East Side Pockets", "Antonio\'s Pizza", "Baja\'s Tex Mex Grill", "Soban Korean Eatery", "Durk BarBQ","by CHLOE","Kabob and Curry","Chinatown","Pokeworks","Baja\'s Taqueria","Den Den Korean Fried Chicken","B.GOOD","Ganko Ittetsu Ramen","Shaking Crab","Flatbread Company","Wow Barbecue","SUSHI X-PRESS","Chipotle Mexican Grill", "Wongs Kitchen","Caliente Mexican Grill","Heng Thai & Rotisserie","Shake Shack","Meeting Street Cafe","Andreas","Subway","Mike\'s Calzones & Deli"];
// list of restaurant(s) corresponding to the selected food restriction(s) and price range
var l1 = helper("vegetarian");
var l2 = helper("vegan");
var l3 = helper("gluten_free");
var l4 = helper("halal");
var l5 = helper("$");
var i;
for (i = 0; i < myArray.length; i++){
if ((l1.indexOf(myArray[i]) >= 0) && (l2.indexOf(myArray[i]) >= 0) && (l3.indexOf(myArray[i]) >= 0) && (l4.indexOf(myArray[i]) >= 0) && (l5.indexOf(myArray[i]) >= 0)){
document.getElementById(myArray[i]).checked = true;
} else{
document.getElementById(myArray[i]).checked = false;
}
}
}
// When the user clicks on the button, toggle between hiding and showing the dropdown content
function drop() {
document.getElementById("myDropdown").classList.toggle("show");
}
// Close the dropdown menu if the user clicks outside of it
window.onclick = function(event) {
if (!event.target.matches('.dropbtn')) {
var dropdowns = document.getElementsByClassName("dropdown-content");
var i;
for (i = 0; i < dropdowns.length; i++) {
var openDropdown = dropdowns[i];
if (openDropdown.classList.contains('show')) {
openDropdown.classList.remove('show');
}
}
}
}
</script>
<script>
// Initialize and add the map
function initMap() {
// The location of thayerstreet
var thayerstreet = {lat: 41.828633, lng: -71.400694};
// The map, centered at thayerstreet
var map = new google.maps.Map(
document.getElementById('map'), {zoom: 17, center: thayerstreet});
// The marker, positioned at thayerstreet
var marker = new google.maps.Marker({position: thayerstreet, map: map});
}
</script>
<!--Load the API from the specified URL
* The async attribute allows the browser to render the page while the API loads
* The key parameter will contain your own API key (which is not needed for this tutorial)
* The callback parameter executes the initMap() function
-->
<script async defer
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCdB7tMRVNIpoVq_7Idgve47S0du8Bt8ZU&callback=initMap">
</script>
</body>
</html>