-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'frontend' of https://github.com/Polynomeer/baseball int…
…o frontend
- Loading branch information
Showing
23 changed files
with
421 additions
and
33 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
21 changes: 21 additions & 0 deletions
21
FE/baseball/src/Components/Game/ScoreBoard/PopUpButton.jsx
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 { ScoreBoardStyles as S } from '@/Components/Game/ScoreBoard/ScoreBoardStyles'; | ||
|
||
const PopUpButton = ({ isHover }) => { | ||
return ( | ||
<S.PopUpButton {...{ isHover }}> | ||
<div> | ||
<svg | ||
width="15px" | ||
height="15px" | ||
viewBox="0 0 192.701 192.701" | ||
fill="#fff" | ||
> | ||
<path d="M171.955,88.526l-75.61,74.528l-75.61-74.54c-4.74-4.704-12.439-4.704-17.179,0c-4.74,4.704-4.74,12.319,0,17.011 l84.2,82.997c4.559,4.511,12.608,4.535,17.191,0l84.2-83.009c4.74-4.692,4.74-12.319,0-17.011 C184.394,83.823,176.695,83.823,171.955,88.526z" /> | ||
<path d="M87.755,104.322c4.559,4.511,12.608,4.535,17.191,0l84.2-82.997c4.74-4.704,4.74-12.319,0-17.011 c-4.74-4.704-12.439-4.704-17.179,0L96.345,78.842L20.734,4.314c-4.74-4.704-12.439-4.704-17.179,0 c-4.74,4.704-4.74,12.319,0,17.011L87.755,104.322z" /> | ||
</svg> | ||
</div> | ||
</S.PopUpButton> | ||
); | ||
}; | ||
|
||
export default PopUpButton; |
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,39 @@ | ||
import ScoreTable from './ScoreTable/ScoreTable'; | ||
import { ScoreBoardStyles as S } from './ScoreBoardStyles'; | ||
import { useState } from 'react'; | ||
import PopUpButton from './PopUpButton'; | ||
|
||
const ScoreBoard = () => { | ||
const initialScoreBoardPosition = -196; | ||
const [isHover, setIsHover] = useState(false); | ||
const [scoreBoardPosition, setScoreBoardPosition] = useState( | ||
initialScoreBoardPosition | ||
); | ||
|
||
const handleMouseEnter = () => { | ||
setIsHover((prev) => !prev); | ||
setScoreBoardPosition(-3); | ||
}; | ||
|
||
const handleMouseLeave = () => { | ||
setIsHover((prev) => !prev); | ||
setScoreBoardPosition(initialScoreBoardPosition); | ||
}; | ||
|
||
return ( | ||
<> | ||
<S.PopUpBackground isHover={isHover} /> | ||
<S.ScoreBoard | ||
isHover={isHover} | ||
scoreBoardPosition={scoreBoardPosition} | ||
onMouseEnter={handleMouseEnter} | ||
onMouseLeave={handleMouseLeave} | ||
> | ||
<ScoreTable /> | ||
<PopUpButton {...{ isHover }} /> | ||
</S.ScoreBoard> | ||
</> | ||
); | ||
}; | ||
|
||
export default ScoreBoard; |
128 changes: 128 additions & 0 deletions
128
FE/baseball/src/Components/Game/ScoreBoard/ScoreBoardStyles.jsx
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,128 @@ | ||
import styled, { keyframes } from 'styled-components'; | ||
import * as CS from '@/Styles/CommonStyles'; | ||
import { BLOCK, NONE } from '@/Utils/const'; | ||
import theme from '@/Styles/theme'; | ||
|
||
const ArrowFade = keyframes` | ||
0% { | ||
top: 0px; | ||
opacity: 0; | ||
} | ||
50% { | ||
top: 2px; | ||
} | ||
100% { | ||
top: 4px; | ||
} | ||
`; | ||
|
||
const ScoreBoardStyles = { | ||
ScoreBoard: styled(CS.BOX.FLEX_CENTER_BOX)` | ||
position: absolute; | ||
top: ${({ scoreBoardPosition }) => `${scoreBoardPosition}px`}; | ||
left: 220px; | ||
width: 1000px; | ||
font-weight: 900; | ||
font-size: 24px; | ||
padding: 10px 40px; | ||
border: 1px solid #fff; | ||
background: #111; | ||
transition: all ease-in-out 0.8s; | ||
cursor: pointer; | ||
z-index: 20; | ||
`, | ||
|
||
ScoreTable: styled(CS.BOX.FLEX_COLUMN_CENTER_BOX)``, | ||
|
||
ScoreRow: styled(CS.BOX.FLEX_CENTER_BOX)``, | ||
|
||
ScoreRowHead: styled(CS.BOX.FLEX_CENTER_BOX)` | ||
width: 100%; | ||
margin-top: 10px; | ||
`, | ||
ScoreMiddleLine: styled.div` | ||
width: 100%; | ||
height: 1px; | ||
border: 1px solid #fff; | ||
margin-bottom: 10px; | ||
`, | ||
|
||
ScoreItem: styled(CS.BOX.FLEX_CENTER_BOX)` | ||
width: 50px; | ||
height: 50px; | ||
`, | ||
|
||
TeamNameBox: styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
position: relative; | ||
`, | ||
|
||
TeamName: styled.div` | ||
width: 120px; | ||
margin: 10px; | ||
box-sizing: border-box; | ||
display: flex; | ||
justify-content: center; | ||
`, | ||
|
||
PopUpBackground: styled.div` | ||
display: ${({ isHover }) => (isHover ? BLOCK : NONE)}; | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
width: 1434px; | ||
height: 1080px; | ||
background: #222; | ||
opacity: 0.8; | ||
transition: display 1.5s; | ||
z-index: 10; | ||
`, | ||
PopUpButton: styled.div` | ||
width: 100px; | ||
height: 30px; | ||
border-radius: 0px 0px 50% 50%; | ||
position: absolute; | ||
bottom: -30px; | ||
left: 750px; | ||
background: gray; | ||
opacity: ${({ isHover }) => (isHover ? 1 : 0.5)}; | ||
text-align: center; | ||
padding: 3px; | ||
z-index: 9999; | ||
border: 1px solid #fff; | ||
cursor: pointer; | ||
transition: all ease-in-out 0.4s; | ||
div { | ||
position: absolute; | ||
color: #fff; | ||
top: 2px; | ||
left: 43px; | ||
animation: ${ArrowFade} 1s infinite ease-in alternate; | ||
} | ||
`, | ||
|
||
AttackTeamTag: styled(CS.BOX.FLEX_CENTER_BOX)` | ||
width: 50px; | ||
height: 50px; | ||
`, | ||
|
||
CurrentPlayerTag: styled.div` | ||
width: fit-content; | ||
font-size: 6px; | ||
text-align: center; | ||
font-weight: 500; | ||
color: red; | ||
border-radius: 8px; | ||
border: 1px solid red; | ||
background: ${theme.COLOR.CURRENT_PLAYER_TAG}; | ||
padding: 3px; | ||
margin: 3px; | ||
position: absolute; | ||
top: 33px; | ||
left: 44px; | ||
`, | ||
}; | ||
|
||
export { ScoreBoardStyles }; |
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,7 @@ | ||
import { ScoreBoardStyles as S } from '../ScoreBoardStyles'; | ||
|
||
const ScoreItem = () => { | ||
return <S.ScoreItem>1</S.ScoreItem>; | ||
}; | ||
|
||
export default ScoreItem; |
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 { ScoreBoardStyles as S } from '../ScoreBoardStyles'; | ||
import AttackTeamTag from '../Teams/AttackTeamTag'; | ||
import TeamNameBox from '../Teams/TeamNameBox'; | ||
import ScoreItem from './ScoreItem'; | ||
|
||
const ScoreRow = ({ teamName }) => { | ||
return ( | ||
<S.ScoreRow> | ||
<AttackTeamTag /> | ||
<TeamNameBox teamName={teamName} /> | ||
<ScoreItem /> | ||
<ScoreItem /> | ||
<ScoreItem /> | ||
<ScoreItem /> | ||
<ScoreItem /> | ||
<ScoreItem /> | ||
<ScoreItem /> | ||
<ScoreItem /> | ||
<ScoreItem /> | ||
<ScoreItem /> | ||
<ScoreItem /> | ||
<ScoreItem /> | ||
<ScoreItem /> | ||
<ScoreItem /> | ||
</S.ScoreRow> | ||
); | ||
}; | ||
|
||
export default ScoreRow; |
31 changes: 31 additions & 0 deletions
31
FE/baseball/src/Components/Game/ScoreBoard/ScoreTable/ScoreRowHead.jsx
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 { BLANK } from '@/Utils/const'; | ||
import { ScoreBoardStyles as S } from '../ScoreBoardStyles'; | ||
import AttackTeamTag from '../Teams/AttackTeamTag'; | ||
import TeamName from '../Teams/TeamName'; | ||
|
||
import ScoreItem from './ScoreItem'; | ||
|
||
const ScoreRowHead = () => { | ||
return ( | ||
<S.ScoreRowHead> | ||
<AttackTeamTag /> | ||
<TeamName teamName={BLANK} /> | ||
<ScoreItem /> | ||
<ScoreItem /> | ||
<ScoreItem /> | ||
<ScoreItem /> | ||
<ScoreItem /> | ||
<ScoreItem /> | ||
<ScoreItem /> | ||
<ScoreItem /> | ||
<ScoreItem /> | ||
<ScoreItem /> | ||
<ScoreItem /> | ||
<ScoreItem /> | ||
<ScoreItem /> | ||
<ScoreItem /> | ||
</S.ScoreRowHead> | ||
); | ||
}; | ||
|
||
export default ScoreRowHead; |
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,16 @@ | ||
import { ScoreBoardStyles as S } from '../ScoreBoardStyles'; | ||
import ScoreRow from './ScoreRow'; | ||
import ScoreRowHead from './ScoreRowHead'; | ||
|
||
const ScoreTable = () => { | ||
return ( | ||
<S.ScoreTable> | ||
<ScoreRowHead /> | ||
<S.ScoreMiddleLine /> | ||
<ScoreRow teamName={'DOOSAN'} /> | ||
<ScoreRow teamName={'NC'} /> | ||
</S.ScoreTable> | ||
); | ||
}; | ||
|
||
export default ScoreTable; |
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,7 @@ | ||
import { ScoreBoardStyles as S } from '@/Components/Game/ScoreBoard/ScoreBoardStyles'; | ||
|
||
const AttackTeamTag = () => { | ||
return <S.AttackTeamTag>⚾︎</S.AttackTeamTag>; | ||
}; | ||
|
||
export default AttackTeamTag; |
7 changes: 7 additions & 0 deletions
7
FE/baseball/src/Components/Game/ScoreBoard/Teams/CurrentPlayerTag.jsx
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,7 @@ | ||
import { ScoreBoardStyles as S } from '@/Components/Game/ScoreBoard/ScoreBoardStyles'; | ||
|
||
const CurrentPlayerTag = () => { | ||
return <S.CurrentPlayerTag>Player</S.CurrentPlayerTag>; | ||
}; | ||
|
||
export default CurrentPlayerTag; |
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,5 @@ | ||
const PlayerTag = () => { | ||
return <div>PlayerTag</div>; | ||
}; | ||
|
||
export default PlayerTag; |
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,7 @@ | ||
import { ScoreBoardStyles as S } from '../ScoreBoardStyles'; | ||
|
||
const TeamName = ({ teamName }) => { | ||
return <S.TeamName>{teamName}</S.TeamName>; | ||
}; | ||
|
||
export default TeamName; |
Oops, something went wrong.