Browse Source

added update time and script for screenshot

visualizer
edoardoo 10 years ago
parent
commit
e69e7f5614
4 changed files with 4532 additions and 3 deletions
  1. +1
    -0
      public/index.html
  2. +10
    -1
      public/scripts/functions.js
  3. +4519
    -0
      public/scripts/html2canvas.js
  4. +2
    -2
      public/style/style.less

+ 1
- 0
public/index.html View File

@ -6,6 +6,7 @@
<link rel="stylesheet/less" type="text/css" href="style/style.less" /> <link rel="stylesheet/less" type="text/css" href="style/style.less" />
<script type="text/javascript" src="scripts/less.min.js"></script> <script type="text/javascript" src="scripts/less.min.js"></script>
<script type="text/javascript" src="scripts/socket.io.js"></script> <script type="text/javascript" src="scripts/socket.io.js"></script>
<script type="text/javascript" src="scripts/html2canvas.js"></script>
</head> </head>
<body> <body>


+ 10
- 1
public/scripts/functions.js View File

@ -111,14 +111,21 @@ function populateBoard(){
var listBoard = document.getElementById("listBoard"); var listBoard = document.getElementById("listBoard");
var results = ""; var results = "";
var rankings = data.data.rankings; var rankings = data.data.rankings;
var date = new Date();
var seconds = date.getSeconds();
var minutes = date.getMinutes();
var hour = date.getHours();
for (var i = rankings.length - 1; i >= 0; i--) { for (var i = rankings.length - 1; i >= 0; i--) {
if( rankings[i].teamId == 235 ){ if( rankings[i].teamId == 235 ){
results += "<p>Updated "+hour+"h "+minutes+"m "+seconds+"s</p>";
results += "<h1>Cazziammolla Placement: "+rankings[i].rank+"</h1>"; results += "<h1>Cazziammolla Placement: "+rankings[i].rank+"</h1>";
results += "<h2>with a score of: "+rankings[i].score+"</h2>"; results += "<h2>with a score of: "+rankings[i].score+"</h2>";
if (rankings[i].rank != points && points != 0){ if (rankings[i].rank != points && points != 0){
score = rankings[i].rank;
ringTheBell(); ringTheBell();
} }
points = rankings[i].rank;
} }
}; };
@ -137,6 +144,8 @@ function populateBoard(){
} }
function updateLeaderBoard(){ function updateLeaderBoard(){
loadRankingJs('https://davar.icfpcontest.org/rankings.js?cachebuster='+ new Date().getTime());
var intervalID = setInterval( function(){ var intervalID = setInterval( function(){
loadRankingJs('https://davar.icfpcontest.org/rankings.js?cachebuster='+ new Date().getTime()); loadRankingJs('https://davar.icfpcontest.org/rankings.js?cachebuster='+ new Date().getTime());
}, 30000); }, 30000);


+ 4519
- 0
public/scripts/html2canvas.js
File diff suppressed because it is too large
View File


+ 2
- 2
public/style/style.less View File

@ -10,7 +10,7 @@
html, body{ html, body{
margin: 0; margin: 0;
padding: 0; padding: 0;
height: 100%;
height: auto;
width: 100%; width: 100%;
} }
body{ body{
@ -37,7 +37,7 @@ audio{
right: -400px; right: -400px;
color: #333; color: #333;
opacity: .2; opacity: .2;
h1, h2{
h1, h2, p{
padding-left: 10px; padding-left: 10px;
} }
&:hover{ &:hover{


Loading…
Cancel
Save