| import { useGpuTier } from "@nous-research/ui/hooks/use-gpu-tier"; |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| export function Backdrop() { |
| const gpuTier = useGpuTier(); |
|
|
| return ( |
| <> |
| <div |
| aria-hidden |
| className="pointer-events-none fixed inset-0 z-[1]" |
| style={{ |
| backgroundColor: "var(--background-base)", |
| mixBlendMode: "difference", |
| }} |
| /> |
|
|
| <div |
| aria-hidden |
| className="pointer-events-none fixed inset-0 z-[2]" |
| style={ |
| { |
| // Themes can override the filler background by setting |
| // `assets.bg` — the <img> hides itself when a CSS bg is set |
| // so the two don't double-darken. CSS var fallbacks keep the |
| // default behaviour unchanged when no theme customises these. |
| mixBlendMode: "var(--component-backdrop-filler-blend-mode, difference)", |
| opacity: "var(--component-backdrop-filler-opacity, 0.033)", |
| backgroundImage: "var(--theme-asset-bg)", |
| backgroundSize: "var(--component-backdrop-background-size, cover)", |
| backgroundPosition: "var(--component-backdrop-background-position, center)", |
| } as unknown as React.CSSProperties |
| } |
| > |
| {/* Default filler image only renders when no theme-asset-bg is |
| set. Themes that provide their own `assets.bg` override the |
| <div>'s backgroundImage above, so hiding the <img> in that |
| case prevents the two from compositing incorrectly. */} |
| <img |
| alt="" |
| className="h-[150dvh] w-auto min-w-[100dvw] object-cover object-top-left invert theme-default-filler" |
| fetchPriority="low" |
| src="/ds-assets/filler-bg0.jpg" |
| /> |
| </div> |
|
|
| <div |
| aria-hidden |
| className="pointer-events-none fixed inset-0 z-[99]" |
| style={{ |
| background: |
| "radial-gradient(ellipse at 0% 0%, transparent 60%, var(--warm-glow) 100%)", |
| mixBlendMode: "lighten", |
| opacity: 0.22, |
| }} |
| /> |
|
|
| {gpuTier > 0 && ( |
| <div |
| aria-hidden |
| className="pointer-events-none fixed inset-0 z-[101]" |
| style={{ |
| backgroundImage: |
| "url(\"data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' fill='%23eaeaea' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E\")", |
| backgroundSize: "512px 512px", |
| mixBlendMode: "color-dodge", |
| opacity: "calc(0.55 * var(--noise-opacity-mul, 1))", |
| }} |
| /> |
| )} |
| </> |
| ); |
| } |
|
|