-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
85 lines (81 loc) · 2.63 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
73
74
75
76
77
78
79
80
81
82
83
84
85
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Tetris</title>
<link rel="stylesheet" href="css/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://d3js.org/d3.v6.min.js"></script>
<link href="https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@500&family=Turret+Road:wght@200;300;400;500;700;800&display=swap" rel="stylesheet">
<meta data-source="https://www.vecteezy.com/free-vector/vector" data-attribute="Vector Vectors by Vecteezy">
</head>
<body>
<div id="tetris">
<!-- <h1 id="heading">Tetris</h1>-->
<div id="heading">
</div>
<div id="playground">
<svg width="100%" height="100%">
</svg>
</div>
<div class="box" id="screen">
<svg width="100%" height="100%">
</svg>
</div>
<div class="box" id="scores">
<div class="pointInTime">
<h3 class="when">now</h1>
<div class="score">
<span class="label">score</span>
<span class="data scoreNow">0</span>
</div>
</div>
<div class="pointInTime">
<h3 class="when">best today</h1>
<div class="score">
<span class="label">score</span>
<span id="today" class="data">0</span>
</div>
</div>
<div class="pointInTime">
<h3 class="when">best ever</h3></h1>
<div class="score">
<span class="label">score</span>
<span id="ever" class="data">0</span>
</div>
</div>
</div>
<div class="box" id="controls">
<button id="left" class="btn"></button>
<button id="down" class="btn"></button>
<button id="right" class="btn"></button>
<button id="flip" class="btn"></button>
</div>
<div id="overlay">
<div id="gameOver">
<h1 id="badNews">Game Over</h1>
<p>Score: <span class="scoreNow">0</span><span id="record"></span></p>
</div>
</div>
</div>
<!-- Because of cross origin errors the game stopped using modules -->
<!-- <script type="module" src="controller.js"></script> -->
<script src="internals/shapes.js"></script>
<script src="internals/engine.js"></script>
<script src="controller.js"></script>
<script>
//reload the webpage on window resize
var resizeTimeout;
window.addEventListener('resize', function(event) {
clearTimeout(resizeTimeout);
resizeTimeout = setTimeout(function(){
// window.location.reload();
// window.location.href = window.location.href
console.log('reload!')
location.reload(true);
setTimeout(location.reload)
}, 1500);
});
</script>
</body>
</html>