Skip to content

Commit

Permalink
chore: Updated volume icons
Browse files Browse the repository at this point in the history
  • Loading branch information
matvp91 committed Sep 19, 2024
1 parent 6c4eca4 commit 2713c75
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 22 deletions.
15 changes: 11 additions & 4 deletions packages/player/lib/ui/components/VolumeButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,23 @@ export function VolumeButton({ volume, setVolume }: VolumeButtonProps) {
}
};

let Icon = VolumeMutedIcon;
let Icon;
let iconStyle: CSSProperties = {};
if (volume > 0.8) {
Icon = Volume2Icon;
iconStyle.width = iconStyle.height = "1.6rem";
} else if (volume > 0.5) {
Icon = Volume1Icon;
iconStyle.left = "-1px";
iconStyle.width = iconStyle.height = "1.4rem";
iconStyle.left = "-0.1rem";
} else if (volume > 0.2) {
Icon = Volume0Icon;
iconStyle.left = "-2px";
iconStyle.width = iconStyle.height = "1.07rem";
iconStyle.left = "-0.48rem";
} else {
Icon = VolumeMutedIcon;
iconStyle.width = iconStyle.height = "1.3rem";
iconStyle.left = "-0.16rem";
}

return (
Expand Down Expand Up @@ -77,7 +84,7 @@ export function VolumeButton({ volume, setVolume }: VolumeButtonProps) {
idleTime={0}
>
<Icon
className="relative w-6 h-6 group-hover:scale-110 transition-transform origin-center"
className="relative group-hover:scale-110 transition-transform origin-center"
style={iconStyle}
/>
</SqButton>
Expand Down
4 changes: 1 addition & 3 deletions packages/player/lib/ui/icons/volume-0.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 1 addition & 4 deletions packages/player/lib/ui/icons/volume-1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 1 addition & 5 deletions packages/player/lib/ui/icons/volume-2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 1 addition & 6 deletions packages/player/lib/ui/icons/volume-muted.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2713c75

Please sign in to comment.