-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from pishposh/variable-cards-in-play
Variable cards in play
- Loading branch information
Showing
13 changed files
with
153 additions
and
14 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
.settings-dialog { | ||
z-index: 100; | ||
overflow-y: scroll; | ||
border: none; | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
height: 100%; | ||
width: 100%; | ||
display: flex; | ||
/* justify-content: center; */ | ||
/* align-items: center; */ | ||
} | ||
|
||
.settings-close-button { | ||
position: absolute; | ||
top: 10px; | ||
right: 10px; | ||
height: 1rem; | ||
width: 1rem; | ||
cursor: pointer; | ||
} | ||
|
||
.container { | ||
justify-content: start; | ||
align-items: center; | ||
display: flex; | ||
flex-direction: column; | ||
gap: 1rem; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { useState } from 'react'; | ||
import { Difficulty } from '../../game'; | ||
import './GameSettings.css'; | ||
|
||
export const GameSettings = ({ | ||
onClose, | ||
onSave, | ||
}: { | ||
onClose: () => void; | ||
onSave: (difficulty: Difficulty) => void; | ||
}) => { | ||
const [selectedDifficulty, setSelectedDifficulty] = useState<Difficulty>(Difficulty.EASY); | ||
|
||
const handleChangeDifficulty = (event: React.ChangeEvent<HTMLSelectElement>) => { | ||
const newValue = event.target.value; | ||
setSelectedDifficulty(newValue as Difficulty); | ||
}; | ||
|
||
return ( | ||
<dialog className="settings-dialog"> | ||
<span className="settings-close-button" onClick={onClose}> | ||
❌ | ||
</span> | ||
<div className="container"> | ||
|
||
<label>Choose your difficulty:</label> | ||
|
||
<select name="difficulty" id="difficulty" value={selectedDifficulty} onChange={handleChangeDifficulty}> | ||
<option value={Difficulty.EASY}>Easy</option> | ||
<option value={Difficulty.MEDIUM}>Medium</option> | ||
<option value={Difficulty.HARD}>Hard</option> | ||
</select> | ||
|
||
<button | ||
className="button" | ||
onClick={() => { | ||
onSave(selectedDifficulty); | ||
onClose(); | ||
}} | ||
> | ||
Let's Play! | ||
</button> | ||
</div> | ||
</dialog> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters