Mod to set the color outside of the canvas
Use the pageColor query parameter to specify a color. Pass "?pageColor=bg" to use the color in settings.bg (the user-defined canvas background color) Supports anything that can be a color string, but # has to be %23.
This commit is contained in:
parent
d665c38f6a
commit
3c2bee69ed
|
|
@ -0,0 +1,16 @@
|
|||
urlParams = new URLSearchParams(window.location.search);
|
||||
|
||||
backgroundUseStrings = ["bg","background","settings.bg"]
|
||||
|
||||
if(urlParams.get('pageColor') != null) { //null check
|
||||
color = urlParams.get('pageColor');
|
||||
if(color === "" || color === null) { //NaN check
|
||||
color = "black";
|
||||
};
|
||||
if(backgroundUseStrings.includes(color.toLowerCase())) {
|
||||
!settings.bg ? color = "black" : color = settings.bg;
|
||||
color = settings.bg;
|
||||
};
|
||||
};
|
||||
|
||||
document.body.style.backgroundColor = color;
|
||||
Loading…
Reference in New Issue