File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ "use client" ;
2+
3+ import GamesButton from "@/components/GamesButton" ;
4+ import { useSearchParams } from "next/navigation" ;
5+
6+ export default function GamesClient ( ) {
7+ const params = useSearchParams ( ) ;
8+ const game = params . get ( "g" ) ;
9+ if ( game ) {
10+ return (
11+ < iframe className = { "h-dvh w-dvw" } src = { `/${ game } /index.html` } > </ iframe >
12+ ) ;
13+ } else {
14+ return (
15+ < div className = "flex flex-col items-center gap-5" >
16+ < h1 className = "justify-center text-7xl w-fit text-primary overflow-hidden" >
17+ Games
18+ </ h1 >
19+ < h2 className = "justify-center text-3xl w-fit text-secondary overflow-hidden" >
20+ Some (very unfinished) games by yours truly!
21+ </ h2 >
22+ < nav className = " grid grid-cols-3 gap-10" >
23+ < GamesButton to = "br2" name = "Banana Run 2" > </ GamesButton >
24+ < GamesButton to = "br3" name = "Banana Run 3" > </ GamesButton >
25+ < GamesButton
26+ to = "cfp"
27+ name = "Click For Points (web edition)"
28+ > </ GamesButton >
29+ < GamesButton
30+ to = "clicks_and_points"
31+ name = "Clicks & Points (VERY VERY EARLY DEVELOPEMENT)"
32+ > </ GamesButton >
33+ < GamesButton to = "plat" name = "Unnamed platformer game" > </ GamesButton >
34+ </ nav >
35+ </ div >
36+ ) ;
37+ }
38+ }
Original file line number Diff line number Diff line change 1- "use client" ;
2-
3- import GamesButton from "@/components/GamesButton" ;
4- import { useSearchParams } from "next/navigation" ;
5-
6- export default function GamesClient ( ) {
7- const params = useSearchParams ( ) ;
8- const game = params . get ( "g" ) ;
9- if ( game ) {
10- return (
11- < iframe className = { "h-dvh w-dvw" } src = { `/${ game } /index.html` } > </ iframe >
12- ) ;
13- } else {
14- return (
15- < div className = "flex flex-col items-center gap-5" >
16- < h1 className = "justify-center text-7xl w-fit text-primary overflow-hidden" >
17- Games
18- </ h1 >
19- < h2 className = "justify-center text-3xl w-fit text-secondary overflow-hidden" >
20- Some (very unfinished) games by yours truly!
21- </ h2 >
22- < nav className = " grid grid-cols-3 gap-10" >
23- < GamesButton to = "br2" name = "Banana Run 2" > </ GamesButton >
24- < GamesButton to = "br3" name = "Banana Run 3" > </ GamesButton >
25- < GamesButton
26- to = "cfp"
27- name = "Click For Points (web edition)"
28- > </ GamesButton >
29- < GamesButton
30- to = "clicks_and_points"
31- name = "Clicks & Points (VERY VERY EARLY DEVELOPEMENT)"
32- > </ GamesButton >
33- < GamesButton to = "plat" name = "Unnamed platformer game" > </ GamesButton >
34- </ nav >
35- </ div >
36- ) ;
37- }
38- }
1+ import { Suspense } from "react" ;
2+ import GamesClient from "./client" ;
3+
4+ export default function Games ( ) {
5+ return (
6+ < Suspense fallback = { < p > Loading...</ p > } >
7+ < GamesClient />
8+ </ Suspense >
9+ ) ;
10+ }
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ export default function RootLayout({
2525 </ header >
2626
2727 < SetColor />
28+
2829 < main className = "grow content-center" > { children } </ main >
2930 </ body >
3031 </ html >
Original file line number Diff line number Diff line change 11"use client" ;
22
3- import { useEffect } from "react" ;
3+ import { useLayoutEffect } from "react" ;
44
55export default function SetColor ( ) {
66 // Stackoverflow, you may be pretty much dead, but you aren't dead in my heart!
@@ -14,7 +14,7 @@ export default function SetColor() {
1414 return color ;
1515 }
1616
17- useEffect ( ( ) => {
17+ useLayoutEffect ( ( ) => {
1818 document . documentElement . style . setProperty ( "--secondary" , getRandomColor ( ) ) ;
1919 } , [ ] ) ;
2020
You can’t perform that action at this time.
0 commit comments