arthur6583 commited on
Commit
2750efe
·
verified ·
1 Parent(s): ccb6073

Rend les page fonctionnel

Browse files
Files changed (1) hide show
  1. index.html +127 -53
index.html CHANGED
@@ -114,55 +114,52 @@
114
  <!-- Header -->
115
  <header class="p-4 flex justify-between items-center border-b border-accent">
116
  <div class="flex items-center">
117
- <i data-feather="menu" class="mr-4 text-light"></i>
118
  <h1 class="text-xl font-bold gradient-text">Melodify</h1>
119
  </div>
120
  <div class="flex items-center">
121
- <i data-feather="search" class="mr-4 text-light"></i>
122
- <i data-feather="user" class="text-light"></i>
123
  </div>
124
  </header>
125
-
126
- <!-- Main Content -->
127
  <main class="flex-1 overflow-y-auto scroll-hidden p-4">
128
  <!-- Now Playing Section -->
129
  <section class="mb-8">
130
  <h2 class="text-lg font-semibold mb-4">Now Playing</h2>
131
  <div class="flex justify-center mb-6">
132
  <div class="relative">
133
- <img src="https://huggingface.co/spaces/arthur6583/melodify/resolve/main/images/Screenshot_2025-10-13-03-24-06-08_2ca4e1d5ec83da2f54025413ac83b968.jpg" alt="Album Art" class="album-art w-64 h-64 rounded-2xl object-cover">
134
  <div class="absolute inset-0 flex items-center justify-center">
135
- <div class="bg-black bg-opacity-50 rounded-full p-4">
136
- <i data-feather="play" class="w-12 h-12 text-white"></i>
137
  </div>
138
  </div>
139
  </div>
140
  </div>
141
  <div class="text-center mb-2">
142
- <h3 class="text-xl font-bold">Blinding Lights</h3>
143
- <p class="text-gray-400">The Weeknd</p>
144
  </div>
145
-
146
- <!-- Progress Bar -->
147
  <div class="mb-2">
148
  <div class="flex justify-between text-sm text-gray-400 mb-1">
149
- <span>1:23</span>
150
- <span>3:45</span>
151
  </div>
152
- <input type="range" min="0" max="100" value="35" class="player-progress w-full">
153
  </div>
154
-
155
  <!-- Player Controls -->
156
  <div class="flex justify-center items-center space-x-8 mt-6">
157
- <i data-feather="shuffle" class="text-gray-400"></i>
158
- <i data-feather="skip-back" class="w-8 h-8 text-light"></i>
159
- <div class="bg-primary rounded-full p-3">
160
- <i data-feather="pause" class="w-8 h-8 text-white"></i>
161
  </div>
162
- <i data-feather="skip-forward" class="w-8 h-8 text-light"></i>
163
- <i data-feather="repeat" class="text-gray-400"></i>
164
  </div>
165
- </section>
166
 
167
  <!-- Recently Played -->
168
  <section>
@@ -170,10 +167,9 @@
170
  <h2 class="text-lg font-semibold">Recently Played</h2>
171
  <span class="text-primary text-sm">See All</span>
172
  </div>
173
-
174
  <div class="space-y-3">
175
  <!-- Song Item -->
176
- <div class="flex items-center p-3 rounded-lg active-song">
177
  <img src="http://static.photos/music/60x60/12" alt="Song" class="w-12 h-12 rounded-lg object-cover mr-4">
178
  <div class="flex-1">
179
  <h4 class="font-medium">Save Your Tears</h4>
@@ -187,12 +183,11 @@
187
  <div class="music-bar"></div>
188
  <div class="music-bar"></div>
189
  </div>
190
- <i data-feather="more-vertical" class="text-gray-400"></i>
191
  </div>
192
  </div>
193
-
194
  <!-- Song Item -->
195
- <div class="flex items-center p-3 rounded-lg bg-accent">
196
  <img src="http://static.photos/music/60x60/23" alt="Song" class="w-12 h-12 rounded-lg object-cover mr-4">
197
  <div class="flex-1">
198
  <h4 class="font-medium">Levitating</h4>
@@ -200,12 +195,11 @@
200
  </div>
201
  <div class="flex items-center">
202
  <span class="text-gray-400 text-sm mr-3">3:24</span>
203
- <i data-feather="more-vertical" class="text-gray-400"></i>
204
  </div>
205
  </div>
206
-
207
  <!-- Song Item -->
208
- <div class="flex items-center p-3 rounded-lg bg-accent">
209
  <img src="http://static.photos/music/60x60/34" alt="Song" class="w-12 h-12 rounded-lg object-cover mr-4">
210
  <div class="flex-1">
