-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
55 lines (54 loc) · 2.19 KB
/
index.html
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
54
55
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="apple-mobile-web-app-capable" content="yes">
<link rel="apple-touch-icon" href="logo.png"/>
<title>GambientFier</title>
<link rel="stylesheet" type="text/css" href="index.css">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
</head>
<body>
<iframe id="frame" style="height:750px; width:999px;"></iframe>
<div id="layer"></div>
<script type="text/javascript">
var FRAME_SECONDS = 60;
var groups = ["gradient", "ariadne", "thesis12"];
//var refs = ["hangman.html", "risk.html", "chart.html", "chart2.html", "http://atinyarm.appspot.com/publicStream.jsp"];
var refs = ["hangman.html", "risk.html", "risk.html", "risk.html", "http://atinyarm.appspot.com/publicStream.jsp"];
var params = [];
var screenIndex = 0;
var questionIndex = window.location.href.indexOf('?');
if(questionIndex == -1){
$("body").empty();
groups.forEach(function(group){
$.getJSON('data/'+group+'.json', function(users) {
var userHTML = "<h2 style='width:999px;padding:10px;'>"+group+"</h2><div style='width:999px;'><ul>";
users.forEach(function(user){
userHTML += "<li> <a href='index.html?userKey="+user.key+"&group="+group+"'>"+user.googlePlusDisplayName+"</a></li>";
});
userHTML += "</ul></div>"
$("body").append(userHTML);
});
});
}else{
var querystring = window.location.href.substring(questionIndex);
var arrayParams = querystring.split("&");
var groupArray = arrayParams[1].split("=");
var group = groupArray[1];
params = [group].concat(groups,[group]);
//console.log("params:"+params);
$(function(){
loadRef();
setInterval(loadRef, FRAME_SECONDS*1000);
});
}
//TODO: show info onload
function loadRef(){
console.log("showing... "+refs[(screenIndex)%refs.length]+arrayParams[0]+"&group="+params[(screenIndex)%params.length]);
document.getElementById("frame").src = refs[(screenIndex)%refs.length]+arrayParams[0]+"&group="+params[(screenIndex)%params.length];
screenIndex++;
}
</script>
</body>
</html>