Merge pull request #1 from dazlygonsalves/main
style(volume-ui): adjust volume thumb position to align with volume fill using CSS var
This commit is contained in:
commit
3332c979ff
2 changed files with 436 additions and 571 deletions
|
|
@ -1034,7 +1034,10 @@ document.addEventListener('DOMContentLoaded', async () => {
|
|||
const updateVolumeUI = () => {
|
||||
const { volume, muted } = audioPlayer;
|
||||
volumeBtn.innerHTML = (muted || volume === 0) ? SVG_MUTE : SVG_VOLUME;
|
||||
volumeFill.style.width = `${muted ? 0 : volume * 100}%`;
|
||||
|
||||
const effectiveVolume = muted ? 0 : volume * 100;
|
||||
|
||||
volumeFill.style.setProperty('--volume-level', `${effectiveVolume}%`);
|
||||
};
|
||||
|
||||
volumeBtn.addEventListener('click', () => {
|
||||
|
|
@ -1157,4 +1160,4 @@ document.addEventListener('DOMContentLoaded', async () => {
|
|||
e.preventDefault();
|
||||
deferredPrompt = e;
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
1000
styles.css
1000
styles.css
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue