diff --git a/src/components/BroadcastGraphics/Chyrons/Driver/ChyronDriver.tsx b/src/components/BroadcastGraphics/Chyrons/Driver/ChyronDriver.tsx
index 881193a..62c6fdf 100644
--- a/src/components/BroadcastGraphics/Chyrons/Driver/ChyronDriver.tsx
+++ b/src/components/BroadcastGraphics/Chyrons/Driver/ChyronDriver.tsx
@@ -1,4 +1,5 @@
import { DriverNumber } from "../../Common/DriverNumber";
+import { AngledFlag } from "../../Common/AngledFlag";
import {
BaseBackground,
FirstName,
@@ -11,10 +12,14 @@ import {
TeamColorBar,
TeamName,
TextContainer,
+ FlagContainer,
} from "./styles";
+import { drivers } from "../../../../domain/data/teams";
+import { theme } from "../../../../shared/theme";
export function ChyronDriver() {
// TODO - Get driver details from Redux.
+ const driver = drivers["hamilton"];
const baseWidth = 582;
const baseHeight = 72;
@@ -26,18 +31,33 @@ export function ChyronDriver() {
1
-
+
- Lewis
- Hamilton
+ {driver.firstName}
+ {driver.lastName}
-
+
- Mercedes
+ {driver.team.shortName}
+
+
+
+
);
}
diff --git a/src/components/BroadcastGraphics/Chyrons/Driver/styles.ts b/src/components/BroadcastGraphics/Chyrons/Driver/styles.ts
index eea391a..2463aa7 100644
--- a/src/components/BroadcastGraphics/Chyrons/Driver/styles.ts
+++ b/src/components/BroadcastGraphics/Chyrons/Driver/styles.ts
@@ -1,8 +1,9 @@
import styled from "styled-components";
+import { Px } from "../../../../types/style";
type BaseBackgroundProps = {
- width: number, // px
- height: number, // px
+ width: Px,
+ height: Px,
};
export const BaseBackground = styled.div`
position: relative;
@@ -20,7 +21,7 @@ export const BaseBackground = styled.div`
BaseBackground.displayName = "BaseBackground";
type PositionFlagProps = {
- containerHeight: number, // px
+ containerHeight: Px,
};
export const PositionFlag = styled.div`
position: relative;
@@ -37,7 +38,7 @@ export const PositionFlag = styled.div`
PositionFlag.displayName = "PositionFlag";
type PositionNumberProps = {
- containerHeight: number, // px
+ containerHeight: Px,
};
export const PositionNumber = styled.span`
font-family: ${p => p.theme.fonts.f1Regular};
@@ -116,3 +117,22 @@ export const Spacer = styled.div`
height: ${({ height = "0" }) => height};
`;
Spacer.displayName = "Spacer";
+
+type FlagContainerProps = {
+ height: Px,
+ width: Px,
+};
+export const FlagContainer = styled.div`
+ position: absolute;
+ right: -65px;
+
+ display: flex;
+ align-items: center;
+ justify-content: flex-end;
+
+ height: ${({ height }) => `${height}px`};
+ width: ${({ width }) => `${width}px`};
+
+ overflow: hidden;
+`;
+FlagContainer.displayName = "FlagContainer";
diff --git a/src/components/BroadcastGraphics/Common/AngledFlag/AngledFlag.tsx b/src/components/BroadcastGraphics/Common/AngledFlag/AngledFlag.tsx
new file mode 100644
index 0000000..4a36388
--- /dev/null
+++ b/src/components/BroadcastGraphics/Common/AngledFlag/AngledFlag.tsx
@@ -0,0 +1,40 @@
+import { FlagMode } from "../../../../types/state";
+import { Px } from "../../../../types/style";
+import { Container, NationalFlag, Slant, Sheen, NationalFlagEdge } from "./styles";
+
+const flags = require.context("../../../../public/images/flags/angled", true);
+const logos = require.context("../../../../public/images/logos", true);
+
+/**
+ * To look right, country flags need to be 2:1. Additional editing will be
+ * necessary for some flags to not cut off prominent elements. Ex: China's flag
+ * would have its stars mostly cut out without edits to place them closer to the
+ * center.
+ */
+type AngledFlagProps = {
+ flagMode: FlagMode,
+ flag: string,
+ flagHeight: Px,
+};
+export function AngledFlag({ flagMode, flag, flagHeight }: AngledFlagProps) {
+ return (
+
+
+ {flagMode === "country" ? (
+ <>
+
+
+ >
+ ) : null}
+
+
+ );
+}
diff --git a/src/components/BroadcastGraphics/Common/AngledFlag/index.ts b/src/components/BroadcastGraphics/Common/AngledFlag/index.ts
new file mode 100644
index 0000000..2d90788
--- /dev/null
+++ b/src/components/BroadcastGraphics/Common/AngledFlag/index.ts
@@ -0,0 +1 @@
+export * from "./AngledFlag";
diff --git a/src/components/BroadcastGraphics/Common/AngledFlag/styles.ts b/src/components/BroadcastGraphics/Common/AngledFlag/styles.ts
new file mode 100644
index 0000000..caad24d
--- /dev/null
+++ b/src/components/BroadcastGraphics/Common/AngledFlag/styles.ts
@@ -0,0 +1,107 @@
+import styled from "styled-components";
+import { Px } from "../../../../types/style";
+
+type ContainerProps = {
+ height: Px,
+ width: Px,
+};
+export const Container = styled.div`
+ position: relative;
+ overflow: hidden;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+
+ width: ${({ width }) => `${width}px`};
+ height: ${({ height }) => `${height}px`};
+ mask-image: linear-gradient(
+ to bottom,
+ transparent 0%,
+ transparent 10%,
+ black 40%,
+ black 60%,
+ transparent 90%,
+ transparent 100%
+ );
+`;
+
+type NationalFlagProps = {
+ height: Px,
+};
+export const NationalFlag = styled.img`
+ max-inline-size: unset;
+ height: ${({ height }) => `${height}px`};
+ clip-path: polygon(50% 0, 100% 0, 100% 30%, 60% 100%, 0 100%, 0 100%);
+ mask-image: linear-gradient(
+ to right,
+ 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";
+
+type SlashProps = {
+ x: Px,
+ height: Px,
+ girth: Px,
+};
+export const Sheen = styled.div`
+ position: absolute;
+ height: ${({ height }) => `${height}px`};
+ width: ${({ girth }) => `${girth}px`};
+
+ background: linear-gradient(
+ to top,
+ transparent 0%,
+ transparent 20%,
+ rgba(255, 255, 255, 0.15) 45%,
+ rgba(255, 255, 255, 0.15) 55%,
+ transparent 80%,
+ transparent 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);
+ transform: skew(-45deg, 0deg) translateX(${({ x }) => `${x}px`});
+
+ border-left: 0.015em solid rgba(255, 255, 255, 0.25);
+`;
+Sheen.displayName = "Sheen";
+
+export const Slant = styled.div`
+ position: absolute;
+ height: ${({ height }) => `${height}px`};
+ width: ${({ girth }) => `${girth}px`};
+
+ background: #1a1a28;
+ transform: skewX(-45deg) translateX(${({ x }) => `${x}px`});
+`;
+Slant.displayName = "Slant";
+
+export const NationalFlagEdge = styled.div`
+ position: absolute;
+ height: ${({ height }) => `${height}px`};
+ width: ${({ girth }) => `${girth}px`};
+
+ background: ${p => p.theme.colors.lightGrey};
+ opacity: 0.5;
+ transform: skewX(-45deg) translateX(${({ x }) => `${x}px`});
+
+ mask-image: linear-gradient(
+ to top,
+ transparent 0%,
+ transparent 10%,
+ black 100%
+ );
+`;
diff --git a/src/components/Common/Inputs/ProgressSlider/ProgressSlider.tsx b/src/components/Common/Inputs/ProgressSlider/ProgressSlider.tsx
index 46e0d31..8f4a28c 100644
--- a/src/components/Common/Inputs/ProgressSlider/ProgressSlider.tsx
+++ b/src/components/Common/Inputs/ProgressSlider/ProgressSlider.tsx
@@ -77,7 +77,7 @@ export function ProgressSlider({
) ? -1 : value > 0.1 ? 4 : 3 // Tuned fitting considerations.
}
disabled={disabled}
- onBarColor={labelColor}
+ color={labelColor}
>
{formatter(value)}
diff --git a/src/components/Common/Inputs/ProgressSlider/styles.ts b/src/components/Common/Inputs/ProgressSlider/styles.ts
index 1b1df95..f881fae 100644
--- a/src/components/Common/Inputs/ProgressSlider/styles.ts
+++ b/src/components/Common/Inputs/ProgressSlider/styles.ts
@@ -62,7 +62,7 @@ ProgressSliderBarHandle.displayName = "ProgressSliderBarHandle";
type ProgressSliderBarIndicatorProps = {
left: number,
disabled: boolean,
- onBarColor?: string,
+ color?: string,
};
export const ProgressSliderBarIndicator = styled.span`
display: block;
@@ -72,11 +72,11 @@ export const ProgressSliderBarIndicator = styled.span p.theme.fonts.f1Regular};
font-size: 0.9em;
- color: ${({ onBarColor, left, disabled }) => (
+ color: ${({ color, left, disabled }) => (
left < 0
? disabled
? (p => p.theme.colors.darkGrey)
- : onBarColor ?? "white"
+ : color ?? "white"
: (p => p.theme.colors.darkGrey)
)};
diff --git a/src/components/Workspaces/CustomWorkSpaces/AngledFlagWorkSpace.tsx b/src/components/Workspaces/CustomWorkSpaces/AngledFlagWorkSpace.tsx
new file mode 100644
index 0000000..454b880
--- /dev/null
+++ b/src/components/Workspaces/CustomWorkSpaces/AngledFlagWorkSpace.tsx
@@ -0,0 +1,14 @@
+import { AngledFlag } from "../../BroadcastGraphics/Common/AngledFlag";
+import { BasicBlock } from "./styles";
+
+export function AngledFlagWorkSpace() {
+ return (
+
+
+
+ );
+}
diff --git a/src/components/Workspaces/CustomWorkSpaces/styles.ts b/src/components/Workspaces/CustomWorkSpaces/styles.ts
new file mode 100644
index 0000000..b57472e
--- /dev/null
+++ b/src/components/Workspaces/CustomWorkSpaces/styles.ts
@@ -0,0 +1,21 @@
+import styled from "styled-components";
+import { Px } from "../../../types/style";
+
+type BasicBlockProps = {
+ width: Px,
+ height: Px,
+ color: string,
+ center?: boolean,
+}
+export const BasicBlock = styled.div`
+ display: flex;
+ justify-content: center;
+ align-items: center;
+
+ width: ${({ width }) => `${width}px`};
+ height: ${({ height }) => `${height}px`};
+
+ background-color: ${({ color }) => color};
+
+ border-radius: 15px;
+`;
diff --git a/src/domain/data/workspaces.ts b/src/domain/data/workspaces.ts
index ff3d0ea..709f4e0 100644
--- a/src/domain/data/workspaces.ts
+++ b/src/domain/data/workspaces.ts
@@ -3,6 +3,7 @@ import { WorkspaceId, WorkspaceProperties } from "../../types/state";
// Broadcast Graphics
import { ChyronDriver } from "../../components/BroadcastGraphics/Chyrons/Driver";
+import { AngledFlagWorkSpace } from "../../components/Workspaces/CustomWorkSpaces/AngledFlagWorkSpace";
type WorkspaceObject = {
[id: WorkspaceId]: WorkspaceProperties,
@@ -27,11 +28,22 @@ export const workspaces: WorkspaceObject = {
height: 200,
},
},
+ angledFlag: {
+ name: "Angled Flag",
+ overlayIds: [
+ "angled-flag-gbr.png",
+ ],
+ previewWindowDimensions: {
+ width: 500,
+ height: 500,
+ },
+ },
};
export function fetchBroadcastGraphic(workspaceId: WorkspaceId): ReactNode {
switch(workspaceId) {
case "chyronDriver": return ChyronDriver();
+ case "angledFlag": return AngledFlagWorkSpace();
default: return null;
}
}
diff --git a/src/public/images/flags/AUS.svg b/src/public/images/flags/AUS.svg
new file mode 100644
index 0000000..3d1060d
--- /dev/null
+++ b/src/public/images/flags/AUS.svg
@@ -0,0 +1,24 @@
+
+
\ No newline at end of file
diff --git a/src/public/images/flags/CAN.svg b/src/public/images/flags/CAN.svg
new file mode 100644
index 0000000..472c431
--- /dev/null
+++ b/src/public/images/flags/CAN.svg
@@ -0,0 +1,5 @@
+
diff --git a/src/public/images/flags/CHN.svg b/src/public/images/flags/CHN.svg
new file mode 100644
index 0000000..61f4fdc
--- /dev/null
+++ b/src/public/images/flags/CHN.svg
@@ -0,0 +1,12 @@
+
+
\ No newline at end of file
diff --git a/src/public/images/flags/DEU.svg b/src/public/images/flags/DEU.svg
new file mode 100644
index 0000000..4a5a153
--- /dev/null
+++ b/src/public/images/flags/DEU.svg
@@ -0,0 +1,6 @@
+
+
diff --git a/src/public/images/flags/ESP.svg b/src/public/images/flags/ESP.svg
new file mode 100644
index 0000000..8fda47a
--- /dev/null
+++ b/src/public/images/flags/ESP.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/public/images/flags/FIN.svg b/src/public/images/flags/FIN.svg
new file mode 100644
index 0000000..e7f293b
--- /dev/null
+++ b/src/public/images/flags/FIN.svg
@@ -0,0 +1,6 @@
+
+
diff --git a/src/public/images/flags/FRA.svg b/src/public/images/flags/FRA.svg
new file mode 100644
index 0000000..3165e37
--- /dev/null
+++ b/src/public/images/flags/FRA.svg
@@ -0,0 +1,6 @@
+
+
diff --git a/src/public/images/flags/GBR.svg b/src/public/images/flags/GBR.svg
new file mode 100644
index 0000000..37f96ce
--- /dev/null
+++ b/src/public/images/flags/GBR.svg
@@ -0,0 +1,11 @@
+
+
diff --git a/src/public/images/flags/ITA.svg b/src/public/images/flags/ITA.svg
new file mode 100644
index 0000000..9ee6003
--- /dev/null
+++ b/src/public/images/flags/ITA.svg
@@ -0,0 +1,6 @@
+
+
diff --git a/src/public/images/flags/JPN.svg b/src/public/images/flags/JPN.svg
new file mode 100644
index 0000000..8f45475
--- /dev/null
+++ b/src/public/images/flags/JPN.svg
@@ -0,0 +1,5 @@
+
+
\ No newline at end of file
diff --git a/src/public/images/flags/MCO.svg b/src/public/images/flags/MCO.svg
new file mode 100644
index 0000000..797f9f2
--- /dev/null
+++ b/src/public/images/flags/MCO.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/public/images/flags/MEX.svg b/src/public/images/flags/MEX.svg
new file mode 100644
index 0000000..7a80b6f
--- /dev/null
+++ b/src/public/images/flags/MEX.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/public/images/flags/NLD.svg b/src/public/images/flags/NLD.svg
new file mode 100644
index 0000000..f19bd00
--- /dev/null
+++ b/src/public/images/flags/NLD.svg
@@ -0,0 +1,5 @@
+
\ No newline at end of file
diff --git a/src/public/images/flags/RAF.svg b/src/public/images/flags/RAF.svg
new file mode 100644
index 0000000..9c187b0
--- /dev/null
+++ b/src/public/images/flags/RAF.svg
@@ -0,0 +1,12 @@
+
+
diff --git a/src/public/images/flags/RUS.svg b/src/public/images/flags/RUS.svg
new file mode 100644
index 0000000..387307f
--- /dev/null
+++ b/src/public/images/flags/RUS.svg
@@ -0,0 +1,6 @@
+
+
diff --git a/src/public/images/flags/THA.svg b/src/public/images/flags/THA.svg
new file mode 100644
index 0000000..2a9fa1c
--- /dev/null
+++ b/src/public/images/flags/THA.svg
@@ -0,0 +1,6 @@
+
+
\ No newline at end of file
diff --git a/src/public/images/flags/angled/AUS.svg b/src/public/images/flags/angled/AUS.svg
new file mode 100644
index 0000000..5365302
--- /dev/null
+++ b/src/public/images/flags/angled/AUS.svg
@@ -0,0 +1,17 @@
+
+
diff --git a/src/public/images/flags/angled/CAN.svg b/src/public/images/flags/angled/CAN.svg
new file mode 100644
index 0000000..a476a99
--- /dev/null
+++ b/src/public/images/flags/angled/CAN.svg
@@ -0,0 +1,6 @@
+
+
diff --git a/src/public/images/flags/angled/CHN.svg b/src/public/images/flags/angled/CHN.svg
new file mode 100644
index 0000000..a7b1632
--- /dev/null
+++ b/src/public/images/flags/angled/CHN.svg
@@ -0,0 +1,9 @@
+
+
diff --git a/src/public/images/flags/angled/DEU.svg b/src/public/images/flags/angled/DEU.svg
new file mode 100644
index 0000000..3e37b0b
--- /dev/null
+++ b/src/public/images/flags/angled/DEU.svg
@@ -0,0 +1,6 @@
+
+
diff --git a/src/public/images/flags/angled/ESP.svg b/src/public/images/flags/angled/ESP.svg
new file mode 100644
index 0000000..0105dfe
--- /dev/null
+++ b/src/public/images/flags/angled/ESP.svg
@@ -0,0 +1,505 @@
+
+
diff --git a/src/public/images/flags/angled/FIN.svg b/src/public/images/flags/angled/FIN.svg
new file mode 100644
index 0000000..a164034
--- /dev/null
+++ b/src/public/images/flags/angled/FIN.svg
@@ -0,0 +1,8 @@
+
+
diff --git a/src/public/images/flags/angled/FRA.svg b/src/public/images/flags/angled/FRA.svg
new file mode 100644
index 0000000..0d76113
--- /dev/null
+++ b/src/public/images/flags/angled/FRA.svg
@@ -0,0 +1,6 @@
+
+
diff --git a/src/public/images/flags/angled/GBR.svg b/src/public/images/flags/angled/GBR.svg
new file mode 100644
index 0000000..08940ed
--- /dev/null
+++ b/src/public/images/flags/angled/GBR.svg
@@ -0,0 +1,9 @@
+
diff --git a/src/public/images/flags/angled/ITA.svg b/src/public/images/flags/angled/ITA.svg
new file mode 100644
index 0000000..0ee3c3a
--- /dev/null
+++ b/src/public/images/flags/angled/ITA.svg
@@ -0,0 +1,6 @@
+
+
diff --git a/src/public/images/flags/angled/JPN.svg b/src/public/images/flags/angled/JPN.svg
new file mode 100644
index 0000000..7454f67
--- /dev/null
+++ b/src/public/images/flags/angled/JPN.svg
@@ -0,0 +1,5 @@
+
+
diff --git a/src/public/images/flags/angled/MCO.svg b/src/public/images/flags/angled/MCO.svg
new file mode 100644
index 0000000..797f9f2
--- /dev/null
+++ b/src/public/images/flags/angled/MCO.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/public/images/flags/angled/MEX.svg b/src/public/images/flags/angled/MEX.svg
new file mode 100644
index 0000000..7a80b6f
--- /dev/null
+++ b/src/public/images/flags/angled/MEX.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/public/images/flags/angled/NLD.svg b/src/public/images/flags/angled/NLD.svg
new file mode 100644
index 0000000..d28acc5
--- /dev/null
+++ b/src/public/images/flags/angled/NLD.svg
@@ -0,0 +1,6 @@
+
+
diff --git a/src/public/images/flags/angled/RAF.svg b/src/public/images/flags/angled/RAF.svg
new file mode 100644
index 0000000..bba573c
--- /dev/null
+++ b/src/public/images/flags/angled/RAF.svg
@@ -0,0 +1,7 @@
+
+
diff --git a/src/public/images/flags/angled/RUS.svg b/src/public/images/flags/angled/RUS.svg
new file mode 100644
index 0000000..b714eb1
--- /dev/null
+++ b/src/public/images/flags/angled/RUS.svg
@@ -0,0 +1,6 @@
+
+
diff --git a/src/public/images/flags/angled/THA.svg b/src/public/images/flags/angled/THA.svg
new file mode 100644
index 0000000..79bd3d4
--- /dev/null
+++ b/src/public/images/flags/angled/THA.svg
@@ -0,0 +1,6 @@
+
+
diff --git a/src/public/images/overlays/angled-flag-gbr.png b/src/public/images/overlays/angled-flag-gbr.png
new file mode 100644
index 0000000..ff16222
Binary files /dev/null and b/src/public/images/overlays/angled-flag-gbr.png differ
diff --git a/src/shared/theme.ts b/src/shared/theme.ts
index 61980ae..755e588 100644
--- a/src/shared/theme.ts
+++ b/src/shared/theme.ts
@@ -29,7 +29,7 @@ export const theme = {
haas: "#fff",
mclaren: "#ff9800",
mercedes: "#00d2be",
- redbull: "#0600ef",
+ redBull: "#0600ef",
williams: "#005aff",
},
},
diff --git a/src/types/state.d.ts b/src/types/state.d.ts
index e30bb47..0b6e997 100644
--- a/src/types/state.d.ts
+++ b/src/types/state.d.ts
@@ -1,65 +1,65 @@
-export type RootState = {
- pageDimensions: PageDimensions,
- workspace: Workspace,
- overlayTool: OverlayTool,
-};
+export interface RootState {
+ pageDimensions: PageDimensions;
+ workspace: Workspace;
+ overlayTool: OverlayTool;
+}
// Page Dimensions
-export type PageDimensions = {
- mainMenu: Dimensions,
- app: Dimensions,
- workspace: Dimensions,
-};
-export type Dimensions = { width: number, height: number };
+export interface PageDimensions {
+ mainMenu: Dimensions;
+ app: Dimensions;
+ workspace: Dimensions;
+}
+export interface Dimensions { width: number; height: number; }
// Workspace
-export type Workspace = {
- workspaceId: WorkspaceId,
- animatedBG: boolean,
- workspaceProperties: WorkspaceProperties,
-};
+export interface Workspace {
+ workspaceId: WorkspaceId;
+ animatedBG: boolean;
+ workspaceProperties: WorkspaceProperties;
+}
export type WorkspaceId = string;
-export type WorkspaceProperties = {
- name: string,
- overlayIds: OverlayIds,
- previewWindowDimensions: Dimensions,
-};
+export interface WorkspaceProperties {
+ name: string;
+ overlayIds: OverlayIds;
+ previewWindowDimensions: Dimensions;
+}
// Overlay Tool
-export type OverlayTool = {
- currentWorkspaceId: WorkspaceId,
- overlayIds: OverlayIds,
- currentOverlayId: OverlayId | null,
- currentOverlayItem: OverlayItem | null,
- visible: boolean,
-};
+export interface OverlayTool {
+ currentWorkspaceId: WorkspaceId;
+ overlayIds: OverlayIds;
+ currentOverlayId: OverlayId | null;
+ currentOverlayItem: OverlayItem | null;
+ visible: boolean;
+}
export type OverlayId = string;
export type OverlayIds = Array;
-export type OverlayPosition = { x: number, y: number };
-export type OverlayItem = {
- position: OverlayPosition,
- opacity: number,
-};
+export interface OverlayPosition { x: number; y: number; }
+export interface OverlayItem {
+ position: OverlayPosition;
+ opacity: number;
+}
// Race State.
-export type Car = {
- position: number,
- driver: Driver,
- // status: ???,
- // distance: number,
-};
+export interface Car {
+ position: number;
+ driver: Driver;
+ // status: ???;
+ // distance: number;
+}
export type Grid = Array;
-export type Driver = {
- id: DriverId,
- firstName: string,
- lastName: string,
- number: number,
- team: Team,
- yellowTCam: boolean,
- initials: string,
- nationality: string, // ISO 3166-1 alpha-3 codes
-};
+export interface Driver {
+ id: DriverId;
+ firstName: string;
+ lastName: string;
+ number: number;
+ team: Team;
+ yellowTCam: boolean;
+ initials: string;
+ nationality: string; // ISO 3166-1 alpha-3 codes
+}
export type DriverId =
| "albon"
| "alonso"
@@ -85,13 +85,13 @@ export type DriverId =
| "vettel"
| "zhou";
-export type Team = {
- id: TeamId,
- shortName: TeamShortName,
- fullName: TeamFullName,
- nationality: string, // ISO 3166-1 alpha-3 codes
- // logo: string,
-};
+export interface Team {
+ id: TeamId;
+ shortName: TeamShortName;
+ fullName: TeamFullName;
+ nationality: string; // ISO 3166-1 alpha-3 codes
+ // logo: string;
+}
export type TeamId =
| "alfaRomeo"
| "alphaTauri"
@@ -127,3 +127,40 @@ export type TeamFullName =
| "Williams Racing";
// Broadcast Graphics
+export interface BGRelativePos {
+ top?: string;
+ right?: string;
+ bottom?: string;
+ left?: string;
+}
+export interface BroadcastGraphics {
+ // timingBoard: BGTimingBoard;
+ // statusIndicator: BGStatusIndicator;
+ // indicators: BGIndicators
+ chyrons: BGChyrons;
+ // gems: BGGems
+ // toasts: BGToasts;
+}
+
+export interface BGChyrons {
+ primary: BGChyron;
+ secondary: BGChyron;
+ // sponsorGem: BGSponsorGem;
+}
+
+export type FlagMode = "country" | "team";
+export type BGChyronMode =
+ | "driver-basic-small"
+ | "driver-basic-medium"
+ | "driver-basic-large";
+export interface BGChyron extends BGRelativePos {
+ mode: BGChyronMode;
+ cars: Array;
+}
+export interface BGChyronMedium extends BGChyron {
+ mode: "driver-basic-medium";
+ flag: FlagMode;
+ showPosFlag: boolean;
+ showDriverNumber: boolean;
+}
+
diff --git a/src/types/style.d.ts b/src/types/style.d.ts
new file mode 100644
index 0000000..da7c5af
--- /dev/null
+++ b/src/types/style.d.ts
@@ -0,0 +1,4 @@
+/**
+ * Type to remind you that we're dealing with pixels.
+ */
+export type Px = number;