-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLandingPage.html
42 lines (34 loc) · 1016 Bytes
/
LandingPage.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
<script src="https://www.gstatic.com/firebasejs/3.4.0/firebase.js"></script>
<script>
// Initialize Firebase
var config = {
apiKey: "AIzaSyCeXFLlhPomgMKvm-EzcclnUcoFe2ALJEw",
authDomain: "police-reform.firebaseapp.com",
databaseURL: "https://police-reform.firebaseio.com",
storageBucket: "",
messagingSenderId: "701054110170"
};
firebase.initializeApp(config);
var database = firebase.database();
// database.ref('users/' + 'TBD').set({
// username: 'name1',
// email: 'email1',
// profile_picture : 'https://placebear.com/200/300'
// });
</script>
<body>
<script src="LandingPage.js"></script>
<script>
var app = Elm.Main.fullscreen();
var zipcodeRef = null;
app.ports.changeZipcode.subscribe(function(zipcode) {
if (zipcodeRef) {
zipcodeRef.off();
}
zipcodeRef = database.ref('zipcodes/' + zipcode + '/');
zipcodeRef.on('value', function(snapshot) {
app.ports.zipcodeData.send(snapshot.val());
});
});
</script>
</body>