diff --git a/app.py b/app.py index a5effe2..a60b752 100755 --- a/app.py +++ b/app.py @@ -64,6 +64,11 @@ def create_app(): # The id parameter is captured, but you can use it as needed. return render_template('album.html') + @app.route('/track/') + def serve_track(id): + # The id parameter is captured, but you can use it as needed. + return render_template('track.html') + @app.route('/static/') def serve_static(path): return send_from_directory('static', path) diff --git a/static/css/track/track.css b/static/css/track/track.css new file mode 100644 index 0000000..e1b4ee5 --- /dev/null +++ b/static/css/track/track.css @@ -0,0 +1,130 @@ +/* Base Styles */ +* { + margin: 0; + padding: 0; + box-sizing: border-box; + font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; + } + + body { + background-color: #121212; + color: #ffffff; + min-height: 100vh; + line-height: 1.4; + } + + #app { + max-width: 1200px; + margin: 0 auto; + padding: 20px; + position: relative; + z-index: 1; + } + + /* Track Header */ + #track-header { + display: flex; + gap: 20px; + margin-bottom: 2rem; + align-items: center; + padding-bottom: 1.5rem; + border-bottom: 1px solid #2a2a2a; + flex-wrap: wrap; + } + + #track-album-image { + width: 200px; + height: 200px; + object-fit: cover; + border-radius: 8px; + flex-shrink: 0; + } + + #track-info { + flex: 1; + min-width: 0; + } + + #track-name { + font-size: 2rem; + margin-bottom: 0.5rem; + } + + #track-artist, + #track-album, + #track-duration, + #track-explicit { + font-size: 1rem; + color: #b3b3b3; + margin-bottom: 0.5rem; + } + + /* Loading and Error States */ + #loading, + #error { + width: 100%; + text-align: center; + font-size: 1rem; + padding: 1rem; + } + + #error { + color: #c0392b; + } + + /* Back Button Styling */ + .back-btn { + background-color: #333; + color: #fff; + border: none; + border-radius: 4px; + padding: 0.5rem 1rem; + font-size: 0.95rem; + cursor: pointer; + transition: background-color 0.2s ease, transform 0.2s ease; + margin-right: 1rem; + } + + .back-btn:hover { + background-color: #444; + } + + .back-btn:active { + transform: scale(0.98); + } + + /* Download Button Base Style (same as in the playlist project) */ + .download-btn { + background-color: #1db954; + color: #fff; + border: none; + border-radius: 4px; + padding: 0.5rem 1rem; + font-size: 0.95rem; + cursor: pointer; + transition: background-color 0.2s ease, transform 0.2s ease; + display: inline-flex; + align-items: center; + justify-content: center; + margin: 0.5rem; + } + + .download-btn:hover { + background-color: #17a44b; + } + + .download-btn:active { + transform: scale(0.98); + } + + /* Queue Toggle Button (if used elsewhere) */ + .queue-icon { + background: none; + border: none; + cursor: pointer; + } + + /* Utility Classes */ + .hidden { + display: none !important; + } \ No newline at end of file diff --git a/static/js/queue.js b/static/js/queue.js index cc5b5e9..7bd2326 100644 --- a/static/js/queue.js +++ b/static/js/queue.js @@ -1,315 +1,342 @@ // queue.js class DownloadQueue { - constructor() { - this.downloadQueue = {}; - this.prgInterval = null; - this.initDOM(); - this.initEventListeners(); - this.loadExistingPrgFiles(); - } - - /* DOM Management */ - initDOM() { - const queueHTML = ` -