1
0
Fork 0
mirror of https://github.com/sussy-code/smov.git synced 2024-12-20 14:37:43 +01:00

Merge remote-tracking branch 'movie-web/dev'

This commit is contained in:
Cooper Ransom 2024-03-22 12:58:37 -04:00
commit 0c4cc5aca4

View file

@ -41,8 +41,13 @@ export function Volume(props: Props) {
const handleMouseEnter = useCallback(async () => {
if (await canChangeVolume()) setHovering(true);
document.body.classList.add("overflow-y-hidden");
}, [setHovering]);
const handleMouseLeave = () => {
document.body.classList.remove("overflow-y-hidden");
};
let percentage = makePercentage(volume * 100);
if (dragging) percentage = makePercentage(dragPercentage);
const percentageString = makePercentageString(percentage);
@ -61,9 +66,10 @@ export function Volume(props: Props) {
<div
className={props.className}
onMouseEnter={handleMouseEnter}
onMouseLeave={handleMouseLeave}
onWheel={handleWheel}
>
<div className="pointer-events-auto flex cursor-pointer items-center py-0">
<div className="pointer-events-auto flex cursor-pointer items-center py-0 touch-none">
<div className="px-4 text-2xl text-white" onClick={handleClick}>
<Icon icon={percentage > 0 ? Icons.VOLUME : Icons.VOLUME_X} />
</div>