-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
executable file
·96 lines (83 loc) · 2.51 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
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>GameBowie</title>
<style>
@import url('css/normalize.css');
@import url('css/default.css');
</style>
</head>
<body>
<div id="container">
<div id="header">
</div>
<!-- Main -->
<div id="main">
<div class="centered-v">
<div class="header">
<img class="seal" src="res/seal.png"/>
<div class="brand">GAME BOWIE</div>
</div>
<!-- Screen -->
<div class="screen">
<canvas id="screen" width="320" height="240">
No support for <code>canvas</code> element.
</canvas>
</div>
</div>
</div>
<!-- Panels -->
<div id="footer">
<div class="centered-h">
<div class="panel-l">
<div class="header">CONSOLE</div>
<div id="output"></div>
</div>
<div class="panel-r">
<div id="dropzone" ondrop="emulator.drop.file(event)" ondragenter="emulator.drop.enter()" ondragleave="emulator.drop.exit()" ondragover="emulator.drop.over(event)" onclick="chooseFile()">
<img src="res/drop.png"/>
<div>DROP GAMEBOY GAMES HERE</div>
</div>
</div>
</div>
</div>
</div>
<!-- Fork me on GitHub -->
<a href="https://github.com/dkoluris/GameBowie"><img id="fork-me" src="res/fork-me.png" alt="Fork me on GitHub"></a>
<script src="dist/quer-3.5.1.slim.min.js"></script>
<script src="dist/emulator.js"></script>
<script>
function chooseFile() {
let input = document.createElement('input');
input.type = 'file';
input.onchange = (event) => {
emulator.openFile(event.target.files[0]);
}
input.click();
}
$(function() {
const screen = $('#screen');
const output = $('#output');
const dropzone = $('#dropzone');
// Startup
setTimeout(function() {
emulator.init(screen, output, dropzone);
window.addEventListener('keydown', (event) => {
input.update(event.keyCode, true);
});
window.addEventListener('keyup', (event) => {
input.update(event.keyCode, false);
});
window.addEventListener('gamepadconnected', (event) => {
emulator.pad.connection(true);
});
window.addEventListener('gamepaddisconnected', (event) => {
emulator.pad.connection(false);
});
}, 1000);
});
</script>
</body>
</html>