diff --git a/README.md b/README.md index fe295c70cb..fa39c3b171 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Any-Language Wordle Clone +# Any-Language Word Guessing Game ## Changes in this fork @@ -24,7 +24,7 @@ _To adapt for your language (the basics):_ 4. Change the file in `src/constants/config.ts` to include meta data about your language. If your language needs words longer or shorter than 5, you can set that in this file and also set the number of tries. 5. Publish on GitHub Pages by changing the `homepage` key in `package.json` and running `npm run deploy` or just committing to the main branch (and a GitHub workflow will take care of the rest). -For more information, including how to localize the interface to your language, visit the blog article: https://blog.mothertongues.org/wordle/. +For more information, including how to localize the interface to your language, visit the blog article: https://blog.mothertongues.org/word-guessing-game/. The interface is translated by default in English, Kiswahili, Mandarin and Spanish - other translations are very welcome! To add translations please submit a pull request with the following steps: @@ -36,40 +36,18 @@ Thanks to Carolyn O'Meara (https://github.com/ckomeara) for providing the Spanis Thanks to Haowen Jiang (https://github.com/howard-haowen) for providing the 中文 translation. Thanks to Benson Muite (https://github.com/bkmgit) for providing the Kiswahili translation. -## On to the original stuff from @hannahcode... - -- Go play the real Wordle [here](https://www.powerlanguage.co.uk/wordle/) -- Read the story behind it [here](https://www.nytimes.com/2022/01/03/technology/wordle-word-game-creator.html) -- Try a demo of this clone project [here](https://wordle.hannahmariepark.com) - -_Inspiration:_ -This game is an open source clone of the immensely popular online word guessing game Wordle. Like many others all over the world, I saw the signature pattern of green, yellow, and white squares popping up all over social media and the web and had to check it out. After a few days of play, I decided it would be great for my learning to try to rebuild Wordle in React! - -_Design Decisions:_ -I used a combination of React, Typescript, and Tailwind to build this Wordle Clone. When examining the original Wordle, I assumed the list might come from an external API or database, but after investigating in chrome dev tools I found that the list of words is simply stored in an array on the front end. I'm using the same list as the OG Wordle uses, but watch out for spoilers if you go find the file in this repo! The word match functionality is simple: the word array index increments each day from a fixed game epoch timestamp (only one puzzle per day!) roughly like so: - -``` -WORDS[Math.floor((NOW_IN_MS - GAME_EPOCH_IN_MS) / ONE_DAY_IN_MS)] -``` - -React enabled me to componentize the littlest parts of the game - keys and letter cells - and use them as the building blocks for the keyboard, word grid, and winning solution graphic. As for handling state, I used the built in useState and useEffect hooks to track guesses, whether the game is won, and to conditionally render popups. - -In addition to other things, Typescript helped ensure type safety for the statuses of each guessed letter, which were used in many areas of the app and needed to be accurate for the game to work correctly. - -I implemented Tailwind mostly because I wanted to learn how to use Tailwind CSS, but I also took advantage of [Tailwind UI](https://tailwindui.com/) with their [headless package](https://headlessui.dev/) to build the modals and notifications. This was such an easy way to build simple popups for how to play, winning the game, and invalid words. - _To Run Locally:_ Clone the repository and perform the following command line actions: ```bash -$ cd wordle +$ cd anylanguage-word-guessing-game $ npm install $ npm run start ``` _To build/run docker container:_ ```bash -$ docker build -t notwordle . -$ docker run -d -p 3000:3000 notwordle +$ docker build -t anylanguage-word-guessing-game . +$ docker run -d -p 3000:3000 anylanguage-word-guessing-game ``` open http://localhost:3000 in browser. diff --git a/package-lock.json b/package-lock.json index 5dd917151d..08888a00a2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "any-language-wordle", + "name": "any-language-word-guessing-game", "version": "0.1.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "any-language-wordle", + "name": "any-language-word-guessing-game", "version": "0.1.0", "dependencies": { "@bcgov/bc-sans": "^1.0.1", @@ -5449,8 +5449,7 @@ "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "funding": [ - { + "funding": [{ "type": "github", "url": "https://github.com/sponsors/feross" }, @@ -6294,12 +6293,10 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.2.0.tgz", "integrity": "sha512-DtBMo82pv1dFtUmHyr48beiuq792Sxohr+8Hm9zoxklYPfa6n0Z3Byjj2IV7bmr2IyqClnqEQhfgHJJ5QF0R5A==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/fb55" - } - ] + "funding": [{ + "type": "github", + "url": "https://github.com/sponsors/fb55" + }] }, "node_modules/domexception": { "version": "2.0.1", @@ -7398,8 +7395,7 @@ "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "funding": [ - { + "funding": [{ "type": "github", "url": "https://github.com/sponsors/feross" }, @@ -7646,12 +7642,10 @@ "version": "1.14.6", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.6.tgz", "integrity": "sha512-fhUl5EwSJbbl8AR+uYL2KQDxLkdSjZGR36xy46AO7cOMTrCMON6Sa28FmAnC2tRTDbd/Uuzz3aJBv7EBN7JH8A==", - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/RubenVerborgh" - } - ], + "funding": [{ + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + }], "engines": { "node": ">=4.0" }, @@ -8489,8 +8483,7 @@ "version": "21.6.11", "resolved": "https://registry.npmjs.org/i18next/-/i18next-21.6.11.tgz", "integrity": "sha512-tJ2+o0lVO+fhi8bPkCpBAeY1SgkqmQm5NzgPWCQssBrywJw98/o+Kombhty5nxQOpHtvMmsxcOopczUiH6bJxQ==", - "funding": [ - { + "funding": [{ "type": "individual", "url": "https://locize.com" }, @@ -13517,8 +13510,7 @@ "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "funding": [ - { + "funding": [{ "type": "github", "url": "https://github.com/sponsors/feross" }, @@ -14300,8 +14292,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "funding": [ - { + "funding": [{ "type": "github", "url": "https://github.com/sponsors/feross" }, @@ -14832,8 +14823,7 @@ "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "funding": [ - { + "funding": [{ "type": "github", "url": "https://github.com/sponsors/feross" }, @@ -28827,4 +28817,4 @@ "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==" } } -} +} \ No newline at end of file diff --git a/package.json b/package.json index f781c05e81..a41b9d488d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { - "name": "any-language-wordle", + "name": "any-language-word-guessing-game", "version": "0.1.0", - "homepage": "https://roedoejet.github.io/AnyLanguage-Wordle", + "homepage": "https://roedoejet.github.io/AnyLanguage-Word-Guessing-Game", "private": true, "dependencies": { "@bcgov/bc-sans": "^1.0.1", diff --git a/public/index.html b/public/index.html index daf076e391..059cf37d14 100644 --- a/public/index.html +++ b/public/index.html @@ -1,14 +1,12 @@ -
+ + - + -