Skip to content

Commit e5a5f91

Browse files
authored
feat: add Game Room feature with loading and settings components (#8)
1 parent 054a1ad commit e5a5f91

File tree

12 files changed

+1424
-10
lines changed

12 files changed

+1424
-10
lines changed

package-lock.json

Lines changed: 767 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"lucide-react": "^0.507.0",
1616
"next": "15.3.1",
1717
"react": "^19.0.0",
18-
"react-dom": "^19.0.0"
18+
"react-dom": "^19.0.0",
19+
"starknet": "^6.24.1"
1920
},
2021
"devDependencies": {
2122
"@eslint/eslintrc": "^3",

src/app/assets/Private key.png

1.73 KB
Loading

src/app/assets/board.png

2.99 MB
Loading

src/app/assets/profiles.png

2.05 KB
Loading
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
"use client";
2+
3+
import React, { useEffect, useState } from "react";
4+
import Image from "next/image";
5+
import board from "@/app/assets/board.png";
6+
// import { useGameRoom } from "@/app/contexts/GameRoomContext";
7+
8+
export default function GameLoading() {
9+
const [dots, setDots] = useState("");
10+
11+
useEffect(() => {
12+
const dotInterval = setInterval(() => {
13+
setDots((prev) => (prev.length < 5 ? prev + "A" : ""));
14+
}, 300);
15+
16+
return () => clearInterval(dotInterval);
17+
}, []);
18+
19+
return (
20+
<div className="min-h-screen bg-[#010f10] flex items-center justify-center text-center p-4 text-white">
21+
<Image
22+
src={board}
23+
alt="board"
24+
className="absolute inset-0 w-full h-full object-cover opacity-30 blur-xs pointer-events-none z-0"
25+
style={{ clipPath: "inset(50% 0 0 0)" }}
26+
/>
27+
28+
<div className="max-w-xl">
29+
<h2 className="text-3xl md:text-4xl font-bold mb-6">Loading Game</h2>
30+
<p className="text-lg md:text-xl">
31+
Always remember to strategize properly and...
32+
<br />
33+
<span className="font-semibold">show no mercy!</span>
34+
</p>
35+
<p className="mt-8 text-xl md:text-3xl animate-pulse">
36+
😈MUAHAHAHAHAHA{dots}😈
37+
</p>
38+
</div>
39+
</div>
40+
);
41+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
"use client";
2+
3+
import React from "react";
4+
import Navbar from "../../components/navbar";
5+
import { useGameRoom } from "@/app/contexts/GameRoomContext";
6+
import GameSettings from "./GameSettings";
7+
import GameLoading from "./GameLoading";
8+
9+
export default function GameRoomContent() {
10+
const { state } = useGameRoom();
11+
12+
return (
13+
<div className="relative min-h-screen ">
14+
{/* Board Background - Fixed positioning */}
15+
16+
{/* Content with proper spacing */}
17+
<div className="relative">
18+
<Navbar />
19+
20+
<div className="pt-16"> {/* Add padding to prevent navbar overlap */}
21+
{!state?.settings ? (
22+
<div className="flex items-center justify-center min-h-[50vh]">
23+
<div className="text-xl bg-white/90 px-6 py-4 rounded-lg shadow-md">
24+
Loading settings...
25+
</div>
26+
</div>
27+
) : state.gameStarted ? (
28+
// Simplified condition - if game is started, always show loading
29+
// No check for isLoading since we want to stay in loading permanently
30+
<GameLoading />
31+
) : (
32+
<GameSettings />
33+
)}
34+
</div>
35+
</div>
36+
</div>
37+
);
38+
}

0 commit comments

Comments
 (0)