From bc15951b0600c9ba166032a0feeb721b1f18ac5f Mon Sep 17 00:00:00 2001 From: 2weiEmu Date: Fri, 19 Jun 2026 16:08:34 +0200 Subject: [PATCH] added: simple song file preview --- public/css/index.css | 1 + public/js/index.js | 9 +++++++++ testing/songs/{A touch of class.m4a => null} | 0 3 files changed, 10 insertions(+) rename testing/songs/{A touch of class.m4a => null} (100%) 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 -- 2.54.0