Browse Source

update slider styling

- hover, drag color
master
jeffvli 3 years ago
parent
commit
2f64bfc4d0
  1. 4
      src/components/player/PlayerBar.tsx
  2. 20
      src/components/player/styled.tsx

4
src/components/player/PlayerBar.tsx

@ -87,7 +87,7 @@ const PlayerBar = () => {
} }
settings.setSync('volume', localVolume); settings.setSync('volume', localVolume);
} }
setIsDragging(false); setIsDraggingVolume(false);
}, 10); }, 10);
return () => clearTimeout(debounce); return () => clearTimeout(debounce);
@ -567,6 +567,7 @@ const PlayerBar = () => {
progress progress
defaultValue={0} defaultValue={0}
value={isDragging ? manualSeek : seek} value={isDragging ? manualSeek : seek}
$isDragging={isDragging}
tooltip={false} tooltip={false}
max={ max={
playQueue[currentEntryList][playQueue.currentIndex] playQueue[currentEntryList][playQueue.currentIndex]
@ -721,6 +722,7 @@ const PlayerBar = () => {
tabIndex={0} tabIndex={0}
progress progress
value={Math.floor(localVolume * 100)} value={Math.floor(localVolume * 100)}
$isDragging={isDraggingVolume}
tooltip={false} tooltip={false}
style={{ width: '100px', marginRight: '10px' }} style={{ width: '100px', marginRight: '10px' }}
onChange={handleVolumeSlider} onChange={handleVolumeSlider}

20
src/components/player/styled.tsx

@ -70,16 +70,24 @@ export const LinkButton = styled.a<{ subtitle?: string }>`
} }
`; `;
export const CustomSlider = styled(Slider)` export const CustomSlider = styled(Slider)<{ isDragging?: boolean }>`
.rs-slider-progress-bar { &:hover {
background-color: ${(props) => props.theme.primary.sliderBackground}; .rs-slider-handle::before {
display: block;
}
.rs-slider-progress-bar {
background-color: ${(props) => props.theme.primary.main};
}
} }
.rs-slider-progress-bar {
.rs-slider-progress-bar::hover { background-color: ${(props) =>
background-color: #ff0 !important; props.$isDragging
? props.theme.primary.main
: props.theme.primary.sliderBackground};
} }
.rs-slider-handle::before { .rs-slider-handle::before {
display: none;
border: ${(props) => `1px solid ${props.theme.primary.main} !important`}; border: ${(props) => `1px solid ${props.theme.primary.main} !important`};
} }
`; `;

Loading…
Cancel
Save