Clean up Rankings Page

This commit is contained in:
Nick Eyre
2014-06-09 20:54:22 -07:00
parent 0c971861f8
commit 32bab18ed1
3 changed files with 19 additions and 25 deletions

View File

@@ -7,7 +7,7 @@ body {
font-family: 'robotoregular';
position: fixed;
font-size: 2em;
cursor: none;
/*cursor: none;*/
}
#titlebar {
@@ -32,7 +32,6 @@ body {
width: 100%;
background-color: #0070ff;
color: white;
text-align: center;
}
#container {
position: fixed;
@@ -46,6 +45,10 @@ body {
::-webkit-scrollbar {
display: none;
}
table {
width: 100%;
text-align: right;
}
td {
padding: 0.2em 1em;
}

View File

@@ -23,27 +23,18 @@ function getData(callback){
function populateView(){
$('#container table').html(template(rankings));
equalize(true);
equalize();
setTimeout(scroll, PAUSE_TIME);
}
// Balance Column Widths
var widths = [];
function equalize(all){
if(all){
var width = $('#container table').width();
var count = $('#container tr').first().children('td').length;
var offset = ($(window).width() - width) / (count + 1);
$('#container tr').first().children('td').each(function(){
var width = $(this).width()+offset;
$(this).width(width);
widths.push(width);
});
$('#header').children('td').each(function(index){
$(this).width(widths[index]);
});
}
$('#container table#new tr').first().children('td').each(function(index){
function equalize(){
$('#container #new tr').first().children('td').each(function(){
var width = $(this).width();
widths.push(width);
});
$('#header').children('td').each(function(index){
$(this).width(widths[index]);
});
}

View File

@@ -24,13 +24,13 @@
<table>
<tr id='header'>
<td class='rank'>Rank</td>
<td class='team'>Team</td>
<td class='team'>Name</td>
<td class='qs'>QS</td>
<td class='assist'>Assist</td>
<td class='tc'>Auto</td>
<td class='qs'>W-L-T</td>
<td>Rank</td>
<td>Team</td>
<td class='left'>Name</td>
<td>QS</td>
<td>Assist</td>
<td>Auto</td>
<td>W-L-T</td>
</tr>
</table>