forked from greatcodeclub/design_patterns
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
39 lines (31 loc) · 797 Bytes
/
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
<html>
<head>
<meta charset="utf-8">
<title>Pony Movin'</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
#pony {
position: absolute;
top: 50px;
left: 250px;
background: red;
color: white;
font-size: 30px;
}
</style>
</head>
<body>
<p><button id="undo">Undo</button> Use arrows to move the pony</p>
<h3>Moves</h3>
<ol id="log"></ol>
<img id="pony" src="pony.jpg" />
<script src="vendor/jquery.js"></script>
<script src="key_codes.js"></script>
<script src="pony_mover.js"></script>
<script>
var mover = new PonyMover($('#pony'), $('#log'))
$('body').keydown(function(e) { mover.move(e.which) })
$('#undo').click(function() { mover.undo() })
</script>
</body>
</html>