feat: 根据VNDB模式调整主容器背景透明度

*   VNDB模式激活且有背景图时,主容器背景设为不透明白色。
*   VNDB模式未激活或无背景图时,主容器背景设为半透明白色。
*   优化界面视觉效果,提升内容与背景的融合度。
This commit is contained in:
Jurangren
2025-08-04 12:59:22 +08:00
parent a745745531
commit e73cdbd90b

View File

@@ -349,6 +349,11 @@ async function handleSearchSubmit(e) {
if (vndbDescription) vndbDescription.classList.add("hidden"); // Hide description instantly
}
document.body.classList.remove("vndb-mode");
const mainContainer = document.getElementById("main-container");
if (mainContainer) {
mainContainer.classList.remove("bg-white");
mainContainer.classList.add("bg-white/95");
}
if (backgroundLayer) {
backgroundLayer.style.backgroundImage = "none";
}
@@ -452,11 +457,21 @@ async function handleSearchSubmit(e) {
img.onload = () => {
backgroundLayer.style.backgroundImage = `url(${vndbInfo.screenshotUrl})`;
document.body.classList.add("vndb-mode");
const mainContainer = document.getElementById("main-container");
if (mainContainer) {
mainContainer.classList.remove("bg-white/95");
mainContainer.classList.add("bg-white");
}
};
img.src = vndbInfo.screenshotUrl;
} else {
backgroundLayer.style.backgroundImage = "none";
document.body.classList.remove("vndb-mode");
const mainContainer = document.getElementById("main-container");
if (mainContainer) {
mainContainer.classList.remove("bg-white");
mainContainer.classList.add("bg-white/95");
}
}
// Show panel only if there is something to display