ISSUE-054 - Added fastest lap gem.
Made the timing tower row height into a centralized piece of data in the theme.ts file.
This commit is contained in:
1 parent
54878b8cb2
commit
35ac571d90
4 files changed
+54
-8
No files matched your search
@@ -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) && (
|
||||
<FastestLapGem />
|
||||
)}
|
||||
<RowLeftHalf
|
||||
roundedCornerBottom={
|
||||
lastRow && orMatch(
|
||||
|
||||
@@ -2,8 +2,6 @@ import styled, { css } from "styled-components";
|
||||
|
||||
import { Fraction, Px } from "../../../../types/style";
|
||||
|
||||
const ROW_HEIGHT = 36.5;
|
||||
|
||||
export const RowsContainer = styled.div`
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -25,7 +23,7 @@ type RowContainerProps = {
|
||||
export const RowContainer = styled.div<RowContainerProps>`
|
||||
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<TimeDiffProps>`
|
||||
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%;
|
||||
`;
|
||||
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 46 43" clip-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"><path fill="#fff" d="M23.022 5.476c-10.31 0-18.691 8.38-18.691 18.691 0 10.31 8.38 18.648 18.691 18.648 10.31 0 18.647-8.337 18.647-18.648 0-10.31-8.336-18.691-18.647-18.691zm0 4.684c7.718 0 13.963 6.29 13.963 14.007 0 7.718-6.245 13.964-13.963 13.964-7.717 0-13.963-6.246-13.963-13.964 0-7.717 6.246-14.007 13.963-14.007z"/><path fill="#fff" d="M19.599 24.145a3.401 3.401 0 014.105-3.328c.554.117 4.578-4.75 6.739-5.193.372-.076.597.037.832.27.197.198.357.394.325.687-.225 2.077-5.453 6.164-5.314 6.684A3.405 3.405 0 0123 27.546a3.401 3.401 0 01-3.401-3.4zM38.538 5.998l2.587 2.542a1.821 1.821 0 01-2.553 2.598l-2.586-2.542a1.821 1.821 0 112.553-2.598zM20.788.186c1.97 0 2.522.024 4.45.024 1.926 0 2.228.99 2.221 2.196-.007 1.206-.167 2.171-2.247 2.171s-2.374-.024-4.45-.024c-2.075 0-2.228-.99-2.221-2.196.007-1.206.276-2.171 2.247-2.171z"/></svg>
|
||||
|
After Width: | Height: | Size: 975 B |
+28
-2
@@ -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",
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user