From 8b99d538fc5b0a0872545c273c1a8a2c7fba0fc1 Mon Sep 17 00:00:00 2001 From: lelo Date: Mon, 17 Mar 2025 17:09:30 +0000 Subject: [PATCH] improve user experience --- app.py | 2 +- static/app.js | 150 ++++++++++++----- static/gallery.js | 369 +++++++++++++++++++++--------------------- static/styles.css | 81 ++++------ templates/browse.html | 32 ++-- 5 files changed, 349 insertions(+), 285 deletions(-) diff --git a/app.py b/app.py index 861a5bf..da364ef 100755 --- a/app.py +++ b/app.py @@ -246,4 +246,4 @@ def index(path): return render_template("browse.html") if __name__ == "__main__": - app.run(debug=True, host='0.0.0.0') + app.run(debug=True, host='0.0.0.0') \ No newline at end of file diff --git a/static/app.js b/static/app.js index 2f8cf58..2ca52e0 100644 --- a/static/app.js +++ b/static/app.js @@ -1,3 +1,7 @@ +// Define global variables to track music files and the current index. +let currentMusicFiles = []; // Array of objects with at least { path, index } +let currentMusicIndex = -1; // Index of the current music file + // Helper function: decode each segment then re-encode to avoid double encoding. function encodeSubpath(subpath) { if (!subpath) return ''; @@ -46,15 +50,19 @@ function renderContent(data) { // Render files. if (data.files.length > 0) { contentHTML += '