Explain double letters in About

This commit is contained in:
Lynn 2022-01-18 14:02:08 +01:00
parent 62a516087f
commit 96ba2fd52e
3 changed files with 48 additions and 8 deletions

View file

@ -16,8 +16,9 @@ export function About() {
<p> <p>
You get {maxGuesses} tries to guess a target word. You get {maxGuesses} tries to guess a target word.
<br /> <br />
After each guess, you get Mastermind-style feedback: After each guess, you get Mastermind-style feedback.
</p> </p>
<hr />
<Row <Row
rowState={RowState.LockedIn} rowState={RowState.LockedIn}
wordLength={4} wordLength={4}
@ -30,11 +31,20 @@ export function About() {
/> />
<p> <p>
<b>W</b> and <b>O</b> aren't in the target word at all. <b>W</b> and <b>O</b> aren't in the target word at all.
<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.
</p> </p>
<p>
<b className="green-bg">R</b> is correct! The third letter is{" "}
<b className="green-bg">R</b>
.<br />
<strong>(There may still be a second R in the word.)</strong>
</p>
<p>
<b className="yellow-bg">D</b> occurs <em>elsewhere</em> in the target
word.
<br />
<strong>(Perhaps more than once. 🤔)</strong>
</p>
<hr />
<p> <p>
Let's move the <b>D</b> in our next guess: Let's move the <b>D</b> in our next guess:
</p> </p>
@ -47,8 +57,8 @@ export function About() {
{ clue: Clue.Correct, letter: "r" }, { clue: Clue.Correct, letter: "r" },
{ clue: Clue.Absent, letter: "k" }, { clue: Clue.Absent, letter: "k" },
]} ]}
annotation={"So close!"}
/> />
<p>So close!</p>
<Row <Row
rowState={RowState.LockedIn} rowState={RowState.LockedIn}
wordLength={4} wordLength={4}
@ -58,8 +68,8 @@ export function About() {
{ clue: Clue.Correct, letter: "r" }, { clue: Clue.Correct, letter: "r" },
{ clue: Clue.Correct, letter: "t" }, { clue: Clue.Correct, letter: "t" },
]} ]}
annotation={"Got it!"}
/> />
<p>Got it!</p>
<p> <p>
Report issues{" "} Report issues{" "}
<a href="https://github.com/lynn/hello-wordl/issues">here</a>, or tweet{" "} <a href="https://github.com/lynn/hello-wordl/issues">here</a>, or tweet{" "}

View file

@ -9,6 +9,7 @@ body {
.Row { .Row {
display: flex; display: flex;
align-items: center;
justify-content: center; justify-content: center;
} }
@ -26,6 +27,12 @@ body {
font-weight: bold; font-weight: bold;
} }
.Row-annotation {
margin-inline-start: 16px;
width: 5em;
text-align: start;
}
.App-container { .App-container {
position: relative; position: relative;
max-width: 500px; max-width: 500px;
@ -163,6 +170,21 @@ a:active {
line-height: 1.4; line-height: 1.4;
} }
.App-about b {
background-color: #888;
color: white;
padding: 1px 3px;
border-radius: 2px;
}
.App-about b.green-bg {
background-color: rgb(87, 172, 120);
}
.App-about b.yellow-bg {
background-color: #e9c601;
}
.Game-seed-info { .Game-seed-info {
opacity: 0.5; opacity: 0.5;
margin-top: 1em; margin-top: 1em;

View file

@ -10,6 +10,7 @@ interface RowProps {
rowState: RowState; rowState: RowState;
wordLength: number; wordLength: number;
cluedLetters: CluedLetter[]; cluedLetters: CluedLetter[];
annotation?: string;
} }
export function Row(props: RowProps) { export function Row(props: RowProps) {
@ -41,5 +42,12 @@ export function Row(props: RowProps) {
}); });
let rowClass = "Row"; let rowClass = "Row";
if (isLockedIn) rowClass += " Row-locked-in"; if (isLockedIn) rowClass += " Row-locked-in";
return <tr className={rowClass}>{letterDivs}</tr>; return (
<tr className={rowClass}>
{letterDivs}
{props.annotation && (
<span className="Row-annotation">{props.annotation}</span>
)}
</tr>
);
} }