Gcuore commited on
Commit
cc72760
·
verified ·
1 Parent(s): dc0b30b

I already have a working music player UI, similar to the one shown in the screenshots. It includes: Date and time at the top Album cover (centered) Song title, artist, and album info below the cover Playback progress bar and controls at the bottom Do not rebuild it from scratch. I just want you to fix the issues without changing the structure or layout. Please fix the following: Alignment issues – make sure all elements (time, cover art, text, controls) are properly centered and spaced. Text readability – improve contrast and legibility of song title and artist text over the blurred background. Cover art scaling – keep the image centered and proportionate across screen sizes. Preserve the blurred background, but make sure it doesn’t wash out or overpower the UI. Do not remove or redesign any components. Make it responsive – ensure the layout works well on both desktop and mobile. Only clean up and improve the existing HTML/CSS/JS. Keep the aesthetic somewhat quirky/indie – it shouldn’t look corporate or overly polished. - Follow Up Deployment

Browse files
Files changed (1) hide show
  1. index.html +41 -31
index.html CHANGED
@@ -37,12 +37,14 @@
37
 
38
  </button>
39
 
40
- <div id="music-player" style="display: none; position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: transparent; padding: 10px; width: 90%; max-width: 300px; z-index: 50;">
41
  <div style="display: flex; flex-direction: column; align-items: center; gap: 8px;">
42
- <div id="album-art-container" style="width: 100%; max-width: min(150px, 25vw); aspect-ratio: 1/1; margin: 0 auto 10px;">
43
- <img id="album-art" src="" style="width: 100%; height: 100%; object-fit: cover; border-radius: 10px;">
 
44
  </div>
45
- <div id="track-info" style="text-align: center; color: white; text-shadow: 0 1px 3px rgba(0,0,0,0.5); width: 100%; padding: 0 10px;">
 
46
  <div id="track-title" style="font-size: clamp(14px, 4vw, 18px); font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;">No song playing</div>
47
  <div id="track-artist" style="font-size: clamp(12px, 3vw, 14px); opacity: 0.8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;">Upload a song to begin</div>
48
  </div>
@@ -51,15 +53,37 @@
51
  <input type="range" id="progress-bar" style="flex-grow: 1; height: 4px;" min="0" max="100" value="0">
52
  <span id="duration" style="font-size: 11px;">0:00</span>
53
  </div>
54
- <div style="display: flex; justify-content: center; gap: clamp(8px, 4vw, 16px); margin-top: 8px;">
55
- <button id="prev-btn" style="background: none; border: none; color: white; font-size: 20px;">⏮</button>
56
- <button id="play-btn" style="background: none; border: none; color: white; font-size: 30px;">▶</button>
57
- <button id="next-btn" style="background: none; border: none; color: white; font-size: 20px;">⏭</button>
 
58
  </div>
59
  </div>
60
  </div>
61
 
62
  <style>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  .clock-container {
64
  position: fixed;
65
  top: 20px;
@@ -72,10 +96,11 @@
72
  border-radius: 12px;
73
  padding: 20px;
74
  backdrop-filter: none;
 
75
  }
76
 
77
  .clock-time {
78
- font-size: 64px;
79
  font-weight: 700;
80
  letter-spacing: -2px;
81
  opacity: 0.55;
@@ -83,7 +108,7 @@
83
  }
84
 
85
  .clock-date {
86
- font-size: 18px;
87
  font-weight: 600;
88
  letter-spacing: -0.3px;
89
  opacity: 0.55;
@@ -216,8 +241,12 @@
216
  const base64String = arrayBufferToBase64(tags.picture.data);
217
  const imageUrl = `data:${tags.picture.format};base64,${base64String}`;
218
  document.getElementById('album-art').src = imageUrl;
 
219
  } else {
220
  document.getElementById('album-art').src = '';
 
 
 
221
  }
222
 
223
  document.getElementById('music-player').style.display = 'block';
@@ -274,28 +303,9 @@
274
  const img = new Image();
275
  img.src = imageUrl;
