forked from daltonridenhour/DOM-Tetris
-
Notifications
You must be signed in to change notification settings - Fork 1
/
tetris.html
151 lines (144 loc) · 4.2 KB
/
tetris.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<!DOCTYPE html>
<html manifest="tetris.manifest">
<head>
<title>jTetris</title>
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0"/>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<link rel="apple-touch-icon" href="tetris_icon.png"/>
<link rel="apple-touch-startup-image" href="tetris_startup.png" />
<style type="text/css">
<!--
body {
overflow: hidden;
background: #d7d7d7;
margin: 0;
padding: 0;
}
#tetris {
width: 320px;
height: 460px;
background-color: #000;
margin: 0;
}
#canvas {
top: 20px;
width: 200px;
height: 440px;
background-color: #000;
position: relative;
color: #fff;
}
#canvas h1 {margin: 0; padding: 0; text-align: center; font-size: 30px; padding-top: 200px;}
.piece {
border: 1px solid white;
position: absolute;
}
.square {
position: absolute;
width: 19px;
height: 19px;
border: 1px solid white;
}
.type0 {background-color: #A000F0;}
.type1 {background-color: #00F0F0;}
.type2 {background-color: #F0A000;}
.type3 {background-color: #0000F0;}
.type4 {background-color: #00F000;}
.type5 {background-color: #F00000;}
.type6 {background-color: #F0F000;}
#next_shape {position: relative; background-color: #000; border: 1px solid white;width: 105px; height: 110px;}
#info {background-color: #000; color: #fff; float: right; width: 110px; height: 420px; padding: 0px;}
.control {
position:absolute;
background-color:transparent;
border:1px solid #fff;
}
.control.persistent {
position:absolute;
background-color:transparent;
border:1px solid #fff;
}
div.move_left, .move_right {
height:98px;
width:99px;
top:260px;
}
div.move_left {
left:0px;
}
div.move_right{
left:101px;
}
div.move_down, div.move_show_controls {
width:200px;
height:98px;
}
div.move_down {
top:360px;
left:0px;
}
div.move_rotate{
height:258px;
width:200px;
left:0px;
top:0;
}
div.move_pause, div.move_show_controls {
width: 105px;
height:98px;
}
div.move_show_controls {
top:260px;
left:210px;
}
div.move_pause {
top:360px;
left:210px;
}
div.move_pause div, div.move_show_controls div{
color:#fff;
text-align:center;
font-size:150%;
}
div.for_help {
display: none;
}
div.show_controls div.for_help {
color:#fff;
display:block;
margin:0 auto;
text-align:center;
vertical-align:middle;
/*padding-top:25%;*/
font-size:150%;
}
div.control span {
position: relative;
top: 25px;
}
-->
</style>
</head>
<body>
<div id="tetris">
<div id="info">
<div id="next_shape">Loading...</div>
<p id="level">Level: <span></span></p>
<p id="lines">Lines: <span></span></p>
<p id="score">Score: <span></span></p>
<p id="time">Time: <span></span></p>
</div>
<div id="canvas"></div>
</div>
<div id="controls" class="show_controls">
<div class="control move_left"><div class="for_help move_left"><span class="move_left">L</span></div></div>
<div class="control move_right"><div class="for_help move_right"><span class="move_right">R</span></div></div>
<div class="control move_down"><div class="for_help move_down"><span class="move_down">Down</span></div></div>
<div class="control move_rotate"><div class="for_help move_rotate"><span class="move_rotate">Rotate</span></div></div>
<div class="control persistent move_pause"><div class="move_pause"><span id="pause_control" class="move_pause">Pause</span></div></div>
<div class="control persistent move_show_controls"><div class="move_show_controls"><span class="move_show_controls">Controls</span></div></div>
</div>
<script type="text/javascript" src="tetris.js"></script>
</body>
</html>