|
1 | 1 | import { type ReactNode } from "react"; |
2 | 2 | import blurredDashboardBackgroundMenuTop from "~/assets/images/blurred-dashboard-background-menu-top.jpg"; |
| 3 | +import blurredDashboardBackgroundMenuTopLight from "~/assets/images/blurred-dashboard-background-menu-top-light.jpg"; |
3 | 4 | import blurredDashboardBackgroundMenuBottom from "~/assets/images/blurred-dashboard-background-menu-bottom.jpg"; |
| 5 | +import blurredDashboardBackgroundMenuBottomLight from "~/assets/images/blurred-dashboard-background-menu-bottom-light.jpg"; |
4 | 6 | import blurredDashboardBackgroundTable from "~/assets/images/blurred-dashboard-background-table.jpg"; |
| 7 | +import blurredDashboardBackgroundTableLight from "~/assets/images/blurred-dashboard-background-table-light.jpg"; |
| 8 | + |
| 9 | +/* Blurred dashboard screenshots; the -light set is the same artwork with the |
| 10 | + lightness inverted for the light theme. */ |
| 11 | +const BACKDROPS = [ |
| 12 | + { |
| 13 | + images: { |
| 14 | + menuTop: blurredDashboardBackgroundMenuTop, |
| 15 | + menuBottom: blurredDashboardBackgroundMenuBottom, |
| 16 | + table: blurredDashboardBackgroundTable, |
| 17 | + }, |
| 18 | + tableFill: "#101214", |
| 19 | + className: "hidden lg:block light:lg:hidden", |
| 20 | + }, |
| 21 | + { |
| 22 | + images: { |
| 23 | + menuTop: blurredDashboardBackgroundMenuTopLight, |
| 24 | + menuBottom: blurredDashboardBackgroundMenuBottomLight, |
| 25 | + table: blurredDashboardBackgroundTableLight, |
| 26 | + }, |
| 27 | + tableFill: "#f4f5f7", |
| 28 | + className: "hidden light:lg:block", |
| 29 | + }, |
| 30 | +]; |
5 | 31 |
|
6 | 32 | export function BackgroundWrapper({ children }: { children: ReactNode }) { |
7 | 33 | return ( |
8 | 34 | <div className="relative h-full w-full overflow-hidden bg-background-dimmed lg:bg-transparent"> |
9 | | - <div |
10 | | - className="absolute left-0 top-0 hidden w-[260px] bg-contain bg-top-left bg-no-repeat lg:block" |
11 | | - style={{ |
12 | | - backgroundImage: `url(${blurredDashboardBackgroundMenuTop})`, |
13 | | - aspectRatio: "auto", |
14 | | - height: "100vh", |
15 | | - backgroundSize: "260px auto", |
16 | | - }} |
17 | | - /> |
| 35 | + {BACKDROPS.map(({ images, tableFill, className }) => ( |
| 36 | + <div key={tableFill} className={className}> |
| 37 | + <div |
| 38 | + className="absolute left-0 top-0 w-[260px] bg-contain bg-top-left bg-no-repeat" |
| 39 | + style={{ |
| 40 | + backgroundImage: `url(${images.menuTop})`, |
| 41 | + aspectRatio: "auto", |
| 42 | + height: "100vh", |
| 43 | + backgroundSize: "260px auto", |
| 44 | + }} |
| 45 | + /> |
18 | 46 |
|
19 | | - <div |
20 | | - className="absolute bottom-0 left-0 hidden w-[260px] bg-contain bg-bottom-left bg-no-repeat lg:block" |
21 | | - style={{ |
22 | | - backgroundImage: `url(${blurredDashboardBackgroundMenuBottom})`, |
23 | | - aspectRatio: "auto", |
24 | | - height: "100vh", |
25 | | - backgroundSize: "260px auto", |
26 | | - }} |
27 | | - /> |
| 47 | + <div |
| 48 | + className="absolute bottom-0 left-0 w-[260px] bg-contain bg-bottom-left bg-no-repeat" |
| 49 | + style={{ |
| 50 | + backgroundImage: `url(${images.menuBottom})`, |
| 51 | + aspectRatio: "auto", |
| 52 | + height: "100vh", |
| 53 | + backgroundSize: "260px auto", |
| 54 | + }} |
| 55 | + /> |
28 | 56 |
|
29 | | - <div |
30 | | - className="absolute top-0 hidden bg-top-left bg-no-repeat lg:block" |
31 | | - style={{ |
32 | | - left: "260px", |
33 | | - backgroundImage: `url(${blurredDashboardBackgroundTable})`, |
34 | | - width: "100%", |
35 | | - height: "100vh", |
36 | | - backgroundSize: "1200px auto", |
37 | | - backgroundColor: "#101214", |
38 | | - }} |
39 | | - /> |
| 57 | + <div |
| 58 | + className="absolute top-0 bg-top-left bg-no-repeat" |
| 59 | + style={{ |
| 60 | + left: "260px", |
| 61 | + backgroundImage: `url(${images.table})`, |
| 62 | + width: "100%", |
| 63 | + height: "100vh", |
| 64 | + backgroundSize: "1200px auto", |
| 65 | + backgroundColor: tableFill, |
| 66 | + }} |
| 67 | + /> |
| 68 | + </div> |
| 69 | + ))} |
40 | 70 |
|
41 | 71 | <div className="relative z-10 h-full w-full">{children}</div> |
42 | 72 | </div> |
|
0 commit comments