mirror of
https://github.com/Moe-Sakura/frontend.git
synced 2026-03-19 05:39:45 +08:00
feat: 根据VNDB模式调整主容器背景透明度
* VNDB模式激活且有背景图时,主容器背景设为不透明白色。 * VNDB模式未激活或无背景图时,主容器背景设为半透明白色。 * 优化界面视觉效果,提升内容与背景的融合度。
This commit is contained in:
15
src/main.js
15
src/main.js
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user