-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement "change dice" on client #70
- Loading branch information
1 parent
28522b3
commit 22ad72f
Showing
13 changed files
with
271 additions
and
11 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// import "../styles/OptionCard.scss"; | ||
import "../styles/OptionCard.scss"; | ||
|
||
export default function DiceCard({ | ||
img, | ||
active, | ||
onSelect, | ||
option, | ||
}: { | ||
img?: string; | ||
active?: boolean; | ||
onSelect?: () => void; | ||
option?: any; | ||
}) { | ||
return ( | ||
<button | ||
className={`option-container ${active ? "active" : ""}`} | ||
onClick={onSelect} | ||
> | ||
<div className="option"> | ||
<div className="name-label">{option.name}</div> | ||
<img src={img} alt="board" /> | ||
<div className="option-label">5/6</div> | ||
</div> | ||
</button> | ||
); | ||
} |
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,21 @@ | ||
import { createContext } from "react"; | ||
|
||
export type DiceType = | ||
| "" | ||
| "basic" | ||
| "gold" | ||
| "black" | ||
| "unique" | ||
| "red" | ||
| "silver" | ||
| string; | ||
|
||
interface DiceContextType { | ||
dice: DiceType; | ||
changeDice: (newDice: DiceType) => void; | ||
} | ||
|
||
export const DiceContext = createContext<DiceContextType>({ | ||
dice: "", | ||
changeDice: () => {}, | ||
}); |
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 @@ | ||
.dice-container { | ||
padding: 1.5px; | ||
background: linear-gradient(180deg, #2dccfd 0%, #ff01ff 100%); | ||
border-radius: 12px; | ||
cursor: pointer; | ||
transition: all 0.5s ease-in-out; | ||
&.active { | ||
background: #2dccfd; | ||
} | ||
&:hover { | ||
background: #2dccfd; | ||
} | ||
.dice { | ||
padding: 5px 12px; | ||
// display: flex; | ||
// flex-direction: column; | ||
// align-items: center; | ||
border-radius: 12px; | ||
background: linear-gradient(180deg, #1b0043 0%, #0e0121 100%); | ||
.dice-label { | ||
border-top: rgba(45, 204, 253, 0.48) 1px solid; | ||
width: 100%f; | ||
text-align: center; | ||
color: #f5f5f5; | ||
font-size: 14px; | ||
line-height: 24px; | ||
font-weight: bold; | ||
} | ||
} | ||
} |
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