-
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.
- Loading branch information
1 parent
5a00452
commit 846024a
Showing
13 changed files
with
218 additions
and
2 deletions.
There are no files selected for viewing
Binary file added
BIN
+26.7 KB
.../apps/audience-display/displays/seasons/fgc_default/assets/blue-side-banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.62 KB
...c/apps/audience-display/displays/seasons/fgc_default/assets/blue-top-banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+31.6 KB
...c/apps/audience-display/displays/seasons/fgc_default/assets/blue-win-banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+68.8 KB
...nd/src/apps/audience-display/displays/seasons/fgc_default/assets/fg-logo-lg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+20.7 KB
...nd/src/apps/audience-display/displays/seasons/fgc_default/assets/fg-logo-md.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+891 KB
...end/src/apps/audience-display/displays/seasons/fgc_default/assets/global-bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+26.8 KB
...c/apps/audience-display/displays/seasons/fgc_default/assets/red-side-banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.69 KB
...rc/apps/audience-display/displays/seasons/fgc_default/assets/red-top-banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+31.7 KB
...rc/apps/audience-display/displays/seasons/fgc_default/assets/red-win-banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
95 changes: 95 additions & 0 deletions
95
...nd/src/apps/audience-display/displays/seasons/fgc_default/components/alliance-preview.tsx
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,95 @@ | ||
import styled from '@emotion/styled'; | ||
import { FC } from 'react'; | ||
import RED_BANNER from '../assets/red-side-banner.png'; | ||
import BLUE_BANNER from '../assets/blue-side-banner.png'; | ||
import { | ||
Alliance, | ||
BLUE_STATION, | ||
MatchParticipant, | ||
Ranking, | ||
Team | ||
} from '@toa-lib/models'; | ||
import { CountryFlag } from './country-flag'; | ||
|
||
const Container = styled.div` | ||
width: 100%; | ||
height: 100%; | ||
display: flex; | ||
flex-direction: row; | ||
`; | ||
|
||
const Banner = styled.img` | ||
width: auto; | ||
height: 100%; | ||
`; | ||
|
||
const AllianceContainer = styled.div((props: { size: number }) => ({ | ||
width: '100%', | ||
height: '100%', | ||
'background-color': '#ffffff', | ||
display: 'grid', | ||
'grid-template-rows': `repeat(${props.size}, 1fr)` | ||
})); | ||
|
||
const TeamContainer = styled.div` | ||
border-bottom: 3px solid #cacaca; | ||
font-weight: bold; | ||
font-size: 3vh; | ||
gap: 16px; | ||
padding-left: 16px; | ||
padding-right: 16px; | ||
display: flex; | ||
align-items: center; | ||
`; | ||
|
||
const CountryText = styled.div` | ||
width: 5vw; | ||
`; | ||
|
||
const RankText = styled.div` | ||
margin-left: auto; | ||
`; | ||
|
||
interface AllianceTeamProps { | ||
team: Team; | ||
rank?: Ranking; | ||
} | ||
|
||
const AllianceTeam: FC<AllianceTeamProps> = ({ team, rank }) => { | ||
return ( | ||
<TeamContainer> | ||
<CountryFlag cc={team.countryCode} /> | ||
<CountryText>[{team.country}]</CountryText> | ||
<div>{team.teamNameLong}</div> | ||
{rank && <RankText>#{rank.rank}</RankText>} | ||
</TeamContainer> | ||
); | ||
}; | ||
|
||
interface Props { | ||
alliance: Alliance; | ||
participants: MatchParticipant[]; | ||
ranks: Ranking[]; | ||
} | ||
|
||
export const AlliancePreview: FC<Props> = ({ | ||
alliance, | ||
participants, | ||
ranks | ||
}) => { | ||
const allianceParticipants = participants.filter((p) => | ||
alliance === 'red' ? p.station < BLUE_STATION : p.station >= BLUE_STATION | ||
); | ||
return ( | ||
<Container> | ||
<Banner src={alliance === 'red' ? RED_BANNER : BLUE_BANNER} /> | ||
<AllianceContainer size={allianceParticipants.length}> | ||
{allianceParticipants.map((p) => { | ||
const rank = ranks.find((r) => r.teamKey === p.teamKey); | ||
if (!p.team) return null; | ||
return <AllianceTeam key={p.station} team={p.team} rank={rank} />; | ||
})} | ||
</AllianceContainer> | ||
</Container> | ||
); | ||
}; |
14 changes: 14 additions & 0 deletions
14
front-end/src/apps/audience-display/displays/seasons/fgc_default/components/country-flag.tsx
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,14 @@ | ||
import styled from '@emotion/styled'; | ||
import { FC } from 'react'; | ||
|
||
interface Props { | ||
cc: string; | ||
} | ||
|
||
const Flag = styled.div` | ||
background-color: #000000; | ||
`; | ||
|
||
export const CountryFlag: FC<Props> = ({ cc }) => { | ||
return <Flag className={`flag-icon flag-icon-${cc}`} />; | ||
}; |
44 changes: 44 additions & 0 deletions
44
front-end/src/apps/audience-display/displays/seasons/fgc_default/components/info-bar.tsx
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,44 @@ | ||
import styled from '@emotion/styled'; | ||
import { FC } from 'react'; | ||
|
||
const Container = styled.div` | ||
background-color: #ffffff; | ||
width: 16vw; | ||
height: 5vh; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
font-weight: bold; | ||
font-size: 2vw; | ||
`; | ||
|
||
const LeftText = styled.div` | ||
width: 100%; | ||
height: 100%; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
background-color: #cacaca; | ||
`; | ||
|
||
const RightText = styled.div` | ||
width: 100%; | ||
height: 100%; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
`; | ||
|
||
interface Props { | ||
left: string | number; | ||
right: string | number; | ||
} | ||
|
||
export const InfoBar: FC<Props> = ({ left, right }) => { | ||
return ( | ||
<Container> | ||
<LeftText>{left.toString().toUpperCase()}</LeftText> | ||
<RightText>{right.toString()}</RightText> | ||
</Container> | ||
); | ||
}; |
67 changes: 65 additions & 2 deletions
67
front-end/src/apps/audience-display/displays/seasons/fgc_default/match-preview.tsx
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 |
---|---|---|
@@ -1,6 +1,69 @@ | ||
import { FC } from 'react'; | ||
import { DisplayProps } from '../../displays'; | ||
import styled from '@emotion/styled'; | ||
import FGC_BG from './assets/global-bg.png'; | ||
import FGC_LOGO from './assets/fg-logo-lg.png'; | ||
import { InfoBar } from './components/info-bar'; | ||
import { AlliancePreview } from './components/alliance-preview'; | ||
|
||
export const MatchPreview: FC<DisplayProps> = () => { | ||
return <div>FGC Match Preview</div>; | ||
const Container = styled.div` | ||
background-image: url(${FGC_BG}); | ||
background-size: cover; | ||
width: 100vw; | ||
height: 100vh; | ||
overflow: hidden; | ||
display: grid; | ||
grid-template-rows: 20vh 7vh 30vh 30vh; | ||
grid-template-areas: | ||
'logo' | ||
'info' | ||
'red' | ||
'blue'; | ||
row-gap: 2vh; | ||
padding: 3vh 20vw; | ||
`; | ||
|
||
const LogoContainer = styled.div` | ||
grid-area: logo; | ||
height: 100%; | ||
width: 100%; | ||
text-align: center; | ||
`; | ||
|
||
const Logo = styled.img` | ||
max-height: 100%; | ||
width: auto; | ||
`; | ||
|
||
const InfoContainer = styled.div` | ||
grid-area: info; | ||
display: flex; | ||
justify-content: space-evenly; | ||
align-items: center; | ||
`; | ||
|
||
export const MatchPreview: FC<DisplayProps> = ({ match, ranks }) => { | ||
const matchParts = match.name.split(' '); | ||
const matchNumber = matchParts[matchParts.length - 1]; | ||
return ( | ||
<Container> | ||
<LogoContainer> | ||
<Logo src={FGC_LOGO} /> | ||
</LogoContainer> | ||
<InfoContainer> | ||
<InfoBar left='match' right={matchNumber} /> | ||
<InfoBar left='field' right={match.fieldNumber} /> | ||
</InfoContainer> | ||
<AlliancePreview | ||
alliance='red' | ||
participants={match.participants ?? []} | ||
ranks={ranks} | ||
/> | ||
<AlliancePreview | ||
alliance='blue' | ||
participants={match.participants ?? []} | ||
ranks={ranks} | ||
/> | ||
</Container> | ||
); | ||
}; |