Add sample song IDs

This commit is contained in:
2026-04-13 12:44:16 -07:00
parent 77059fd2b8
commit 976c331834
4 changed files with 88 additions and 1 deletions
+27
View File
@@ -480,6 +480,21 @@ window.onhashchange = () => {
const MAX_REQUESTS = 10;
const REQUEST_POLL_MS = 5000;
/** BeatSaver map keys for the debug “example” control (cycles on each click). */
const DEBUG_BSR_EXAMPLE_IDS = [
"43239",
"4b55e",
"49201",
"35a5e",
"2c25a",
"3864b",
"2d205",
"41d08",
"e298",
] as const;
let debugBsrExampleIndex = 0;
const requestListEl = must<HTMLOListElement>("requestList");
const requestOverlayEl = must<HTMLElement>("requestOverlay");
const requestEmptyEl = must<HTMLElement>("requestEmpty");
@@ -641,6 +656,18 @@ async function bootstrap() {
void applyDebugSong();
}
};
const debugSongIdExampleBtn = must<HTMLButtonElement>("debugSongIdExample");
const syncDebugBsrExampleButton = () => {
debugSongIdExampleBtn.textContent = DEBUG_BSR_EXAMPLE_IDS[debugBsrExampleIndex];
};
syncDebugBsrExampleButton();
debugSongIdExampleBtn.onclick = () => {
const id = DEBUG_BSR_EXAMPLE_IDS[debugBsrExampleIndex];
debugBsrExampleIndex = (debugBsrExampleIndex + 1) % DEBUG_BSR_EXAMPLE_IDS.length;
debugSongIdInput.value = id;
debugSongIdInput.dispatchEvent(new Event("input", { bubbles: true }));
syncDebugBsrExampleButton();
};
document.documentElement.onclick = () => document.body.classList.toggle("preview");
must<HTMLElement>("settings").onclick = (e: MouseEvent) => e.stopPropagation();