-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
42 lines (42 loc) · 1.08 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hi</title>
<script src="wasm_exec.js"></script>
<script>
const go = new Go()
WebAssembly.instantiateStreaming(fetch("main.wasm"), go.importObject).then((result)=> {
go.run(result.instance)
});
</script>
<style>
*{
margin: 0;
}
#head{
margin-top: 50px;
display: flex;
justify-content: center;
}
#game{
position: absolute;
top: 50%;
left: 50%;
transform: translateX(-50%) translateY(-50%);
}
</style>
</head>
<body>
<h1 id="head">PRESS F FOR FULLSCREEN</h1>
<canvas id="game" width="640" height="480"></canvas>
<script>
var fpsCounter = document.getElementById("fps")
function fpsUpdate(fps){
fpsCounter.innerText = fps
}
</script>
</body>
</html>