Skip to content

Commit 8bc4ef8

Browse files
committed
Update README and prepare app for production build
1 parent 0aa1ba9 commit 8bc4ef8

File tree

9 files changed

+30
-16
lines changed

9 files changed

+30
-16
lines changed

README.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,31 @@
11
# GaliGuessr
22

3-
React geography quiz 🌍 Originally designed for [Galicia](https://en.wikipedia.org/wiki/Galicia_(Spain)) but customizable for any region in the world. Try it for yourself at ...
3+
React geography quiz 🌍 Originally designed for [Galicia](https://en.wikipedia.org/wiki/Galicia_(Spain)) but customizable for any region in the world. Try it for yourself at https://minimuino.github.io/galiguessr/
44

55
## Features
66

7-
- Four game modes: Point & Click, Write Name, Guess Location and City Map.
7+
- Four game modes: Point & Click, Write Name, Guess Location and Guess the City.
88
- Load any valid geojson file and create a custom map quiz.
99
- Responsive design.
1010

1111
## Usage
1212

13-
1. Fork this repo.
13+
Go to [the custom quiz page](https://minimuino.github.io/galiguessr/custom-quiz), choose a valid geojson file from your local storage, select game mode and hit play button. The geojson file must meet two requirements:
14+
- It is a valid geojson: https://datatracker.ietf.org/doc/html/rfc7946
15+
- Every Feature item has a `properties` field that includes the `name` property with some string value.
16+
17+
There are several websites you can use to get nice geospatial data:
18+
- https://overpass-turbo.eu/
19+
- https://www.naturalearthdata.com/
20+
- https://github.com/martynafford/natural-earth-geojson
21+
- https://gadm.org/
22+
23+
You can also make your own geography quiz by following these steps:
24+
1. Fork or copy this repo.
1425
2. Choose a name and logo for your project and set it in metadata properties.
1526
3. Replace all files in `/data/geojson` with your own. Make sure each Feature item has an `id` field and a `properties` field that includes the `name` property.
1627
4. Edit `/src/assets/settings.json` to reference each one of your geojson files.
17-
5. Set your language to 'en' in `/src/i18n.ts`, or add new i18n files if you want so.
28+
5. Set your language to 'en' in `/src/i18n.ts`, or add new i18n files if you want to.
1829
6. Edit `/src/components/CreditsModal.tsx` to add your own copyright notice.
1930
7. Deploy and enjoy!
2031

src/App.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export default function Home() {
5151
<main className="flex flex-col gap-16 row-start-2 items-center">
5252
<div className="flex flex-col gap-6">
5353
<img
54-
src="/logo.svg"
54+
src="./logo.svg"
5555
alt="Galiguessr logo"
5656
width={450}
5757
height={76}
@@ -90,7 +90,7 @@ export default function Home() {
9090
onClick={onClickBack}
9191
>
9292
<img
93-
src="/back.svg"
93+
src="./back.svg"
9494
alt="Back"
9595
width={14}
9696
height={14}
@@ -147,7 +147,7 @@ export default function Home() {
147147
>
148148
<img
149149
aria-hidden
150-
src="/github-mark.svg"
150+
src="./github-mark.svg"
151151
alt="Github icon"
152152
width={16}
153153
height={16}
@@ -162,7 +162,7 @@ export default function Home() {
162162
>
163163
<img
164164
aria-hidden
165-
src="/globe.svg"
165+
src="./globe.svg"
166166
alt="Error icon"
167167
width={16}
168168
height={16}
@@ -175,7 +175,7 @@ export default function Home() {
175175
>
176176
<img
177177
aria-hidden
178-
src="/file.svg"
178+
src="./file.svg"
179179
alt="Credits icon"
180180
width={16}
181181
height={16}

src/assets/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
{"name": "Vilas e Cidades", "data": "vilas-cidades.json", "availableModes": ["point-and-click", "guess-location", "write-name", "city-map"]},
66
{"name": "Ríos", "data": "rios.json", "availableModes": ["point-and-click", "guess-location", "write-name"]},
77
{"name": "Natureza", "data": "natureza.json", "availableModes": ["point-and-click", "guess-location", "write-name"]},
8-
{"name": "100 ao azar", "data": "random", "availableModes": ["point-and-click","guess-location"]}
8+
{"name": "100 ao azar", "data": "random", "availableModes": ["guess-location"]}
99
]
1010
}

src/components/CreditsModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default function CreditsModal({ ref }: Props) {
2222
>
2323
<div className="rounded-xl overflow-hidden bg-white p-8 flex flex-col gap-8 items-left">
2424
<img
25-
src="/logo.svg"
25+
src="./logo.svg"
2626
alt="Galiguessr logo"
2727
width={280}
2828
height={56}

src/components/GameOverModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export default function GameOverModal({ score, totalDistanceKm, datasetName, mod
6565
>
6666
<div className="rounded-xl overflow-hidden bg-white p-8 flex flex-col gap-8 items-center">
6767
<img
68-
src="/logo.svg"
68+
src="./logo.svg"
6969
alt="Galiguessr logo"
7070
width={280}
7171
height={56}

src/components/TextInput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export default function TextInput({ onEnterText }: Props) {
3838
type="submit"
3939
>
4040
<img
41-
src="/send.svg"
41+
src="./send.svg"
4242
alt="Submit icon"
4343
width={28}
4444
height={28}

src/main.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ const router = createBrowserRouter([
2929
{
3030
path: "/custom-quiz",
3131
element: <SelectFile />,
32-
},
33-
]);
32+
}],
33+
{
34+
basename: import.meta.env.BASE_URL
35+
});
3436

3537
createRoot(document.getElementById("root")!).render(
3638
<StrictMode>

src/pages/Play.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ export default function Play() {
131131
>
132132
<img
133133
className="-translate-x-[2px]"
134-
src="/back.svg"
134+
src="./back.svg"
135135
alt="Back"
136136
width={16}
137137
height={16}

vite.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ import { defineConfig } from "vite";
1111
// https://vite.dev/config/
1212
export default defineConfig({
1313
plugins: [react()],
14+
base: "/galiguessr/",
1415
});

0 commit comments

Comments
 (0)