276
  img.onload = function() {
277
- // Create a small canvas to analyze the image
278
- const canvas = document.createElement('canvas');
279
- const ctx = canvas.getContext('2d');
280
- canvas.width = 16;
281
- canvas.height = 16;
282
- ctx.drawImage(img, 0, 0, 16, 16);
283
-
284
- // Get dominant color
285
- const pixelData = ctx.getImageData(0, 0, 16, 16).data;
286
- let r = 0, g = 0, b = 0;
287
- for (let i = 0; i < pixelData.length; i += 4) {
288
- r += pixelData[i];
289
- g += pixelData[i + 1];
290
- b += pixelData[i + 2];
291
- }
292
- r = Math.floor(r / (pixelData.length / 4));
293
- g = Math.floor(g / (pixelData.length / 4));
294
- b = Math.floor(b / (pixelData.length / 4));
295
-
296
- // Apply background with blur
297
  document.body.style.background = `
298
- linear-gradient(rgba(${r}, ${g}, ${b}, 0.7), rgba(${r}, ${g}, ${b}, 0.9)),
299
  url(${imageUrl})
300
  `;
301
  document.body.style.backgroundSize = 'cover';
 
37
 
38
  </button>
39
 
40
+ <div id="music-player" style="display: none; position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: transparent; padding: clamp(10px, 4vw, 15px); width: min(95%, 400px); border-radius: 20px; z-index: 50;">
41
  <div style="display: flex; flex-direction: column; align-items: center; gap: 8px;">
42
+ <div id="album-art-container" style="width: min(250px, 60vw); aspect-ratio: 1/1; margin: -120px auto 10px; position: relative; z-index: 60; pointer-events: none;">
43
+ <div style="position: absolute; width: 100%; height: 100%; background: transparent; pointer-events: auto;"></div>
44
+ <img id="album-art" src="" style="width: 100%; height: 100%; object-fit: cover; border-radius: 15px; box-shadow: 0 8px 20px rgba(0,0,0,0.3);">
45
  </div>
46
+ <div style="background: rgba(30,30,30,0.5); backdrop-filter: blur(20px); border-radius: 15px; padding: clamp(10px, 3vw, 15px); width: 100%; margin-top: 10px;">
47
+ <div id="track-info" style="text-align: center; color: white; text-shadow: 0 1px 3px rgba(0,0,0,0.5); width: 100%; padding: 0 clamp(5px, 3vw, 10px);">
48
  <div id="track-title" style="font-size: clamp(14px, 4vw, 18px); font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;">No song playing</div>
49
  <div id="track-artist" style="font-size: clamp(12px, 3vw, 14px); opacity: 0.8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;">Upload a song to begin</div>
50
  </div>
 
53
  <input type="range" id="progress-bar" style="flex-grow: 1; height: 4px;" min="0" max="100" value="0">
54
  <span id="duration" style="font-size: 11px;">0:00</span>
55
  </div>
56
+ <div style="display: flex; justify-content: center; gap: clamp(8px, 4vw, 20px); margin-top: clamp(8px, 3vw, 10px);">
57
+ <button id="prev-btn" style="background: none; border: none; color: white; font-size: clamp(14px, 4vw, 20px);">⏮</button>
58
+ <button id="play-btn" style="background: none; border: none; color: white; font-size: clamp(20px, 5vw, 30px);">▶</button>
59
+ <button id="next-btn" style="background: none; border: none; color: white; font-size: clamp(14px, 4vw, 20px);">⏭</button>
60
+ </div>
61
  </div>
62
  </div>
63
  </div>
64
 
65
  <style>
66
+ @media (max-width: 500px) {
67
+ #music-player {
68
+ width: 90% !important;
69
+ bottom: 10px !important;
70
+ }
71
+
72
+ #album-art-container {
73
+ width: min(200px, 80vw) !important;
74
+ margin: -80px auto 10px !important;
75
+ }
76
+
77
+ .clock-container {
78
+ top: 10px;
79
+ padding: 15px;
80
+ }
81
+
82
+ .clock-time {
83
+ font-size: clamp(40px, 12vw, 48px) !important;
84
+ }
85
+ }
86
+
87
  .clock-container {
88
  position: fixed;
89
  top: 20px;
 
96
  border-radius: 12px;
97
  padding: 20px;
98
  backdrop-filter: none;
99
+ margin-bottom: 100px;
100
  }
101
 
102
  .clock-time {
103
+ font-size: clamp(48px, 10vw, 64px);
104
  font-weight: 700;
105
  letter-spacing: -2px;
106
  opacity: 0.55;
 
108
  }
109
 
110
  .clock-date {
111
+ font-size: clamp(14px, 3vw, 18px);
112
  font-weight: 600;
113
  letter-spacing: -0.3px;
114
  opacity: 0.55;
 
241
  const base64String = arrayBufferToBase64(tags.picture.data);
242
  const imageUrl = `data:${tags.picture.format};base64,${base64String}`;
243
  document.getElementById('album-art').src = imageUrl;
244
+ setBackgroundFromImage(imageUrl);
245
  } else {
246
  document.getElementById('album-art').src = '';
247
+ // Reset to default background if no album art
248
+ document.body.style.background = 'transparent';
249
+ document.body.style.backdropFilter = 'none';
250
  }
251
 
252
  document.getElementById('music-player').style.display = 'block';
 
303
  const img = new Image();
304
  img.src = imageUrl;
305
  img.onload = function() {
306
+ // Apply background with blur and overlay
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
307
  document.body.style.background = `
308
+ linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.6)),
309
  url(${imageUrl})
310
  `;
311
  document.body.style.backgroundSize = 'cover';