Skip to content

Commit

Permalink
add 2021 historic record. delete useless files. update scores.json wi…
Browse files Browse the repository at this point in the history
…th test data and update altater.html to read from scores.json
  • Loading branch information
neokat committed Jul 31, 2024
1 parent 1e7b238 commit 65ef960
Show file tree
Hide file tree
Showing 8 changed files with 284 additions and 253 deletions.
92 changes: 0 additions & 92 deletions ac.html

This file was deleted.

91 changes: 0 additions & 91 deletions ac2.html

This file was deleted.

154 changes: 90 additions & 64 deletions altater.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta property="og:title" content="Exodus Altater Cup Leaderboard">
<meta property="og:description" content="How do you stack up to other potatoes?">
<meta property="og:url" content="https://neokat.github.io/altater">
<title>Exodus Altater Cup Leaderboard</title>

<link rel="icon" href="https://i.imgur.com/VtISIr7.png " type="image/x-icon">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta property="og:title" content="Exodus Altater Cup Leaderboard">
<meta property="og:description" content="How do you stack up to other potatoes?">
<meta property="og:url" content="https://neokat.github.io/altater">
<title>Exodus Altater Cup Leaderboard</title>

<link rel="icon" href="https://i.imgur.com/VtISIr7.png " type="image/x-icon">

<style>
html, body {
Expand Down Expand Up @@ -43,26 +43,26 @@
text-align: left;
background-color: #F8AE28;
color: white;
}

@media only screen and (max-width: 730px) {
#spuds td:nth-child(3),
#spuds th:nth-child(3),
#spuds td:nth-child(4),
#spuds th:nth-child(4),
#spuds td:nth-child(5),
#spuds th:nth-child(5),
#spuds td:nth-child(6),
#spuds th:nth-child(6),
#spuds td:nth-child(7),
#spuds th:nth-child(7) {display: none;}
}

@media only screen and (max-width: 730px) {
#spuds td:nth-child(3),
#spuds th:nth-child(3),
#spuds td:nth-child(4),
#spuds th:nth-child(4),
#spuds td:nth-child(5),
#spuds th:nth-child(5),
#spuds td:nth-child(6),
#spuds th:nth-child(6),
#spuds td:nth-child(7),
#spuds th:nth-child(7) {display: none;}
}
</style>
</head>
<body>
<center>
<center>
<img src="http://i.imgur.com/oUSxtvh.png" width="60%"><br>
<table id="spuds">
<table id="spuds">
<tr><th id="lu" colspan="9" style="text-align: center !important;"></th></tr>
<tr>
<th style="text-align: center !important;">
Expand All @@ -83,49 +83,75 @@
TOTAL POINTS</th>
<th>
RANK</th>
</tr>
<tr><td style="text-align: center !important;"><img src="https://images.neopets.com/altador/altadorcup/2010/popups/maraqua/logo.png" height="50px"></td><td>nostalgia</td><td>770</td><td>0</td><td>117</td><td>5,418</td><td>6,020</td><td>21,380</td><td>All-Star</td></tr>
<tr><td style="text-align: center !important;"><img src="https://images.neopets.com/altador/altadorcup/2010/popups/rooisland/logo.png" height="50px"></td><td>superkathiee</td><td>341</td><td>0</td><td>51</td><td>180</td><td>2,075</td><td>6,653</td><td>All-Star</td></tr>
<tr><td style="text-align: center !important;"><img src="https://images.neopets.com/altador/altadorcup/2010/popups/tyrannia/logo.png" height="50px"></td><td>goosesticks</td><td>80</td><td>0</td><td>4</td><td>115</td><td>341</td><td>1,440</td><td>Level 7</td></tr>

</tr>
<tr><img src="https://images.neopets.com/altador/altadorcup/2010/popups/maraqua/logo.png" height="50px"></td><td>testjfklsdjflkds</td><td>770</td><td>0</td><td>117</td><td>5,418</td><td>6,020</td><td>21,380</td><td>All-Star</td></tr>

