91 lines
2.2 KiB
HTML
91 lines
2.2 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Invaders</title>
|
|
<style>
|
|
* { box-sizing: border-box; }
|
|
html, body {
|
|
background-color: #111;
|
|
color: #bbb;
|
|
font-family: monospace;
|
|
margin: 0;
|
|
overflow: hidden;
|
|
text-align: center;
|
|
}
|
|
canvas {
|
|
margin: calc(50vh - 300px) auto;
|
|
}
|
|
.overlay {
|
|
height: 600px;
|
|
left: calc(50vw - 400px);
|
|
padding-top: 240px;
|
|
position: absolute;
|
|
text-align: center;
|
|
top: calc(50vh - 300px);
|
|
width: 800px;
|
|
}
|
|
#success {
|
|
background-color: #040;
|
|
color: #0f0;
|
|
}
|
|
#success button {
|
|
border: 2px solid #0f0;
|
|
color: #0f0;
|
|
}
|
|
#failure {
|
|
background-color: #400;
|
|
color: #f00;
|
|
}
|
|
#failure button {
|
|
border: 2px solid #f00;
|
|
color: #f00;
|
|
}
|
|
#welcome {
|
|
background-color: #000;
|
|
color: #fff;
|
|
}
|
|
#welcome button {
|
|
border: 2px solid #fff;
|
|
color: #fff;
|
|
}
|
|
#welcome p {
|
|
margin-top: -1rem;
|
|
}
|
|
button {
|
|
background: none;
|
|
border-radius: .25rem;
|
|
cursor: pointer;
|
|
font-family: monospace;
|
|
font-size: 1rem;
|
|
outline: none;
|
|
padding: .5rem 1rem;
|
|
}
|
|
button:hover {
|
|
background-color: rgba(255, 255, 255, 0.2);
|
|
}
|
|
.hidden {
|
|
display: none;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<noscript>This page contains WebAssembly and JavaScript content, please enable JavaScript in your browser.</noscript>
|
|
<script src="./bootstrap.js"></script>
|
|
<canvas id="canvas" width="800" height="600">This page contains WebGL content, please enable WebGL in your browser.</canvas>
|
|
<div id="welcome" class="overlay">
|
|
<h1>Invaders</h1>
|
|
<p>v0.1.1</p>
|
|
<button onclick="window.play_game()">Play</button>
|
|
</div>
|
|
<div id="success" class="overlay hidden">
|
|
<h1>You won!</h1>
|
|
<button onclick="window.play_game()">Play again</button>
|
|
</div>
|
|
<div id="failure" class="overlay hidden">
|
|
<h1>You lost!</h1>
|
|
<button onclick="window.play_game()">Play again</button>
|
|
</div>
|
|
</body>
|
|
</html>
|