-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathplayers.html
More file actions
53 lines (41 loc) · 1.83 KB
/
players.html
File metadata and controls
53 lines (41 loc) · 1.83 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
---
layout: default
title: "About"
author: "Harrison"
permalink: /players/
---
<div class="players-list">
</div>
<script type="text/javascript">
var ref = new Firebase("https://tdpba-e41f2.firebaseio.com/");
playersRef = ref.child('/players/');
playersRef.on('child_added', function(snapshot) {
var playersJson = snapshot.val();
var accolades = playersJson['accolades'];
var accoladesHtml = "";
console.log(accolades);
if(accolades != null && accolades != undefined) {
accoladesHtml += "<h3>ACCOLADES</h3>";
}
for(var accolade in accolades) {
accolade = accolades[accolade];
accoladesHtml += "<p>* " + accolade + "</p>";
}
var playersElmHtml = "<div class='player-list-container'>" +
"<h3 class='players-list-header' style='background-color:" + playersJson['color'] + "'>" + playersJson['name'] + "</h3>" +
"<div class='players-list-body'>" +
"<div class='player-team'>" + playersJson['team'] + " | " + playersJson['school'] + "</div>" +
"<hr>" +
"<h4><span class='stats-large'>" + playersJson['PPG'] + "</span>PPG <span class='stats-large'>" + playersJson['RPG']+ "</span>RPG <span class='stats-large'>" + playersJson['APG'] + "</span>APG<h4>" +
"<h4>BPG: " + playersJson['BPG'] + " | SPG: " + playersJson['SPG'] + " | " + "FG: " + playersJson['FG'] + "%</h4>" +
"<hr>" +
"<p class='" + playersJson['status'] + "'><strong>" + playersJson['status'] + "</strong></p>" +
"<p class='player-text'>" + playersJson['text'] + "</p>" +
"<div class='accolades'>" +
accoladesHtml +
"</div>" +
"</div>";
$('.players-list').append(playersElmHtml);
});
</script>
<div style="clear: both"></div>