211
  <h4 class="font-medium">Stay</h4>
@@ -213,12 +207,11 @@
213
  </div>
214
  <div class="flex items-center">
215
  <span class="text-gray-400 text-sm mr-3">2:59</span>
216
- <i data-feather="more-vertical" class="text-gray-400"></i>
217
  </div>
218
  </div>
219
-
220
  <!-- Song Item -->
221
- <div class="flex items-center p-3 rounded-lg bg-accent">
222
  <img src="http://static.photos/music/60x60/45" alt="Song" class="w-12 h-12 rounded-lg object-cover mr-4">
223
  <div class="flex-1">
224
  <h4 class="font-medium">Good 4 U</h4>
@@ -226,56 +219,137 @@
226
  </div>
227
  <div class="flex items-center">
228
  <span class="text-gray-400 text-sm mr-3">2:58</span>
229
- <i data-feather="more-vertical" class="text-gray-400"></i>
230
  </div>
231
  </div>
232
- </div>
233
  </section>
234
  </main>
235
 
236
  <!-- Navigation -->
237
  <nav class="flex justify-around items-center p-4 border-t border-accent bg-secondary">
238
  <div class="flex flex-col items-center text-primary">
239
- <i data-feather="home" class="w-6 h-6"></i>
240
  <span class="text-xs mt-1">Home</span>
241
  </div>
242
  <div class="flex flex-col items-center text-gray-400">
243
- <i data-feather="search" class="w-6 h-6"></i>
244
  <span class="text-xs mt-1">Search</span>
245
  </div>
246
  <div class="flex flex-col items-center text-gray-400">
247
- <i data-feather="book" class="w-6 h-6"></i>
248
  <span class="text-xs mt-1">Library</span>
249
  </div>
250
  <div class="flex flex-col items-center text-gray-400">
251
- <i data-feather="heart" class="w-6 h-6"></i>
252
  <span class="text-xs mt-1">Favorites</span>
253
  </div>
254
  <div class="flex flex-col items-center text-gray-400">
255
- <i data-feather="user" class="w-6 h-6"></i>
256
  <span class="text-xs mt-1">Profile</span>
257
  </div>
258
  </nav>
259
- </div>
260
-
261
  <script>
262
  feather.replace();
263
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
264
  // Simulate music progress
265
- const progressBar = document.querySelector('.player-progress');
 
266
  let progress = 35;
267
 
268
  setInterval(() => {
269
- progress += 0.1;
270
- if (progress > 100) progress = 0;
271
- progressBar.value = progress;
272
-
273
- // Update time display
274
- const currentTime = document.querySelector('.text-sm.text-gray-400:first-child');
275
- const minutes = Math.floor(progress * 2.2 / 60);
276
- const seconds = Math.floor(progress * 2.2 % 60);
277
- currentTime.textContent = `${minutes}:${seconds < 10 ? '0' : ''}${seconds}`;
 
 
278
  }, 1000);
 
 
 
 
279
  </script>
280
  </body>
281
  </html>
 
114
  <!-- Header -->
115
  <header class="p-4 flex justify-between items-center border-b border-accent">
116
  <div class="flex items-center">
117
+ <i data-feather="menu" class="mr-4 text-light cursor-pointer" onclick="toggleMenu()"></i>
118
  <h1 class="text-xl font-bold gradient-text">Melodify</h1>
119
  </div>
120
  <div class="flex items-center">
121
+ <a href="search.html"><i data-feather="search" class="mr-4 text-light cursor-pointer"></i></a>
122
+ <i data-feather="user" class="text-light cursor-pointer"></i>
123
  </div>
124
  </header>
125
+ <!-- Main Content -->
 
126
  <main class="flex-1 overflow-y-auto scroll-hidden p-4">
127
  <!-- Now Playing Section -->
128
  <section class="mb-8">
129
  <h2 class="text-lg font-semibold mb-4">Now Playing</h2>
130
  <div class="flex justify-center mb-6">
131
  <div class="relative">
132
+ <img id="albumArt" src="https://huggingface.co/spaces/arthur6583/melodify/resolve/main/images/Screenshot_2025-10-13-03-24-06-08_2ca4e1d5ec83da2f54025413ac83b968.jpg" alt="Album Art" class="album-art w-64 h-64 rounded-2xl object-cover">
133
  <div class="absolute inset-0 flex items-center justify-center">
134
+ <div class="bg-black bg-opacity-50 rounded-full p-4 cursor-pointer" onclick="togglePlay()">
135
+ <i data-feather="play" class="w-12 h-12 text-white" id="playIcon"></i>
136
  </div>
137
  </div>
138
  </div>
139
  </div>
140
  <div class="text-center mb-2">
