|
12 | 12 | <!-- Songs List --> |
13 | 13 | <div *ngFor="let song of songs()" |
14 | 14 | class="flex items-center gap-4 py-4 px-2 rounded-md hover:bg-[var(--list-hover)] transition-all cursor-pointer" |
15 | | - [class.bg-[var(--list-hover)]]="currentSong?.url === getSongUrl(song)"> |
16 | | - <div class="relative w-12 h-12 rounded-md overflow-hidden group" (click)="playSong(getSongUrl(song), song)"> |
| 15 | + (click)="playSong(getSongUrl(song), song)"> |
| 16 | + <div class="relative w-12 h-12 rounded-md overflow-hidden group"> |
17 | 17 | <img [src]="song.image?.[2]?.url || 'assets/img/music_icon/icons8-airpods-pro-max-100.png'" alt="{{ song.name }}" |
18 | 18 | class="w-full h-full object-cover group-hover:brightness-75 transition-all duration-300 ease-in-out" |
19 | 19 | [class.brightness-75]="currentSong?.url === getSongUrl(song)" /> |
|
22 | 22 | class="absolute inset-0 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity duration-300" |
23 | 23 | [class.opacity-100]="currentSong?.url === getSongUrl(song)"> |
24 | 24 | <img |
25 | | - [src]="currentSong?.url === getSongUrl(song)? 'assets/img/music_icon/icons8-pause-50.png' :'assets/img/music_icon/icons8-play-50.png'" |
| 25 | + [src]="((audio?.paused)) ? 'assets/img/music_icon/icons8-play-50.png' : currentSong?.url === getSongUrl(song) ?'assets/img/music_icon/icons8-pause-50.png' : 'assets/img/music_icon/icons8-play-50.png'" |
26 | 26 | alt="Play" class="w-6 h-6 object-contain" style="filter: invert(100%);" /> |
27 | 27 | </div> |
28 | 28 | </div> |
29 | 29 |
|
30 | 30 | <div class="flex-1"> |
31 | | - <div class="font-medium text-[var(--color-text)]">{{ song.name }}</div> |
32 | | - <div class="text-sm text-[var(--color-gray-500)]">{{ song.artists.primary[0]?.name || 'Unknown Artist' }}</div> |
| 31 | + <div class="flex items-center space-x-2 font-medium" |
| 32 | + [ngClass]="currentSong?.url === getSongUrl(song) ? 'text-[var(--theme-color)]' : 'text-[var(--color-text)]'"> |
| 33 | + <img *ngIf="currentSong?.url === getSongUrl(song)" src="assets/img/music_icon/waves.gif" |
| 34 | + alt="playing animation" class="w-5 h-5" /> |
| 35 | + <span>{{ song.name }}</span> |
| 36 | + </div> |
| 37 | + <div class="text-sm text-[var(--color-gray-500)]"> |
| 38 | + {{ song.artists.primary[0]?.name || 'Unknown Artist' }} |
| 39 | + </div> |
33 | 40 | </div> |
34 | 41 |
|
35 | 42 | <div class="text-sm text-[var(--color-gray-500)]">{{ formatTime(song.duration) }}</div> |
|
43 | 50 | [ngStyle]="{'background-color': 'var(--color-surface)', 'color': 'var(--color-text)', 'z-index': '70'}"> |
44 | 51 |
|
45 | 52 | <!-- Song Image --> |
46 | | - <img (click)="openPlayerModal()" [src]="currentSong.image?.[2]?.url || 'assets/img/music_icon/icons8-airpods-pro-max-100.png'" alt="Cover" |
| 53 | + <img (click)="openPlayerModal()" |
| 54 | + [src]="currentSong.image?.[2]?.url || 'assets/img/music_icon/icons8-airpods-pro-max-100.png'" alt="Cover" |
47 | 55 | class="w-12 h-12 rounded-md shadow-md shrink-0" /> |
48 | 56 |
|
49 | 57 | <!-- Song Info + Progress --> |
|
62 | 70 | </div> |
63 | 71 |
|
64 | 72 | <!-- Play/Pause Button --> |
65 | | - <button (click)="playSong(currentSong.url, currentSong); $event.stopPropagation();" |
| 73 | + <button (click)="playSong(currentSong.url, currentSong, true); $event.stopPropagation();" |
66 | 74 | class="w-8 h-8 flex items-center justify-center rounded-full hover:bg-[var(--list-hover)] active:scale-90 transition-transform"> |
67 | 75 | <img |
68 | 76 | [src]="audio?.paused ? 'assets/img/music_icon/icons8-play-50.png' : 'assets/img/music_icon/icons8-pause-50.png'" |
@@ -159,7 +167,7 @@ <h2 class="text-xl md:text-2xl font-semibold text-[var(--color-text)] truncate"> |
159 | 167 | </button> |
160 | 168 |
|
161 | 169 | <!-- Play/Pause --> |
162 | | - <button (click)="playSong(currentSong.url, currentSong)" |
| 170 | + <button (click)="playSong(currentSong.url, currentSong, true)" |
163 | 171 | class="bg-[var(--theme-color)] p-4 rounded-full active:scale-90 transition-transform"> |
164 | 172 | <img [src]="audio?.paused |
165 | 173 | ? 'assets/img/music_icon/icons8-play-50.png' |
|
0 commit comments