Felix Zieger
commited on
Commit
Β·
683d2d2
1
Parent(s):
72443f0
help dialog
Browse files
src/components/game/WelcomeScreen.tsx
CHANGED
|
@@ -2,7 +2,8 @@ import { Button } from "@/components/ui/button";
|
|
| 2 |
import { motion } from "framer-motion";
|
| 3 |
import { useState } from "react";
|
| 4 |
import { HighScoreBoard } from "../HighScoreBoard";
|
| 5 |
-
import { Dialog, DialogContent } from "@/components/ui/dialog";
|
|
|
|
| 6 |
|
| 7 |
interface WelcomeScreenProps {
|
| 8 |
onStart: () => void;
|
|
@@ -10,20 +11,46 @@ interface WelcomeScreenProps {
|
|
| 10 |
|
| 11 |
export const WelcomeScreen = ({ onStart }: WelcomeScreenProps) => {
|
| 12 |
const [showHighScores, setShowHighScores] = useState(false);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
return (
|
| 15 |
<>
|
| 16 |
<motion.div
|
| 17 |
initial={{ opacity: 0 }}
|
| 18 |
animate={{ opacity: 1 }}
|
| 19 |
-
className="text-center"
|
| 20 |
>
|
| 21 |
-
<
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
</
|
|
|
|
| 27 |
<div className="space-y-4">
|
| 28 |
<Button
|
| 29 |
onClick={onStart}
|
|
@@ -31,13 +58,22 @@ export const WelcomeScreen = ({ onStart }: WelcomeScreenProps) => {
|
|
| 31 |
>
|
| 32 |
Start Game β
|
| 33 |
</Button>
|
| 34 |
-
<
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
</div>
|
| 42 |
</motion.div>
|
| 43 |
|
|
@@ -51,6 +87,15 @@ export const WelcomeScreen = ({ onStart }: WelcomeScreenProps) => {
|
|
| 51 |
/>
|
| 52 |
</DialogContent>
|
| 53 |
</Dialog>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
</>
|
| 55 |
);
|
| 56 |
-
};
|
|
|
|
| 2 |
import { motion } from "framer-motion";
|
| 3 |
import { useState } from "react";
|
| 4 |
import { HighScoreBoard } from "../HighScoreBoard";
|
| 5 |
+
import { Dialog, DialogContent, DialogHeader, DialogTitle } from "@/components/ui/dialog";
|
| 6 |
+
import { Card, CardContent } from "@/components/ui/card";
|
| 7 |
|
| 8 |
interface WelcomeScreenProps {
|
| 9 |
onStart: () => void;
|
|
|
|
| 11 |
|
| 12 |
export const WelcomeScreen = ({ onStart }: WelcomeScreenProps) => {
|
| 13 |
const [showHighScores, setShowHighScores] = useState(false);
|
| 14 |
+
const [showHowToPlay, setShowHowToPlay] = useState(false);
|
| 15 |
+
|
| 16 |
+
const HowToPlayContent = () => (
|
| 17 |
+
<div className="space-y-6">
|
| 18 |
+
<div className="grid gap-4 text-gray-600">
|
| 19 |
+
<div>
|
| 20 |
+
<h3 className="font-medium text-gray-800">The Setup</h3>
|
| 21 |
+
<p>You'll work with two AIs: one as your partner giving clues, and another trying to guess the word.</p>
|
| 22 |
+
</div>
|
| 23 |
+
<div>
|
| 24 |
+
<h3 className="font-medium text-gray-800">Your Goal</h3>
|
| 25 |
+
<p>Help the AI guess the secret word using one-word clues. Each correct guess earns you a point!</p>
|
| 26 |
+
</div>
|
| 27 |
+
<div>
|
| 28 |
+
<h3 className="font-medium text-gray-800">The Rules</h3>
|
| 29 |
+
<ul className="list-disc list-inside space-y-1">
|
| 30 |
+
<li>One word per clue only</li>
|
| 31 |
+
<li>No parts of the secret word or translations</li>
|
| 32 |
+
<li>Clues must relate to the word (be creative!)</li>
|
| 33 |
+
<li>No spelling out the answer</li>
|
| 34 |
+
</ul>
|
| 35 |
+
</div>
|
| 36 |
+
</div>
|
| 37 |
+
</div>
|
| 38 |
+
);
|
| 39 |
|
| 40 |
return (
|
| 41 |
<>
|
| 42 |
<motion.div
|
| 43 |
initial={{ opacity: 0 }}
|
| 44 |
animate={{ opacity: 1 }}
|
| 45 |
+
className="max-w-2xl mx-auto text-center space-y-8"
|
| 46 |
>
|
| 47 |
+
<div>
|
| 48 |
+
<h1 className="mb-4 text-4xl font-bold text-gray-900">Think in Sync</h1>
|
| 49 |
+
<p className="text-lg text-gray-600">
|
| 50 |
+
A modern twist on a classic children's game where you team up with AI to guess secret words!
|
| 51 |
+
</p>
|
| 52 |
+
</div>
|
| 53 |
+
|
| 54 |
<div className="space-y-4">
|
| 55 |
<Button
|
| 56 |
onClick={onStart}
|
|
|
|
| 58 |
>
|
| 59 |
Start Game β
|
| 60 |
</Button>
|
| 61 |
+
<div className="grid grid-cols-2 gap-4">
|
| 62 |
+
<Button
|
| 63 |
+
onClick={() => setShowHowToPlay(true)}
|
| 64 |
+
variant="outline"
|
| 65 |
+
className="text-lg"
|
| 66 |
+
>
|
| 67 |
+
How to Play π
|
| 68 |
+
</Button>
|
| 69 |
+
<Button
|
| 70 |
+
onClick={() => setShowHighScores(true)}
|
| 71 |
+
variant="outline"
|
| 72 |
+
className="text-lg"
|
| 73 |
+
>
|
| 74 |
+
Leaderboard π
|
| 75 |
+
</Button>
|
| 76 |
+
</div>
|
| 77 |
</div>
|
| 78 |
</motion.div>
|
| 79 |
|
|
|
|
| 87 |
/>
|
| 88 |
</DialogContent>
|
| 89 |
</Dialog>
|
| 90 |
+
|
| 91 |
+
<Dialog open={showHowToPlay} onOpenChange={setShowHowToPlay}>
|
| 92 |
+
<DialogContent className="sm:max-w-[600px]">
|
| 93 |
+
<DialogHeader>
|
| 94 |
+
<DialogTitle className="text-xl font-semibold text-primary">How to Play</DialogTitle>
|
| 95 |
+
</DialogHeader>
|
| 96 |
+
<HowToPlayContent />
|
| 97 |
+
</DialogContent>
|
| 98 |
+
</Dialog>
|
| 99 |
</>
|
| 100 |
);
|
| 101 |
+
};
|