-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
157 lines (148 loc) · 4.86 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=808, user-scalable=no">
<meta name="Description" content="Gamebuino emulator">
<title>Gamebuino Emulator</title>
<style>
body {
margin: 10px;
padding: 0;
background-color: #5391d8;
color: #012141;
font-size: 20px;
font-family: 'Open Sans', sans-serif;
}
a {
color: #012141;
text-decoration: none;
}
a:hover {
color: #004385;
text-decoration: none;
}
#info {
display: flex;
}
#info>div {
margin-right: 24px;
}
ul {
margin-top: 4px;
}
</style>
</head>
<body>
<gamebuino-emulator src="https://raw.githubusercontent.com/Rodot/Games-META/master/binaries/METAtris/METAtris.bin">
</gamebuino-emulator>
<div id="foo"></div>
<div id="info">
<div>
<b>Controls</b>
<table>
<thead>
<tr>
<th>Key</th>
<th>Button</th>
</tr>
</thead>
<tbody>
<tr>
<td>w</td>
<td>Up</td>
</tr>
<tr>
<td>a</td>
<td>Left</td>
</tr>
<tr>
<td>s</td>
<td>Down</td>
</tr>
<tr>
<td>d</td>
<td>Right</td>
</tr>
<tr>
<td>j</td>
<td>A</td>
</tr>
<tr>
<td>k</td>
<td>B</td>
</tr>
</tbody>
</table>
</div>
<div><b>Other games</b>
<ul>
<li><a class="game-link" href="#"
data-binary-url="https://raw.githubusercontent.com/Rodot/Games-META/master/binaries/CatsAndCoinsDemo/CatsAndCoinsDemo.bin">Cats
and Coins</a></li>
<li><a class="game-link" href="#"
data-binary-url="https://raw.githubusercontent.com/Rodot/Games-META/master/binaries/DefendPluto/DefendPluto.bin">Defend
Pluto</a></li>
<li><a class="game-link" href="#"
data-binary-url="https://raw.githubusercontent.com/aoneill01/meta-dn2/feature/no-sd/binaries/DnGame/DNGAME.BIN">dn</a>
</li>
<li><a class="game-link" href="#"
data-binary-url="https://raw.githubusercontent.com/Rodot/Games-META/master/binaries/METAtris/METAtris.bin">METAtris</a>
</li>
<li><a class="game-link" href="#"
data-binary-url="https://raw.githubusercontent.com/Rodot/Games-META/master/binaries/PongMETA/PongMETA.bin">Pong
META</a></li>
<li><a class="game-link" href="#"
data-binary-url="https://raw.githubusercontent.com/aoneill01/meta-solitaire/master/binaries/Solitaire/SOLITAIRE.BIN">Solitaire</a>
</li>
<li><a class="game-link" href="#"
data-binary-url="https://raw.githubusercontent.com/Rodot/Games-META/master/binaries/SuperCrateMETA/SuperCrateMETA.bin">Super
Crate META</a></li>
<li><a class="game-link" href="#"
data-binary-url="https://raw.githubusercontent.com/Rodot/Games-META/master/binaries/UFO-Race/UFO-Race.bin">UFO
Race</a></li>
<li><a class="game-link" href="#"
data-binary-url="https://raw.githubusercontent.com/Rodot/Games-META/master/binaries/picomon/picomon.bin">Picomon</a>
</li>
<li><a class="game-link" href="#"
data-binary-url="https://raw.githubusercontent.com/Rodot/Games-META/master/binaries/reuben3/reuben3.bin">Reuben
3</a></li>
</ul>
</div>
<div><b><label for="file-upload">Upload game</label></b><br /><input type="file" id="file-upload" /></div>
<div><b>Style</b>
<ul>
<li><a class="style-link" href="#" data-background="1">Console 1</a></li>
<li><a class="style-link" href="#" data-background="2">Console 2</a></li>
<li><a class="style-link" href="#" data-background="none">None</a></li>
</ul>
</div>
</div>
<script src="./index.js" type="module"></script>
<script>
document.getElementById("file-upload").onchange = function () {
if (this.files.length == 1) {
var f = this.files[0];
var reader = new FileReader();
reader.onload = function (e) {
document.querySelector("gamebuino-emulator").start(e.target.result);
};
reader.readAsArrayBuffer(f);
this.value = "";
}
};
document.querySelectorAll("a.game-link").forEach(link => {
link.addEventListener("click", (ev) => {
ev.preventDefault();
document.querySelector("gamebuino-emulator").src = link.dataset.binaryUrl;
});
})
document.querySelectorAll("a.style-link").forEach(link => {
link.addEventListener("click", (ev) => {
ev.preventDefault();
document.querySelector("gamebuino-emulator").background = link.dataset.background;
});
})
</script>
</body>
</html>