Set-seed UI
This commit is contained in:
22
src/App.tsx
22
src/App.tsx
@@ -1,6 +1,6 @@
|
||||
import "./App.css";
|
||||
import common from "./common.json";
|
||||
import { dictionarySet, pick } from "./util";
|
||||
import { dictionarySet, pick, seed } from "./util";
|
||||
import Game from "./Game";
|
||||
import { names } from "./names";
|
||||
import { useState } from "react";
|
||||
@@ -18,6 +18,19 @@ function App() {
|
||||
{about ? "Close" : "About"}
|
||||
</a>
|
||||
</div>
|
||||
<div style={{ position: "absolute", left: 5, top: 5 }}>
|
||||
<a
|
||||
href="#"
|
||||
onClick={() =>
|
||||
(document.location = seed
|
||||
? "/"
|
||||
: "?seed=" +
|
||||
new Date().toISOString().replace(/-/g, "").slice(0, 8))
|
||||
}
|
||||
>
|
||||
{seed ? "Random" : "Today's"}
|
||||
</a>
|
||||
</div>
|
||||
{about && (
|
||||
<div className="App-about">
|
||||
<p>
|
||||
@@ -49,8 +62,7 @@ function App() {
|
||||
<br />
|
||||
<b>R</b> is correct! The third letter is <b>R</b>
|
||||
.<br />
|
||||
<b>D</b> occurs <em>elsewhere</em> in the target
|
||||
word.
|
||||
<b>D</b> occurs <em>elsewhere</em> in the target word.
|
||||
</p>
|
||||
<p>
|
||||
Let's move the <b>D</b> in our next guess:
|
||||
@@ -77,7 +89,9 @@ function App() {
|
||||
/>
|
||||
Got it!
|
||||
</p>
|
||||
Report issues <a href="https://github.com/lynn/hello-wordl/issues">here</a>, or tweet <a href="https://twitter.com/chordbug">@chordbug</a>.
|
||||
Report issues{" "}
|
||||
<a href="https://github.com/lynn/hello-wordl/issues">here</a>, or
|
||||
tweet <a href="https://twitter.com/chordbug">@chordbug</a>.
|
||||
</div>
|
||||
)}
|
||||
<Game maxGuesses={maxGuesses} hidden={about} />
|
||||
|
||||
Reference in New Issue
Block a user