Skip to content

Commit cae0d2c

Browse files
committed
update
1 parent 2859343 commit cae0d2c

2 files changed

Lines changed: 26 additions & 8 deletions

File tree

src/app/features/music/music.component.html

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
</header>
2828

2929
<!-- Songs List -->
30-
<main class="max-w-xl mx-auto px-4 py-6 flex flex-col gap-2">
30+
<main class="max-w-xl mx-auto px-2 py-2 flex flex-col gap-2">
3131
<div *ngIf="songs().length === 0" class="flex flex-col items-center justify-center py-20 opacity-50">
3232
<svg class="w-16 h-16 mb-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
3333
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"
@@ -167,13 +167,27 @@ <h4 class="font-semibold truncate text-[var(--color-text)]">{{ currentSong.name
167167

168168
<!-- Modal Header -->
169169
<div class="flex justify-between items-center py-4">
170-
<button (click)="closePlayerModal()"
171-
class="p-3 rounded-full hover:bg-white/10 active:scale-90 transition-all text-[var(--color-text)]">
170+
<button (click)="closePlayerModal()" class="p-3 rounded-full hover:bg-white/10 active:scale-90 transition-all">
171+
<svg class="w-6 h-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
172+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" />
173+
</svg>
174+
</button>
175+
176+
<span class="text-xs font-bold tracking-[0.2em] uppercase text-gray-400">
177+
Now Playing
178+
</span>
179+
180+
<!-- ⭐ Repeat Button -->
181+
<button (click)="repeatCurrentSong = !repeatCurrentSong"
182+
class="p-3 rounded-full hover:bg-white/10 active:scale-90 transition-all"
183+
[ngClass]="repeatCurrentSong ? 'text-[var(--theme-color)]' : 'text-gray-400'" title="Repeat current song">
184+
172185
<svg class="w-6 h-6" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
173-
<path stroke-linecap="round" stroke-linejoin="round" d="M19 9l-7 7-7-7" />
186+
<path stroke-linecap="round" stroke-linejoin="round"
187+
d="M17 1l4 4-4 4M3 11V9a4 4 0 014-4h14M7 23l-4-4 4-4M21 13v2a4 4 0 01-4 4H3" />
174188
</svg>
189+
175190
</button>
176-
<span class="text-xs font-bold tracking-[0.2em] uppercase text-gray-400">Now Playing</span>
177191
</div>
178192

179193
<!-- Large Album Art -->
@@ -247,8 +261,8 @@ <h2 class="text-3xl font-bold truncate text-[var(--color-text)] tracking-tight">
247261
</button>
248262
</div>
249263

250-
<button (click)="toggleLike()" class="p-4 hover:bg-white/10 rounded-full transition-all active:scale-90">
251-
<svg class="w-8 h-8 transition-colors"
264+
<button (click)="toggleLike()" class="p-3 hover:bg-white/10 rounded-full transition-all active:scale-90">
265+
<svg class="w-6 h-6 transition-colors"
252266
[ngClass]="isSongLiked() ? 'text-red-500 fill-current drop-shadow-md' : 'text-gray-400'"
253267
viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
254268
<path stroke-linecap="round" stroke-linejoin="round"

src/app/features/music/music.component.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export class MusicComponent implements OnDestroy {
2828
showPlayerModal = false;
2929
likedPlaylist: any[] = [];
3030
currentLikedIndex = -1;
31+
repeatCurrentSong = false;
3132

3233
@ViewChild('searchSongInput') searchSongInput!: ElementRef;
3334

@@ -95,7 +96,10 @@ export class MusicComponent implements OnDestroy {
9596

9697
onSongFinished(): void {
9798
if (!this.isBrowser) return;
98-
99+
if (this.repeatCurrentSong && this.currentSong?.url) {
100+
this.playSong(this.currentSong.url, this.currentSong);
101+
return;
102+
}
99103
this.likedPlaylist = this.userLikedSongsService.getAll() || [];
100104

101105
if (!this.likedPlaylist.length) return;

0 commit comments

Comments
 (0)