MCPcopy Create free account
hub / github.com/MCSManager/MCSManager / setBackgroundImage

Function setBackgroundImage

frontend/src/stores/useAppConfigStore.ts:49–67  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

47 );
48
49 const setBackgroundImage = (url: string) => {
50 const body = document.querySelector("body");
51 if (body) {
52 body.style.backgroundSize = "cover";
53 body.style.backgroundPosition = "center";
54 body.style.backgroundRepeat = "no-repeat";
55 if (isDarkTheme.value) {
56 body.style.backgroundImage = `linear-gradient(135deg, rgba(0,0,0,0.65), rgba(0,0,0,0.65) 100%), url(${url})`;
57 body.classList.remove("app-light-extend-theme");
58 body.classList.add("app-dark-extend-theme");
59 } else {
60 body.style.backgroundImage = `linear-gradient(135deg, rgba(220,220,220,0.3), rgba(53,53,53,0.3) 100%), url(${url})`;
61 body.classList.remove("app-dark-extend-theme");
62 body.classList.add("app-light-extend-theme");
63 }
64
65 hasBgImage.value = true;
66 }
67 };
68
69 const setLight = () => {
70 theme.algorithm = antTheme.defaultAlgorithm;

Callers 1

initAppThemeFunction · 0.85

Calls 1

addMethod · 0.80

Tested by

no test coverage detected