Skip to content

Commit fee1ee3

Browse files
committed
add global UI shader
1 parent e7f742d commit fee1ee3

2 files changed

Lines changed: 86 additions & 0 deletions

File tree

src/App.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { ThemeProvider } from "@/components/theme-provider"
2+
import { GlobalShaderOverlay } from "@/components/ui/global-shader-overlay"
23
import { BrowserRouter as Router, Routes, Route, Navigate } from 'react-router-dom';
34
import { AuthProvider, useAuth } from './contexts/AuthContext';
45
import { GlobalProvider } from './contexts/GlobalContext';
@@ -54,6 +55,7 @@ function App() {
5455
<WorkspaceProvider>
5556
<GlobalProvider>
5657
<PWAProvider>
58+
<GlobalShaderOverlay />
5759
<Routes>
5860
<Route path="/" element={<LandingPage />} />
5961
<Route path="/docs" element={<DocsPage />} />
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
import React from "react"
2+
import { cn } from "@/lib/utils"
3+
4+
const NOISE_TEXTURE_DATA_URL =
5+
"data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20160%20160'%3E%3Cfilter%20id='n'%3E%3CfeTurbulence%20type='fractalNoise'%20baseFrequency='0.8'%20numOctaves='4'%20stitchTiles='noStitch'/%3E%3C/filter%3E%3Crect%20width='100%25'%20height='100%25'%20filter='url(%23n)'%20opacity='0.45'/%3E%3C/svg%3E"
6+
7+
type GlobalShaderOverlayProps = {
8+
className?: string
9+
}
10+
11+
export const GlobalShaderOverlay = ({ className }: GlobalShaderOverlayProps) => {
12+
return (
13+
<div
14+
aria-hidden="true"
15+
className={cn(
16+
"pointer-events-none fixed inset-0 z-30 overflow-hidden",
17+
"opacity-60 mix-blend-normal dark:mix-blend-screen",
18+
className
19+
)}
20+
>
21+
<div className="absolute inset-0 dark:hidden">
22+
<div
23+
className="absolute -top-[25%] left-[-10%] h-[85%] w-[130%] blur-3xl"
24+
style={{
25+
backgroundImage:
26+
"radial-gradient(circle at 20% 15%, rgba(30, 64, 175, 0.45) 0%, rgba(15, 23, 42, 0) 60%)",
27+
}}
28+
/>
29+
<div
30+
className="absolute bottom-[-25%] right-[-20%] h-[90%] w-[140%] blur-3xl"
31+
style={{
32+
backgroundImage:
33+
"radial-gradient(circle at 80% 100%, rgba(30, 64, 175, 0.35) 0%, rgba(15, 23, 42, 0) 65%)",
34+
}}
35+
/>
36+
<div
37+
className="absolute inset-[6%] blur-3xl"
38+
style={{
39+
backgroundImage:
40+
"radial-gradient(circle at 35% 55%, rgba(15, 23, 42, 0.25) 0%, rgba(15, 23, 42, 0) 55%)",
41+
}}
42+
/>
43+
<div
44+
className="absolute bottom-[-5%] right-[-5%] h-[40%] w-[45%] blur-2xl"
45+
style={{
46+
backgroundImage:
47+
"radial-gradient(circle at 100% 100%, rgba(37, 99, 235, 0.5) 0%, rgba(15, 23, 42, 0) 55%)",
48+
}}
49+
/>
50+
</div>
51+
52+
<div className="absolute inset-0 hidden dark:block">
53+
<div
54+
className="absolute -top-[45%] left-[-25%] h-[100%] w-[150%] blur-3xl"
55+
style={{
56+
backgroundImage:
57+
"radial-gradient(circle at 25% 0%, rgba(59, 130, 246, 0.75) 0%, rgba(15, 23, 42, 0) 55%)",
58+
}}
59+
/>
60+
<div
61+
className="absolute inset-[8%] blur-3xl"
62+
style={{
63+
backgroundImage:
64+
"radial-gradient(circle at 55% 80%, rgba(15, 23, 42, 0.9) 0%, rgba(0, 0, 0, 0.9) 70%)",
65+
}}
66+
/>
67+
<div
68+
className="absolute bottom-[-10%] right-[-5%] h-[45%] w-[50%] blur-3xl"
69+
style={{
70+
backgroundImage:
71+
"radial-gradient(circle at 100% 100%, rgba(96, 165, 250, 0.9) 0%, rgba(15, 23, 42, 0) 60%)",
72+
}}
73+
/>
74+
</div>
75+
76+
<div
77+
className="pointer-events-none absolute inset-0 opacity-25 mix-blend-overlay"
78+
style={{
79+
backgroundImage: `url(${NOISE_TEXTURE_DATA_URL})`,
80+
}}
81+
/>
82+
</div>
83+
)
84+
}

0 commit comments

Comments
 (0)