-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
336 lines (268 loc) · 19.7 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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Beatz 5.3!</title>
<link rel="icon" type="image/x-icon" href="Resources/favicon.png" />
<link rel="stylesheet" id="stylesheet" type="text/css" href="styles.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" />
</head>
<body>
<div id="canvasContainer">
<canvas id="myCanvas" width="1280" height="720"></canvas>
<div id="backgroundOverlay"></div>
</div>
<div id="loadingBarContainer">
<div id="loadingText">Loading...</div>
<div id="loadingBar"></div>
</div>
<div id="orientationMessage">Please rotate your device to landscape mode.</div>
<h1 id="titleGame">Beatz.io</h1>
<div id="errorContainer" style="position: fixed; bottom: 0; left: 0; width: fit-content"></div>
<button id="togglePauseMBL" title="Pause Game" onclick="togglePause()" style="display: none"><i class="fa-solid fa-circle"></i> Pause Game!</button
><br id="pauseMargin" /><br id="pauseMargin2" />
<button id="startButton">Play! <i class="fa-solid fa-play"></i></button>
<button id="myYoutube" title="My YouTube! (@GuayabR)" style="display: none" onclick="NewTab()"><i class="fa-brands fa-youtube"></i></button>
<button id="githubRepo" title="GitHub Repository for Beatz! Where you can download the game for offline use!" style="display: none">
<i class="fa-brands fa-github"></i>
</button>
<button id="toggleNoteStyleButton" title="Toggle Note Style (Arrows / Circles)" style="display: none">
<i class="fa-solid fa-arrow-up" style="display: none"></i>
<i class="fa-solid fa-circle" style="display: none"></i>
</button>
<button id="previousButton" title="Previous Song" style="display: none"><i class="fa-solid fa-backward-fast"></i></button>
<button id="restartButton" title="Restart Song" style="display: none"><i class="fa-solid fa-repeat"></i></button>
<button id="nextButton" title="Next Song" style="display: none"><i class="fa-solid fa-forward-fast"></i></button>
<button id="randomizeButton" title="Randomize Song" style="display: none"><i class="fa-solid fa-shuffle"></i></button>
<button id="toggleAutoHit" style="display: none">Toggle Auto Hit</button>
<button id="fullscreen" title="Toggle Fullscreen" style="display: none" onclick="toggleFullScreen()"><i class="fa-solid fa-expand"></i></button>
<button id="keybindsButton" title="Game Settings" style="display: none"><i class="fa-solid fa-gear"></i></button><br /><br />
<button id="openSongListBTN"><i class="fa-solid fa-music" id="bouncingIcon"></i> Song list!</button>
<!-- Keybinds Modal -->
<div id="keybindsModal" class="modal">
<div class="modal-content">
<span id="closeSettings" class="close"><i class="fa-solid fa-xmark"></i></span>
<button id="resetKeybindsButton" class="keybind-button reset-keybinds"><i class="fa-solid fa-rotate"></i></button>
<button id="redoKeybindsButton" class="keybind-button redo-keybinds"><i class="fa-solid fa-rotate-right"></i></button>
<button id="undoKeybindsButton" class="keybind-button undo-keybinds"><i class="fa-solid fa-rotate-left"></i></button>
<button id="presetSettingsButton" class="keybind-button preset-settings"><i class="fa-solid fa-screwdriver-wrench"></i></button>
<button id="switchToMiscSettings" class="switch-modal switch-right">
<i class="fa-solid fa-arrow-right"></i>
</button>
<h1>Customize Keybinds!</h1>
<form id="keybindsForm" class="shared-form">
<!-- KEYBINDS -->
<label for="left">Note Left:</label>
<input type="text" id="left" name="left" />
<label for="up">Note Up:</label>
<input type="text" id="up" name="up" /><br class="marginKB" /><br class="marginKB" />
<label for="down">Note Down:</label>
<input type="text" id="down" name="down" />
<label for="right">Note Right:</label>
<input type="text" id="right" name="right" /><br class="marginKB" /><br class="marginKB" />
<label for="pause">Pause Game:</label>
<input type="text" id="pause" name="pause" />
<label for="autoHit">Toggle Auto Hit:</label>
<input type="text" id="autoHit" name="autoHit" /><br class="marginKB" /><br class="marginKB" />
<label for="fullscreenInput">Fullscreen:</label>
<input type="text" id="fullscreenInput" name="fullscreen" /><br class="marginKB" /><br class="marginKB" />
<label for="previousInput">Previous Song:</label>
<input type="text" id="previousInput" name="previous" />
<label for="restartInput">Restart Song:</label>
<input type="text" id="restartInput" name="restart" />
<label for="nextInput">Next Song:</label>
<input type="text" id="nextInput" name="next" /><br class="marginKB" /><br class="marginKB" />
<label for="randomize">Randomize Song:</label>
<input type="text" id="randomize" name="randomize" /><br class="marginKB" /><br class="marginKB" />
<label for="toggleNoteStyleInput">Toggle Note Style:</label>
<input type="text" id="toggleNoteStyleInput" name="toggleNoteStyle" /><br class="marginKB" /><br class="marginKB" />
<label for="openSongL">Open Song List:</label>
<input type="text" id="openSongL" name="openSongListKey" /><br class="marginKB" /><br class="marginKB" />
<label for="openKeybindsKey">Open Settings:</label>
<input type="text" id="openKeybindsKey" name="openKeybindsModal" /><br class="marginKB" /><br class="marginKB" />
<span id="settingsSaved" style="color: white; display: none" class="settingsSavedMsg">Settings saved!</span>
<button id="saveSettingsBtn" class="save-settings-btn" type="button">Save</button>
</form>
</div>
</div>
<!-- Miscellaneous Settings Modal -->
<div id="miscSettingsModal" class="modal">
<div class="modal-content">
<span id="closeMiscSettingsModal" class="close"><i class="fa-solid fa-xmark"></i></span>
<button id="resetKeybindsButton" class="keybind-button reset-keybinds"><i class="fa-solid fa-rotate"></i></button>
<button id="redoKeybindsButton" class="keybind-button redo-keybinds"><i class="fa-solid fa-rotate-right"></i></button>
<button id="undoKeybindsButton" class="keybind-button undo-keybinds"><i class="fa-solid fa-rotate-left"></i></button>
<button id="presetSettingsButton" class="keybind-button preset-settings"><i class="fa-solid fa-screwdriver-wrench"></i></button>
<button id="switchToKeybinds" class="switch-modal switch-left">
<i class="fa-solid fa-arrow-left"></i>
</button>
<h1>Miscellaneous Settings</h1>
<form id="miscSettingsForm" class="shared-form">
<!-- MISCELLANEOUS -->
<label for="defaultNoteStyle">Default Note Style:</label>
<select id="defaultNoteStyle" name="defaultNoteStyle">
<option value="arrows">Arrows</option>
<option value="circles">Circles</option>
</select>
<label for="defaultHitSound">Hit Sound:</label>
<select id="defaultHitSound" name="hitSoundSelector">
<option value="defaultHit">Osu Hit Sound</option>
<option value="mcHit">Minecraft Hit Sound</option>
<option value="hitMarker">CoD Hitmarker Sound</option>
<option value="clickHit">Click Hit Sound</option>
<option value="smallClick">Small Click Hit Sound</option>
</select>
<br /><br />
<label for="logKeysCheck">Log Keys to Console</label>
<input type="checkbox" id="logKeysCheck" onclick="toggleKeyLogger()" /><br />
<label for="saveRecentSongs">Save ALL recent songs?</label>
<input type="checkbox" id="saveRecentSongs" onclick="toggleSavingSongs()" /><br />
<label for="songTimeoutAfterSongEnd">Restart song after it ends?</label>
<input type="checkbox" id="songTimeoutAfterSongEnd" name="songTimeoutSongEnd" />
<label id="numTimeout" for="songTimeoutAfterSongEndNum">Delay:</label>
<input type="text" id="songTimeoutAfterSongEndNum" placeholder="Value in milliseconds" name="songTimeoutSongEndNum" /><br />
<label for="circularImage">Circular Cover Images?</label>
<input type="checkbox" id="circularImage" name="circularImage" onchange="toggleVinylRotation()" /><br />
<label for="vinylRotation" id="vinylRotationLabel" style="display: none">Enable Cover Image Rotation:</label>
<input type="checkbox" id="vinylRotation" name="vinylRotation" style="display: none" /><br id="marginRotation" />
<label for="fetchSongsSite">Fetch songs from guayabr.github.io? (Mainly for iOS)</label>
<input type="checkbox" id="fetchSongsSite" name="fetchSongsSite" onchange="toggleFetchingSongs()" /><br />
<label for="playSFXcheck">Play button SFX?</label>
<input type="checkbox" id="playSFXcheck" name="playSFXcheck" onchange="togglePlaySFX()" /><br />
<label for="pulseOnBPMcheck">Elements pulse on BPM?</label>
<input type="checkbox" id="pulseOnBPMcheck" name="pulseOnBPMcheck" onchange="togglePulseOnBPM()" /><br />
<label for="quickFScheck">Quick Fullscreen? (Beta) </label>
<input type="checkbox" id="quickFScheck" name="quickFScheck" onchange="toggleQuickFS()" /><br />
<label for="extraLogCheck">Extra notices? (Dev)</label>
<input type="checkbox" id="extraLogCheck" name="extraLogCheck" onchange="toggleExtraLogs()" /><br /><br />
<label id="readyTimerLabel" for="readyTimerInput">Seconds before starting a song:</label>
<input type="number" id="readyTimerInput" max="15" min="0" step="0.5" /><br /><br />
<label for="defaultBackground">Background image:</label>
<select id="defaultBackground" name="backgroundForCanvas">
<option value="defaultBG">Default (Uproxide)</option>
<option value="defaultBG2">Wavy chromatic</option>
<option value="defaultBG3">Dark orange sunset</option>
<option value="defaultBG4">Dark Blue Flow</option>
<option value="defaultBG5">Space</option>
<option value="defaultBG6">Galaxy</option>
<option value="defaultBG7">Darker Space</option>
<option value="defaultBG8">Star System</option>
<option value="htmlBG">Copy HTML</option>
<option value="transparentBG">Transparent</option>
<option value="customBG">Custom background!</option></select
><br id="marginSelect" /><br id="marginSelect2" />
<label id="customBGLabel" for="customBGInput" style="display: none">Custom background image:</label>
<input type="file" id="customBGInput" accept="image/*" style="display: none" /><br id="marginCustomBG" /><br id="marginCustomBG2" />
<label id="customTransparentBGblur" for="backdropBlurInput" style="display: none">Background blur:</label>
<input type="number" id="backdropBlurInput" style="display: none" /><br id="marginBlurBG" /><br id="marginBlurBG2" />
<label id="customBrightness" for="brightnessInput">Brightness:</label>
<input type="number" id="brightnessInput" max="1" step="0.01" /><br id="marginBrightBG" /><br id="marginBrightBG2" />
<span id="settingsSaved" style="color: white; display: none" class="settingsSavedMsg">Settings saved!</span>
<button id="saveSettingsBtn" class="save-settings-btn" type="button">Save</button>
</form>
</div>
</div>
<div id="presetModal" class="modal">
<div class="modal-content">
<span id="closePresets" class="close"><i class="fa-solid fa-xmark"></i></span>
<button id="resetKeybindsButton" class="keybind-button reset-keybinds"><i class="fa-solid fa-rotate"></i></button>
<h1>Setting Presets</h1>
<label for="presetGuayabR">Preset 1:</label>
<button id="presetGuayabR" class="presetBTN">GuayabR</button><br /><br />
<label for="presetVERIDIAN">Preset 2:</label>
<button id="presetVERIDIAN" class="presetBTN">VERIDIAN</button><br /><br />
<label for="presetOG">Preset 3:</label>
<button id="presetOG" class="presetBTN">OG</button><br /><br />
<span id="presetDescription" style="color: white; display: none"></span>
<h4><span id="presetSaved" style="color: white; display: none">Preset has been saved!</span></h4>
<button id="applyPresetKeysBTN" class="apply-preset" title="Only apply Keybinds"><i class="fa-regular fa-keyboard"></i></button>
<button id="applyPresetButton" class="apply-preset">Apply Preset</button>
<button id="applyPresetMiscBTN" class="apply-preset" title="Only apply Miscellaneous"><i class="fa-solid fa-wand-magic-sparkles"></i></button>
</div>
</div>
<div id="songVol" class="volume-control" style="display: none">
<label for="songVolume">Song Volume</label>
<input type="range" id="songVolume" name="songVolume" min="0" max="100" value="50" />
</div>
<div id="hitSoundVol" class="volume-control" style="display: none">
<label id="hitSoundVol" for="hitSoundSlider">Hit Sound volume:</label>
<input type="range" id="hitSoundSlider" name="hitSoundSlider" min="0" max="100" value="50" />
</div>
<br /><br />
<div id="contactBtn">
<button id="contactbtn" onclick="email()"><i class="fa-solid fa-envelope"></i> Contact</button>
</div>
<div id="publicToTestToggle"><button id="publicbtn" onclick="toVersion()">Open public game</button><br /><br /></div>
<h2>
Background image from:
<a
href="https://github.com/Uproxide/Texture-Workshop/commit/457788213d900a980f559ae8f241febad3322bdd#diff-1dbd3c28454ab3b1596af576394661ba03597f51326dbbff288c6b8ccc353041"
>Uproxide's "Texture Workshop"</a
>
</h2>
<h2>Notes from: <a href="https://github.com/Simply-Love/Simply-Love-SM5?tab=readme-ov-file">Teejusb's "Simply Love" osu! mania skins</a></h2>
<h3>If you are the artist of any of these songs, contact me through my email if you want them removed.</h3>
<h3>Credit of the songs goes to their respective creators.</h3>
<h3>Note that i am NOT making any money on this game, i just code occasionally for the fun of it. <3</h3>
<div id="songListModal" class="modal">
<div class="modal-content">
<span id="closeSongListModal" class="close"><i class="fa-solid fa-xmark"></i></span>
<span id="keywordListButton"><i class="fa-regular fa-circle-question"></i></span>
<div class="modal-header">
<h1 class="modal-title">Song List</h1>
</div>
<label for="songSearchInput">Search songs by keyword, index, album, or artist.</label><br /><br />
<label for="songSearchInput" id="pressEnter">Press "Enter" to play first result.</label><br /><br />
<input type="text" id="songSearchInput" placeholder="Search..." oninput="filterSongs()" /><br /><br />
<div id="resultsForSearch" style="display: none">Results found</div>
<button type="button" id="mostRecent" class="most-recent-button" style="display: none">Play most recent song</button>
<div id="noResultsTXT" style="display: none">No results found for your search.</div>
<br /><br />
<div class="modal-body" id="songList">
<!-- Song buttons will be dynamically inserted here -->
</div>
</div>
</div>
<!-- Keyword List Modal -->
<div id="keywordListModal" class="pop-up-modal">
<div class="modal-content">
<span id="closeKeywordListModal" class="close"><i class="fa-solid fa-xmark"></i></span>
<div class="modal-header">
<h1 class="modal-title">Keyword List</h1>
</div>
<div class="modal-body" id="keywordDescriptions">
<!-- Keyword descriptions will be dynamically inserted here -->
</div>
</div>
</div>
<!-- Selected Song Modal -->
<div id="selectedSongModal" class="modal">
<div class="modal-content">
<span id="closeSelectedSongModal" class="close"><i class="fa-solid fa-xmark"></i></span>
<h2 id="songTitle">Song Title</h2>
<div class="row align-items-center">
<div class="col-auto">
<img id="songCoverImage" src="" alt="Cover Image not found or your browser doesn't support HTML5 images." class="img-fluid" />
</div>
<div class="col">
<p><strong>Artist:</strong> <span id="songArtist">Artist Name</span></p>
<p><strong>BPM:</strong> <span id="songBPM">120</span></p>
<p>
<span id="speedTXT"><strong>Note Speed:</strong></span> <span id="songSpeed">15.5</span>
</p>
<div id="versionDropdownContainer" style="display: none">
<label for="versionDropdown"><strong>Choose version:</strong></label>
<select id="versionDropdown"></select>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" id="playSongButton" title="Press 'Enter' to play.">Play song!</button>
</div>
</div>
</div>
<script src="JavaScript/BeatzInit.js"></script>
<script src="JavaScript/BeatzSettings.js"></script>
<script src="JavaScript/BeatzGame.js"></script>
</body>
</html>