-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
205 lines (189 loc) · 6.1 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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
<html>
<head>
<title>Organya</title>
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1">
<style>
body {
background-color: #d4d0c8;
}
body,
html {
height: 100%;
margin: 0;
padding: 0
}
#toolbar {
position: absolute;
flex-wrap: nowrap;
height: 40px;
display: flex;
top: 0;
left: 0;
right: 0;
}
#toolbar select {
min-width: 0;
max-width: 256px;
flex: 0 1 auto;
}
#canvas-container {
position: absolute;
top: 40px;
bottom: 0;
left: 0;
right: 0;
}
</style>
</head>
<body>
<div id="toolbar">
<select id="songs"></select>
<button onclick="playOrg()">Play</button>
<button onclick="stopOrg()">Stop</button>
</div>
<div id="canvas-container">
<canvas id="org-canvas"></canvas>
</div>
<!-- increment before each deploy -->
<script src="organya.js?cache_bust=5"></script>
<script src="organya-ui.js?cache_bust=4"></script>
<script>
(() => {
const songs = `Pixel/all/Get Heart Tank!.org
Pixel/all/Halloween 2.org
Pixel/all/On to Grasstown.org
Pixel/all/Quiet.org
Pixel/all/Jenka 1.org
Pixel/all/XXXX.org
Pixel/all/Torokos Theme.org
Pixel/all/Wind Fortress.org
Pixel/all/People of the Root.org
Pixel/all/Victory!.org
Pixel/all/Got Item!.org
Pixel/all/Gestation.org
Pixel/all/Balrog's Theme.org
Pixel/all/Run!.org
Pixel/all/Labyrinth Fight.org
Pixel/all/White.org
Pixel/all/Living Waterway.org
Pixel/all/Charge.org
Pixel/all/Gameover.org
Pixel/all/Mimiga Town.org
Pixel/all/Cemetery.org
Pixel/all/Pier Walk.org
Pixel/all/Scorching Back.org
Pixel/all/Pulse.org
Pixel/all/Moonsong.org
Pixel/all/Geothermal.org
Pixel/all/The Way Back Home.org
Pixel/all/Seal Chamber.org
Pixel/all/Mischievous Robot.org
Pixel/all/Access.org
Pixel/all/Eyes of Flame.org
Pixel/all/Tyrant.org
Pixel/all/Running Hell.org
Pixel/all/Meltdown.org
Pixel/all/Safety.org
Pixel/all/Last Cave.org
Pixel/all/Hero's End.org
Pixel/all/Break Down.org
Pixel/all/Cave Story.org
Pixel/all/Plant.org
Pixel/all/Snoopy Cake (Rockorg).org
Pixel/all/Gravity.org
Pixel/all/Zombie.org
Pixel/all/Jenka 2.org
Pixel/all/Balcony.org
Pixel/all/Oppression.org
Pixel/all/Last Battle.org
Pixel/all/Meltdown 2.org
Pixel/allbeta/Wind Fortress Beta 2002-07-05.org
Pixel/allbeta/Pier Walk Beta 2001-09-30.org
Pixel/allbeta/Oppression Beta 2001-12-09.org
Pixel/allbeta/Wind Fortress Beta 2002-07-09.org
Pixel/allbeta/Safety Beta 2002-07-01.org
Pixel/allbeta/Living Waterway Beta 2002-01-20.org
Pixel/allbeta/Plant Beta 2001-12-09.org
Pixel/allbeta/Wind Fortress Beta 2002-10-24.org
Pixel/allbeta/Safety Beta 2002-06-07.org
Pixel/allbeta/Plant Beta 2002-12-17.org
Pixel/allbeta/Gravity Beta 2002-07-20.org
Pixel/allbeta/Cemetery Beta 2002-12-17.org
Pixel/allbeta/Gestation Beta 2001-09-30.org
Pixel/allbeta/Meltdown Beta 2001-09-30.org
Pixel/allbeta/Gravity Beta 2002-01-20.org
Pixel/allbeta/Quiet Beta 2004-02-19.org
Pixel/allbeta/Eyes of Flame Beta 2002-10-24.org
Pixel/allbeta/Pulse Beta 2003-02-10.org
Pixel/allbeta/Safety Beta 2001-12-09.org
Pixel/allbeta/White Beta 2002-01-20.org
Pixel/allbeta/Safety Beta 2002-07-20.org
Pixel/allbeta/Oppression Beta 2002-02-28.org
Pixel/allbeta/Meltdown Beta 2001-12-09.org
Pixel/allbeta/Safety Beta 2001-09-30.org
Pixel/allbeta/Plant Beta 2001-09-30.org
Pixel/allbeta/Eyes of Flame Beta 2004-12-15.org
Pixel/allbeta/Hero's End Beta 2001-12-09.org
Pixel/allbeta/Eyes of Flame Beta 2002-12-17.org
Pixel/allbeta/Wind Fortress Beta 2002-07-20.org
Pixel/allbeta/Mimiga Town Beta 2003-02-10.org
Pixel/allbeta/Gravity Beta 2001-09-30.org
Pixel/allbeta/Living Waterway Beta 2001-12-09.org
Pixel/allbeta/Cave Story Beta 2004-12-07.org
Pixel/allbeta/Eyes of Flame Beta 2004-12-14.org
Pixel/allbeta/Cave Story Beta 2001-12-09.org
Pixel/allbeta/Living Waterway Beta 2001-09-30.org
Pixel/allbeta/Mischievous Robot Beta 2002-06-07.org
Pixel/allbeta/Mischievous Robot Beta 2002-07-01.org
Pixel/allbeta/White Beta 2002-02-14.org
Pixel/allbeta/Moonsong Beta 2001-12-09.org
Pixel/allbeta/Moonsong Beta 2002-01-20.org
Pixel/allbeta/Cave Story Beta 2001-09-30.org
Pixel/allbeta/White Beta 2002-02-28.org
Pixel/allbeta/Hero's End Beta 2001-09-30.org
Pixel/allbeta/Last Battle Beta.org
Pixel/allbeta/Hero's End Beta 2002-01-20.org
Pixel/maimai.org
Pixel/wanpaku.org
Pixel/snowfalling.org
Pixel/happy00.org
Pixel/town0.org`.split("\n").sort();
const songListEl = document.getElementById("songs");
for (let song of songs) {
song = song.trim();
const opt = document.createElement("option");
opt.value = "songs/" + song;
opt.textContent = song;
songListEl.appendChild(opt);
}
const canvasContainer = document.getElementById("canvas-container");
const orgCanvas = document.getElementById("org-canvas");
orgCanvas.width = canvasContainer.clientWidth;
orgCanvas.height = canvasContainer.clientHeight;
const ui = new OrganyaUI(orgCanvas);
window.addEventListener("resize", () => {
orgCanvas.width = canvasContainer.clientWidth;
orgCanvas.height = canvasContainer.clientHeight;
ui.draw();
})
let currentOrg = null;
window.stopOrg = () => {
if (currentOrg != null) {
currentOrg.stop();
currentOrg = null;
}
}
window.playOrg = async () => {
stopOrg();
console.log("fetching song...");
const res = await fetch(songListEl.options[songListEl.selectedIndex].value);
const data = await res.arrayBuffer();
await initOrganya();
currentOrg = new Organya(data);
ui.setOrganya(currentOrg);
currentOrg.play();
}
})();
</script>
</body>
</html>