-
-
-
Loading...
+
+
-
-
sync
-
⏮
-
▶
-
⏭
-
-
0:00/0:00
-
-
-
-
-
🔊
-
+
+
+
+
+
+
sync
+
⏮
+
▶
+
⏭
+
+
0:00/0:00
+
+
+
+
+
+ 🔊
+
+
-
diff --git a/public/styles.css b/public/styles.css
index 268adc5..89bcab8 100644
--- a/public/styles.css
+++ b/public/styles.css
@@ -1,23 +1,42 @@
* { margin: 0; padding: 0; box-sizing: border-box; }
-body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: #111; color: #eee; display: flex; justify-content: center; align-items: center; min-height: 100vh; }
-#app { width: 100%; max-width: 480px; padding: 2rem; }
-h1 { font-size: 1.2rem; color: #888; margin-bottom: 1.5rem; display: flex; align-items: center; gap: 0.5rem; }
+body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: #111; color: #eee; min-height: 100vh; }
+#app { width: 100%; max-width: 1200px; margin: 0 auto; padding: 1rem; display: flex; flex-direction: column; min-height: 100vh; }
+h1 { font-size: 1.2rem; color: #888; margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem; }
+h3 { font-size: 0.9rem; color: #666; margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.05em; }
#sync-indicator { width: 8px; height: 8px; border-radius: 50%; background: #4e8; display: none; flex-shrink: 0; }
#sync-indicator.visible { display: inline-block; }
#sync-indicator.disconnected { background: #e44; }
-#stream-select { margin-bottom: 1.5rem; }
+
+/* Header */
+#header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
+#auth-section { display: flex; gap: 0.5rem; align-items: center; }
+#auth-section .user-info { display: flex; align-items: center; gap: 0.5rem; }
+#auth-section .username { color: #4e8; font-weight: 600; }
+#auth-section .admin-badge { background: #c4f; color: #111; padding: 0.1rem 0.4rem; border-radius: 3px; font-size: 0.7rem; }
#stream-select select { background: #222; color: #eee; border: 1px solid #333; padding: 0.4rem 0.8rem; border-radius: 4px; font-size: 0.9rem; }
-#now-playing { margin-bottom: 0.5rem; }
-#stream-name { font-size: 0.85rem; color: #888; margin-bottom: 0.2rem; }
-#track-name { font-size: 1.4rem; font-weight: 600; }
+
+/* Main content - library and playlist */
+#main-content { display: flex; gap: 1rem; flex: 1; min-height: 0; margin-bottom: 1rem; }
+#library-panel, #playlist-panel { flex: 1; background: #1a1a1a; border-radius: 8px; padding: 1rem; display: flex; flex-direction: column; min-height: 300px; max-height: 60vh; }
+#library, #playlist { flex: 1; overflow-y: auto; }
+#library .track, #playlist .track { padding: 0.5rem 0.75rem; border-radius: 4px; cursor: pointer; font-size: 0.9rem; display: flex; justify-content: space-between; }
+#library .track:hover, #playlist .track:hover { background: #222; }
+#playlist .track.active { background: #2a4a3a; color: #4e8; }
+#library .track .duration, #playlist .track .duration { color: #666; font-size: 0.8rem; }
+
+/* Player bar */
+#player-bar { background: #1a1a1a; border-radius: 8px; padding: 1rem; display: flex; gap: 1rem; align-items: center; }
+#now-playing { min-width: 200px; }
+#stream-name { font-size: 0.75rem; color: #666; margin-bottom: 0.2rem; }
+#track-name { font-size: 1rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
+#player-controls { flex: 1; }
+#progress-row { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.3rem; }
+#progress-row.denied { animation: flash-red 0.5s ease-out; }
+@keyframes flash-red { 0% { background: #e44; } 100% { background: transparent; } }
#btn-sync { font-size: 0.75rem; cursor: pointer; color: #666; transition: color 0.2s, text-shadow 0.2s; letter-spacing: 0.05em; }
#btn-sync:hover { color: #888; }
#btn-sync.synced { color: #eb0; text-shadow: 0 0 8px #eb0, 0 0 12px #eb0; }
#btn-sync.synced.connected { color: #4e8; text-shadow: 0 0 8px #4e8, 0 0 12px #4e8; }
-#time { font-size: 0.8rem; color: #888; margin: 0; line-height: 1; }
-#progress-row { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
-#progress-row.denied { animation: flash-red 0.5s ease-out; }
-@keyframes flash-red { 0% { background: #e44; } 100% { background: transparent; } }
#btn-prev, #btn-next { font-size: 0.8rem; cursor: pointer; opacity: 0.6; transition: opacity 0.2s; }
#btn-prev:hover, #btn-next:hover { opacity: 1; }
#status-icon { font-size: 0.9rem; width: 1rem; text-align: center; cursor: pointer; }
@@ -27,26 +46,26 @@ h1 { font-size: 1.2rem; color: #888; margin-bottom: 1.5rem; display: flex; align
#progress-bar.playing.local { background: #c4f; }
#progress-bar.muted { background: #555 !important; }
#seek-tooltip { position: absolute; bottom: 12px; background: #333; color: #eee; padding: 2px 6px; border-radius: 3px; font-size: 0.75rem; pointer-events: none; display: none; transform: translateX(-50%); }
-#buffer-bar { display: flex; gap: 2px; margin-bottom: 0.5rem; }
-#buffer-bar .segment { flex: 1; height: 4px; background: #333; border-radius: 2px; }
+#time { font-size: 0.8rem; color: #888; margin: 0; line-height: 1; white-space: nowrap; }
+#buffer-bar { display: flex; gap: 2px; margin-bottom: 0.3rem; }
+#buffer-bar .segment { flex: 1; height: 3px; background: #333; border-radius: 2px; }
#buffer-bar .segment.available { background: #396; }
#buffer-bar .segment.loading { background: #666; animation: throb 0.6s ease-in-out infinite alternate; }
@keyframes throb { from { background: #444; } to { background: #888; } }
-#download-speed { font-size: 0.7rem; color: #666; text-align: right; margin-bottom: 0.5rem; }
-#time { display: flex; justify-content: space-between; font-size: 0.8rem; color: #888; margin-bottom: 1rem; }
-#controls { display: flex; gap: 0.5rem; align-items: center; }
+#download-speed { font-size: 0.65rem; color: #555; text-align: right; }
+#volume-controls { display: flex; gap: 0.5rem; align-items: center; }
#btn-mute { font-size: 1.2rem; cursor: pointer; opacity: 0.8; transition: opacity 0.2s; }
#btn-mute:hover { opacity: 1; }
-#volume { width: 100px; accent-color: #4e8; }
+#volume { width: 80px; accent-color: #4e8; }
+
+/* Common */
button { background: #222; color: #eee; border: 1px solid #333; padding: 0.5rem 1.2rem; border-radius: 4px; cursor: pointer; font-size: 0.9rem; }
button:hover { background: #333; }
-#status { margin-top: 1.5rem; font-size: 0.8rem; color: #666; }
+#status { margin-top: 0.5rem; font-size: 0.8rem; color: #666; text-align: center; }
.empty { color: #666; font-style: italic; }
-#auth-section { margin-bottom: 1.5rem; display: flex; gap: 0.5rem; align-items: center; justify-content: space-between; }
-#auth-section .user-info { display: flex; align-items: center; gap: 0.5rem; }
-#auth-section .username { color: #4e8; font-weight: 600; }
-#auth-section .admin-badge { background: #c4f; color: #111; padding: 0.1rem 0.4rem; border-radius: 3px; font-size: 0.7rem; }
-#login-panel { display: flex; flex-direction: column; gap: 1rem; padding: 2rem; background: #1a1a1a; border-radius: 8px; border: 1px solid #333; }
+
+/* Login panel */
+#login-panel { display: flex; flex-direction: column; gap: 1rem; padding: 2rem; background: #1a1a1a; border-radius: 8px; border: 1px solid #333; max-width: 400px; margin: auto; }
#login-panel.hidden { display: none; }
#login-panel h2 { font-size: 1.1rem; color: #888; margin-bottom: 0.5rem; }
#login-panel .tabs { display: flex; gap: 1rem; margin-bottom: 1rem; }
@@ -64,14 +83,11 @@ button:hover { background: #333; }
#guest-section .divider::before, #guest-section .divider::after { content: ""; flex: 1; height: 1px; background: #333; }
#guest-section .guest-btn { width: 100%; background: #333; color: #eee; border: 1px solid #444; padding: 0.6rem; border-radius: 4px; font-size: 0.95rem; cursor: pointer; }
#guest-section .guest-btn:hover { background: #444; }
-#player-content { display: none; }
-#player-content.visible { display: block; }
-#playlist { margin-top: 1.5rem; max-height: 300px; overflow-y: auto; }
-#playlist .track { padding: 0.5rem 0.75rem; border-radius: 4px; cursor: pointer; font-size: 0.9rem; display: flex; justify-content: space-between; }
-#playlist .track:hover { background: #222; }
-#playlist .track.active { background: #2a4a3a; color: #4e8; }
-#playlist .track .duration { color: #666; font-size: 0.8rem; }
-::-webkit-scrollbar { width: 12px; }
-::-webkit-scrollbar-track { background-color: #000; border-radius: 6px; }
-::-webkit-scrollbar-thumb { background-color: #333; border-radius: 6px; }
+
+#player-content { display: none; flex-direction: column; flex: 1; }
+#player-content.visible { display: flex; }
+
+::-webkit-scrollbar { width: 8px; }
+::-webkit-scrollbar-track { background-color: #111; border-radius: 4px; }
+::-webkit-scrollbar-thumb { background-color: #333; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background-color: #555; }
diff --git a/server.ts b/server.ts
index 4d0887c..c34e411 100644
--- a/server.ts
+++ b/server.ts
@@ -71,16 +71,25 @@ async function discoverTracks(): Promise
{
}
}
-// Initialize streams
+// Store all library tracks
+let libraryTracks: Track[] = [];
+
+// Initialize streams and library
async function init(): Promise