-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
34 lines (31 loc) · 857 Bytes
/
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>Tetris</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style>
html {
font-size: 1.5em;
}
</style>
</head>
<body>
<div id="root"></div>
<script type="module">
import "https://unpkg.com/react@18/umd/react.development.js";
import "https://unpkg.com/react-dom@18/umd/react-dom.development.js";
import init, { App, WasmReact } from "./pkg/tetris.js";
await init();
WasmReact.useReact(window.React);
const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(
React.createElement(App, {
width: 10,
height: 25,
})
);
</script>
</body>
</html>