Add screenshots to the rankings page for boxes.

This commit is contained in:
Auke Kok 2017-11-13 07:05:18 +00:00
parent 16c40ea1be
commit ab1ba6fca0
3 changed files with 34 additions and 5 deletions

View File

@ -13,6 +13,14 @@
<body>
<script src="nav.js"></script>
<div id="modal" class="modal">
<div class="modal-content">
<span class="close">&times;</span>
<div id="screenshot"></div>
</div>
</div>
<script src="screenshots.js"></script>
<h1>Rankings!</h1>
<h2>Builder Rankings</h2>

View File

@ -15,10 +15,14 @@
"40": "tvZmfkq",
"47": "o0PWndJ",
"51": "AuFUQsO",
"59": "LgJQhX4",
"80": "zxkdJMt",
"81": "x2f0g83",
"118": "CNJ4AeG",
"168": "2VLKCkM",
"120": "eBqTlWL",
"137": "3xiSe3l",
"140": "eYFo7wQ",
"179": "052dneC",
"188": "aw86yKr"
}

17
top.js
View File

@ -10,6 +10,22 @@ function jsonget(url, id)
{
var tbl = JSON.parse(r.responseText);
if (id == "box") {
var s = "<table style=\"width: 80%;margin: 0 auto;\">";
s += "<tr><th width=\"5%\">Rank</th><th width=\"15%\">Number</th><th>Name</th><th>Builder</th></tr>\n";
for (i = 1; i <= 10; i++)
{
s += "<tr>";
s += "<td>" + i.toString() + "</td>";
s += "<td>" + tbl[i].split(/: /, 1)[0] + "</td>";
var ss = tbl[i].split(/: /, 2);
s += "<td>" + getbox(tbl[i].split(/: /, 1)[0], ss[1].split(/ by /, 1)[0].replace(/"/g, '')) + "</td>";
s += "<td>" + ss[1].split(/ by /, 2)[1] + "</td>";
s += "</tr>\n";
}
s += "</table>\n";
} else {
var s = "<table style=\"width: 80%;margin: 0 auto;\"><tr><th width=\"15%\">Rank</th><th>Name</th></tr>\n";
for (i = 1; i <= 10; i++)
@ -17,6 +33,7 @@ function jsonget(url, id)
s += "<tr><td>" + i.toString() + "</td><td>" + tbl[i] + "</td></tr>\n";
}
s += "</table>\n";
}
document.getElementById(id).innerHTML = s;
}