-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.html
128 lines (97 loc) · 5.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
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!-- THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -->
<head>
<meta http-equiv="Content-Type" content="text/html" charset="utf-8"/>
<meta name="keywords" content="steven lu, tetris, game, free, javascript, html5, browser, native, iOS, iPhone, iPad, iPad 2, Android, webkit, opera, chrome, touch, safari" />
<meta name="description" content="This is a HTML5 tetris game that has wide browser support. It provides innovative intuitive touch controls for Apple iOS iPhone iPad products and also Android devices. " />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta names="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<title>Tetris!</title>
<!-- strokeText.js from http://www.netzgesta.de/dev/text/#overview
I need to switch to displaying game messages using regular elements rather than scrawling on canvas
-->
<script src="strokeText.js"></script>
<link rel="stylesheet" href="page.css" type="text/css" />
<style type="text/css"> /* These are just for finger debug elements */
* {
-webkit-user-select: none;
user-select: none;
}
.finger-indicator {
position: absolute;
z-index: 4;
border: 2px solid #4a4;
background-color: rgba(0,50,0,0.5);
padding: 4px;
}
.finger-indicator.control {
background-color: rgba(50,0,0,0.5);
border: 2px solid #a44;
}
</style>
<!-- <script src='style/prettify/prettify.js'></script>
<link href="style/prettify.css" rel="stylesheet" type="text/css" />
<script>Event.observe(window, 'load', function() {prettyPrint()});</script> -->
<script src='tetris.js' type="text/javascript"></script>
<script type='text/javascript'>
TETRIS.setScoreIncreasing();
</script>
</head>
<body>
<div id='indicatorcontainer'></div>
<canvas id="board_canvas" width="120" height="250" style="position:fixed; left:10px; top:10px; z-index:1">
Your browser does not support HTML5 Canvas.
</canvas>
<canvas id="animated_canvas" width="120" height="250" style="position:fixed; left:10px; top:10px; z-index:3"></canvas>
<canvas id="shadow_canvas" width="120" height="250" style="position:fixed; left:10px; top:10px; z-index:2"></canvas>
<!-- <div id="placeholder" style=""> </div> -->
<div style="position: fixed; top:10px; font-family:Sans-serif; font-size:30px"> <span id="score" >0</span></div>
<div id="instructions" style='position: relative'>
<div id='controls' style='float: left' >
<input type='button' onclick="if (TETRIS.isPaused()) { TETRIS.unPause(); } else { TETRIS.setPause(); }" value='Pause' style='font-size: 150%' /><br/>
<p><input type='button' onclick='var i = document.getElementById("instr").style; i.display = (i.display=="none"?"inline":"none"); TETRIS.setPause(); ' value='Toggle Instructions' /></p>
</div>
<div id='instr' style='display: none;'>
<h1>HTML5 Tetris</h1>
<p> Touch events are now supported! Play on iOS and Android: <br/>
Swipe anywhere to move, tap to rotate (Can also tap while swiping to rotate). Swipe down to drop.
</p>
<p>
Touch Sensitivity:
<input id = 'sens_range' type='range' min='0.2' max='5' step='0.05' value='1' onchange='TETRIS.setTouchSensitivity(this.value); document.getElementById("sensitivity").innerHTML = Math.round(this.value*1000)/1000;'/>
<span id='sensitivity'>1</span>
</p>
<p> For PC/Mac: Use the Arrow keys to move and rotate, spacebar to drop.
Z,X to rotate in either direction. </p>
<p> Pause: P</p>
<p> Mouse control (toggle): M</br>
left click to rotate and right click to drop. Mouse control is experimental.
</p>
<p> To start a new game, refresh the page (F5)! </p>
<p>This is an infinite tetris game. It does not speed up.
To score more points, drop pieces as fast
as you can!</p>
<p>Changes coming soon (To do list): </p>
<ul>
<li>Centered positioning of board</li>
<li>Preview next piece(s)</li>
<li>More visual effects and animations: CSS3 transitions for animation, with fallback to JS animation. In particular I want a satisfying effect for the hard drop.</li>
</ul>
<p><input type='button' onclick='var result = TETRIS.toggle_touch_draw(); if (result) {this.value = "Turn Touch Debug Off"; } else { this.value="Turn Touch Debug On";}' value='Toggle touch debug' /></p>
</div>
</div>
</body>
</html>