ISSUE-031 - Progress checkpoint.

A lot of work going on here.
* Moved WorkspaceControls component to a new sub directory
* Renamed overlay images
* Started a static ChyronDriverBasic component (using Hamilton as an example)
* Created a fancy DriverNumber rendering system
* Defined DriverNumber style for Mercedes and no one else yet
* A bunch of new states for the grid: cars, drivers, teams, etc
* Defined a bunch of data for the drivers and teams
* Created another string utility function to generate repeat strings; unit tests included
This commit is contained in:
Kyle Geib committed 2022-01-21 14:14:45 -05:00
1 parent 1c38137480
commit db14bf902f
21 files changed
+787 -41

No files matched your search

+336
View File
@@ -0,0 +1,336 @@
import { theme } from "../../shared/theme";
import { Driver, Team } from "../../types/state";
import { repeater } from "../../utils/strings";
/**
* Do not grab directly!
* 2021 Driver lineup with 2022 newcomers included (Zhou and Albon).
*/
export const teams: {[id: string]: Team} = {
alfaRomeo: {
id: "alfaRomeo",
shortName: "Alfa Romeo",
fullName: "Alfa Romeo F1 Team ORLEN",
nationality: "CHE",
},
alphaTauri: {
id: "alphaTauri",
shortName: "AlphaTauri",
fullName: "Scuderia AlphaTauri",
nationality: "ITA",
},
alpine: {
id: "alpine",
shortName: "Alpine",
fullName: "Alpine F1 Team",
nationality: "FRA",
},
astonMartin: {
id: "astonMartin",
shortName: "Aston Martin",
fullName: "Aston Martin Cognizant Formula One Team",
nationality: "GBR",
},
ferrari: {
id: "ferrari",
shortName: "Ferrari",
fullName: "Scuderia Ferrari",
nationality: "ITA",
},
haas: {
id: "haas",
shortName: "Haas F1 Team",
fullName: "Uralkali Haas F1 Team",
nationality: "USA",
},
mclaren: {
id: "mclaren",
shortName: "McLaren",
fullName: "McLaren F1 Team",
nationality: "GBR",
},
mercedes: {
id: "mercedes",
shortName: "Mercedes",
fullName: "Mercedes-AMG Petronas Formula One Team",
nationality: "DEU",
},
redBull: {
id: "redBull",
shortName: "Red Bull Racing",
fullName: "Red Bull Racing",
nationality: "AUT",
},
williams: {
id: "williams",
shortName: "Williams",
fullName: "Williams Racing",
nationality: "GBR",
},
};
/**
* Do not grab directly!
* 2021 Driver lineup with 2022 newcomers included (Zhou and Albon)
*/
export const drivers: {[lastName: string]: Driver} = {
albon: {
id: "albon",
firstName: "Alex",
lastName: "Albon",
number: 23,
team: teams.williams,
yellowTCam: false, // TBD
initials: "ALB",
nationality: "THA",
},
alonso: {
id: "alonso",
firstName: "Fernando",
lastName: "Alonso",
number: 14,
team: teams.alpine,
yellowTCam: false,
initials: "ALO",
nationality: "ESP",
},
bottas: {
id: "bottas",
firstName: "Valtteri",
lastName: "Bottas",
number: 77,
team: teams.mercedes,
yellowTCam: true,
initials: "BOT",
nationality: "FIN",
},
gasly: {
id: "gasly",
firstName: "Pierre",
lastName: "Gasly",
number: 10,
team: teams.alphaTauri,
yellowTCam: true,
initials: "GAS",
nationality: "FRA",
},
giovinazzi: {
id: "giovinazzi",
firstName: "Antonio",
lastName: "Giovinazzi",
number: 99,
team: teams.alfaRomeo,
yellowTCam: true,
initials: "GIO",
nationality: "ITA",
},
hamilton: {
id: "hamilton",
firstName: "Lewis",
lastName: "Hamilton",
number: 44,
team: teams.mercedes,
yellowTCam: false,
initials: "HAM",
nationality: "GBR",
},
kubica: {
id: "kubica",
firstName: "Robert",
lastName: "Kubica",
number: 88,
team: teams.alfaRomeo,
yellowTCam: false,
initials: "KUB",
nationality: "POL",
},
latifi: {
id: "latifi",
firstName: "Nicolas",
lastName: "Latifi",
number: 6,
team: teams.williams,
yellowTCam: true,
initials: "LAT",
nationality: "CAN",
},
leclerc: {
id: "leclerc",
firstName: "Charles",
lastName: "Leclerc",
number: 16,
team: teams.ferrari,
yellowTCam: false,
initials: "LEC",
nationality: "MCO",
},
mazepin: {
id: "mazepin",
firstName: "Nikita",
lastName: "Mazepin",
number: 9,
team: teams.haas,
yellowTCam: false,
initials: "MAZ",
nationality: "RUS", // RAF SUPPORT MAYBE LATER...
},
norris: {
id: "norris",
firstName: "Lando",
lastName: "Norris",
number: 4,
team: teams.mclaren,
yellowTCam: true,
initials: "NOR",
nationality: "GBR",
},
ocon: {
id: "ocon",
firstName: "Esteban",
lastName: "Ocon",
number: 31,
team: teams.alpine,
yellowTCam: true,
initials: "OCO",
nationality: "FRA",
},
perez: {
id: "perez",
firstName: "Sergio",
lastName: "Pérez",
number: 11,
team: teams.redBull,
yellowTCam: true,
initials: "PER",
nationality: "MEX",
},
raikkonen: {
id: "raikkonen",
firstName: "Kimi",
lastName: "Räikkönen",
number: 7,
team: teams.alfaRomeo,
yellowTCam: false,
initials: "RAI",
nationality: "FIN",
},
ricciardo: {
id: "ricciardo",
firstName: "Daniel",
lastName: "Ricciardo",
number: 3,
team: teams.mclaren,
yellowTCam: false,
initials: "RIC",
nationality: "AUS",
},
russell: {
id: "russell",
firstName: "George",
lastName: "Russell",
number: 63,
team: teams.williams,
yellowTCam: false,
initials: "RUS",
nationality: "GBR",
},
sainz: {
id: "sainz",
firstName: "Carlos",
lastName: "Sainz",
number: 55,
team: teams.ferrari,
yellowTCam: true,
initials: "SAI",
nationality: "ESP",
},
schumacher: {
id: "schumacher",
firstName: "Mick",
lastName: "Schumacher",
number: 47,
team: teams.haas,
yellowTCam: true,
initials: "MSC",
nationality: "DEU",
},
stroll: {
id: "stroll",
firstName: "Lance",
lastName: "Stroll",
number: 18,
team: teams.astonMartin,
yellowTCam: false,
initials: "STR",
nationality: "CAN",
},
tsunoda: {
id: "tsunoda",
firstName: "Yuki",
lastName: "Tsunoda",
number: 22,
team: teams.alphaTauri,
yellowTCam: false,
initials: "TSU",
nationality: "JPN",
},
verstappen: {
id: "verstappen",
firstName: "Max",
lastName: "Verstappen",
number: 33,
team: teams.redBull,
yellowTCam: false,
initials: "VER",
nationality: "NLD",
},
vettel: {
id: "vettel",
firstName: "Sebastian",
lastName: "Vettel",
number: 5,
team: teams.astonMartin,
yellowTCam: true,
initials: "VET",
nationality: "DEU",
},
zhou: {
id: "zhou",
firstName: "Guanyu",
lastName: "Zhou",
number: 24,
team: teams.alfaRomeo,
yellowTCam: true,
initials: "ZHO",
nationality: "CHN",
},
};
type NumberStyleRule = {
type: "stroke"
color: string,
width: number,
} | {
type: "shadow",
property: string,
};
export type NumberStyle = {
numberColor: string,
fontFamily: string,
rules: Array<NumberStyleRule>,
};
/**
* Do not grab directly!
*/
export const teamNumberStyles: { [teamId: string]: NumberStyle } = {
mercedes: {
numberColor: "#daffff",
fontFamily: theme.fonts.f1Italic,
rules: [
{ type: "shadow", property: repeater("0 0 0.15em #daffff", 4) },
{ type: "stroke", color: "#000", width: 0.10 },
{ type: "stroke", color: "#35dfae", width: 0.05 },
{ type: "shadow", property: repeater("0 0 0.07em #35dfae", 2) },
],
},
};
+31
View File
@@ -0,0 +1,31 @@
import { ReactNode } from "react";
import { WorkspaceId, WorkspaceProperties } from "../../types/state";
// Broadcast Graphics
import { ChyronDriverBasic } from "../../components/BroadcastGraphics/Chyrons/Driver";
type WorkspaceObject = {
[id: WorkspaceId]: WorkspaceProperties,
};
export const workspaces: WorkspaceObject = {
chyronDriverBasic: {
name: "Chyron Driver Basic",
overlayIds: [
"chyron-driver-basic-full.png",
"chyron-driver-basic-opening-1.png",
"chyron-driver-basic-opening-2.png",
],
previewWindowDimensions: {
width: 650,
height: 200,
},
},
};
export function fetchBroadcastGraphic(workspaceId: WorkspaceId): ReactNode {
switch(workspaceId) {
case "chyronDriverBasic": return ChyronDriverBasic();
default: return null;
}
}