Changed from reloader to projector

This commit is contained in:
The Great & Powerful James Wernicke 2015-06-04 00:02:51 -06:00
parent 6d4f200397
commit 815bf83538
3 changed files with 64 additions and 12 deletions

View File

@ -9,7 +9,7 @@ function shuf (ul) {
var lists = document.getElementsByClassName("shuf"); var lists = document.getElementsByClassName("shuf");
for (var l = 0; l < lists.length; l += 1) { for (var l = 0; l < lists.length; l += 1) {
var ul = lists[l]; var ul = lists[l];
for (var i = ul.children.length; i >= 0; i--) { for (var i = ul.children.length; i >= 0; i--) {
ul.appendChild(ul.children[Math.random() * i | 0]); ul.appendChild(ul.children[Math.random() * i | 0]);
} }
@ -27,10 +27,10 @@ window.addEventListener("load", init);
</head> </head>
<body> <body>
<h1>Credits</h1> <h1>Credits</h1>
<section> <section>
<h2>Created By</h2> <h2>Created By</h2>
<ul class="shuf"> <ul class="shuf">
<!-- Added in order of date --> <!-- Added in order of date -->
<li>Neale Pickett</li> <li>Neale Pickett</li>
@ -48,13 +48,14 @@ window.addEventListener("load", init);
<li>Erin Ochoa</li> <li>Erin Ochoa</li>
<li>William Phillips</li> <li>William Phillips</li>
<li>Jeremy Hefner</li> <li>Jeremy Hefner</li>
<li>James Wernicke</li>
</ul> </ul>
<p> <p>
Should your name be here? Please remind me! Should your name be here? Please remind me!
</p> </p>
</section> </section>
<section> <section>
<h2>Inspiration</h2> <h2>Inspiration</h2>
<ul class="shuf"> <ul class="shuf">
@ -63,7 +64,7 @@ window.addEventListener("load", init);
<li>Sandia National Laboratories</li> <li>Sandia National Laboratories</li>
</ul> </ul>
</section> </section>
<section> <section>
<h2>Thanks</h2> <h2>Thanks</h2>
<p> <p>

52
www/projector.html Normal file
View File

@ -0,0 +1,52 @@
<!DOCTYPE html>
<html>
<head>
<title>Scoreboard</title>
<link rel="stylesheet" href="style.css" type="text/css">
<script src="scoreboard.js" async></script>
<style>
body, html {
width: 100%;
height: 100%;
overflow: hidden;
cursor: none;
}
iframe {
width: 100%;
height: 100%;
border: none;
margin: 0;
padding: 0;
}
</style>
<script>
var urls = ["scoreboard.html", "credits.html", "tanks.html"];
var stack = [];
var i = 0;
function reload() {
// alternate between scoreboard and other things
if (i%2){
url = urls[0];
}
else {
if (stack.length === 0){
stack = urls.slice(1);
}
url = stack.pop();
}
console.log("loading " + url);
document.getElementById('reloader').src = url;
i++;
}
function init() {
setInterval(reload, 60000);
}
window.addEventListener("load", init);
</script>
</head>
<body>
<iframe id="reloader" src="scoreboard.html"></iframe>
</body>
</html>

View File

@ -13,7 +13,7 @@
} }
iframe { iframe {
width: 100%; width: 100%;
height: 100; height: 100%;
border: none; border: none;
margin: 0; margin: 0;
padding: 0; padding: 0;
@ -21,16 +21,15 @@
</style> </style>
<script> <script>
function init() { function init() {
setTimeout(function(){ setInterval(function(){
window.document.getElementById('reloader').src = window.document.getElementById('reloader').src; window.document.getElementById('reloader').src = window.document.getElementById('reloader').src;
},60000); },2000);
} }
window.addEventListener("load", init); window.addEventListener("load", init);
</script> </script>
</head> </head>
<body> <body>
<iframe id="reloader" src="http://localhost/tf6/scoreboard.html"> <iframe id="reloader" src="//koth/scoreboard.html">
<div id="scoreboard"></div> <div id="scoreboard"></div>
</body> </body>
</html> </html>