moth/www/scoreboard.html

79 lines
1.6 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<title>Scoreboard</title>
<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>
<script src="scoreboard.js" async></script>
<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();
}
function init() {
var sb = document.getElementById("scoreboard");
scoreboard(sb, true, type, interval);
}
window.addEventListener("load", preinit);
window.addEventListener("load", init);
</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>
<div id="scoreboard"></div>
</body>
</html>