player: show volume slider only on icon hover
This commit is contained in:
@@ -501,12 +501,14 @@ const initPlayer = (): void => {
|
|||||||
showControls()
|
showControls()
|
||||||
})
|
})
|
||||||
|
|
||||||
volumeWrap?.addEventListener('mouseenter', () => {
|
muteBtn?.addEventListener('mouseenter', () => {
|
||||||
|
volumeWrap?.classList.add('show-volume')
|
||||||
isHoveringVolume = true
|
isHoveringVolume = true
|
||||||
showControls()
|
showControls()
|
||||||
})
|
})
|
||||||
|
|
||||||
volumeWrap?.addEventListener('mouseleave', () => {
|
muteBtn?.addEventListener('mouseleave', () => {
|
||||||
|
volumeWrap?.classList.remove('show-volume')
|
||||||
isHoveringVolume = false
|
isHoveringVolume = false
|
||||||
showControls()
|
showControls()
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -84,7 +84,7 @@
|
|||||||
height: 130px;
|
height: 130px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.volume-wrap:hover .volume-panel,
|
.volume-wrap.show-volume .volume-panel,
|
||||||
.volume-wrap:focus-within .volume-panel,
|
.volume-wrap:focus-within .volume-panel,
|
||||||
.volume-panel:hover,
|
.volume-panel:hover,
|
||||||
.volume-panel:focus-within {
|
.volume-panel:focus-within {
|
||||||
@@ -93,7 +93,7 @@
|
|||||||
pointer-events: auto;
|
pointer-events: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.volume-wrap:hover .volume-underline,
|
.volume-wrap.show-volume .volume-underline,
|
||||||
.volume-wrap:focus-within .volume-underline {
|
.volume-wrap:focus-within .volume-underline {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user