-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
56 lines (52 loc) · 2.23 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
<!DOCTYPE html>
<html lang="en" id = "html"></html>
<head>
<script src = "Scripts/jquery-3.4.1.js"></script>
<link rel="stylesheet" href="CSS/website.css">
<link rel="stylesheet" href="CSS/tetris.css">
<title>Tetris</title>
</head>
<body style="top:0;margin:0;min-width: unset;" hidden>
<header></header>
<script>
boxWidth = 44;
const pixleRatio = window.devicePixelRatio || 1
const boxWidthRatio = 44 * 1.5 * pixleRatio
</script>
<div id = "content" >
<div id = "top">
<h1 style="top:0;margin: 3px;" class="header">Tetris</h1>
</div>
</div>
<main class= "gameHolder" >
<!-- <section class="sectionContainer"> -->
<div id = "tetrisContainer"class="game">
<br>
<button class = "tetrisButton" id="tetrisStart">Start Game</button>
<button class = "tetrisButton" id="tetrisAIStart">Start AI</button>
<canvas id="tetris"> </canvas>
<script src = "Scripts/tetris/aiTetris.js"></script>
<script src = "Scripts/tetris/tetrisBox.js"></script>
<script src = "Scripts/tetris/tetrisObject.js"></script>
<script src = "Scripts/tetris/tetrisGameBoard.js"></script>
<script src = "Scripts/tetris/tetrisCanvas.js"></script>
<script src = "Scripts/tetris/tetris.js"></script>
<script src = "Scripts/tetris/tetrisControler.js"></script>
</div>
<!-- </div> -->
</main>
<script>
const tetrisCanvas = document.getElementById("tetris");
function resizeGame(){
let avalibleWidth = window.innerWidth
let avalibleHeight = Math.min(window.innerHeight, avalibleWidth * 1.04) ;
tetrisCanvas.style.height = (avalibleHeight * .90) +"px"
tetrisCanvas.style.maxHeight = (avalibleHeight * .90) +"px"
resizeButtons()
}
window.addEventListener("load", resizeGame);
window.addEventListener("resize", resizeGame);
</script>
<footer></footer>
</body>
</html>