moth/www/scoreboard.html

79 lines
1.6 KiB
HTML
Raw Normal View History

2015-04-02 17:44:49 -06:00
<!DOCTYPE html>
<html>
2015-04-03 16:52:43 -06:00
<head>
<title>Scoreboard</title>
2015-04-19 23:14:31 -06:00
<link rel="stylesheet" href="style.css" type="text/css">
<style>
#info {
max-width: 20em;
position: absolute;
opacity: 0.8;
bottom: 1em;
right: 10em;
text-align: center;
}
</style>
<script src="d3.js" async></script>
2015-04-19 23:14:31 -06:00
<script src="scoreboard.js" async></script>
2015-04-03 16:52:43 -06:00
<script>
var type = "original";
var interval = 60000;
function preinit()
{
var url = location.href;
url = new URL(url);
type = url.searchParams.get("type");
interval = url.searchParams.get("interval");
if(!type)
{
type = "original";
}
if(!interval)
{
interval = 60000;
}
if(type == "original")
{
document.getElementById("originalButton").checked = true;
}
else if(type == "total")
{
document.getElementById("totalButton").checked = true;
}
else if(type == "time")
{
document.getElementById("timelineButton").checked = true;
}
}
function updateType(newType)
{
type = newType;
init();
}
2015-04-03 16:52:43 -06:00
function init() {
var sb = document.getElementById("scoreboard");
scoreboard(sb, true, type, interval);
2015-04-03 16:52:43 -06:00
}
2015-04-02 17:44:49 -06:00
window.addEventListener("load", preinit);
2015-04-03 16:52:43 -06:00
window.addEventListener("load", init);
2015-04-03 16:52:43 -06:00
</script>
</head>
<body>
<h1>Cyber Fire</h1>
<h2>
Scoreboard Type:
<input type="radio" name="type" id="originalButton" value="original" onclick="updateType('original');"> Scored Points
<input type="radio" name="type" id="totalButton" value="total" onclick="updateType('total');"> All Points
<input type="radio" name="type" id="timelineButton" value="timeline" onclick="updateType('time');"> Timeline
</h2>
2015-04-03 16:52:43 -06:00
<div id="scoreboard"></div>
</body>
2015-04-02 17:44:49 -06:00
</html>