Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
60 lines (52 sloc) 1.98 KB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>The Milky Way</title>
<meta name="author" content="Shawn Lukas<!--please add your name here when you contribute-->">
<meta name="description" content="A galaxy acarde game on your web browser.">
<meta name="viewport" content="width=device-width, user-scalable=no">
<link rel="stylesheet" href="engn/style.css">
<link rel="icon" href="engn/icon.ico">
</head>
<body>
<script>
var test = {
addEventListener : !!window.addEventListener,
querySelectorAll : !!document.querySelectorAll,
};
if (test.addEventListener && test.querySelectorAll) {
var script = document.querySelector("script");
board = document.createElement("board");
document.body.insertBefore(board,script);
var intro = document.createElement("intro");
board.appendChild(intro);
var hgroup = document.createElement("hgroup");
intro.appendChild(hgroup);
var h1 = document.createElement("h1");
hgroup.appendChild(h1);
h1.innerHTML = "The<br> Milky Way";
var h2 = document.createElement("h2");
hgroup.appendChild(h2);
h2.innerHTML = "for people and the web";
var button = document.createElement("button");
hgroup.appendChild(button);
button.innerHTML = "Play";
button.addEventListener("click", startGame, false);
button.addEventListener("touchstart", startGame, false);
function startGame() {
var board = document.querySelector("board");
board.removeChild(intro);
if ("classList" in document.documentElement) {
board.classList.add("edges");
}
}
}
else {
h3 = document.createElement("h3");
document.body.appendChild(h3);
h3.innerHTML = "Browser<br> Not Supported";
};
</script>
</body>
</html>