-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
72 lines (65 loc) · 2.24 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<!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>Forca</title>
<link rel="stylesheet" href="css/reset.css" />
<link rel="stylesheet" href="css/index.css" />
<script src="js/forms_canvas.js"></script>
<script src="js/tecladoInterceptor.js"></script>
<script src="js/palavras.js"></script>
<script src="js/dicionarioHandler.js"></script>
<script src="js/jogo.js"></script>
<script src="js/invokeKeyboard.js"></script>
</head>
<body>
<p id="palavrasTentadas"></p>
<div class="c-center">
<canvas class="jogo"></canvas>
<div id="loading" class="c-center">
<h1>Carregando...</h1>
<div class="circle"></div>
</div>
</div>
<div class="keyboard"></div>
<div id="dicionario">
<h1>Dicionário</h1>
<h3 id="palavra"></h3>
<h3 id="significado"></h3>
<h3 id="etimologia"></h3>
</div>
</body>
<script>
const canvas = document.querySelector(".jogo");
createKeyboard();
document.addEventListener("DOMContentLoaded", () => {
// jogo.update();
setInterval(() => {
let width_screen =
window.outerWidth > window.innerWidth
? window.innerWidth
: window.outerWidth;
if (jogo._canvas == null || jogo._canvas.width > width_screen) {
jogo.set_canvas(canvas, width_screen, 200);
}
jogo.update();
}, 1000 / 60);
});
// getSignificado(getRandomWord(13)).then((res) => {
// console.log(res);
// document.querySelector("#palavra").innerHTML = res.palavra;
// document.querySelector("#significado").innerHTML = res.significado;
// document.querySelector("#etimologia").innerHTML = res.etimologia;
// });
// getSignificado("bananas").then((res) => {
// console.log(res);
// });
document.addEventListener("keydown", getTeclado);
canvas.onclick = (e) => {
// jogo.desenhaCirculo(e.offsetX, e.offsetY, 10, colors.red);
console.log(e.offsetX, e.offsetY);
};
</script>
</html>