ISSUE-031 - Improvements to the look of National Flag. Adjusted the sizing and spacing to better support larger chyron heights.

This commit is contained in:
Kyle Geib committed 2022-01-25 13:32:31 -05:00
1 parent 562667bdd7
commit 1dc8e8bc15
4 files changed
+15 -21

No files matched your search

@@ -20,7 +20,6 @@ import { theme } from "../../../../shared/theme";
export function ChyronDriver() {
// TODO - Get driver details from Redux.
const driver = drivers["hamilton"];
const baseWidth = 582;
const baseHeight = 72;
@@ -49,14 +48,14 @@ export function ChyronDriver() {
</TextContainer>
<FlagContainer
height={baseHeight * 0.9}
width={250}
width={baseHeight * 3}
right={-baseHeight * 0.6}
>
<AngledFlag
flagMode="country"
flag={driver.nationality}
flagHeight={64}
flagHeight={baseHeight * 0.9}
/>
</FlagContainer>
</BaseBackground>
);
@@ -121,10 +121,11 @@ Spacer.displayName = "Spacer";
type FlagContainerProps = {
height: Px,
width: Px,
right: Px,
};
export const FlagContainer = styled.div<FlagContainerProps>`
position: absolute;
right: -65px;
right: ${({ right }) => `${right}px`};
display: flex;
align-items: center;
@@ -24,6 +24,7 @@ export const Container = styled.div<ContainerProps>`
transparent 100%
);
`;
Container.displayName = "Container";
type NationalFlagProps = {
height: Px,
@@ -31,21 +32,14 @@ type NationalFlagProps = {
export const NationalFlag = styled.img<NationalFlagProps>`
max-inline-size: unset;
height: ${({ height }) => `${height}px`};
clip-path: polygon(50% 0, 100% 0, 100% 30%, 60% 100%, 0 100%, 0 100%);
clip-path: polygon(50% 0, 100% 0, 100% 30%, 66% 100%, 0 100%, 0 100%);
mask-image: linear-gradient(
to right,
60deg,
transparent 0%,
black 15%,
black 85%,
transparent 100%
);
mask-image: radial-gradient(
circle at center,
black 0%,
black 80%,
transparent 96%,
transparent 100%
);
`;
NationalFlag.displayName = "NationalFlag";
@@ -60,19 +54,19 @@ export const Sheen = styled.div<SlashProps>`
width: ${({ girth }) => `${girth}px`};
background: linear-gradient(
to top,
transparent 0%,
transparent 20%,
25deg,
black 0%,
black 25%,
rgba(255, 255, 255, 0.15) 45%,
rgba(255, 255, 255, 0.15) 55%,
transparent 80%,
transparent 100%
black 75%,
black 100%
);
font-size: ${({ height }) => `${height}px`}; // Hack to let me use em.
box-shadow:
0.02em 0 0.005em 0.015em rgba(0, 0, 0, 0.2),
1em 0 0 1em rgba(0, 0, 0, 0.1);
1em 0 0 1em rgba(0, 0, 0, 0.5);
transform: skew(-45deg, 0deg) translateX(${({ x }) => `${x}px`});
border-left: 0.015em solid rgba(255, 255, 255, 0.25);
@@ -6,7 +6,7 @@ export function AngledFlagWorkSpace() {
<BasicBlock width={400} height={400} color="rgba(30, 30, 30, .7)">
<AngledFlag
flagMode="country"
flag="JPN"
flag="GBR"
flagHeight={64}
/>
</BasicBlock>