diff --git a/src/About.tsx b/src/About.tsx index 12d0b4e..b434a1a 100644 --- a/src/About.tsx +++ b/src/About.tsx @@ -2,11 +2,7 @@ import { Clue } from "./clue"; import { Row, RowState } from "./Row"; import { maxGuesses } from "./util"; -interface aboutProps { - color: boolean; -} - -export function About(props: aboutProps) { +export function About() { return (

@@ -32,21 +28,19 @@ export function About(props: aboutProps) { { clue: Clue.Correct, letter: "r" }, { clue: Clue.Elsewhere, letter: "d" }, ]} - color={props.color} />

W and O aren't in the target word at all.

- R is correct! - The third letter is{" "} - R + R is correct! The third letter is{" "} + R .
(There may still be a second R in the word.)

- D occurs{" "} - elsewhere in the target word. + D occurs elsewhere in the target + word.
(Perhaps more than once. 🤔)

@@ -64,7 +58,6 @@ export function About(props: aboutProps) { { clue: Clue.Absent, letter: "k" }, ]} annotation={"So close!"} - color={props.color} />

Report issues{" "} diff --git a/src/App.css b/src/App.css index 875ea16..f6a72c4 100644 --- a/src/App.css +++ b/src/App.css @@ -121,35 +121,18 @@ table.Game-rows > tbody { outline: none; } -.Row-letter-color.letter-correct { - border: 2px solid rgba(0, 0, 0, 0.3); - background-color: #f5793a; - color: white !important; -} - .letter-correct { border: 2px solid rgba(0, 0, 0, 0.3); background-color: rgb(87, 172, 120); color: white !important; } -.Row-letter-color.letter-elsewhere { - border: 2px dotted rgba(0, 0, 0, 0.3); - background-color: #85c0f9; - color: white !important; -} .letter-elsewhere { border: 2px dotted rgba(0, 0, 0, 0.3); background-color: #e9c601; color: white !important; } -.Row-letter-color.letter-absent { - border: 2px solid transparent; - background-color: rgb(162, 162, 162); - color: white !important; -} - .letter-absent { border: 2px solid transparent; background-color: rgb(162, 162, 162); @@ -210,16 +193,10 @@ a:active { .App-about b.green-bg { background-color: rgb(87, 172, 120); } -.App-about b.orange-bg { - background-color: #f5793a; -} .App-about b.yellow-bg { background-color: #e9c601; } -.App-about b.blue-bg { - background-color: #85c0f9; -} .Game-seed-info { opacity: 0.5; @@ -276,3 +253,13 @@ a:active { .top-right a + a { margin-inline-start: 8px; } + +.App-container.color-blind .letter-correct, +.App-container.color-blind .App-about b.green-bg { + background-color: #f5793a; +} + +.App-container.color-blind .letter-elsewhere, +.App-container.color-blind .App-about b.yellow-bg { + background-color: #85c0f9; +} diff --git a/src/App.tsx b/src/App.tsx index be9256a..252ecfc 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -33,7 +33,7 @@ function App() { window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches; const [dark, setDark] = useSetting("dark", prefersDark); - const [color, setColor] = useSetting("color", false); + const [colorBlind, setColorBlind] = useSetting("colorblind", false); const [difficulty, setDifficulty] = useSetting("difficulty", 0); useEffect(() => { @@ -57,7 +57,7 @@ function App() { ); return ( -

+

- {page === "about" && } + {page === "about" && } {page === "settings" && (
@@ -113,15 +113,12 @@ function App() {
{ - console.log("set color to ", !color); - setColor((x: boolean) => !x); - }} + checked={colorBlind} + onChange={() => setColorBlind((x: boolean) => !x)} /> - +
); diff --git a/src/Game.tsx b/src/Game.tsx index 744ca7f..560bdbd 100644 --- a/src/Game.tsx +++ b/src/Game.tsx @@ -25,7 +25,7 @@ interface GameProps { maxGuesses: number; hidden: boolean; difficulty: Difficulty; - color: boolean; + colorBlind: boolean; } const targets = targetList.slice(0, targetList.indexOf("murky") + 1); // Words no rarer than this one @@ -220,7 +220,6 @@ function Game(props: GameProps) { : RowState.Pending } cluedLetters={cluedLetters} - color={props.color} /> ); }); @@ -297,13 +296,16 @@ function Game(props: GameProps) { {" "}