mirror of
https://github.com/woodchen-ink/nezha-dash-v1.git
synced 2025-07-18 17:41:56 +08:00
fix: custom background position on mobile
This commit is contained in:
parent
115fd59ec8
commit
45dc3f7935
19
src/App.tsx
19
src/App.tsx
@ -46,18 +46,19 @@ const App: React.FC = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Router basename={import.meta.env.BASE_URL}>
|
<Router basename={import.meta.env.BASE_URL}>
|
||||||
|
{/* 固定定位的背景层 */}
|
||||||
|
{customBackgroundImage && (
|
||||||
<div
|
<div
|
||||||
className={cn(
|
className="fixed inset-0 z-0 bg-cover min-h-lvh bg-no-repeat bg-center"
|
||||||
"flex min-h-screen w-full flex-col bg-cover bg-no-repeat bg-center bg-fixed",
|
style={{ backgroundImage: `url(${customBackgroundImage})` }}
|
||||||
{
|
/>
|
||||||
"bg-background": !customBackgroundImage,
|
|
||||||
},
|
|
||||||
)}
|
)}
|
||||||
style={{
|
<div
|
||||||
backgroundImage: customBackgroundImage ? `url(${customBackgroundImage})` : undefined,
|
className={cn("flex min-h-screen w-full flex-col", {
|
||||||
}}
|
"bg-background": !customBackgroundImage,
|
||||||
|
})}
|
||||||
>
|
>
|
||||||
<main className="flex min-h-[calc(100vh-calc(var(--spacing)*16))] flex-1 flex-col gap-4 p-4 md:p-10 md:pt-8">
|
<main className="flex z-20 min-h-[calc(100vh-calc(var(--spacing)*16))] flex-1 flex-col gap-4 p-4 md:p-10 md:pt-8">
|
||||||
<Header />
|
<Header />
|
||||||
<Routes>
|
<Routes>
|
||||||
<Route path="/" element={<Server />} />
|
<Route path="/" element={<Server />} />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user