Spaces:
Running
Running
Commit
·
0591976
1
Parent(s):
5b7f9a5
about tab
Browse files- src/App.tsx +7 -1
- src/components/about-tab.tsx +49 -0
src/App.tsx
CHANGED
@@ -1,11 +1,12 @@
|
|
1 |
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
2 |
import ViewerTab from "@/components/viewer-tab";
|
3 |
import PlayTab from "@/components/play-tab";
|
|
|
4 |
import { SignInWithHuggingFaceButton } from "@/components/sign-in-with-hf-button";
|
5 |
import { useState } from "react";
|
6 |
|
7 |
export default function Home() {
|
8 |
-
const [selectedTab, setSelectedTab] = useState<"view" | "play">("view");
|
9 |
const [startArticle, setStartArticle] = useState<string>("");
|
10 |
const [destinationArticle, setDestinationArticle] = useState<string>("");
|
11 |
|
@@ -27,6 +28,7 @@ export default function Home() {
|
|
27 |
<TabsList className="mb-4">
|
28 |
<TabsTrigger value="view">View Runs</TabsTrigger>
|
29 |
<TabsTrigger value="play">Play Game</TabsTrigger>
|
|
|
30 |
</TabsList>
|
31 |
|
32 |
<TabsContent value="view">
|
@@ -36,6 +38,10 @@ export default function Home() {
|
|
36 |
<TabsContent value="play">
|
37 |
<PlayTab startArticle={startArticle} destinationArticle={destinationArticle} />
|
38 |
</TabsContent>
|
|
|
|
|
|
|
|
|
39 |
</Tabs>
|
40 |
</div>
|
41 |
);
|
|
|
1 |
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
2 |
import ViewerTab from "@/components/viewer-tab";
|
3 |
import PlayTab from "@/components/play-tab";
|
4 |
+
import AboutTab from "@/components/about-tab";
|
5 |
import { SignInWithHuggingFaceButton } from "@/components/sign-in-with-hf-button";
|
6 |
import { useState } from "react";
|
7 |
|
8 |
export default function Home() {
|
9 |
+
const [selectedTab, setSelectedTab] = useState<"view" | "play" | "about">("view");
|
10 |
const [startArticle, setStartArticle] = useState<string>("");
|
11 |
const [destinationArticle, setDestinationArticle] = useState<string>("");
|
12 |
|
|
|
28 |
<TabsList className="mb-4">
|
29 |
<TabsTrigger value="view">View Runs</TabsTrigger>
|
30 |
<TabsTrigger value="play">Play Game</TabsTrigger>
|
31 |
+
<TabsTrigger value="about">About</TabsTrigger>
|
32 |
</TabsList>
|
33 |
|
34 |
<TabsContent value="view">
|
|
|
38 |
<TabsContent value="play">
|
39 |
<PlayTab startArticle={startArticle} destinationArticle={destinationArticle} />
|
40 |
</TabsContent>
|
41 |
+
|
42 |
+
<TabsContent value="about">
|
43 |
+
<AboutTab />
|
44 |
+
</TabsContent>
|
45 |
</Tabs>
|
46 |
</div>
|
47 |
);
|
src/components/about-tab.tsx
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"use client";
|
2 |
+
|
3 |
+
import React from "react";
|
4 |
+
import { Card, CardContent, CardHeader, CardTitle, CardDescription } from "@/components/ui/card";
|
5 |
+
import { Button } from "@/components/ui/button";
|
6 |
+
import { ExternalLink } from "lucide-react";
|
7 |
+
|
8 |
+
export default function AboutTab() {
|
9 |
+
return (
|
10 |
+
<div className="space-y-6">
|
11 |
+
<Card>
|
12 |
+
<CardHeader>
|
13 |
+
<CardTitle className="text-2xl">About Wikispeedia</CardTitle>
|
14 |
+
<CardDescription>
|
15 |
+
A wiki racing game where you navigate from one Wikipedia article to another using only hyperlinks
|
16 |
+
</CardDescription>
|
17 |
+
</CardHeader>
|
18 |
+
<CardContent className="space-y-4">
|
19 |
+
<p>
|
20 |
+
Wikispeedia (also known as the Wikipedia Game, WikiRace, or WikiClick) is a game where players race to navigate from
|
21 |
+
one Wikipedia article to another using only the hyperlinks within each article. The goal is to reach the target
|
22 |
+
article in the fewest clicks or in the shortest time.
|
23 |
+
</p>
|
24 |
+
|
25 |
+
<p>
|
26 |
+
This implementation allows you to play against AI models or challenge yourself to find the most efficient path
|
27 |
+
between articles.
|
28 |
+
</p>
|
29 |
+
|
30 |
+
<h3 className="text-lg font-semibold mt-4">How to Play</h3>
|
31 |
+
<ol className="list-decimal pl-5 space-y-2">
|
32 |
+
<li>Select a starting article and a target article</li>
|
33 |
+
<li>Choose to play yourself or let an AI model play</li>
|
34 |
+
<li>Navigate through the articles using the buttons</li>
|
35 |
+
<li>Try to reach the target article in as few clicks as possible</li>
|
36 |
+
</ol>
|
37 |
+
|
38 |
+
<div className="flex justify-center mt-6">
|
39 |
+
<Button variant="outline" className="gap-2" asChild>
|
40 |
+
<a href="https://en.wikipedia.org/wiki/Wikipedia:Wiki_Game" target="_blank" rel="noopener noreferrer">
|
41 |
+
Learn more on Wikipedia <ExternalLink size={16} />
|
42 |
+
</a>
|
43 |
+
</Button>
|
44 |
+
</div>
|
45 |
+
</CardContent>
|
46 |
+
</Card>
|
47 |
+
</div>
|
48 |
+
);
|
49 |
+
}
|