141
+ <h3 id="songTitle" class="text-xl font-bold">Blinding Lights</h3>
142
+ <p id="artistName" class="text-gray-400">The Weeknd</p>
143
  </div>
144
+ <!-- Progress Bar -->
 
145
  <div class="mb-2">
146
  <div class="flex justify-between text-sm text-gray-400 mb-1">
147
+ <span id="currentTime">1:23</span>
148
+ <span id="totalTime">3:45</span>
149
  </div>
150
+ <input type="range" min="0" max="100" value="35" class="player-progress w-full" id="progressBar">
151
  </div>
 
152
  <!-- Player Controls -->
153
  <div class="flex justify-center items-center space-x-8 mt-6">
154
+ <i data-feather="shuffle" class="text-gray-400 cursor-pointer"></i>
155
+ <i data-feather="skip-back" class="w-8 h-8 text-light cursor-pointer" onclick="previousSong()"></i>
156
+ <div class="bg-primary rounded-full p-3 cursor-pointer" onclick="togglePlay()">
157
+ <i data-feather="pause" class="w-8 h-8 text-white" id="playPauseIcon"></i>
158
  </div>
159
+ <i data-feather="skip-forward" class="w-8 h-8 text-light cursor-pointer" onclick="nextSong()"></i>
160
+ <i data-feather="repeat" class="text-gray-400 cursor-pointer"></i>
161
  </div>
162
+ </section>
163
 
164
  <!-- Recently Played -->
165
  <section>
 
167
  <h2 class="text-lg font-semibold">Recently Played</h2>
168
  <span class="text-primary text-sm">See All</span>
169
  </div>
 
170
  <div class="space-y-3">
171
  <!-- Song Item -->
172
+ <div class="flex items-center p-3 rounded-lg active-song cursor-pointer" onclick="playSong(0)">
173
  <img src="http://static.photos/music/60x60/12" alt="Song" class="w-12 h-12 rounded-lg object-cover mr-4">
174
  <div class="flex-1">
175
  <h4 class="font-medium">Save Your Tears</h4>
 
183
  <div class="music-bar"></div>
184
  <div class="music-bar"></div>
185
  </div>
186
+ <i data-feather="more-vertical" class="text-gray-400 cursor-pointer"></i>
187
  </div>
188
  </div>
 
189
  <!-- Song Item -->
190
+ <div class="flex items-center p-3 rounded-lg bg-accent cursor-pointer" onclick="playSong(1)">
191
  <img src="http://static.photos/music/60x60/23" alt="Song" class="w-12 h-12 rounded-lg object-cover mr-4">
192
  <div class="flex-1">
193
  <h4 class="font-medium">Levitating</h4>
 
195
  </div>
196
  <div class="flex items-center">
197
  <span class="text-gray-400 text-sm mr-3">3:24</span>
198
+ <i data-feather="more-vertical" class="text-gray-400 cursor-pointer"></i>
199
  </div>
200
  </div>
 
201
  <!-- Song Item -->
202
+ <div class="flex items-center p-3 rounded-lg bg-accent cursor-pointer" onclick="playSong(2)">
203
  <img src="http://static.photos/music/60x60/34" alt="Song" class="w-12 h-12 rounded-lg object-cover mr-4">
204
  <div class="flex-1">
205
  <h4 class="font-medium">Stay</h4>
 
207
  </div>
208
  <div class="flex items-center">
209
  <span class="text-gray-400 text-sm mr-3">2:59</span>
210
+ <i data-feather="more-vertical" class="text-gray-400 cursor-pointer"></i>
211
  </div>
212
  </div>
 
213
  <!-- Song Item -->
214
+ <div class="flex items-center p-3 rounded-lg bg-accent cursor-pointer" onclick="playSong(3)">
215
  <img src="http://static.photos/music/60x60/45" alt="Song" class="w-12 h-12 rounded-lg object-cover mr-4">
216
  <div class="flex-1">
217
  <h4 class="font-medium">Good 4 U</h4>
 
219
  </div>
220
  <div class="flex items-center">
221
  <span class="text-gray-400 text-sm mr-3">2:58</span>
222
+ <i data-feather="more-vertical" class="text-gray-400 cursor-pointer"></i>
223
  </div>
224
  </div>
225
+ </div>
226
  </section>
227
  </main>
228
 
229
  <!-- Navigation -->
230
  <nav class="flex justify-around items-center p-4 border-t border-accent bg-secondary">
231
  <div class="flex flex-col items-center text-primary">
232
+ <i data-feather="home" class="w-6 h-6 cursor-pointer"></i>
233
  <span class="text-xs mt-1">Home</span>
234
  </div>
