File tree Expand file tree Collapse file tree 3 files changed +31
-11
lines changed
Expand file tree Collapse file tree 3 files changed +31
-11
lines changed Original file line number Diff line number Diff line change 1111 "dependencies" : {
1212 "react" : " ^17.0.2" ,
1313 "react-dom" : " ^17.0.2" ,
14- "react-router-dom" : " ^6.27.0"
14+ "react-router-dom" : " ^6.27.0" ,
15+ "shadertoy-react" : " ^1.1.2"
1516 },
1617 "devDependencies" : {
1718 "@monaco-editor/react" : " ^4.3.1" ,
Original file line number Diff line number Diff line change 1+ //@ts -ignore
2+ import ShadertoyReact from "shadertoy-react" ;
3+ //Above is like only JS, but it works with react.
4+ //@ts -check
5+
6+ const fragmentShader = `
7+ void main(void) {
8+ vec2 uv = gl_FragCoord.xy/iResolution.xy;
9+ vec3 col = 0.5 + 0.5*cos(iTime+uv.xyx+vec3(0,2,4));
10+ gl_FragColor = vec4(col*0.25 ,1.0);
11+ }
12+ ` ;
13+
114export function Background ( ) : JSX . Element {
215 return < >
3- < div className = "bg-black" > </ div >
16+ < div className = "-z-1 fixed top-0 left-0 w-full h-full" >
17+ < ShadertoyReact fs = { fragmentShader } />
18+ </ div >
419 </ > ;
520 }
Original file line number Diff line number Diff line change @@ -10,19 +10,23 @@ import PGASGame from './Pages/ProjectsPage/PGASGame';
1010
1111export const App : React . FC = ( ) => {
1212 return < >
13- { < Background /> }
13+ { < Background /> }
1414
1515 { /* Top bar stuff */ }
16- { < Navbar /> }
16+ < div className = 'z-1 relative' >
17+ { < Navbar /> }
18+ </ div >
1719
1820 { /* Main page stuff */ }
19- < Routes >
20- < Route path = "/" element = { < Home /> } />
21- < Route path = "/proj" element = { < Projects /> } />
21+ < div className = 'z-0 pt-2' >
22+ < Routes >
23+ < Route path = "/" element = { < Home /> } />
24+ < Route path = "/proj" element = { < Projects /> } />
2225
23- { /* Side Pages */ }
24- < Route path = "/proj-first-glsl" element = { < FirstGLSL /> } />
25- < Route path = "/proj-pgas-game" element = { < PGASGame /> } />
26- </ Routes >
26+ { /* Side Pages */ }
27+ < Route path = "/proj-first-glsl" element = { < FirstGLSL /> } />
28+ < Route path = "/proj-pgas-game" element = { < PGASGame /> } />
29+ </ Routes >
30+ </ div >
2731 </ > ;
2832}
You can’t perform that action at this time.
0 commit comments