This commit is contained in:
Lynn 2022-01-18 17:09:12 +01:00
parent 8df7a8da6f
commit ca7f46667d
3 changed files with 15 additions and 4 deletions

View file

@ -1,7 +1,7 @@
# hello wordl
It's [Wordle](https://www.powerlanguage.co.uk/wordle/) but you can play forever!
Play it [here](http://foldr.moe/hello-wordl/).
Play it [here](https://foldr.moe/hello-wordl/).
## Introduction
Wordle is a word game similar to the TV show [Lingo](https://en.wikipedia.org/wiki/Lingo_(British_game_show)).

View file

@ -1,7 +1,7 @@
{
"name": "wordl",
"version": "0.1.0",
"homepage": "https://lynn.github.io/hello-wordl",
"homepage": "http://hellowordl.net/",
"private": false,
"dependencies": {
"@testing-library/jest-dom": "^5.16.1",

View file

@ -234,8 +234,19 @@ function Game(props: GameProps) {
<p>
<button
onClick={() => {
navigator.clipboard.writeText(getChallengeUrl(target));
setHint("Challenge link copied to clipboard!");
const url = getChallengeUrl(target);
if (!navigator.clipboard) {
setHint(url);
} else {
navigator.clipboard
.writeText(url)
.then(() => {
setHint("Challenge link copied to clipboard!");
})
.catch(() => {
setHint(url);
});
}
}}
>
Challenge a friend to this word