From: 2weiEmu Date: Fri, 19 Jun 2026 14:08:34 +0000 (+0200) Subject: added: simple song file preview X-Git-Url: https://git.saalbach.dev/?a=commitdiff_plain;h=bc15951b0600c9ba166032a0feeb721b1f18ac5f;p=binbsis50-sm.git added: simple song file preview --- diff --git a/public/css/index.css b/public/css/index.css index 03a85ce..c618f2a 100644 --- a/public/css/index.css +++ b/public/css/index.css @@ -119,6 +119,7 @@ button { margin: 20px 15px 20px 15px; padding: 20px 0 20px 0; border-radius: 10px; + justify-content: space-between; * { margin: auto 15px auto 15px; diff --git a/public/js/index.js b/public/js/index.js index d724d98..3f6721d 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -44,7 +44,16 @@ function NewSongFileElement(songFileName) { songFileElement.addEventListener("click", (_) => { renameSongFile(songFileName) }) + let audioPreview = document.createElement("audio") + audioPreview.controls = true + + let audioSource = document.createElement("source") + audioSource.src = "binb.sis50.nl/songs/" + songFileName // TODO: hardcoded + + audioPreview.appendChild(audioSource) + songFileElement.appendChild(songFileNameP) + songFileElement.appendChild(audioPreview) return songFileElement } diff --git a/testing/songs/A touch of class.m4a b/testing/songs/null similarity index 100% rename from testing/songs/A touch of class.m4a rename to testing/songs/null