mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
Fix filters not updating
This commit is contained in:
parent
aceaeaff3c
commit
a5fb9d153d
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
min/dark.min.css
vendored
2
min/dark.min.css
vendored
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
File diff suppressed because one or more lines are too long
@ -23,15 +23,19 @@
|
|||||||
const reloadColor = (() =>
|
const reloadColor = (() =>
|
||||||
{
|
{
|
||||||
const html = document.querySelector("html");
|
const html = document.querySelector("html");
|
||||||
const color = new ColorProcessor();
|
return function (newColor)
|
||||||
return function ()
|
|
||||||
{
|
{
|
||||||
html.style.setProperty("--theme-color", settings.customStyleColor);
|
const color = new ColorProcessor(newColor);
|
||||||
|
html.style.setProperty("--theme-color", newColor);
|
||||||
for (let opacity = 10; opacity <= 90; opacity += 10)
|
for (let opacity = 10; opacity <= 90; opacity += 10)
|
||||||
{
|
{
|
||||||
html.style.setProperty(`--theme-color-${opacity}`,
|
html.style.setProperty(`--theme-color-${opacity}`,
|
||||||
color.rgbToString(color.hexToRgba(settings.customStyleColor + opacity)));
|
color.rgbToString(color.hexToRgba(newColor + opacity)));
|
||||||
}
|
}
|
||||||
|
html.style.setProperty("--blue-image-filter", color.blueImageFilter);
|
||||||
|
html.style.setProperty("--pink-image-filter", color.pinkImageFilter);
|
||||||
|
html.style.setProperty("--brightness", color.brightness);
|
||||||
|
html.style.setProperty("--invert-filter", color.filterInvert);
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
const textValidate = {
|
const textValidate = {
|
||||||
@ -154,7 +158,10 @@
|
|||||||
.prop("checked", newValue)
|
.prop("checked", newValue)
|
||||||
.change();
|
.change();
|
||||||
$(`input[type='text'][key='${key}']`).val(newValue);
|
$(`input[type='text'][key='${key}']`).val(newValue);
|
||||||
reloadColor();
|
if (key === "customStyleColor")
|
||||||
|
{
|
||||||
|
reloadColor(newValue);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
function syncGui()
|
function syncGui()
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user