-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgame.html
84 lines (73 loc) · 3.72 KB
/
game.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Gametime!</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap3-dialog/1.34.7/css/bootstrap-dialog.min.css" crossorigin="anonymous">
<link rel="stylesheet" href="gamne/jquery.jqpuzzle.css" crossorigin="anonymous">
</head>
<body>
<div style="padding: 30px;">
<h3>Solve me :) (Click tiles)</h3>
<img src="https://i.imgur.com/NLoURM1.jpg">
</div>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="game/jquery.js"></script>
<script src="game/jquery.jqpuzzle.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('img').jqPuzzle({
rows: 3, // number of rows [3 ... 9]
cols: 3, // number of columns [3 ... 9]
hole: 1, // initial hole position [1 ... rows*columns]
shuffle: true, // initially show shuffled pieces [true|false]
numbers: true, // initially show numbers on pieces [true|false]
language: 'en', // language for gui elements [language code]
// display additional gui controls
control: {
shufflePieces: false, // display 'Shuffle' button [true|false]
confirmShuffle: false, // ask before shuffling [true|false]
toggleOriginal: true, // display 'Original' button [true|false]
toggleNumbers: false, // display 'Numbers' button [true|false]
counter: false, // display moves counter [true|false]
timer: false, // display timer (seconds) [true|false]
pauseTimer: false // pause timer if 'Original' button is activated
// [true|false]
},
// perform actions when the puzzle is solved sucessfully
success: {
fadeOriginal: true, // cross-fade original image [true|false]
callback: function() {
alert(atob("WW91IGRpZCBpdCEgQSBpcyBvdmVyLiBOID0gMTMzNy4="));
}, // callback a user-defined function [function]
// the function is passed an object as its argument
// which includes the fields 'moves' and 'seconds'
callbackTimeout: 1 // time in ms after which the callback is called
},
// animation speeds and settings
animation: {
shuffleRounds: 2, // number of shuffle rounds [1 ... ]
shuffleSpeed: 300, // time in ms to perform a shuffle round
slidingSpeed: 100, // time in ms for a single move
fadeOriginalSpeed: 300 // time in ms to cross-fade original image
},
// additional style information not specified via css
style: {
gridSize: 2, // space between two pieces in px
overlap: true, // if true, adjacent piece borders will overlap
// applies only if gridSize is set to 0
backgroundOpacity: 0 // opacity of the original image behind the pieces
// [0 ... 1] (0 means no display)
}
}
); // apply to all images
});
</script>
</body>
</html>