mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
Fix foreground not update
This commit is contained in:
parent
a5059203f0
commit
1c333aab10
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
min/gui-settings.min.js
vendored
2
min/gui-settings.min.js
vendored
@ -1 +1 @@
|
||||
(()=>{return(e,t)=>{const n=t.attributes.textValidate.export.Validator;const o={red:"#e57373",pink:"#F06292",purple:"#BA68C8",deepPurple:"#9575CD",indigo:"#7986CB",blue:"#2196F3",lightBlue:"#00A0D8",cyan:"#00ACC1",teal:"#26A69A",green:"#81C784",lightGreen:"#9CCC65",orange:"#FF9800",deepOrange:"#FF7043",brown:"#A1887F",grey:"#757575",blueGrey:"#78909C"};const i=(()=>{const e=document.querySelector("html");return function(t){const n=new ColorProcessor(t);const o=n.hexToRgba(t+"70");$("div.custom-color-preview").css("background",t).css("box-shadow",`0px 2px 8px 1px rgba(${o.r},${o.g},${o.b},${o.a})`);e.style.setProperty("--theme-color",t);for(let o=10;o<=90;o+=10){e.style.setProperty(`--theme-color-${o}`,n.rgbToString(n.hexToRgba(t+o)))}e.style.setProperty("--blue-image-filter",n.blueImageFilter);e.style.setProperty("--pink-image-filter",n.pinkImageFilter);e.style.setProperty("--brightness",n.brightness);e.style.setProperty("--invert-filter",n.filterInvert)}})();function s(e){let t=e.nextElementSibling;const n=[];while(t!==null&&!t.classList.contains("category")){n.push(t);t=t.nextElementSibling}return n}function r(e,t){$(`input[type='checkbox'][key='${e}']`).prop("checked",t);$(`input[type='text'][key='${e}']`).val(t)}function c(){for(const[t,n]of Object.entries(e)){r(t,n)}}function l(){$(".gui-settings-mask").on("click",()=>{$(".gui-settings-widgets-box,.gui-settings-box,.gui-settings-mask").removeClass("opened")});$("input[type='text'][key]").each((t,n)=>{$(n).attr("placeholder",e[$(n).attr("key")])});$("div.custom-color-preview").on("click",()=>{const e=$(".predefined-colors");e.toggleClass("opened")});$(".gui-settings-content ul li.category").on("click",e=>{e.currentTarget.classList.toggle("folded");s(e.currentTarget).forEach(e=>e.classList.toggle("folded"))});$(".gui-settings-dropdown>input").on("click",e=>{$(e.currentTarget).parent().toggleClass("opened")});onSettingsChange((e,t,n)=>{r(e,n);c()})}function a(){$("input[type='checkbox'][key]").each((t,n)=>{$(n).on("change",()=>{const t=n.getAttribute("key");const o=n.checked;e[t]=o;saveSettings(e)})});$("input[type='text'][key]").each((t,o)=>{$(o).on("change",()=>{const t=o.getAttribute("key");const s=n.getValidator(t).validate(o.value);if(t==="customStyleColor"){i(s)}e[t]=s;o.value=s;saveSettings(e)})})}function p(){const e={};$(`input[dependencies]`).each((t,n)=>{const o=$(n).attr("dependencies");if(o){e[$(n).attr("key")]=o}});const t=t=>{const n=t.prop("checked");for(const o in e){const i=e[o].split(" ");if(i.indexOf(t.attr("key"))!==-1){let e=true;if(n&&i.every(e=>$(`input[key='${e}']`).prop("checked"))){e=false}const t=$(`li:has(input[key='${o}'])`);const s=e?"addClass":"removeClass";t[s]("disabled");$(`input[key='${o}'][type='text']`).parent()[s]("disabled")}}};$(`input[type='checkbox'][key]`).on("change",e=>t($(e.target))).each((e,n)=>t($(n)))}function u(){const e=$(".predefined-colors-grid");for(const t of Object.values(o)){$(`<div class='predefined-colors-grid-block'></div>`).appendTo(e).css("background",t).attr("data-color",t).on("click",e=>{$(`input[key='customStyleColor']`).val($(e.target).attr("data-color")).trigger("input").change();$("div.custom-color-preview").on("click")})}}function g(){if(e.blurSettingsPanel){$(".gui-settings-box").addClass("blur")}}function d(){if(typeof offlineData!=="undefined"){$("li:has(input[key=useCache])").addClass("disabled");$("input[key=useCache]").prop("disabled",true)}}function y(){$(".gui-settings-content ul li.category").each((e,t)=>{$(t).click()})}function f(){if(!CSS.supports("backdrop-filter","blur(24px)")&&!CSS.supports("-webkit-backdrop-filter","blur(24px)")){$("input[key=blurVideoControl]").prop("disabled",true);e.blurVideoControl=false;saveSettings(e)}}t.applyStyle("guiSettingsStyle");const b=t.data.guiSettingsDom.text;if(b){$("body").append(b);l();d();c();p();u();a();y();f()}new SpinQuery(()=>$("body"),e=>e.length>0&&!(unsafeWindow.parent.window===unsafeWindow),e=>$(".gui-settings-icon-panel").css("display","none")).start()}})();
|
||||
(()=>{return(e,t)=>{const o=t.attributes.textValidate.export.Validator;const n={red:"#e57373",pink:"#F06292",purple:"#BA68C8",deepPurple:"#9575CD",indigo:"#7986CB",blue:"#2196F3",lightBlue:"#00A0D8",cyan:"#00ACC1",teal:"#26A69A",green:"#81C784",lightGreen:"#9CCC65",orange:"#FF9800",deepOrange:"#FF7043",brown:"#A1887F",grey:"#757575",blueGrey:"#78909C"};const r=(()=>{const e=document.querySelector("html");return function(t){const o=new ColorProcessor(t);const n=o.hexToRgba(t+"70");$("div.custom-color-preview").css("background",t).css("box-shadow",`0px 2px 8px 1px rgba(${n.r},${n.g},${n.b},${n.a})`);e.style.setProperty("--theme-color",t);for(let n=10;n<=90;n+=10){e.style.setProperty(`--theme-color-${n}`,o.rgbToString(o.hexToRgba(t+n)))}e.style.setProperty("--foreground-color:"+o.foreground);e.style.setProperty("--foreground-color-b:"+rgbToString(o.hexToRgba(o.foreground+"b")));e.style.setPropertyh("--foreground-color-d:"+rgbToString(o.hexToRgba(o.foreground+"d")));e.style.setProperty("--blue-image-filter",o.blueImageFilter);e.style.setProperty("--pink-image-filter",o.pinkImageFilter);e.style.setProperty("--brightness",o.brightness);e.style.setProperty("--invert-filter",o.filterInvert)}})();function i(e){let t=e.nextElementSibling;const o=[];while(t!==null&&!t.classList.contains("category")){o.push(t);t=t.nextElementSibling}return o}function s(e,t){$(`input[type='checkbox'][key='${e}']`).prop("checked",t);$(`input[type='text'][key='${e}']`).val(t)}function c(){for(const[t,o]of Object.entries(e)){s(t,o)}}function l(){$(".gui-settings-mask").on("click",()=>{$(".gui-settings-widgets-box,.gui-settings-box,.gui-settings-mask").removeClass("opened")});$("input[type='text'][key]").each((t,o)=>{$(o).attr("placeholder",e[$(o).attr("key")])});$("div.custom-color-preview").on("click",()=>{const e=$(".predefined-colors");e.toggleClass("opened")});$(".gui-settings-content ul li.category").on("click",e=>{e.currentTarget.classList.toggle("folded");i(e.currentTarget).forEach(e=>e.classList.toggle("folded"))});$(".gui-settings-dropdown>input").on("click",e=>{$(e.currentTarget).parent().toggleClass("opened")});onSettingsChange((e,t,o)=>{s(e,o);c()})}function a(){$("input[type='checkbox'][key]").each((t,o)=>{$(o).on("change",()=>{const t=o.getAttribute("key");const n=o.checked;e[t]=n;saveSettings(e)})});$("input[type='text'][key]").each((t,n)=>{$(n).on("change",()=>{const t=n.getAttribute("key");const i=o.getValidator(t).validate(n.value);if(t==="customStyleColor"){r(i)}e[t]=i;n.value=i;saveSettings(e)})})}function u(){const e={};$(`input[dependencies]`).each((t,o)=>{const n=$(o).attr("dependencies");if(n){e[$(o).attr("key")]=n}});const t=t=>{const o=t.prop("checked");for(const n in e){const r=e[n].split(" ");if(r.indexOf(t.attr("key"))!==-1){let e=true;if(o&&r.every(e=>$(`input[key='${e}']`).prop("checked"))){e=false}const t=$(`li:has(input[key='${n}'])`);const i=e?"addClass":"removeClass";t[i]("disabled");$(`input[key='${n}'][type='text']`).parent()[i]("disabled")}}};$(`input[type='checkbox'][key]`).on("change",e=>t($(e.target))).each((e,o)=>t($(o)))}function g(){const e=$(".predefined-colors-grid");for(const t of Object.values(n)){$(`<div class='predefined-colors-grid-block'></div>`).appendTo(e).css("background",t).attr("data-color",t).on("click",e=>{$(`input[key='customStyleColor']`).val($(e.target).attr("data-color")).trigger("input").change();$("div.custom-color-preview").on("click")})}}function p(){if(e.blurSettingsPanel){$(".gui-settings-box").addClass("blur")}}function d(){if(typeof offlineData!=="undefined"){$("li:has(input[key=useCache])").addClass("disabled");$("input[key=useCache]").prop("disabled",true)}}function y(){$(".gui-settings-content ul li.category").each((e,t)=>{$(t).click()})}function f(){if(!CSS.supports("backdrop-filter","blur(24px)")&&!CSS.supports("-webkit-backdrop-filter","blur(24px)")){$("input[key=blurVideoControl]").prop("disabled",true);e.blurVideoControl=false;saveSettings(e)}}t.applyStyle("guiSettingsStyle");const b=t.data.guiSettingsDom.text;if(b){$("body").append(b);l();d();c();u();g();a();y();f()}new SpinQuery(()=>$("body"),e=>e.length>0&&!(unsafeWindow.parent.window===unsafeWindow),e=>$(".gui-settings-icon-panel").css("display","none")).start()}})();
|
||||
@ -39,6 +39,11 @@
|
||||
html.style.setProperty(`--theme-color-${opacity}`,
|
||||
color.rgbToString(color.hexToRgba(newColor + opacity)));
|
||||
}
|
||||
html.style.setProperty("--foreground-color:" + color.foreground);
|
||||
html.style.setProperty("--foreground-color-b:" +
|
||||
rgbToString(color.hexToRgba(color.foreground + "b")));
|
||||
html.style.setPropertyh("--foreground-color-d:" +
|
||||
rgbToString(color.hexToRgba(color.foreground + "d")));
|
||||
html.style.setProperty("--blue-image-filter", color.blueImageFilter);
|
||||
html.style.setProperty("--pink-image-filter", color.pinkImageFilter);
|
||||
html.style.setProperty("--brightness", color.brightness);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user