mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 10:31:47 +00:00
fix precise-volume position in PiP
This commit is contained in:
@ -33,15 +33,14 @@ const listenForToggle = () => {
|
|||||||
const clonedExitButton = originalExitButton.cloneNode(true);
|
const clonedExitButton = originalExitButton.cloneNode(true);
|
||||||
clonedExitButton.onclick = () => togglePictureInPicture();
|
clonedExitButton.onclick = () => togglePictureInPicture();
|
||||||
|
|
||||||
const player = $('#player');
|
const appLayout = $("ytmusic-app-layout");
|
||||||
const onPlayerDblClick = player.onDoubleClick_;
|
|
||||||
|
|
||||||
const playerBar = $("ytmusic-player-bar");
|
|
||||||
const expandMenu = $('#expanding-menu');
|
const expandMenu = $('#expanding-menu');
|
||||||
const middleControls = $('.middle-controls');
|
const middleControls = $('.middle-controls');
|
||||||
const playerPage = $("ytmusic-player-page");
|
const playerPage = $("ytmusic-player-page");
|
||||||
const togglePlayerPageButton = $(".toggle-player-page-button");
|
const togglePlayerPageButton = $(".toggle-player-page-button");
|
||||||
const fullScreenButton = $(".fullscreen-button");
|
const fullScreenButton = $(".fullscreen-button");
|
||||||
|
const player = $('#player');
|
||||||
|
const onPlayerDblClick = player.onDoubleClick_;
|
||||||
|
|
||||||
ipcRenderer.on('pip-toggle', (_, isPip) => {
|
ipcRenderer.on('pip-toggle', (_, isPip) => {
|
||||||
if (isPip) {
|
if (isPip) {
|
||||||
@ -52,13 +51,13 @@ const listenForToggle = () => {
|
|||||||
togglePlayerPageButton.click();
|
togglePlayerPageButton.click();
|
||||||
}
|
}
|
||||||
fullScreenButton.click();
|
fullScreenButton.click();
|
||||||
playerBar.classList.add("pip");
|
appLayout.classList.add("pip");
|
||||||
} else {
|
} else {
|
||||||
$(".exit-fullscreen-button").replaceWith(originalExitButton);
|
$(".exit-fullscreen-button").replaceWith(originalExitButton);
|
||||||
player.onDoubleClick_ = onPlayerDblClick;
|
player.onDoubleClick_ = onPlayerDblClick;
|
||||||
expandMenu.onmouseleave = undefined;
|
expandMenu.onmouseleave = undefined;
|
||||||
originalExitButton.click();
|
originalExitButton.click();
|
||||||
playerBar.classList.remove("pip");
|
appLayout.classList.remove("pip");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,14 +1,21 @@
|
|||||||
ytmusic-player-bar.pip svg,
|
/* improve visibility of the player bar elements */
|
||||||
ytmusic-player-bar.pip .time-info,
|
ytmusic-app-layout.pip ytmusic-player-bar svg,
|
||||||
ytmusic-player-bar.pip yt-formatted-string,
|
ytmusic-app-layout.pip ytmusic-player-bar .time-info,
|
||||||
ytmusic-player-bar.pip .yt-formatted-string {
|
ytmusic-app-layout.pip ytmusic-player-bar yt-formatted-string,
|
||||||
|
ytmusic-app-layout.pip ytmusic-player-bar .yt-formatted-string {
|
||||||
filter: drop-shadow(2px 4px 6px black);
|
filter: drop-shadow(2px 4px 6px black);
|
||||||
color: white !important;
|
color: white !important;
|
||||||
fill: white !important;
|
fill: white !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
ytmusic-player-bar.pip ytmusic-player-expanding-menu {
|
/* improve the style of the player bar expanding menu */
|
||||||
|
ytmusic-app-layout.pip ytmusic-player-expanding-menu {
|
||||||
border-radius: 30px;
|
border-radius: 30px;
|
||||||
background-color: rgba(0, 0, 0, 0.3);
|
background-color: rgba(0, 0, 0, 0.3);
|
||||||
backdrop-filter: blur(5px) brightness(20%);
|
backdrop-filter: blur(5px) brightness(20%);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* fix volumeHud position when both in-app-menu and PiP are active */
|
||||||
|
.cet-container ytmusic-app-layout.pip #volumeHud{
|
||||||
|
top: 22px !important;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user