-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
37 lines (32 loc) · 1.02 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
<!DOCTYPE html>
<html>
<head>
<style>
canvas {
border: 1px solid #000;
}
</style>
</head>
<body>
<button id="startStop">Start</button>
<button id="addCreature">Add Creature</button>
<script src="./js/creature.js"></script>
<script src="./js/app.js"></script>
<script type="text/javascript">
(function() {
document.getElementById('startStop').addEventListener('click', function() {
if(this.innerHTML == 'Start') {
this.innerHTML = 'Stop';
window.app.start();
return;
}
this.innerHTML = 'Start';
window.app.stop();
});
document.getElementById('addCreature').addEventListener('click', function() {
window.app.addCreature();
});
})();
</script>
</body>
</html>