mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-12-27 10:31:22 +08:00
parent
02cbf91351
commit
b657ff2b2a
3 changed files with 22 additions and 10 deletions
|
|
@ -34,9 +34,15 @@ export function getCSS() {
|
|||
|
||||
export function apply() {
|
||||
let filterCSS = getCSS();
|
||||
$(".customBackground").css({
|
||||
let css = {
|
||||
filter: filterCSS,
|
||||
});
|
||||
width: `calc(100% + ${filters.blur.value * 4}rem)`,
|
||||
height: `calc(100% + ${filters.blur.value * 4}rem)`,
|
||||
left: `-${filters.blur.value * 2}rem`,
|
||||
top: `-${filters.blur.value * 2}rem`,
|
||||
position: "absolute",
|
||||
};
|
||||
$(".customBackground img").css(css);
|
||||
}
|
||||
|
||||
function syncSliders() {
|
||||
|
|
|
|||
|
|
@ -165,10 +165,11 @@ export function clearRandom() {
|
|||
}
|
||||
|
||||
export function applyCustomBackground() {
|
||||
$(".customBackground").css({
|
||||
backgroundImage: `url(${Config.customBackground})`,
|
||||
backgroundAttachment: "fixed",
|
||||
});
|
||||
// $(".customBackground").css({
|
||||
// backgroundImage: `url(${Config.customBackground})`,
|
||||
// backgroundAttachment: "fixed",
|
||||
// });
|
||||
$(".customBackground").html(`<img src="${Config.customBackground}"></img>`);
|
||||
if (Config.customBackground === "") {
|
||||
$("#words").removeClass("noErrorBorder");
|
||||
} else {
|
||||
|
|
@ -178,12 +179,14 @@ export function applyCustomBackground() {
|
|||
|
||||
export function applyCustomBackgroundSize() {
|
||||
if (Config.customBackgroundSize == "max") {
|
||||
$(".customBackground").css({
|
||||
backgroundSize: "100% 100%",
|
||||
$(".customBackground img").css({
|
||||
// width: "calc(100%)",
|
||||
// height: "calc(100%)",
|
||||
objectFit: "",
|
||||
});
|
||||
} else if (Config.customBackgroundSize != "") {
|
||||
$(".customBackground").css({
|
||||
backgroundSize: Config.customBackgroundSize,
|
||||
$(".customBackground img").css({
|
||||
objectFit: Config.customBackgroundSize,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -141,6 +141,9 @@ body {
|
|||
background-position: center center;
|
||||
background-repeat: no-repeat;
|
||||
z-index: -999;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
html {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue