-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat(wiggle): wiggle bugs * feat(wiggle): fixed wiggle within a wiggle, wiggleception * feat(card): card box fixes * feat(menu): adding click back to menu * feat(dev): added developer popup
- Loading branch information
1 parent
50815d0
commit ac0f6d4
Showing
23 changed files
with
336 additions
and
78 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
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,21 @@ | ||
import { DebugTableRowProps } from './type'; | ||
import { Table } from '@mantine/core'; | ||
import { RFC } from '@app/ui/type'; | ||
|
||
|
||
export const DebugTableRow: RFC<DebugTableRowProps> = ({ | ||
label, value, fontSize = 'sm', | ||
}) => ( | ||
<Table.Tr> | ||
<Table.Td | ||
p={0} | ||
pl='sm'> | ||
<strong>{label}</strong> | ||
</Table.Td> | ||
<Table.Td | ||
p={0} | ||
fz={fontSize}> | ||
{value} | ||
</Table.Td> | ||
</Table.Tr> | ||
); |
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,17 @@ | ||
.symbol { | ||
margin-left: 9px; | ||
margin-top: -10px; | ||
} | ||
|
||
.pi { | ||
box-shadow: 1px 5px 14px -2px rgba(0, 0, 0, 0.24); | ||
background-color: #cfc; | ||
border-radius: 16px; | ||
position: fixed; | ||
border: 3px solid #000; | ||
opacity : .75; | ||
bottom: 50px; | ||
z-index: 99; | ||
color: #222; | ||
right: 50px; | ||
} |
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,76 @@ | ||
import { Table, Tabs, Text, List, rem } from '@mantine/core'; | ||
import { DebugTableRow } from './DebugTableRow'; | ||
import { GameDebugTabsProps } from './type'; | ||
import { RFC } from '@app/ui/type'; | ||
|
||
|
||
export const GameDebugTabs: RFC<GameDebugTabsProps> = ({ | ||
dealerDealtCard, playerDealtCard, currentPlayer, | ||
gameState, authToken, isDealer, isHost, | ||
}) => { | ||
return ( | ||
<Tabs defaultValue='one'> | ||
<Tabs.List> | ||
<Tabs.Tab value='one'> | ||
<Text | ||
fz='sm' | ||
fw={600}>{"ONE"}</Text> | ||
</Tabs.Tab> | ||
<Tabs.Tab value='two'>{"TWO"}</Tabs.Tab> | ||
</Tabs.List> | ||
<Tabs.Panel value='one'> | ||
<Table | ||
cellSpacing={0} | ||
cellPadding={0} | ||
fz='xs' | ||
style={{ maxWidth : rem(220) }}> | ||
<Table.Tbody> | ||
{gameState.error_message && <DebugTableRow | ||
label='Error' | ||
value={gameState.error_message} />} | ||
<DebugTableRow | ||
label='IsDealer' | ||
value={isDealer ? 'Yes' : 'No'} /> | ||
<DebugTableRow | ||
label='AuthToken' | ||
value={authToken} /> | ||
<DebugTableRow | ||
label='IsHost' | ||
value={isHost ? 'Yes' : 'No'} /> | ||
<DebugTableRow | ||
label='Game Code' | ||
value={gameState.game_code} /> | ||
<DebugTableRow | ||
label='Stage' | ||
value={gameState.game_stage} /> | ||
<DebugTableRow | ||
label='PlayerId' | ||
value={currentPlayer?.id} | ||
fontSize='xs' /> | ||
<DebugTableRow | ||
label='Username' | ||
value={currentPlayer?.username} | ||
fontSize='xs' /> | ||
<DebugTableRow | ||
label='Score' | ||
value={currentPlayer?.score} /> | ||
<DebugTableRow | ||
label="Dealer's Card" | ||
value={dealerDealtCard?.text} /> | ||
<DebugTableRow | ||
label="Player's Card" | ||
value={playerDealtCard?.text} /> | ||
</Table.Tbody> | ||
</Table> | ||
</Tabs.Panel> | ||
<Tabs.Panel value='two'> | ||
<List> | ||
<List.Item>{"ONE"}</List.Item> | ||
<List.Item>{"ONE"}</List.Item> | ||
<List.Item>{"ONE"}</List.Item> | ||
<List.Item>{"ONE"}</List.Item> | ||
</List> | ||
</Tabs.Panel> | ||
</Tabs> | ||
); | ||
}; |
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,25 @@ | ||
import { Box, rem, Text } from '@mantine/core'; | ||
import classes from './GameDebug.module.css'; | ||
import { RFC } from '@app/ui/type'; | ||
import { Props } from './type'; | ||
|
||
|
||
export const GameDebugCard: RFC<Props> = ({ | ||
wiggleBoxId, wiggleSeed, | ||
}) => { | ||
|
||
return ( | ||
<Box | ||
className={classes.pi} | ||
w={rem(220)} | ||
h={rem(440)}> | ||
<Text> | ||
{`wiggleBoxId(${wiggleBoxId})`} | ||
</Text> | ||
<br /> | ||
<Text> | ||
{`wiggleSeed(${wiggleSeed})`} | ||
</Text> | ||
</Box> | ||
); | ||
}; |
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,29 @@ | ||
import { GameStateDTO } from '../../../../api/src/game/dtos/game-state.dto'; | ||
import { PlayerDTO } from '../../../../api/src/game/dtos/player.dto'; | ||
import { CardDTO } from '../../../../api/src/game/dtos/card.dto'; | ||
import { ReactNode } from 'react'; | ||
|
||
|
||
export interface Props { | ||
wiggleBoxId : string; | ||
wiggleSeed : string; | ||
} | ||
|
||
export interface DebugTableRowProps { | ||
|
||
fontSize ?: string; | ||
label : string; | ||
value : ReactNode; | ||
} | ||
|
||
|
||
export interface GameDebugTabsProps { | ||
|
||
dealerDealtCard ?: CardDTO | null; | ||
playerDealtCard ?: CardDTO | null; | ||
currentPlayer : PlayerDTO | null; | ||
authToken : string | null; | ||
gameState : GameStateDTO; | ||
isDealer : boolean; | ||
isHost : boolean; | ||
} |
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,31 @@ | ||
import { CardColor } from '../../../../api/src/constant/card-color.enum'; | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
import { GameDev } from '.'; | ||
|
||
|
||
const meta: Meta<typeof GameDev> = { | ||
title : 'Components/GameDev', | ||
component : GameDev, | ||
tags : ['autodocs'], | ||
}; | ||
|
||
export default meta; | ||
|
||
|
||
type Story = StoryObj<typeof meta>; | ||
|
||
// Sample player data for the scoreboard | ||
const samplePlayers = [ | ||
{ player : { id : '1', username : 'Player 1' }, score : 3, isWinner : false, isDone : true }, | ||
{ player : { id : '2', username : 'Player 2' }, score : 5, isWinner : true, isDone : true }, | ||
{ player : { id : '3', username : 'Player 3' }, score : 1, isWinner : false, isDone : false }, | ||
]; | ||
|
||
export const DefaultScoreboard: Story = { | ||
args : { | ||
playerStatusList : samplePlayers, // Provide the sample player data | ||
shouldShowScore : true, // Show the scores | ||
shouldShowDone : true, // Indicate if players are done | ||
textColor : CardColor.White, // Set text color to white | ||
}, | ||
}; |
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,33 @@ | ||
|
||
import { GameStack } from '../GameStack'; | ||
import { GameText } from '../GameText'; | ||
import { GameTextType } from '../GameText/type'; | ||
|
||
|
||
export const GameDev = () => { | ||
|
||
return ( | ||
<GameStack> | ||
<GameText size='sm'> | ||
<GameText | ||
size='lg' | ||
type={GameTextType.Title}> | ||
{'CrudeCards is Open Source'} | ||
</GameText> | ||
<a | ||
href='https://github.com/dandonahoe/crude-cards' | ||
style={{ | ||
color : 'white', | ||
textDecoration : 'underline', | ||
}}> | ||
{'Browse the GitHub Repo.'} | ||
</a> | ||
<GameText size='sm'> | ||
{'Or don\'t, nerd.'} | ||
</GameText> | ||
</GameText> | ||
|
||
</GameStack> | ||
); | ||
} | ||
|
Oops, something went wrong.