refactor(suggestions): move preview to album art overlay
Move play button from action buttons to album art hover overlay, matching the pattern used in ArtistDetailView popular tracks.
This commit is contained in:
1 parent
79e37cbf7a
commit
900df9307a
1 file changed
+32
-18
@@ -309,6 +309,15 @@
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
|
{#if onPreviewTrack}
|
||||||
|
<button
|
||||||
|
class="play-overlay"
|
||||||
|
onclick={(e) => { e.stopPropagation(); onPreviewTrack(track); }}
|
||||||
|
aria-label="Preview track"
|
||||||
|
>
|
||||||
|
<Play size={16} fill="white" color="white" />
|
||||||
|
</button>
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="track-info">
|
<div class="track-info">
|
||||||
@@ -345,15 +354,6 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
{#if onPreviewTrack}
|
|
||||||
<button
|
|
||||||
class="action-btn preview"
|
|
||||||
onclick={(e) => { e.stopPropagation(); onPreviewTrack(track); }}
|
|
||||||
title="Preview"
|
|
||||||
>
|
|
||||||
<Play size={14} />
|
|
||||||
</button>
|
|
||||||
{/if}
|
|
||||||
<button
|
<button
|
||||||
class="action-btn info"
|
class="action-btn info"
|
||||||
onclick={(e) => { e.stopPropagation(); handleShowTrackInfo(track.track_id); }}
|
onclick={(e) => { e.stopPropagation(); handleShowTrackInfo(track.track_id); }}
|
||||||
@@ -521,6 +521,7 @@
|
|||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.album-art img {
|
.album-art img {
|
||||||
@@ -529,6 +530,28 @@
|
|||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.play-overlay {
|
||||||
|
position: absolute;
|
||||||
|
inset: 0;
|
||||||
|
display: none;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
background: rgba(0, 0, 0, 0.5);
|
||||||
|
border: none;
|
||||||
|
border-radius: 4px;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: background 150ms ease;
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.suggestion-row:hover .play-overlay {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.play-overlay:hover {
|
||||||
|
background: rgba(0, 0, 0, 0.7);
|
||||||
|
}
|
||||||
|
|
||||||
.track-info {
|
.track-info {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
@@ -623,15 +646,6 @@
|
|||||||
color: var(--text-primary);
|
color: var(--text-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.action-btn.preview {
|
|
||||||
color: var(--text-muted);
|
|
||||||
}
|
|
||||||
|
|
||||||
.action-btn.preview:hover {
|
|
||||||
background: var(--accent-primary);
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
.action-btn.info {
|
.action-btn.info {
|
||||||
color: var(--text-muted);
|
color: var(--text-muted);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user