fix(web): make the desktop player compact (#71)

This commit was merged in pull request #71.
This commit is contained in:
joshuafhiggins committed 2026-11-04 17:00:11 -05:00
1 parent 20b5cb4ea7
commit 867808fe2b
1 file changed
+19 -19
+19 -19
View File
@@ -76,8 +76,8 @@ export function PlayerBar() {
queueOpen && !isMobile && "right-72"
)}
>
<div className="pointer-events-auto flex w-full max-w-6xl items-center gap-2 rounded-full border border-foreground/20 bg-(--player-background) px-3 py-2 text-card-foreground shadow-lg [--player-background:var(--card)] @min-[640px]:gap-5 @min-[640px]:px-5 @min-[640px]:py-3 dark:border-white/20 dark:text-white dark:[--player-background:#303033]">
<div className="flex shrink-0 items-center gap-0 @min-[640px]:gap-1 [&_button]:size-7 @min-[640px]:[&_button]:size-10 [&_svg]:size-4 @min-[640px]:[&_svg]:size-6">
<div className="pointer-events-auto flex w-full max-w-[40rem] items-center gap-2 rounded-full border border-foreground/20 bg-(--player-background) px-3 py-2 text-card-foreground shadow-lg [--player-background:var(--card)] md:gap-3 md:py-1.5 dark:border-white/20 dark:text-white dark:[--player-background:#303033]">
<div className="flex shrink-0 items-center gap-0 md:gap-0.5 [&_button]:size-7 [&_svg]:size-4">
<Button
variant="ghost"
size="icon"
@@ -91,7 +91,7 @@ export function PlayerBar() {
)}
onClick={() => void toggleShuffle()}
>
<Shuffle className="size-4 @min-[640px]:size-6" />
<Shuffle className="size-4" />
</Button>
<Button
variant="ghost"
@@ -100,7 +100,7 @@ export function PlayerBar() {
disabled={!hasQueue}
onClick={() => void skipPrevious()}
>
<SkipBack className="size-4 fill-current @min-[640px]:size-6" />
<SkipBack className="size-4 fill-current" />
</Button>
<Button
variant="ghost"
@@ -110,9 +110,9 @@ export function PlayerBar() {
onClick={() => setIsPlaying(!isPlaying)}
>
{isPlaying ? (
<Pause className="size-5! fill-current @min-[640px]:size-8!" />
<Pause className="size-5! fill-current" />
) : (
<Play className="size-5! fill-current @min-[640px]:size-8!" />
<Play className="size-5! fill-current" />
)}
</Button>
<Button
@@ -122,7 +122,7 @@ export function PlayerBar() {
disabled={!hasQueue}
onClick={() => void skipNext()}
>
<SkipForward className="size-4 fill-current @min-[640px]:size-6" />
<SkipForward className="size-4 fill-current" />
</Button>
<Button
variant="ghost"
@@ -138,33 +138,33 @@ export function PlayerBar() {
onClick={() => void cycleRepeat()}
>
{repeatEnabled === "once" ? (
<Repeat1 className="size-4 @min-[640px]:size-6" />
<Repeat1 className="size-4" />
) : (
<Repeat className="size-4 @min-[640px]:size-6" />
<Repeat className="size-4" />
)}
</Button>
</div>
<div className="relative flex h-11 min-w-0 flex-1 items-center gap-2 pb-2 @min-[640px]:h-16 @min-[640px]:gap-3">
<div className="relative flex h-11 min-w-0 flex-1 items-center gap-2 pb-2 md:h-9 md:pb-1">
{currentSong ? (
<>
<div className="relative size-9 shrink-0 overflow-hidden rounded @min-[640px]:size-14">
<div className="relative size-9 shrink-0 overflow-hidden rounded md:size-8">
<Image
src={albumCoverUrl(currentSong.album.id)}
alt={currentSong.album.title}
fill
sizes="56px"
sizes="36px"
className="object-cover"
/>
</div>
<div className="min-w-0 flex-1">
<Link
href={`/album/${currentSong.album.id}`}
className="block truncate text-sm font-semibold hover:underline @min-[640px]:text-xl"
className="block truncate text-sm font-semibold hover:underline md:text-[13px] md:leading-4"
>
{currentSong.title}
</Link>
<p className="truncate text-xs @min-[640px]:text-lg">
<p className="truncate text-xs">
<Link
href={`/artist/${currentSong.artist.id}`}
className="hover:underline"
@@ -200,7 +200,7 @@ export function PlayerBar() {
<div className="absolute inset-x-0 -bottom-1">
<Slider
className={cn(
"h-3 flex-1 [&_[data-slot=slider-range]]:bg-current/80 [&_[data-slot=slider-thumb]]:size-2 [&_[data-slot=slider-thumb]]:border-current [&_[data-slot=slider-thumb]]:bg-current [&_[data-slot=slider-thumb]]:opacity-0 focus-within:[&_[data-slot=slider-thumb]]:opacity-100 hover:[&_[data-slot=slider-thumb]]:opacity-100 [&_[data-slot=slider-track]]:h-[3px] [&_[data-slot=slider-track]]:bg-current/30",
"h-3 flex-1 [&_[data-slot=slider-range]]:bg-current/80 [&_[data-slot=slider-thumb]]:size-2 [&_[data-slot=slider-thumb]]:border-current [&_[data-slot=slider-thumb]]:bg-current [&_[data-slot=slider-thumb]]:opacity-0 focus-within:[&_[data-slot=slider-thumb]]:opacity-100 hover:[&_[data-slot=slider-thumb]]:opacity-100 [&_[data-slot=slider-track]]:h-[3px] [&_[data-slot=slider-track]]:bg-current/30 md:[&_[data-slot=slider-track]]:h-0.5",
!hasActiveSong && "[&_[data-slot=slider-thumb]]:hidden"
)}
min={0}
@@ -222,7 +222,7 @@ export function PlayerBar() {
</div>
</div>
<div className="flex shrink-0 items-center gap-0 @min-[640px]:gap-2 [&_button]:size-7 @min-[640px]:[&_button]:size-10 [&_svg]:size-4 @min-[640px]:[&_svg]:size-6">
<div className="flex shrink-0 items-center gap-0 md:gap-1 [&_button]:size-7 [&_svg]:size-4">
<Button
variant="ghost"
size="icon"
@@ -230,7 +230,7 @@ export function PlayerBar() {
aria-label="Lyrics"
disabled
>
<MessageSquareQuote className="size-4 @min-[640px]:size-6" />
<MessageSquareQuote className="size-4" />
</Button>
<Button
variant="ghost"
@@ -240,12 +240,12 @@ export function PlayerBar() {
className={cn(queueOpen && "text-primary")}
onClick={toggleQueueOpen}
>
<ListMusic className="size-4 @min-[640px]:size-6" />
<ListMusic className="size-4" />
</Button>
<Popover>
<PopoverTrigger asChild>
<Button variant="ghost" size="icon" aria-label="Volume">
<Volume2 className="size-4 @min-[640px]:size-6" />
<Volume2 className="size-4" />
</Button>
</PopoverTrigger>
<PopoverContent side="top" align="end" className="w-40">