</table>
<script>
var seconds = 1000;
var minutes = seconds * 60;
var hours = minutes * 60;
var days = hours * 24;
var now = new Date();
var update = new Date('Tue, 30 Jul 2024 11:57:00 -0500');
var t = now - update;
var w = Math.floor(t / seconds);
var x = Math.floor(t / minutes);
var y = Math.floor(t / hours);
var z = Math.floor(t / days);

if (w == 1) {
document.getElementById("lu").innerHTML = 'Last update: ' + w + ' second ago';
}
if (2 <= w && w < 60) {
document.getElementById("lu").innerHTML = 'Last update: ' + w + ' seconds ago';
}
if (60 <= w && w < 120) {
document.getElementById("lu").innerHTML = 'Last update: ' + x + ' minute ago';
}
if (120 <= w && w < 3600) {
document.getElementById("lu").innerHTML = 'Last update: ' + x + ' minutes ago';
}
if (3600 <= w && w < 7200) {
document.getElementById("lu").innerHTML = 'Last update: ' + y + ' hour ago';
}
if (7200 <= w && w < 86400) {
document.getElementById("lu").innerHTML = 'Last update: ' + y + ' hours ago';
}
if (86400 <= w && w < 172800) {
document.getElementById("lu").innerHTML = 'Last update: ' + z + ' day ago';
}
if (172800 <= w) {
document.getElementById("lu").innerHTML = 'Last update: ' + z + ' days ago';
}
<script type="text/javascript">
// build table body
$(function() {
var scores = [];

$.getJSON('scores.json', function(data) {
$.each(data.scores, function(i, user) {
var tblRow = "<tr>" +
"<td><img src=\"" + user.team_logo + "\" height=\"50px\"</td>" +
"<td>" + user.username + "</td>" +
"<td>" + user.yyb_wins + "</td>" +
"<td>" + user.yyb_draws + "</td>" +
"<td>" + user.slsl_wins + "</td>" +
"<td>" + user.msn_plays + "</td>" +
"<td>" + user.sosd_plays + "</td>" +
"<td>" + user.total_score + "</td>" +
"<td>" + user.rank + "</td>" +
"<td>" + user.last_updated + "</td>" +
"</tr>"
$(tblRow).appendTo("#spuds tbody");
});
});

});

// calculate last update time
var seconds = 1000;
var minutes = seconds * 60;
var hours = minutes * 60;
var days = hours * 24;
var now = new Date();
var update = new Date('Tue, 30 Jul 2024 11:57:00 -0500');
var t = now - update;
var w = Math.floor(t / seconds);
var x = Math.floor(t / minutes);
var y = Math.floor(t / hours);
var z = Math.floor(t / days);

if (w == 1) {
document.getElementById("lu").innerHTML = 'Last update: ' + w + ' second ago';
}
if (2 <= w && w < 60) {
document.getElementById("lu").innerHTML = 'Last update: ' + w + ' seconds ago';
}
if (60 <= w && w < 120) {
document.getElementById("lu").innerHTML = 'Last update: ' + x + ' minute ago';
}
if (120 <= w && w < 3600) {
document.getElementById("lu").innerHTML = 'Last update: ' + x + ' minutes ago';
}
if (3600 <= w && w < 7200) {
document.getElementById("lu").innerHTML = 'Last update: ' + y + ' hour ago';
}
if (7200 <= w && w < 86400) {
document.getElementById("lu").innerHTML = 'Last update: ' + y + ' hours ago';
}
if (86400 <= w && w < 172800) {
document.getElementById("lu").innerHTML = 'Last update: ' + z + ' day ago';
}
if (172800 <= w) {
document.getElementById("lu").innerHTML = 'Last update: ' + z + ' days ago';
}
</script>


</center>
</body>
</html>
Binary file removed altater.png
Binary file not shown.
Loading

0 comments on commit 65ef960

Please sign in to comment.