Merge pull request #44 from TiE23/ISSUE-041

Issue 041
This commit is contained in:
Kyle Geib authored and GitHub committed 2022-02-02 15:25:47 -05:00
commit 32d92de2d5
28 files changed
+90 -49

No files matched your search

@@ -17,8 +17,12 @@ import {
TeamName, TeamName,
TextContainer, TextContainer,
FlagContainer, FlagContainer,
PortraitDiv,
BaseContainer,
} from "./styles"; } from "./styles";
const driverPortraits = require.context("../../../../public/images/drivers/front", true);
type ChyronDriverProps = { type ChyronDriverProps = {
chyronData: BGChyronDriver, chyronData: BGChyronDriver,
subMode: BGChyronSubMode, subMode: BGChyronSubMode,
@@ -28,52 +32,61 @@ export function ChyronDriver({ chyronData, subMode }: ChyronDriverProps) {
: subMode === "large" ? [638, 98] : subMode === "large" ? [638, 98]
: [0, 0]; : [0, 0];
const { car, flagMode, showPosFlag, showDriverNumber } = chyronData; const { car, flagMode, showPosFlag, showDriverNumber, showPortrait } = chyronData;
const flagProps = flagMode === "country" const flagProps = flagMode === "country"
? { flagMode, flag: car.driver.nationality } ? { flagMode, flag: car.driver.nationality }
: flagMode === "team" ? { flagMode, flag: car.driver.team.id } : undefined; : flagMode === "team" ? { flagMode, flag: car.driver.team.id } : undefined;
return ( return (
<BaseBackground width={baseWidth} height={baseHeight}> <BaseContainer width={baseWidth} height={baseHeight}>
<Spacer width="6px" /> <BaseBackground >
{showPosFlag && ( <Spacer width="6px" />
<PositionFlag containerHeight={baseHeight}> {showPosFlag && (
<PositionNumber containerHeight={baseHeight}> <PositionFlag containerHeight={baseHeight}>
{car.position} <PositionNumber containerHeight={baseHeight}>
</PositionNumber> {car.position}
</PositionFlag> </PositionNumber>
)} </PositionFlag>
<Spacer width="8px" />
<TeamColorBar color={theme.colors.teams[car.driver.team.id]} />
<Spacer width="8px" />
<TextContainer>
<NameContainer>
<FirstName>{car.driver.firstName}</FirstName>
<LastName>{car.driver.lastName}</LastName>
{showDriverNumber && (
<NumberContainer>
<DriverNumber
teamId={car.driver.team.id}
fontSize="29px"
number={car.driver.number}
/>
</NumberContainer>
)}
</NameContainer>
<TeamName>{car.driver.team.shortName}</TeamName>
</TextContainer>
<FlagContainer
height={baseHeight * 0.9}
width={baseHeight * 3}
right={-baseHeight * 0.6}
>
{flagProps != null && (
<AngledFlag
flagHeight={baseHeight * 0.9}
flagProps={flagProps}
/>
)} )}
</FlagContainer> <Spacer width="8px" />
</BaseBackground> <TeamColorBar color={theme.colors.teams[car.driver.team.id]} />
<Spacer width="8px" />
<TextContainer>
<NameContainer>
<FirstName>{car.driver.firstName}</FirstName>
<LastName>{car.driver.lastName}</LastName>
{showDriverNumber && (
<NumberContainer>
<DriverNumber
teamId={car.driver.team.id}
fontSize="29px"
number={car.driver.number}
/>
</NumberContainer>
)}
</NameContainer>
<TeamName>{car.driver.team.shortName}</TeamName>
</TextContainer>
<FlagContainer
height={baseHeight * 0.9}
width={baseHeight * 3}
right={-baseHeight * 0.6}
>
{flagProps != null && (
<AngledFlag
flagHeight={baseHeight * 0.9}
flagProps={flagProps}
/>
)}
</FlagContainer>
</BaseBackground>
{showPortrait && (
<PortraitDiv
src={driverPortraits(`./${car.driver.id}.png`)}
height={baseHeight * 2.5}
rightMargin={-5}
/>
)}
</BaseContainer>
); );
} }
@@ -1,14 +1,21 @@
import styled from "styled-components"; import styled from "styled-components";
import { Px } from "../../../../types/style"; import { Px } from "../../../../types/style";
type BaseBackgroundProps = { type BaseContainerProps = {
width: Px, width: Px,
height: Px, height: Px,
}; };
export const BaseBackground = styled.div<BaseBackgroundProps>` export const BaseContainer = styled.div<BaseContainerProps>`
position: relative; position: relative;
width: ${({ width }) => `${width}px`}; width: ${({ width }) => `${width}px`};
height: ${({ height }) => `${height}px`}; height: ${({ height }) => `${height}px`};
`;
BaseContainer.displayName = "BaseContainer";
export const BaseBackground = styled.div`
position: relative;
height: 100%;
width: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
@@ -107,7 +114,6 @@ export const TeamName = styled.div`
`; `;
TeamName.displayName = "TeamName"; TeamName.displayName = "TeamName";
type SpacerProps = { type SpacerProps = {
width?: string, width?: string,
height?: string; height?: string;
@@ -137,3 +143,24 @@ export const FlagContainer = styled.div<FlagContainerProps>`
overflow: hidden; overflow: hidden;
`; `;
FlagContainer.displayName = "FlagContainer"; FlagContainer.displayName = "FlagContainer";
type PortraitDivProps = {
src: string,
height: Px,
rightMargin: Px,
};
export const PortraitDiv = styled.div<PortraitDivProps>`
position: absolute;
height: ${({ height }) => `${height}px`};
width: ${({ height }) => `${height * 1.4}px`};
bottom: 0;
right: ${({ rightMargin }) => `${rightMargin}px`};
background-image: url(${({ src }) => src});
background-size: contain;
background-repeat: no-repeat;
background-position: center ${({ height }) => `${height * .18}px`};
`;
PortraitDiv.displayName = "PortraitDiv";
+1 -1
View File
@@ -173,7 +173,7 @@ export const drivers: {[lastName: string]: Driver} = {
team: teams.haas, team: teams.haas,
yellowTCam: false, yellowTCam: false,
initials: "MAZ", initials: "MAZ",
nationality: "RUS", // RAF SUPPORT MAYBE LATER... nationality: "RAF",
}, },
norris: { norris: {
id: "norris", id: "norris",
+5 -4
View File
@@ -7,18 +7,19 @@ export const workspaces: WorkspaceObject = {
chyron: { chyron: {
name: "Chyron", name: "Chyron",
overlayIds: [ overlayIds: [
"chyron-driver-medium-full-ham.png",
"chyron-driver-medium-full-alo.png", "chyron-driver-medium-full-alo.png",
"chyron-driver-medium-full-lec.png", "chyron-driver-medium-full-lec.png",
"chyron-driver-medium-full-rai.png", "chyron-driver-medium-full-rai.png",
"chyron-driver-medium-full-vet.png", "chyron-driver-medium-full-vet.png",
"chyron-driver-medium-full-per.png", "chyron-driver-medium-full-per.png",
"chyron-driver-medium-full-msc.png", "chyron-driver-medium-full-msc.png",
"chyron-driver-medium-op1-ham.png",
"chyron-driver-medium-op2-ham.png",
"chyron-driver-medium-full-ham.png",
"chyron-driver-portrait-maz.png",
"chyron-driver-medium-full-gas-weird.png", "chyron-driver-medium-full-gas-weird.png",
"chyron-driver-medium-full-nor-weird.png", "chyron-driver-medium-full-nor-weird.png",
"chyron-driver-medium-full-lat-no-pos.png", "chyron-driver-medium-full-lat-no-pos.png",
"chyron-driver-medium-op1-ham.png",
"chyron-driver-medium-op2-ham.png",
"chyron-driver-large-np-tsu.png", "chyron-driver-large-np-tsu.png",
"chyron-driver-large-dnf-ver.png", "chyron-driver-large-dnf-ver.png",
], ],
@@ -34,7 +35,7 @@ export const workspaces: WorkspaceObject = {
], ],
previewWindowDimensions: { previewWindowDimensions: {
width: 1200, width: 1200,
height: 150, height: 250,
}, },
}, },
angledFlagCountry: { angledFlagCountry: {
Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB