From 976c331834ac4e5ddb9a53ee17321e5d42af2964 Mon Sep 17 00:00:00 2001 From: pleb Date: Mon, 13 Apr 2026 12:44:16 -0700 Subject: [PATCH] Add sample song IDs --- index.css | 31 +++++++++++++++++++++++++++++++ index.html | 5 ++++- index.js | 26 ++++++++++++++++++++++++++ src/client/index.ts | 27 +++++++++++++++++++++++++++ 4 files changed, 88 insertions(+), 1 deletion(-) diff --git a/index.css b/index.css index 8bb1e15..40e82f1 100644 --- a/index.css +++ b/index.css @@ -412,3 +412,34 @@ body.bottom #time { float: right; margin-left: 1em; } + +#settings .debugSongIdRow { + display: flex; + align-items: baseline; + gap: 0.5em; +} + +#debugSongIdInput { + flex: 0 0 10rem; + width: 10rem; + max-width: 50%; +} + +/* One wrapper sets weight; inner + +
About This is a fork of Iza's overlay diff --git a/index.js b/index.js index 50b907a..c82d725 100644 --- a/index.js +++ b/index.js @@ -580,6 +580,18 @@ window.onhashchange = () => { }; var MAX_REQUESTS = 10; var REQUEST_POLL_MS = 5e3; +var DEBUG_BSR_EXAMPLE_IDS = [ + "43239", + "4b55e", + "49201", + "35a5e", + "2c25a", + "3864b", + "2d205", + "41d08", + "e298" +]; +var debugBsrExampleIndex = 0; var requestListEl = must("requestList"); var requestOverlayEl = must("requestOverlay"); var requestEmptyEl = must("requestEmpty"); @@ -742,6 +754,20 @@ async function bootstrap() { void applyDebugSong(); } }; + const debugSongIdExampleBtn = must("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("settings").onclick = (e) => e.stopPropagation(); void loadRequestQueue(); diff --git a/src/client/index.ts b/src/client/index.ts index 4d69584..0cbd4ff 100644 --- a/src/client/index.ts +++ b/src/client/index.ts @@ -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("requestList"); const requestOverlayEl = must("requestOverlay"); const requestEmptyEl = must("requestEmpty"); @@ -641,6 +656,18 @@ async function bootstrap() { void applyDebugSong(); } }; + const debugSongIdExampleBtn = must("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("settings").onclick = (e: MouseEvent) => e.stopPropagation();