-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHome.html
More file actions
252 lines (227 loc) · 12.2 KB
/
Copy pathHome.html
File metadata and controls
252 lines (227 loc) · 12.2 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
<!DOCTYPE html>
<html>
<head>
<link rel="shortcut icon" href="placeLogo.ico" />
<script src="https://kit.fontawesome.com/15d341663e.js" crossorigin="anonymous"></script>
<head>
<style>
</style>
<body class = "backImage">
<link href="css/styleHome.css" type="text/css" rel="stylesheet">
<title class = "title lowercase">Pollen</title>
</head>
<body id = "bod">
<div class="wrapperHeader">
<div>
<img id="logoimage" src="Images/pollenlogo.png" alt="logo" />
</div>
</div>
<div class="header">
<p class = "headLink" > Rate Sort Help </pre></p>
<input type="text" id="myInput" onkeyup="myFunction()" placeholder="Search a business..." title="Type in a name" >
</div>
<!-- The core Firebase JS SDK is always required and must be listed first -->
<script src="https://www.gstatic.com/firebasejs/8.2.9/firebase-app.js"></script>
<!-- TODO: Add SDKs for Firebase products that you want to use
https://firebase.google.com/docs/web/setup#available-libraries -->
<script src="https://www.gstatic.com/firebasejs/8.2.9/firebase-analytics.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.2.9/firebase-database.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.2.9/firebase-storage.js"></script>
<script>
// Your web app's Firebase configuration
// For Firebase JS SDK v7.20.0 and later, measurementId is optional
var firebaseConfig = {
apiKey: "AIzaSyAdOQ-Rk1Gm5hlVL2Yjz5tR72KdnfITSBQ",
authDomain: "hacksc-pollen-82499.firebaseapp.com",
projectId: "hacksc-pollen-82499",
storageBucket: "hacksc-pollen-82499.appspot.com",
messagingSenderId: "607618457140",
appId: "1:607618457140:web:59a7e27dabf5c07499b461",
measurementId: "G-P9MSVE83G9"
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
// firebase.analytics();
function myFunction() {
var input, filter, ul, li, a, i, txtValue, j;
input = document.getElementById("myInput");
filter = input.value.toUpperCase();
ul = document.getElementById("bod");
li = document.getElementsByTagName("h3");
di = document.getElementsByClassName("store")
console.log(input,filter)
console.log(li,li.outerText)
for (i = 0; i < li.length; i++) {
a = li[i].innerText.trim();
console.log(a)
// txtValue = a.textContent || a.innerText;
if (a.toUpperCase().indexOf(filter) > -1) {
li[i].style.display = "";
di[i].style.display = "";
} else {
li[i].style.display = "none";
di[i].style.display = "none"
}
}
}
// displayRating()
function displayRating(){
firebase.database().ref('/').on('value', function(snapshot){
var covidR = snapshot.val()["Trader Joe's"]["covidRating"]
var busyR = snapshot.val()["Trader Joe's"]["busyRating"]
console.log("covidr", covidR, "busyr",busyR);
document.querySelector("#tjCovid").innerHTML = covidR;
document.querySelector("#tjBusy").innerHTML = busyR;
})
}
displayRating2()
function displayRating2(){
firebase.database().ref('/').on('value', function(snapshot){
var storename = document.querySelector("#tjname").innerHTML;
var covidR = snapshot.val()[storename+" Average Covid Rating"]["covidAvr"]
var busyR = snapshot.val()[storename+" Average Busy Rating"]["busyAvr"]
// console.log("getting value covidr", covidR, "busyr",busyR);
var covidPercentage = (100 * covidR) / 5;
var safePercentage = (100 * busyR) / 5;
console.log("covidpercentage",covidPercentage)
// console.log("safepercentage",safePercentage)
var covidStar = document.querySelector("#covid-star");
covidStar.style.width = covidPercentage + "%";
// document.querySelector("#covidNum").innerHTML = covidR
var busyStar = document.querySelector("#busy-star");
busyStar.style.width = safePercentage + "%";
// document.querySelector("#busyNum").innerHTML = busyR
})
}
</script>
</div>
<div class = "store">
<h3 class="StoreName">Target</h3>
<div class="storerow">
<div class="storeImages">
<img style = "padding: 10px" src="Images/target.jpg" width="250" height="250" float = "left" >
</div>
<div class = "section">
<ul>
<li class="info">Department Store</li>
<li class="info"><a href="https://www.google.com/maps/dir/34.0262912,-118.2892032/Target,+3131+S+Hoover+St+STE+1910,+Los+Angeles,+CA+90089/@34.0261685,-118.2953348,15z/data=!3m1!4b1!4m9!4m8!1m1!4e1!1m5!1m1!1s0x80c2c808a44e8137:0xafba0072f4475ded!2m2!1d-118.2841969!2d34.0259722">0.2 Miles Away</a></li>
<li class="info">Current Covid Rating:
<div class="ratings">
<div class="empty-stars"></div>
<div class="full-stars" style="width:90%"></div>
</div></li>
<li class="info">Current Busy Rating:
<div class="ratings">
<div class="empty-stars"></div>
<div class="full-stars" style="width:30%"></div>
</div></li>
<li class="info"><a href="https://www.google.com/maps/dir//Trader+Joe's,+3131+S+Hoover+St+Ste+1920,+Los+Angeles,+CA+90089/data=!4m6!4m5!1m1!4e2!1m2!1m1!1s0x80c2c7e590c9b1d3:0x29839d05bb0c4e08?sa=X&ved=2ahUKEwjVrYXU-vjuAhVjdc0KHSA5BGQQ48ADMAB6BAgEECs">See Details</a></li>
</ul>
</div><!--section-->
</div><!--row-->
</div><!--store-->
<div class = "store">
<h3 class="StoreName" id="tjname">Trader Joe's</h3>
<div class="storerow">
<div class="storeImages">
<img style = "padding: 10px" src="Images/traderJoes.jpg" width="250" height="250" float = "left" >
</div>
<div class = "section">
<ul>
<li class="info">Grocery Store</li>
<li class="info"><a href="https://www.google.com/maps/place/Trader+Joe's/@34.0262062,-118.3474125,12z/data=!4m8!1m2!2m1!1strader+joe's!3m4!1s0x80c2c7e590c9b1d3:0x29839d05bb0c4e08!8m2!3d34.026076!4d-118.2846645">0.2 Miles Away</a></li>
<li class="info">Current Covid Rating:
<div class="ratings">
<div class="empty-stars"></div>
<div class="full-stars" id="covid-star"></div>
<span id="covidNum"></span>
</div></li>
<li class="info">Current Busy Rating:
<div class="ratings">
<div class="empty-stars"></div>
<div class="full-stars" id="busy-star"></div>
<span id="tjBusy"></span>
</div></li>
<li class="info"><a href="traderjoe-page.html">See Details</a></li>
</ul>
</div><!--section-->
</div><!--row-->
</div><!--store-->
<div class = "store">
<h3 class="StoreName">Thai By Trio</h3>
<div class="storerow">
<div class="storeImages">
<img style = "padding: 10px" src="Images/thaiTrio.jpg" width="250" height="250" float = "left" >
</div>
<div class = "section">
<ul>
<li class="info">Thai Restaurant</li>
<li class="info"><a href="https://www.google.com/maps/dir//Thai+by+Trio,+2700+S+Figueroa+St+%23101,+Los+Angeles,+CA+90007/@34.0269383,-118.2787404,17z/data=!4m9!4m8!1m0!1m5!1m1!1s0x80c2c75c11a34a93:0x68a488ef82ade7b7!2m2!1d-118.2765517!2d34.0269339!3e0">0.8 Miles Away</a></li>
<li class="info">Current Covid Rating:
<div class="ratings">
<div class="empty-stars"></div>
<div class="full-stars" style="width:50%"></div>
</div></li>
<li class="info">Current Busy Rating:
<div class="ratings">
<div class="empty-stars"></div>
<div class="full-stars" style="width:80%"></div>
</div></li>
<li class="info"><a href="https://www.google.com/maps/dir//Trader+Joe's,+3131+S+Hoover+St+Ste+1920,+Los+Angeles,+CA+90089/data=!4m6!4m5!1m1!4e2!1m2!1m1!1s0x80c2c7e590c9b1d3:0x29839d05bb0c4e08?sa=X&ved=2ahUKEwjVrYXU-vjuAhVjdc0KHSA5BGQQ48ADMAB6BAgEECs">See Details</a></li>
</ul>
</div><!--section-->
</div><!--row-->
</div><!--store-->
</div>
<div class = "store">
<h3 class="StoreName">True Value</h3>
<div class="storerow">
<div class="storeImages">
<img style = "padding: 10px" src="Images/trueValue.png" width="250" height="250" float = "left" >
</div>
<div class = "section">
<ul>
<li class="info">Hardware Store</li>
<li class="info"><a href="https://www.google.com/maps/dir//Vermont+Outlet+True+Value:+Home+Improvement+Center,+2929+S+Vermont+Ave,+Los+Angeles,+CA+90007/@33.9959243,-118.3302252,13z/data=!4m9!4m8!1m0!1m5!1m1!1s0x80c2c7f11dded2d5:0xb27055267012755a!2m2!1d-118.2918298!2d34.0279551!3e0">0.9 Miles Away</a></li>
<li class="info">Current Covid Rating:
<div class="ratings">
<div class="empty-stars"></div>
<div class="full-stars" style="width:100%"></div>
</div></li>
<li class="info">Current Busy Rating:
<div class="ratings">
<div class="empty-stars"></div>
<div class="full-stars" style="width:30%"></div>
</div></li>
<li class="info"><a href="https://www.google.com/maps/dir//Trader+Joe's,+3131+S+Hoover+St+Ste+1920,+Los+Angeles,+CA+90089/data=!4m6!4m5!1m1!4e2!1m2!1m1!1s0x80c2c7e590c9b1d3:0x29839d05bb0c4e08?sa=X&ved=2ahUKEwjVrYXU-vjuAhVjdc0KHSA5BGQQ48ADMAB6BAgEECs">See Details</a></li>
</ul>
</div><!--section-->
</div><!--row-->
</div><!--store-->
<div class = "store">
<h3 class="StoreName">Panda Express</h3>
<div class="storerow">
<div class="storeImages">
<img style = "padding: 10px" src="Images/panda.jpg" width="250" height="250" float = "left" >
</div>
<div class = "section">
<ul>
<li class="info">Chinese Restaurant</li>
<li class="info"><a href="https://www.google.com/maps/dir//Panda+Express,+2828+S+Figueroa+St,+Los+Angeles,+CA+90007/@34.0301378,-118.2785608,14.91z/data=!4m9!4m8!1m0!1m5!1m1!1s0x80c2c7e77393fe39:0xfe826e249082e38d!2m2!1d-118.2772116!2d34.0258636!3e0">1.2 Miles Away</a></li>
<li class="info">Current Covid Rating:
<div class="ratings">
<div class="empty-stars"></div>
<div class="full-stars" style="width:100%"></div>
</div></li>
<li class="info">Current Busy Rating:
<div class="ratings">
<div class="empty-stars"></div>
<div class="full-stars" style="width:90%"></div>
</div></li>
<li class="info"><a href="https://www.google.com/maps/dir//Trader+Joe's,+3131+S+Hoover+St+Ste+1920,+Los+Angeles,+CA+90089/data=!4m6!4m5!1m1!4e2!1m2!1m1!1s0x80c2c7e590c9b1d3:0x29839d05bb0c4e08?sa=X&ved=2ahUKEwjVrYXU-vjuAhVjdc0KHSA5BGQQ48ADMAB6BAgEECs">See Details</a></li>
</ul>
</div><!--section-->
</div><!--row-->
</div><!--store-->
</body>
</html>