-
Notifications
You must be signed in to change notification settings - Fork 0
/
puzzle.html
86 lines (73 loc) · 3.08 KB
/
puzzle.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
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<title>
LearnEra
</title>
<link rel="icon" href="./pictures/logo.jpg" type="image/x-icon" />
<head>
<title>Image Puzzle</title>
<link href="style_puzzle.css" rel="stylesheet" />
<link href="image-puzzle.css" rel="stylesheet" />
<script src="image-puzzle.js"></script>
</head>
<body>
<div id="collage">
<h2>Image Puzzle</h2>
<hr />
<div id="playPanel" style="padding:5px;display:none;">
<h3 id="imgTitle"></h3>
<hr />
<div style="display:inline-block; margin:auto; width:95%; vertical-align:top;">
<ul id="sortable" class="sortable"></ul>
<div id="actualImageBox">
<div id="stepBox">
<div>Steps:</div>
<div id="stepCount" class="stepCount">0</div>
</div>
<div id="timeBox">
Time Taken: <span id="timerPanel"></span> secs
</div>
<img id="actualImage" />
<div>Re-arrange to create a picture like this.</div>
</div>
</div>
</div>
<div id="gameOver" style="display:none;">
<div style="background-color: #fc9e9e; padding: 5px 10px 20px 10px; text-align: center; ">
<h2 style="text-align:center;">Game Over!!</h2>
Congratulations!! <br /> You have completed this picture.
<br /> Steps: <span id="stepCount" class="stepCount">0</span> steps.
<br /> Time Taken: <span class="timeCount">0</span> seconds<br />
<div style="background-image: url('./pictures/puzzle/congrats-14.gif'); height:250px; width: 260px;">
<button type="button" onclick="window.location.reload(true);">Play Again</button>
</div>
</div>
</div>
<div id="btn">
<button id="btnRule" type="button" class="btn1" onclick="rules();">Rules</button>
<button type="button" class="btn1" onclick="window.location.reload(true);">Another Photo</button>
</div>
<script>
var images = [
{ src: 'pictures/puzzle/cat.jpg', title: 'CAT' },
{ src: 'pictures/puzzle/ball.jpg', title: 'BALL' },
{ src: 'pictures/puzzle/house.png', title: 'HOUSE' }
];
window.onload = function () {
var gridSize = 4;
imagePuzzle.startGame(images);
};
function restart() {
var gridSize = 4;
imagePuzzle.startGame(images);
}
function rules() {
alert('Re arrange the image parts in a way that it correctly forms the picture. \nThe no. of steps taken will be counted.');
}
function about() {
alert('It is a real life object');
}
</script>
</div>
</body>
</html>