This commit is contained in:
the1812 2019-06-02 17:50:05 +08:00
parent 986eabf1d7
commit 49f4202c62
4 changed files with 9 additions and 11 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
(()=>{return(o,t)=>{document.body.style.setProperty("--custom-control-background-opacity",o.customControlBackgroundOpacity);addSettingsListener("customControlBackgroundOpacity",o=>{document.body.style.setProperty("--custom-control-background-opacity",o)});const n=()=>{if(o.customControlBackgroundOpacity>0){t.applyStyle("customControlBackgroundStyle");if(!o.touchVideoPlayer){t.applyImportantStyleFromText(`\n <style id="control-background-non-touch">\n .bilibili-player-video-control-bottom\n {\n margin: 7px 0 0 0 !important;\n padding: 8px 0 0 !important;\n }\n </style>\n `)}}};return{reload:n,unload:()=>{t.removeStyle("customControlBackgroundStyle");const o=document.getElementById("control-background-non-touch");o&&o.remove()}}}})();
(()=>{return(o,t)=>{document.body.style.setProperty("--custom-control-background-opacity",o.customControlBackgroundOpacity);addSettingsListener("customControlBackgroundOpacity",o=>{document.body.style.setProperty("--custom-control-background-opacity",o)});const n=()=>{t.applyStyle("customControlBackgroundStyle");if(!o.touchVideoPlayer){t.applyImportantStyleFromText(`\n <style id="control-background-non-touch">\n .bilibili-player-video-control-bottom\n {\n margin: 7px 0 0 0 !important;\n padding: 8px 0 0 !important;\n }\n </style>\n `)}};n();return{reload:n,unload:()=>{t.removeStyle("customControlBackgroundStyle");const o=document.getElementById("control-background-non-touch");o&&o.remove()}}}})();

View File

@ -4,12 +4,10 @@ addSettingsListener("customControlBackgroundOpacity", value =>
document.body.style.setProperty("--custom-control-background-opacity", value);
});
const load = () => {
if (settings.customControlBackgroundOpacity > 0)
resources.applyStyle("customControlBackgroundStyle");
if (!settings.touchVideoPlayer)
{
resources.applyStyle("customControlBackgroundStyle");
if (!settings.touchVideoPlayer)
{
resources.applyImportantStyleFromText(/*html*/`
resources.applyImportantStyleFromText(/*html*/`
<style id="control-background-non-touch">
.bilibili-player-video-control-bottom
{
@ -18,9 +16,9 @@ const load = () => {
}
</style>
`);
}
}
};
load();
export default {
reload: load,
unload: () => {