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