diff --git a/src/components/BroadcastGraphics/TimingBoard/TimingTower/TimingTower.tsx b/src/components/BroadcastGraphics/TimingBoard/TimingTower/TimingTower.tsx index cab353d..10fa754 100644 --- a/src/components/BroadcastGraphics/TimingBoard/TimingTower/TimingTower.tsx +++ b/src/components/BroadcastGraphics/TimingBoard/TimingTower/TimingTower.tsx @@ -2,7 +2,7 @@ import { useSelector } from "react-redux"; import { broadcastGraphicsSelector } from "../../../../features/broadcast/graphics/broadcastGraphicsSelector"; import { eventSelector } from "../../../../features/event/eventSelector"; -import { BGTimingTowerModes, Car, CarStatus } from "../../../../types/state"; +import { BGTimingTowerModes, Car, CarNotice, CarStatus } from "../../../../types/state"; import { Fraction } from "../../../../types/style"; import { orMatch } from "../../../../utils/common"; import { timeDiff } from "../../../../utils/event"; @@ -12,6 +12,7 @@ import { TeamGem } from "../../Common/TeamGem"; import { DriverName, + FastestLapGem, RowContainer, RowLeftHalf, RowLeftHalfGemContainer, @@ -88,6 +89,9 @@ export function TimingTower({ retired={car.status === CarStatus.Retired} wide={timingBoard.timingTower.mode !== BGTimingTowerModes.Minimum} > + {car.notices.includes(CarNotice.FastestLap) && ( + + )} ` position: relative; width: ${({ wide }) => wide ? 255 : 147}px; - height: ${ROW_HEIGHT}px; // Future will be animated. + height: ${p => p.theme.design.timingTower.rowHeightPx}px; // Future will be animated. ${({ topGap }) => topGap && css`margin-top: 3px;`} ${({ bottomGap }) => bottomGap && css`margin-bottom: 3px;`} @@ -50,7 +48,7 @@ export const RowLeftHalf = styled(Rounded)` top: 0; width: 147px; // Future will be animated. - height: ${ROW_HEIGHT}px; + height: ${p => p.theme.design.timingTower.rowHeightPx}px; background-color: #000000e5 `; @@ -83,7 +81,7 @@ export const RowRightHalf = styled(Rounded)` top: 0; width: 108px; // Future will be animated. - height: ${ROW_HEIGHT}px; + height: ${p => p.theme.design.timingTower.rowHeightPx}px; overflow-x: hidden; @@ -127,3 +125,20 @@ export const TimeDiff = styled.span` transform: scale(${({ xScale, yScale }) => `${xScale}, ${yScale}`}); `; TimeDiff.displayName = "TimeDiff"; + +import fastestLapIcon from "../../../../public/images/icons/fastest-lap.svg"; +export const FastestLapGem = styled.div` + position: absolute; + + height: ${p => p.theme.design.timingTower.rowHeightPx}px; + width: ${p => p.theme.design.timingTower.rowHeightPx - 2}px; + + left: ${p => -p.theme.design.timingTower.rowHeightPx + 2}px; + top: 0; + + background-color: ${p => p.theme.colors.laps.purple}; + background-image: url(${fastestLapIcon}); + background-repeat: no-repeat; + background-size: 89%; + background-position: center 40%; +`; diff --git a/src/public/images/icons/fastest-lap.svg b/src/public/images/icons/fastest-lap.svg new file mode 100644 index 0000000..a47bcce --- /dev/null +++ b/src/public/images/icons/fastest-lap.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/shared/theme.ts b/src/shared/theme.ts index 2757431..6e18a0e 100644 --- a/src/shared/theme.ts +++ b/src/shared/theme.ts @@ -23,24 +23,50 @@ export const theme = { faintGrey: "#eee", darkGrey: "#303030", videoFrameBG: "#333", - teams: { + teams: { // 2021 Season alfaRomeo: "#900000", alphaTauri: "#2b4562", alpine: "#0090ff", astonMartin: "#006f62", ferrari: "#dc0000", - haas: "#fff", + haas: "#ffffff", mclaren: "#ff9800", mercedes: "#00d2be", redBull: "#0600ef", williams: "#005aff", }, + logos: { // Colors provided by https://www.f1.daavs.org/credits + f1Red: "#ff1801", + dhlYellow: "#ffcc00", + dhlRed: "#d40511", + rolexGreen: "#006039", + rolexGold: "#a37e2c", + emiratesRed: "#d71a21", + pirelliRed: "#d52b1e", + pirelliYellow: "#fed100", + }, + laps: { // Colors provided by https://www.f1.daavs.org/credits + purple: "#a700ff", + green: "#44d745", + yellow: "#f8d500", + red: "#be2c30", + }, + tyres: { // Colors provided by https://www.f1.daavs.org/credits + soft: "#e93324", + medium: "#f3fd54", + hard: "#ffffff", + wet: "#518ed4", + intermediate: "#6ebe4f", + }, }, fontSizes: { label: "0.9em", selector: "0.9em", }, design: { + timingTower: { + rowHeightPx: 36.5, + }, button: { borderRadius: "0.25rem", },