feat: Add heading

This commit is contained in:
sigmasternchen 2024-09-20 22:51:36 +02:00
parent 2f9603264c
commit 619c893517
3 changed files with 28 additions and 14 deletions

View file

@ -7,6 +7,16 @@ body {
background-color: black; background-color: black;
} }
h1 {
color: white;
text-align: center;
font-size: 60px;
}
h2 {
font-size: 40px;
}
.setup { .setup {
text-align: center; text-align: center;
color: white; color: white;
@ -14,6 +24,7 @@ body {
.setup ul { .setup ul {
list-style-type: none; list-style-type: none;
padding: 0;
} }
.setup li { .setup li {

View file

@ -21,17 +21,20 @@ export const App = () => {
console.log(correct) console.log(correct)
return <>{ wordLength === null ? return <>
<SetupScreen <h1>x86-64 Wordle</h1>
dictionary={dictionary} { wordLength === null ?
selectLength={setWordLength} <SetupScreen
/> : dictionary={dictionary}
<Game selectLength={setWordLength}
wordLength={wordLength} /> :
reset={() => setWordLength(null)} <Game
numberOfGuesses={numberOfGuesses} wordLength={wordLength}
availableWords={availableWords} reset={() => setWordLength(null)}
correctWord={correct} numberOfGuesses={numberOfGuesses}
/> availableWords={availableWords}
}</> correctWord={correct}
/>
}
</>
}; };

View file

@ -11,7 +11,7 @@ export const SetupScreen = ({dictionary, selectLength}) => {
.map(length => [length, lengthsMap[length].length]); .map(length => [length, lengthsMap[length].length]);
return <div className="setup"> return <div className="setup">
<h1>Select word length</h1> <h2>Select word length</h2>
<ul> <ul>
{lengths.map(([length, numberOfWordsWithLength]) => {lengths.map(([length, numberOfWordsWithLength]) =>
<li key={length} onClick={() => selectLength(parseInt(length))}> <li key={length} onClick={() => selectLength(parseInt(length))}>