| import { PAGE_GRADIENTS } from "../../config/gradients"; |
| import type { GradientPageKey } from "../../config/gradients"; |
| import { useAppContext } from "../../context/AppContext"; |
| import { useMediaQuery } from "../../hooks/useMediaQuery"; |
|
|
| interface GradientMeshProps { |
| |
| page: GradientPageKey; |
| } |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| export function GradientMesh({ page }: GradientMeshProps) { |
| const { isDarkMode } = useAppContext(); |
| const isMobile = useMediaQuery("(max-width: 767px)"); |
|
|
| const gradients = PAGE_GRADIENTS[page]; |
| let background: string; |
|
|
| if (isMobile) { |
| background = isDarkMode ? gradients.mobileDark : gradients.mobileLight; |
| } else { |
| background = isDarkMode ? gradients.dark : gradients.light; |
| } |
|
|
| return ( |
| <div className="absolute inset-0 -z-20 overflow-hidden" aria-hidden="true"> |
| <div className="absolute inset-0" style={{ background }} /> |
| </div> |
| ); |
| } |
|
|