mirror of
https://github.com/DeveloLongScript/MHSF.git
synced 2026-05-07 16:44:59 -05:00
fix: p.2
This commit is contained in:
parent
76ebc94056
commit
53f7cdb171
@ -555,21 +555,6 @@ export async function GET(
|
||||
console.error("Failed to load fonts for error page:", e);
|
||||
}
|
||||
|
||||
// Try to load the banner image
|
||||
let bannerImageData: Buffer | null = null;
|
||||
try {
|
||||
const bannerPath = path.join(
|
||||
process.cwd(),
|
||||
"public",
|
||||
"branding",
|
||||
"dark-banner.png"
|
||||
);
|
||||
bannerImageData = fs.readFileSync(bannerPath);
|
||||
} catch (e) {
|
||||
// If banner image fails to load, use a solid color background
|
||||
console.error("Failed to load banner image for error page:", e);
|
||||
}
|
||||
|
||||
return new ImageResponse(
|
||||
(
|
||||
<div
|
||||
@ -577,7 +562,6 @@ export async function GET(
|
||||
display: "flex",
|
||||
fontSize: 60,
|
||||
color: "white",
|
||||
background: bannerImageData ? undefined : "#121212",
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
padding: "50px 50px",
|
||||
@ -585,11 +569,7 @@ export async function GET(
|
||||
justifyContent: "center",
|
||||
alignItems: "center",
|
||||
fontFamily: "Inter",
|
||||
...(bannerImageData && {
|
||||
backgroundImage: `url(data:image/png;base64,${bannerImageData.toString("base64")})`,
|
||||
backgroundSize: "cover",
|
||||
backgroundPosition: "center",
|
||||
}),
|
||||
backgroundColor: "white"
|
||||
}}
|
||||
>
|
||||
<div
|
||||
|
||||
@ -154,7 +154,6 @@ export async function GET(
|
||||
textAlign: "center",
|
||||
justifyContent: "center",
|
||||
alignItems: "center",
|
||||
backgroundImage: `url(${new URL("/branding/bg-banner.png", request.url).toString()})`,
|
||||
backgroundSize: "cover",
|
||||
backgroundPosition: "center",
|
||||
fontFamily: "Inter",
|
||||
@ -422,16 +421,6 @@ export async function GET(
|
||||
const [interRegular, interBold] = await loadFonts();
|
||||
console.error("Error generating OG image:", error);
|
||||
|
||||
// Try to load the banner image again in case it failed earlier
|
||||
let bannerImageData: ArrayBuffer | undefined;
|
||||
try {
|
||||
bannerImageData = await fetch(
|
||||
new URL("/branding/dark-banner.png", request.url)
|
||||
).then((res) => res.arrayBuffer());
|
||||
} catch (e) {
|
||||
// If banner image fails to load, use a solid color background
|
||||
console.error("Failed to load banner image for error page:", e);
|
||||
}
|
||||
|
||||
return new ImageResponse(
|
||||
(
|
||||
@ -440,7 +429,7 @@ export async function GET(
|
||||
display: "flex",
|
||||
fontSize: 60,
|
||||
color: "white",
|
||||
background: bannerImageData ? undefined : "#121212",
|
||||
background: "#121212",
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
padding: "50px 50px",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user