This repository has been archived by the owner on Jan 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
/
index.html
executable file
·111 lines (102 loc) · 2.78 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
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8" />
<title>rustynes</title>
<style>
html,
body {
min-height: 100%;
height: 100%;
overflow: hidden;
}
body {
display: flex;
justify-content: center;
align-items: center;
}
canvas {
transform: scale3d(2, 2, 1);
transform-origin: 0 0;
}
.nes {
width: 512px;
height: 480px;
}
.select {
margin-left: 16px;
}
.key {
margin: 16px 0 0 16px;
}
</style>
</head>
<body>
<div id="dropzone">
<div class="nes">
<canvas></canvas>
</div>
<div class="select">
<select name="rom">
<option value="falling">falling</option>
<option value="dushlan">dushlan</option>
<option value="color_test">color_test</option>
<option value="firedemo">firedemo</option>
<option value="giko005">giko005</option>
<option value="giko008">giko008</option>
<option value="giko009">giko009</option>
<option value="giko010b">giko010b</option>
<option value="giko011">giko011</option>
<option value="giko012">giko012</option>
<option value="giko013">giko013</option>
<option value="giko015">giko015</option>
<option value="giko016">giko016</option>
<option value="giko017">giko017</option>
<option value="hello">hello</option>
<option value="nestest">nestest</option>
</select>
</div>
</div>
<div class="key">
<span>Key pad</span>
<ul>
<li>X A</li>
<li>Z B</li>
<li>A SELECT</li>
<li>S START</li>
<li>↑ ↑</li>
<li>↓ ↓</li>
<li>← ←</li>
<li>→ →</li>
</ul>
</div>
<script type="module" src="./src/nes/browser/pulse.js"></script>
<script type="module" src="./src/nes/browser/oscillator.js"></script>
<script type="module" src="./src/nes/browser/noise.js"></script>
<script type="module" src="./main.js"></script>
<script type="module" src="./init.js"></script>
<script type="module">
import {start, startFile} from './main.js';
document.querySelector('select')
.addEventListener('change', (e) => {
start(`./roms/${e.target.value}.nes`);
})
if (window.FileReader) {
const dropzone = document.querySelector('#dropzone');
dropzone.addEventListener('dragover', (event) => {
event.stopPropagation();
event.preventDefault();
event.dataTransfer.dropEffect = 'copy';
}, false);
dropzone.addEventListener('drop', (event) => {
event.stopPropagation();
event.preventDefault();
const files = event.dataTransfer.files;
if (files.length <= 0)
return;
startFile(files[0]);
}, false);
}
</script>
</body>
</html>