235
  <div class="flex flex-col items-center text-gray-400">
236
+ <a href="search.html"><i data-feather="search" class="w-6 h-6 cursor-pointer"></i></a>
237
  <span class="text-xs mt-1">Search</span>
238
  </div>
239
  <div class="flex flex-col items-center text-gray-400">
240
+ <i data-feather="book" class="w-6 h-6 cursor-pointer"></i>
241
  <span class="text-xs mt-1">Library</span>
242
  </div>
243
  <div class="flex flex-col items-center text-gray-400">
244
+ <i data-feather="heart" class="w-6 h-6 cursor-pointer"></i>
245
  <span class="text-xs mt-1">Favorites</span>
246
  </div>
247
  <div class="flex flex-col items-center text-gray-400">
248
+ <i data-feather="user" class="w-6 h-6 cursor-pointer"></i>
249
  <span class="text-xs mt-1">Profile</span>
250
  </div>
251
  </nav>
252
+ </div>
 
253
  <script>
254
  feather.replace();
255
 
256
+ // Music player functionality
257
+ const songs = [
258
+ {
259
+ title: "Save Your Tears",
260
+ artist: "The Weeknd",
261
+ albumArt: "http://static.photos/music/60x60/12",
262
+ duration: "3:24"
263
+ },
264
+ {
265
+ title: "Levitating",
266
+ artist: "Dua Lipa",
267
+ albumArt: "http://static.photos/music/60x60/23",
268
+ duration: "3:24"
269
+ },
270
+ {
271
+ title: "Stay",
272
+ artist: "The Kid LAROI, Justin Bieber",
273
+ albumArt: "http://static.photos/music/60x60/34",
274
+ duration: "2:59"
275
+ },
276
+ {
277
+ title: "Good 4 U",
278
+ artist: "Olivia Rodrigo",
279
+ albumArt: "http://static.photos/music/60x60/45",
280
+ duration: "2:58"
281
+ }
282
+ ];
283
+
284
+ let currentSongIndex = 0;
285
+ let isPlaying = true;
286
+
287
+ function togglePlay() {
288
+ isPlaying = !isPlaying;
289
+ const playIcon = document.getElementById('playIcon');
290
+ const playPauseIcon = document.getElementById('playPauseIcon');
291
+
292
+ if (isPlaying) {
293
+ playIcon.setAttribute('data-feather', 'pause');
294
+ playPauseIcon.setAttribute('data-feather', 'pause');
295
+ } else {
296
+ playIcon.setAttribute('data-feather', 'play');
297
+ playPauseIcon.setAttribute('data-feather', 'play');
298
+ }
299
+
300
+ feather.replace();
301
+ }
302
+
303
+ function nextSong() {
304
+ currentSongIndex = (currentSongIndex + 1) % songs.length;
305
+ updatePlayer();
306
+ }
307
+
308
+ function previousSong() {
309
+ currentSongIndex = (currentSongIndex - 1 + songs.length) % songs.length;
310
+ updatePlayer();
311
+ }
312
+
313
+ function playSong(index) {
314
+ currentSongIndex = index;
315
+ updatePlayer();
316
+ isPlaying = true;
317
+ const playIcon = document.getElementById('playIcon');
318
+ const playPauseIcon = document.getElementById('playPauseIcon');
319
+ playIcon.setAttribute('data-feather', 'pause');
320
+ playPauseIcon.setAttribute('data-feather', 'pause');
321
+ feather.replace();
322
+ }
323
+
324
+ function updatePlayer() {
325
+ const song = songs[currentSongIndex];
326
+ document.getElementById('songTitle').textContent = song.title;
327
+ document.getElementById('artistName').textContent = song.artist;
328
+ document.getElementById('albumArt').src = song.albumArt;
329
+ }
330
+
331
  // Simulate music progress
332
+ const progressBar = document.getElementById('progressBar');
333
+ const currentTimeElement = document.getElementById('currentTime');
334
  let progress = 35;
335
 
336
  setInterval(() => {
337
+ if (isPlaying) {
338
+ progress += 0.1;
339
+ if (progress > 100) progress = 0;
340
+ progressBar.value = progress;
341
+
342
+ // Update time display
343
+ const totalSeconds = Math.floor(progress * 2.2);
344
+ const minutes = Math.floor(totalSeconds / 60);
345
+ const seconds = totalSeconds % 60;
346
+ currentTimeElement.textContent = `${minutes}:${seconds < 10 ? '0' : ''}${seconds}`;
347
+ }
348
  }, 1000);
349
+
350
+ function toggleMenu() {
351
+ alert("Menu functionality would be implemented here");
352
+ }
353
  </script>
354
  </body>
355
  </html>