Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/components/PlayerBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ const ProgressScrubber = memo(function ProgressScrubber() {
setIsHoveringProgress,
handleProgressMouseDown,
} = useProgressScrub();
const [showTimeLeft, setShowTimeLeft] = useState(false);

return (
<div className="w-full flex items-center gap-2 text-th-text-muted">
Expand Down Expand Up @@ -308,8 +309,15 @@ const ProgressScrubber = memo(function ProgressScrubber() {
}}
/>
</div>
<span className="min-w-[40px] text-[11px] tabular-nums select-none">
{currentTrack ? formatTime(duration) : "0:00"}
<span
className="min-w-[40px] text-[11px] tabular-nums select-none cursor-pointer"
onClick={() => currentTrack && setShowTimeLeft((v) => !v)}
>
{currentTrack
? showTimeLeft
? `-${formatTime(Math.max(0, duration - displayTime))}`
: formatTime(duration)
: "0:00"}
</span>
</div>
);
Expand Down