-
Notifications
You must be signed in to change notification settings - Fork 4
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 #172 from moonstream-to/alpha
Alpha
- Loading branch information
Showing
108 changed files
with
5,885 additions
and
478 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,13 @@ | ||
import Layout from "../../src/components/layout/layout"; | ||
import PracticeSelect from "../../src/components/practice/PracticeSelect"; | ||
import AtBatView from "../../src/components/atbat/AtBatView"; | ||
|
||
const Home = () => { | ||
return ( | ||
<Layout home={true} title="Fullcount"> | ||
<AtBatView /> | ||
</Layout> | ||
); | ||
}; | ||
|
||
export default Home; |
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,12 @@ | ||
import Layout from "../../src/components/layout/layout"; | ||
import PracticeSelect from "../../src/components/practice/PracticeSelect"; | ||
|
||
const Home = () => { | ||
return ( | ||
<Layout home={true} title="Fullcount"> | ||
<PracticeSelect /> | ||
</Layout> | ||
); | ||
}; | ||
|
||
export default Home; |
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,65 @@ | ||
import styles from "./AtBatsList.module.css"; | ||
import { AtBat, OwnedToken, Token } from "../../types"; | ||
import TokenToPlay from "./TokenToPlay"; | ||
import DotsCounter from "../sessions/DotsCounter"; | ||
|
||
export const outcomes = [ | ||
"In Progress", | ||
"Strikeout", | ||
"Walk", | ||
"Single", | ||
"Double", | ||
"Triple", | ||
"Home Run", | ||
"In Play Out", | ||
]; | ||
|
||
export const outcomeType = (tokens: Token[], atBat: AtBat): "positive" | "negative" | undefined => { | ||
const { pitcher, batter } = atBat; | ||
if (tokens.some((t) => t.address === pitcher?.address && t.id === pitcher.id)) { | ||
return atBat.outcome === 1 || atBat.outcome === 7 ? "positive" : "negative"; | ||
} | ||
if (tokens.some((t) => t.address === batter?.address && t.id === batter.id)) { | ||
return atBat.outcome === 1 || atBat.outcome === 7 ? "negative" : "positive"; | ||
} | ||
}; | ||
|
||
const AtBatItem = ({ atBat, tokens }: { atBat: AtBat; tokens: OwnedToken[] }) => { | ||
return ( | ||
<div className={styles.atBatContainer}> | ||
<div className={styles.cards}> | ||
{atBat.pitcher ? ( | ||
<TokenToPlay token={atBat.pitcher} isPitcher={true} /> | ||
) : ( | ||
<div style={{ width: "100px", height: "152px", border: "1px solid #7E8E7F" }} /> | ||
)} | ||
<div className={styles.vs}>VS</div> | ||
{atBat.batter ? ( | ||
<TokenToPlay token={atBat.batter} isPitcher={false} /> | ||
) : ( | ||
<div style={{ width: "100px", height: "152px", border: "1px solid #7E8E7F" }} /> | ||
)} | ||
</div> | ||
{atBat.outcome !== 0 ? ( | ||
<div | ||
className={ | ||
!outcomeType(tokens, atBat) | ||
? styles.othersOutcome | ||
: outcomeType(tokens, atBat) === "positive" | ||
? styles.positiveOutcome | ||
: styles.negativeOutcome | ||
} | ||
> | ||
{outcomes[atBat.outcome]}! | ||
</div> | ||
) : ( | ||
<div className={styles.activeAtBat}> | ||
<DotsCounter label={"BALL"} count={atBat.balls} capacity={4} /> | ||
<DotsCounter label={"STRIKE"} count={atBat.strikes} capacity={3} /> | ||
</div> | ||
)} | ||
</div> | ||
); | ||
}; | ||
|
||
export default AtBatItem; |
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,126 @@ | ||
.container { | ||
display: flex; | ||
gap: 10px; | ||
flex-direction: column; | ||
align-items: center; | ||
} | ||
|
||
.atBatContainer { | ||
display: flex; | ||
width: 280px; | ||
padding: 10px; | ||
flex-direction: column; | ||
align-items: flex-start; | ||
gap: 5px; | ||
|
||
border: 1px solid #7E8E7F; | ||
background: #FFF; | ||
} | ||
|
||
.cards { | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
align-self: stretch; | ||
} | ||
|
||
.vs { | ||
color: #669568; | ||
text-overflow: ellipsis; | ||
font-family: Bangers, cursive; | ||
font-size: 24px; | ||
font-style: normal; | ||
font-weight: 400; | ||
line-height: 100%; /* 24px */ | ||
} | ||
|
||
.activeAtBat { | ||
display: flex; | ||
padding: 5px; | ||
justify-content: center; | ||
align-items: center; | ||
gap: 10px; | ||
align-self: stretch; | ||
border: 1px solid #000; | ||
background: #328449; | ||
color: #FFF; | ||
font-family: Bangers, cursive; | ||
font-size: 14px; | ||
font-style: normal; | ||
font-weight: 400; | ||
line-height: normal; | ||
text-transform: uppercase; | ||
} | ||
|
||
.stat { | ||
gap: 5px; | ||
} | ||
.dots { | ||
gap: 4px; | ||
} | ||
.filledDot, .emptyDot { | ||
height: 6px; | ||
width: 6px; | ||
border-radius: 50%; | ||
} | ||
.emptyDot { | ||
background-color: #34603B; | ||
} | ||
.filledDot { | ||
background-color: #FFF; | ||
} | ||
|
||
|
||
.positiveOutcome { | ||
display: flex; | ||
padding: 5px; | ||
justify-content: center; | ||
align-items: center; | ||
gap: 10px; | ||
align-self: stretch; | ||
border: 1px solid #262019; | ||
color: #328449; | ||
font-family: Bangers, cursive; | ||
font-size: 18px; | ||
font-style: normal; | ||
font-weight: 400; | ||
line-height: normal; | ||
text-transform: uppercase; | ||
} | ||
|
||
.negativeOutcome { | ||
display: flex; | ||
width: 260px; | ||
padding: 5px; | ||
justify-content: center; | ||
align-items: center; | ||
gap: 10px; | ||
border: 1px solid #8F8476; | ||
background: #262019; | ||
color: #7E8E7F; | ||
font-family: Bangers; | ||
font-size: 18px; | ||
font-style: normal; | ||
font-weight: 400; | ||
line-height: normal; | ||
text-transform: uppercase; | ||
} | ||
|
||
.othersOutcome { | ||
display: flex; | ||
padding: 5px; | ||
justify-content: center; | ||
align-items: center; | ||
gap: 10px; | ||
align-self: stretch; | ||
|
||
background: #FCECD9; | ||
color: #262019; | ||
font-family: Bangers, cursive; | ||
font-size: 18px; | ||
font-style: normal; | ||
font-weight: 400; | ||
line-height: normal; | ||
text-transform: uppercase; | ||
} | ||
|
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,15 @@ | ||
import styles from "./AtBatsList.module.css"; | ||
import { AtBat, OwnedToken } from "../../types"; | ||
import AtBatItem from "./AtBatItem"; | ||
|
||
const AtBatsList = ({ atBats, tokens }: { atBats: AtBat[]; tokens: OwnedToken[] }) => { | ||
return ( | ||
<div className={styles.container}> | ||
{atBats.map((a, idx) => ( | ||
<AtBatItem atBat={a} key={idx} tokens={tokens} /> | ||
))} | ||
</div> | ||
); | ||
}; | ||
|
||
export default AtBatsList; |
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 React from "react"; | ||
import { Box, Flex, Grid } from "@chakra-ui/react"; | ||
import { valueToColor } from "../../utils/colors"; | ||
|
||
const HeatMapSmall = ({ rates, size }: { rates: number[]; size?: string }) => { | ||
const generateCell = (index: number) => ( | ||
<Box key={index}> | ||
<Box | ||
height={size ?? "4px"} | ||
width={size ?? "4px"} | ||
display="flex" | ||
alignItems="center" | ||
justifyContent="center" | ||
cursor={"pointer"} | ||
bg={valueToColor(rates[index], rates)} | ||
/> | ||
</Box> | ||
); | ||
|
||
return ( | ||
<Flex direction={"column"} alignItems={"center"} gap={"10px"}> | ||
<Grid | ||
templateColumns="repeat(5, 1fr)" | ||
w={"fit-content"} | ||
border={size === "10px" ? "1px solid #262019" : "2px solid #262019"} | ||
> | ||
{Array.from({ length: 25 }).map((_, i) => generateCell(i))} | ||
</Grid> | ||
</Flex> | ||
); | ||
}; | ||
|
||
export default HeatMapSmall; |
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,6 @@ | ||
.container { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 20px; /*Roster has 10px bottom margin*/ | ||
} | ||
|
Oops, something went wrong.