ISSUE-045 - Venetian Blinds - Starting work on the "venetian blinds" transition effect.
I'll be starting with re-creating this effect on the PositionFlag component. That involves first separating out the PositionFlag into its own common component (it's used on the timing board as well, so it makes sense). Adding new overlays for prototyping work.
This commit is contained in:
1 parent
5e86b92ca5
commit
e747a7d7c3
13 files changed
+65
-34
No files matched your search
@@ -4,14 +4,13 @@ import { theme } from "../../../../shared/theme";
|
||||
|
||||
import { DriverNumber } from "../../Common/DriverNumber";
|
||||
import { AngledFlag } from "../../Common/AngledFlag";
|
||||
import { PositionFlag } from "../../Common/PositionFlag";
|
||||
import {
|
||||
BaseBackground,
|
||||
FirstName,
|
||||
PositionNumber,
|
||||
LastName,
|
||||
NameContainer,
|
||||
NumberContainer,
|
||||
PositionFlag,
|
||||
Spacer,
|
||||
TeamColorBar,
|
||||
TeamName,
|
||||
@@ -42,11 +41,7 @@ export function ChyronDriver({ chyronData, subMode }: ChyronDriverProps) {
|
||||
<BaseBackground >
|
||||
<Spacer width="6px" />
|
||||
{showPosFlag && (
|
||||
<PositionFlag containerHeight={baseHeight}>
|
||||
<PositionNumber containerHeight={baseHeight}>
|
||||
{car.position}
|
||||
</PositionNumber>
|
||||
</PositionFlag>
|
||||
<PositionFlag size={baseHeight * 0.85} number={car.position} />
|
||||
)}
|
||||
<Spacer width="8px" />
|
||||
<TeamColorBar color={theme.colors.teams[car.driver.team.id]} />
|
||||
|
||||
@@ -27,33 +27,6 @@ export const BaseBackground = styled.div`
|
||||
`;
|
||||
BaseBackground.displayName = "BaseBackground";
|
||||
|
||||
type PositionFlagProps = {
|
||||
containerHeight: Px,
|
||||
};
|
||||
export const PositionFlag = styled.div<PositionFlagProps>`
|
||||
position: relative;
|
||||
height: ${({ containerHeight }) => `${containerHeight * 0.85}px`};
|
||||
width: ${({ containerHeight }) => `${containerHeight * 0.85}px`};
|
||||
|
||||
border-bottom-right-radius: 9px;
|
||||
background-color: #f4f3ee;
|
||||
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
`;
|
||||
PositionFlag.displayName = "PositionFlag";
|
||||
|
||||
type PositionNumberProps = {
|
||||
containerHeight: Px,
|
||||
};
|
||||
export const PositionNumber = styled.span<PositionNumberProps>`
|
||||
font-family: ${p => p.theme.fonts.f1Regular};
|
||||
font-size: ${({ containerHeight }) => `${containerHeight * 0.85 * 0.64}px`};
|
||||
margin-top: 2px;
|
||||
`;
|
||||
PositionNumber.displayName = "PositionNumber";
|
||||
|
||||
type TeamColorBarProps = {
|
||||
color: string,
|
||||
};
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import { Px } from "../../../../types/style";
|
||||
|
||||
import { PositionFlagBox, PositionNumber } from "./styles";
|
||||
|
||||
type PositionFlagProps = {
|
||||
size: Px,
|
||||
number: number,
|
||||
};
|
||||
export function PositionFlag({ size, number }: PositionFlagProps) {
|
||||
return (
|
||||
<PositionFlagBox size={size}>
|
||||
<PositionNumber size={size}>
|
||||
{number}
|
||||
</PositionNumber>
|
||||
</PositionFlagBox>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export * from "./PositionFlag";
|
||||
@@ -0,0 +1,29 @@
|
||||
import styled from "styled-components";
|
||||
import { Px } from "../../../../types/style";
|
||||
|
||||
type PositionFlagBoxProps = {
|
||||
size: Px,
|
||||
};
|
||||
export const PositionFlagBox = styled.div<PositionFlagBoxProps>`
|
||||
position: relative;
|
||||
height: ${({ size }) => `${size}px`};
|
||||
width: ${({ size }) => `${size}px`};
|
||||
|
||||
border-bottom-right-radius: 15%;
|
||||
background-color: #f4f3ee;
|
||||
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
`;
|
||||
PositionFlagBox.displayName = "PositionFlagBox";
|
||||
|
||||
type PositionNumberProps = {
|
||||
size: Px,
|
||||
};
|
||||
export const PositionNumber = styled.span<PositionNumberProps>`
|
||||
font-family: ${p => p.theme.fonts.f1Regular};
|
||||
font-size: ${({ size }) => `${size * 0.64}px`};
|
||||
margin-top: 2px;
|
||||
`;
|
||||
PositionNumber.displayName = "PositionNumber";
|
||||
Reference in new issue
Block a user