-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
135 lines (125 loc) · 5.55 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
129
130
131
132
133
134
135
<!doctype html>
<html>
<head>
<title>Lock Puzzle</title>
<link rel="stylesheet" href="assets/css/master.css" type="text/css" media="screen" />
<link rel="stylesheet" href="assets/css/locks.css" type="text/css" media="screen" />
<link rel="stylesheet" href="assets/css/jQueryMobile/jqueryMobileMin.css" />
<script type="text/javascript" src="assets/js/jqueryMin.js"></script>
<script type="text/javascript" src="assets/js/jqueryMobileMin.js">
<script src="assets/js/cordova.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
function onLoad() {
document.addEventListener("deviceready", onDeviceReady, false);
setTimeout(giveupOnPhoneGap, 2000);
}
function onDeviceReady() {
console.log('PhoneGap device is ready. :)');
initApp();
}
function giveupOnPhoneGap() {
console.warn('PhoneGap device not ready. Initializing regardless... :(');
initApp();
}
</script>
</head>
<body onload="onLoad()">
<div id="menu" data-role="page">
<div data-role="header">Lock Puzzle</div>
<br/>
<a data-role="button" data-transition="none" data-inline="true" data-theme="b" href="#play">Play</a>
<a data-role="button" data-transition="none" data-inline="true" href="#info">About</a>
</div>
<div data-role="page" id="play">
<div data-role="content">
<div id="gameboard">
<center>
<div id="game" class="threeLocks">
<table border="2">
<tr>
<td><div id="Cell_1_1" class="lock threeLocks" row="1" col="1"> </div></td>
<td><div id="Cell_1_2" class="lock threeLocks" row="1" col="2"> </div></td>
<td><div id="Cell_1_3" class="lock threeLocks" row="1" col="3"> </div></td>
</tr>
<tr>
<td><div id="Cell_2_1" class="lock threeLocks" row="2" col="1"> </div></td>
<td><div id="Cell_2_2" class="lock threeLocks" row="2" col="2"> </div></td>
<td><div id="Cell_2_3" class="lock threeLocks" row="2" col="3"> </div></td>
</tr>
<tr>
<td><div id="Cell_3_1" class="lock threeLocks" row="3" col="1"> </div></td>
<td><div id="Cell_3_2" class="lock threeLocks" row="3" col="2"> </div></td>
<td><div id="Cell_3_3" class="lock threeLocks" row="3" col="3"> </div></td>
</tr>
</table>
</div>
<div id="game" class="fourLocks">
<table border="2">
<tr>
<td><div id="Cell_1_1" class="lock fourLocks" row="1" col="1"> </div></td>
<td><div id="Cell_1_2" class="lock fourLocks" row="1" col="2"> </div></td>
<td><div id="Cell_1_3" class="lock fourLocks" row="1" col="3"> </div></td>
<td><div id="Cell_1_4" class="lock fourLocks" row="1" col="4"> </div></td>
</tr>
<tr>
<td><div id="Cell_2_1" class="lock fourLocks" row="2" col="1"> </div></td>
<td><div id="Cell_2_2" class="lock fourLocks" row="2" col="2"> </div></td>
<td><div id="Cell_2_3" class="lock fourLocks" row="2" col="3"> </div></td>
<td><div id="Cell_2_4" class="lock fourLocks" row="2" col="4"> </div></td>
</tr>
<tr>
<td><div id="Cell_3_1" class="lock fourLocks" row="3" col="1"> </div></td>
<td><div id="Cell_3_2" class="lock fourLocks" row="3" col="2"> </div></td>
<td><div id="Cell_3_3" class="lock fourLocks" row="3" col="3"> </div></td>
<td><div id="Cell_3_4" class="lock fourLocks" row="3" col="4"> </div></td>
</tr>
<tr>
<td><div id="Cell_4_1" class="lock fourLocks" row="4" col="1"> </div></td>
<td><div id="Cell_4_2" class="lock fourLocks" row="4" col="2"> </div></td>
<td><div id="Cell_4_3" class="lock fourLocks" row="4" col="3"> </div></td>
<td><div id="Cell_4_4" class="lock fourLocks" row="4" col="4"> </div></td>
</tr>
</table>
</div>
<p>Moves: <span id="moveCount">0</span></p>
</center>
</div>
</div>
</div>
<div data-role="page" id="info">
<div data-role="Content" style="background:white;color:#234; padding:1em;">
<h1>Try get all the locks vertical</h1>
<div style="text-align:justify">
<p>When you tap a lock, all the locks in the same row and column will toggle position. Get all the locks vertical to complete the puzzle.</p>
<p>Future versions will encorporate levels when difficulty increases by number of locks, and high scores for time to complete and how many moves you use to complete the puzzle.</p>
</div>
<hr noshade />
<p id="libraries">Built by Bernhard Hofmann<br/>
<img src="assets/img/splash.png"><br/>
with <a href="http://www.phonegap.com/">PhoneGap</a> <span id="phoneGapVersion"></span><br/>
and <a href="http://jquerymobile.com/">jQuery Mobile</a>
</p>
<p id="deviceProperties" style="text-align:left;"></p>
</div>
</div>
<script src="assets/js/locks.js" type="text/javascript" charset="utf-8"></script>
<script src="assets/js/app.js" type="text/javascript" charset="utf-8"></script>
<script>
var
width = document.body.clientWidth / 4,
height = document.body.clientHeight / 4,
blockSize = Math.min(width, height);
$('.threeLocks td').css('height', blockSize+'px');
$('.threeLocks td').css('width', blockSize+'px');
$('.lock.threeLocks').css('width', blockSize+'px');
$('.lock.threeLocks').css('height', blockSize/5 +'px');
width = document.body.clientWidth / 5;
height = document.body.clientHeight / 5;
blockSize = Math.min(width, height);
$('.fourLocks td').css('height', blockSize+'px');
$('.fourLocks td').css('width', blockSize+'px');
$('.lock.fourLocks').css('width', blockSize+'px');
$('.lock.fourLocks').css('height', blockSize/5 +'px');
</script>
</body>
</html>