17 files changed
+301
-79
No files matched your search
@@ -2,7 +2,7 @@ import { useSpring } from "@react-spring/web";
|
||||
import { useDispatch } from "react-redux";
|
||||
|
||||
import { BGChyronDriver, BGChyronSubMode, OpenState } from "../../../../types/state";
|
||||
import { Fraction } from "../../../../types/style";
|
||||
import { DebugDurationProps } from "../../../../types/style";
|
||||
import { clearChyrons } from "../../../../features/broadcast/graphics/broadcastGraphicsSlice";
|
||||
import { theme } from "../../../../shared/theme";
|
||||
import { outlineClipPath } from "../../../../utils/styling";
|
||||
@@ -30,11 +30,10 @@ import {
|
||||
import { VenetianBlindsTransition } from "../../Common/VenetianBlindsTransition";
|
||||
import { Spacer } from "../../Common/Spacer.styled";
|
||||
|
||||
type ChyronDriverProps = {
|
||||
type ChyronDriverProps = DebugDurationProps & {
|
||||
chyronData: BGChyronDriver,
|
||||
subMode: BGChyronSubMode,
|
||||
openState: OpenState,
|
||||
debugDurationMultiplier?: Fraction,
|
||||
};
|
||||
export function ChyronDriver({
|
||||
chyronData,
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
import { useSelector } from "react-redux";
|
||||
|
||||
import { broadcastGraphicsSelector } from "../../../../features/broadcast/graphics/broadcastGraphicsSelector";
|
||||
import { eventSelector } from "../../../../features/event/eventSelector";
|
||||
import { theme } from "../../../../shared/theme";
|
||||
import { BGStatusIndicatorModes } from "../../../../types/state";
|
||||
import { DebugDurationProps, TransitionArgs } from "../../../../types/style";
|
||||
import { orMatch } from "../../../../utils/common";
|
||||
|
||||
import { LapCount, LapLabel, LapLine, StatusIndicatorBase, StatusIndicatorLayout } from "./styles";
|
||||
|
||||
type StatusIndicatorProps = DebugDurationProps;
|
||||
|
||||
|
||||
|
||||
export function StatusIndicator({
|
||||
debugDurationMultiplier: DDM = 1.0,
|
||||
}: StatusIndicatorProps) {
|
||||
const { design: { timingTower: ttTheme } } = theme;
|
||||
|
||||
const { timingBoard: { statusIndicator: { mode } } } =
|
||||
useSelector(broadcastGraphicsSelector);
|
||||
const { progress: { scheduledLaps, lapCount } } = useSelector(eventSelector);
|
||||
|
||||
const toWideTransition: TransitionArgs[] = [{
|
||||
property: "all",
|
||||
duration: ttTheme.fullWidthDurationMs * DDM,
|
||||
}];
|
||||
const toNarrowTransition: TransitionArgs[] = [{
|
||||
property: "all",
|
||||
duration: ttTheme.fullWidthDurationMs * DDM,
|
||||
delay: ttTheme.fullWidthCloseDelayMs * DDM,
|
||||
}];
|
||||
|
||||
return (
|
||||
<StatusIndicatorBase
|
||||
open={mode !== BGStatusIndicatorModes.LapNarrow}
|
||||
transitionOpeningProps={toWideTransition}
|
||||
transitionClosingProps={toNarrowTransition}
|
||||
>
|
||||
<StatusIndicatorLayout>
|
||||
{orMatch(mode, BGStatusIndicatorModes.LapNarrow, BGStatusIndicatorModes.LapWide) && (
|
||||
<>
|
||||
<LapLine
|
||||
mode={BGStatusIndicatorModes.LapNarrow}
|
||||
open={mode === BGStatusIndicatorModes.LapNarrow}
|
||||
transitionOpeningProps={toNarrowTransition}
|
||||
transitionClosingProps={toWideTransition}
|
||||
/>
|
||||
<LapLine
|
||||
mode={BGStatusIndicatorModes.LapWide}
|
||||
open={mode === BGStatusIndicatorModes.LapWide}
|
||||
transitionOpeningProps={toWideTransition}
|
||||
transitionClosingProps={toNarrowTransition}
|
||||
/>
|
||||
<LapLabel
|
||||
mode={mode}
|
||||
open={mode === BGStatusIndicatorModes.LapWide}
|
||||
transitionOpeningProps={toWideTransition}
|
||||
transitionClosingProps={toNarrowTransition}
|
||||
>LAP</LapLabel>
|
||||
<LapCount
|
||||
mode={mode}
|
||||
open={mode === BGStatusIndicatorModes.LapWide}
|
||||
transitionOpeningProps={toWideTransition}
|
||||
transitionClosingProps={toNarrowTransition}
|
||||
>
|
||||
<span>{lapCount} / {scheduledLaps}</span>
|
||||
</LapCount>
|
||||
</>
|
||||
)}
|
||||
</StatusIndicatorLayout>
|
||||
</StatusIndicatorBase>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export * from "./StatusIndicator";
|
||||
@@ -0,0 +1,120 @@
|
||||
import styled from "styled-components";
|
||||
import { BGStatusIndicatorModes } from "../../../../types/state";
|
||||
|
||||
import { DirectionalTransitionProps } from "../../../../types/style";
|
||||
import { commonDirectionalTransition } from "../../../../utils/styling";
|
||||
|
||||
export const StatusIndicatorBase = styled.div<DirectionalTransitionProps>`
|
||||
background-color: black;
|
||||
border-top-right-radius: ${p => p.theme.design.statusIndicator.roundedCornerRadiusPx}px;
|
||||
height: ${p => p.theme.design.statusIndicator.heightNormalPx}px;
|
||||
width: ${({ theme: { design: { timingTower: ttTheme } }, open }) => open
|
||||
? ttTheme.rowLeftHalfWidthPx + ttTheme.rowRightHalfWidthPx
|
||||
: ttTheme.rowLeftHalfWidthPx}px;
|
||||
|
||||
${({ open, transitionOpeningProps, transitionClosingProps, transitionProps }) =>
|
||||
commonDirectionalTransition(open, transitionOpeningProps, transitionClosingProps, transitionProps)}
|
||||
`;
|
||||
StatusIndicatorBase.displayName = "StatusIndicatorBase";
|
||||
|
||||
|
||||
export const StatusIndicatorLayout = styled.div`
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
`;
|
||||
StatusIndicatorLayout.displayName = "StatusIndicatorLayout";
|
||||
|
||||
type IndicatorModeProps = {
|
||||
mode: BGStatusIndicatorModes,
|
||||
};
|
||||
|
||||
|
||||
////// Lap Indicator Mode Styles //////
|
||||
type LapLineProps = DirectionalTransitionProps & IndicatorModeProps;
|
||||
export const LapLine = styled.div<LapLineProps>`
|
||||
position: absolute;
|
||||
top: ${({ mode }) =>
|
||||
mode === BGStatusIndicatorModes.LapNarrow
|
||||
? 33 : mode === BGStatusIndicatorModes.LapWide ? 5 : 0}px;
|
||||
left: ${({ mode }) =>
|
||||
mode === BGStatusIndicatorModes.LapNarrow
|
||||
? 30 : mode === BGStatusIndicatorModes.LapWide ? 128 : 0}px;
|
||||
|
||||
opacity: ${({ open }) => open ? 1 : 0};
|
||||
|
||||
width: ${({ mode, open }) =>
|
||||
mode === BGStatusIndicatorModes.LapNarrow
|
||||
? (90 * (open ? 1 : 0.3)) : mode === BGStatusIndicatorModes.LapWide ? 3 : 0}px;
|
||||
height: ${({ mode, open }) =>
|
||||
mode === BGStatusIndicatorModes.LapNarrow
|
||||
? 3 : mode === BGStatusIndicatorModes.LapWide ? (60 * (open ? 1 : 0.3)) : 0}px;
|
||||
|
||||
background-color: ${p => p.theme.colors.textWhite};
|
||||
border: 1px solid ${p => p.theme.colors.dimGrey};
|
||||
mask-image: linear-gradient(
|
||||
to ${({ mode }) => mode === BGStatusIndicatorModes.LapNarrow ? "left" : "bottom"},
|
||||
transparent 0,
|
||||
#000000cc 40%,
|
||||
#000000cc 50%,
|
||||
#000000cc 60%,
|
||||
transparent 100%
|
||||
);
|
||||
|
||||
${({ open, transitionOpeningProps, transitionClosingProps, transitionProps }) =>
|
||||
commonDirectionalTransition(open, transitionOpeningProps, transitionClosingProps, transitionProps)}
|
||||
`;
|
||||
LapLine.displayName = "LapLine";
|
||||
|
||||
|
||||
type LapLabelProps = DirectionalTransitionProps & IndicatorModeProps;
|
||||
export const LapLabel = styled.span<LapLabelProps>`
|
||||
position: absolute;
|
||||
top: ${({ mode }) =>
|
||||
mode === BGStatusIndicatorModes.LapNarrow
|
||||
? 6 : mode === BGStatusIndicatorModes.LapWide ? 22 : 0}px;
|
||||
left: ${({ mode }) =>
|
||||
mode === BGStatusIndicatorModes.LapNarrow
|
||||
? 33 : mode === BGStatusIndicatorModes.LapWide ? 25 : 0}px;
|
||||
|
||||
font-family: ${p => p.theme.fonts.f1Wide};
|
||||
font-size: ${p => p.theme.fontSizes.indicatorLapLabel};
|
||||
color: ${p => p.theme.colors.textWhite};
|
||||
|
||||
${({ open, transitionOpeningProps, transitionClosingProps, transitionProps }) =>
|
||||
commonDirectionalTransition(open, transitionOpeningProps, transitionClosingProps, transitionProps)}
|
||||
`;
|
||||
LapLabel.displayName = "LapLabel";
|
||||
|
||||
|
||||
type LapCountProps = DirectionalTransitionProps & IndicatorModeProps;
|
||||
export const LapCount = styled.div<LapCountProps>`
|
||||
position: absolute;
|
||||
top: ${({ mode }) =>
|
||||
mode === BGStatusIndicatorModes.LapNarrow
|
||||
? 41 : mode === BGStatusIndicatorModes.LapWide ? 24 : 0}px;
|
||||
left: ${({ mode }) =>
|
||||
mode === BGStatusIndicatorModes.LapNarrow
|
||||
? 72 : mode === BGStatusIndicatorModes.LapWide ? 185 : 0}px;
|
||||
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
width: 0;
|
||||
height: ${p => p.theme.fontSizes.indicatorLapCount};
|
||||
overflow-y: clip;
|
||||
|
||||
> span {
|
||||
font-family: ${p => p.theme.fonts.f1Regular};
|
||||
font-size: ${p => p.theme.fontSizes.indicatorLapCount};
|
||||
color: ${p => p.theme.colors.textWhite};
|
||||
|
||||
font-feature-settings: 'tnum' 1;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
${({ open, transitionOpeningProps, transitionClosingProps, transitionProps }) =>
|
||||
commonDirectionalTransition(open, transitionOpeningProps, transitionClosingProps, transitionProps)}
|
||||
`;
|
||||
LapCount.displayName = "LapCount";
|
||||
@@ -1,23 +1,23 @@
|
||||
import { useSelector } from "react-redux";
|
||||
|
||||
import { workspaceSelector } from "../../../features/workspace/workspaceSelector";
|
||||
import { theme } from "../../../shared/theme";
|
||||
|
||||
import { TimingBoardLayout } from "./styles";
|
||||
import { MockupBlock } from "../../Common/MockupBlock.styled";
|
||||
import { TimingTower } from "./TimingTower";
|
||||
import { StatusIndicator } from "./StatusIndicator";
|
||||
|
||||
export function TimingBoard() {
|
||||
type TimingBoardProps = {
|
||||
debug?: boolean,
|
||||
};
|
||||
export function TimingBoard({ debug = false }: TimingBoardProps) {
|
||||
const { debugDurationMultiplier } = useSelector(workspaceSelector);
|
||||
return (
|
||||
<TimingBoardLayout>
|
||||
<MockupBlock
|
||||
height="73px"
|
||||
width={`${theme.design.timingTower.rowLeftHalfWidthPx}px`}
|
||||
color="black"
|
||||
<StatusIndicator
|
||||
debugDurationMultiplier={debug ? debugDurationMultiplier : 1}
|
||||
/>
|
||||
<TimingTower
|
||||
debugDurationMultiplier={debugDurationMultiplier}
|
||||
debugDurationMultiplier={debug ? debugDurationMultiplier : 1}
|
||||
/>
|
||||
</TimingBoardLayout>
|
||||
);
|
||||
|
||||
@@ -4,14 +4,12 @@ import { useSelector } from "react-redux";
|
||||
import { broadcastGraphicsSelector } from "../../../../features/broadcast/graphics/broadcastGraphicsSelector";
|
||||
import { eventSelector } from "../../../../features/event/eventSelector";
|
||||
import { BGTimingTowerDisplayMode, CarStatus } from "../../../../types/state";
|
||||
import { Fraction } from "../../../../types/style";
|
||||
import { DebugDurationProps } from "../../../../types/style";
|
||||
|
||||
import { RowsContainer } from "./styles";
|
||||
import { TimingTowerRow } from "./TimingTowerRow";
|
||||
|
||||
type TimingTowerProps = {
|
||||
debugDurationMultiplier?: Fraction,
|
||||
};
|
||||
type TimingTowerProps = DebugDurationProps;
|
||||
|
||||
export function TimingTower({ debugDurationMultiplier: DDM }: TimingTowerProps) {
|
||||
const { lastUpdate, grid, trackLength } = useSelector(eventSelector);
|
||||
|
||||
@@ -7,8 +7,8 @@ import { orMatch } from "../../../../utils/common";
|
||||
import { getCarAtPos, timeDiff } from "../../../../utils/event";
|
||||
import { formatTime, outlineClipPath } from "../../../../utils/styling";
|
||||
|
||||
import { Fraction } from "../../../../types/style";
|
||||
import { Meters, Milliseconds } from "../../../../types/util";
|
||||
import { DebugDurationProps, Fraction } from "../../../../types/style";
|
||||
import { Meters } from "../../../../types/util";
|
||||
import {
|
||||
BGTimingTowerDisplayMode,
|
||||
BGTimingTowerSplitsMode,
|
||||
@@ -39,13 +39,7 @@ import {
|
||||
} from "./styles";
|
||||
import useMeasure from "react-use-measure";
|
||||
|
||||
const WIPE_DELAY: Milliseconds = 3500;
|
||||
const WIPE_DURATION: Milliseconds = 400;
|
||||
const TRAVEL_DURATION: Milliseconds = 750;
|
||||
const FULL_WIDTH_DURATION: Milliseconds = 750;
|
||||
const FULL_WIDTH_CLOSE_DELAY: Milliseconds = 333;
|
||||
|
||||
interface TimingTowerRowProps {
|
||||
type TimingTowerRowProps = DebugDurationProps & {
|
||||
car: Car;
|
||||
grid: Grid;
|
||||
startingCarsCount: number;
|
||||
@@ -53,7 +47,6 @@ interface TimingTowerRowProps {
|
||||
splitsMode: BGTimingTowerSplitsMode;
|
||||
displayMode: BGTimingTowerDisplayMode;
|
||||
trackLength: Meters;
|
||||
debugDurationMultiplier?: Fraction,
|
||||
}
|
||||
export function TimingTowerRow({
|
||||
car,
|
||||
@@ -65,6 +58,8 @@ export function TimingTowerRow({
|
||||
trackLength,
|
||||
debugDurationMultiplier: DDM = 1.0,
|
||||
}: TimingTowerRowProps) {
|
||||
const { design: { timingTower: ttTheme } } = theme;
|
||||
|
||||
const [pastPos, setPastPos] = useState(car.position);
|
||||
const [posChange, setPosChange] = useState(0);
|
||||
const [pastDisplayMode, setPastDisplayMode] = useState(displayMode);
|
||||
@@ -75,8 +70,10 @@ export function TimingTowerRow({
|
||||
const [showPosChange, setShowPosChange] = useState(false);
|
||||
const [showOutline, setShowOutline] = useState(false);
|
||||
const [wipeVisible, setWipeVisible] = useState(false);
|
||||
useTimeoutWhen(() => setShowPosChange(false), (WIPE_DELAY + WIPE_DURATION) * DDM, showPosChange);
|
||||
useTimeoutWhen(() => setShowOutline(false), TRAVEL_DURATION * DDM, showOutline);
|
||||
useTimeoutWhen(() => setShowPosChange(false), (
|
||||
ttTheme.wipeDelayMs + ttTheme.wipeDurationMs
|
||||
) * DDM, showPosChange);
|
||||
useTimeoutWhen(() => setShowOutline(false), ttTheme.rowTravelDurationMs * DDM, showOutline);
|
||||
useTimeoutWhen(() => setWipeVisible(false), 1, wipeVisible);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -149,80 +146,74 @@ export function TimingTowerRow({
|
||||
yScale = rightHalfContent.includes("+") ? 1.1 : 1.0;
|
||||
}
|
||||
|
||||
const { design: { timingTower: timingTowerTheme } } = theme;
|
||||
|
||||
return (
|
||||
<AnimatedRowContainer
|
||||
key={car.driver.id}
|
||||
retired={car.status === CarStatus.Retired}
|
||||
wide={displayMode !== BGTimingTowerDisplayMode.LeftOnly}
|
||||
top={(car.position - 1) * timingTowerTheme.rowHeightPx}
|
||||
transitionTime={TRAVEL_DURATION * DDM}
|
||||
top={(car.position - 1) * ttTheme.rowHeightPx}
|
||||
transitionTime={ttTheme.rowTravelDurationMs * DDM}
|
||||
>
|
||||
{car.notices.includes(CarNotice.FastestLap) && (
|
||||
<FastestLapGem />
|
||||
)}
|
||||
<RowLeftHalf
|
||||
roundedCornerTop={
|
||||
(displayMode === BGTimingTowerDisplayMode.FullLeft &&
|
||||
car.position === 1) ? 5 : 0
|
||||
}
|
||||
roundedCornerBottom={
|
||||
bottomRounded && orMatch(
|
||||
displayMode,
|
||||
BGTimingTowerDisplayMode.LeftOnly,
|
||||
BGTimingTowerDisplayMode.FullLeft,
|
||||
) ? 5 : 0
|
||||
) ? ttTheme.rowRoundedCornerRadiusPx : 0
|
||||
}
|
||||
open={displayMode === BGTimingTowerDisplayMode.FullLeft}
|
||||
transitionOpeningProps={[{
|
||||
property: "width",
|
||||
duration: FULL_WIDTH_DURATION * DDM,
|
||||
duration: ttTheme.fullWidthDurationMs * DDM,
|
||||
}, {
|
||||
property: "border-top-right-radius",
|
||||
duration: TRAVEL_DURATION * DDM,
|
||||
duration: ttTheme.rowTravelDurationMs * DDM,
|
||||
}, {
|
||||
property: "border-bottom-right-radius",
|
||||
duration: TRAVEL_DURATION * DDM,
|
||||
duration: ttTheme.rowTravelDurationMs * DDM,
|
||||
}]}
|
||||
transitionClosingProps={[{
|
||||
property: "width",
|
||||
duration: FULL_WIDTH_DURATION * DDM,
|
||||
delay: FULL_WIDTH_CLOSE_DELAY * DDM,
|
||||
duration: ttTheme.fullWidthDurationMs * DDM,
|
||||
delay: ttTheme.fullWidthCloseDelayMs * DDM,
|
||||
}, {
|
||||
property: "border-top-right-radius",
|
||||
duration: TRAVEL_DURATION * DDM,
|
||||
delay: FULL_WIDTH_CLOSE_DELAY * DDM,
|
||||
duration: ttTheme.rowTravelDurationMs * DDM,
|
||||
delay: ttTheme.fullWidthCloseDelayMs * DDM,
|
||||
}, {
|
||||
property: "border-bottom-right-radius",
|
||||
duration: TRAVEL_DURATION * DDM,
|
||||
delay: FULL_WIDTH_CLOSE_DELAY * DDM,
|
||||
duration: ttTheme.rowTravelDurationMs * DDM,
|
||||
delay: ttTheme.fullWidthCloseDelayMs * DDM,
|
||||
}]}
|
||||
ref={leftHalfRef}
|
||||
>
|
||||
<RowLeftHalfLayout>
|
||||
{car.status !== CarStatus.Retired && (
|
||||
<RowLeftHalfPosFlagContainer size={timingTowerTheme.posFlagSize}>
|
||||
<RowLeftHalfPosFlagContainer size={ttTheme.posFlagSizePx}>
|
||||
<PositionFlag
|
||||
size={timingTowerTheme.posFlagSize}
|
||||
size={ttTheme.posFlagSizePx}
|
||||
number={car.position}
|
||||
numberSizeFraction={.6}
|
||||
/>
|
||||
<RowLeftHalfPosFlagChangeContainer
|
||||
size={timingTowerTheme.posFlagSize}
|
||||
size={ttTheme.posFlagSizePx}
|
||||
visible={showPosChange}
|
||||
transitionTime={167 * DDM}
|
||||
>
|
||||
{showPosChange && (
|
||||
<WipeTransition
|
||||
visible={wipeVisible}
|
||||
delay={WIPE_DELAY * DDM}
|
||||
delay={ttTheme.wipeDelayMs * DDM}
|
||||
angle={45}
|
||||
duration={WIPE_DURATION * DDM}
|
||||
duration={ttTheme.wipeDurationMs * DDM}
|
||||
startingCorner="topLeft"
|
||||
>
|
||||
<PositionFlag
|
||||
size={timingTowerTheme.posFlagSize}
|
||||
size={ttTheme.posFlagSizePx}
|
||||
number={car.position}
|
||||
numberSizeFraction={.6}
|
||||
color={posChange > 0
|
||||
@@ -241,7 +232,7 @@ export function TimingTowerRow({
|
||||
transitionOpeningProps={[{
|
||||
property: "opacity",
|
||||
duration: 333 * DDM,
|
||||
delay: (FULL_WIDTH_DURATION - 333) * DDM,
|
||||
delay: (ttTheme.fullWidthDurationMs - 333) * DDM,
|
||||
}]}
|
||||
transitionClosingProps={[{
|
||||
property: "opacity",
|
||||
@@ -255,7 +246,7 @@ export function TimingTowerRow({
|
||||
open={displayMode === BGTimingTowerDisplayMode.FullLeft}
|
||||
transitionOpeningProps={[{
|
||||
property: "width",
|
||||
duration: FULL_WIDTH_DURATION * 2 * DDM,
|
||||
duration: ttTheme.fullWidthDurationMs * 2 * DDM,
|
||||
delay: 0 * DDM,
|
||||
}, {
|
||||
property: "opacity",
|
||||
@@ -264,12 +255,12 @@ export function TimingTowerRow({
|
||||
}]}
|
||||
transitionClosingProps={[{
|
||||
property: "width",
|
||||
duration: FULL_WIDTH_DURATION * DDM,
|
||||
duration: ttTheme.fullWidthDurationMs * DDM,
|
||||
delay: 0 * DDM,
|
||||
}, {
|
||||
property: "opacity",
|
||||
duration: 333 * DDM,
|
||||
delay: (FULL_WIDTH_DURATION - 333) * DDM,
|
||||
delay: (ttTheme.fullWidthDurationMs - 333) * DDM,
|
||||
}]}
|
||||
>
|
||||
<DriverName open>
|
||||
@@ -279,7 +270,7 @@ export function TimingTowerRow({
|
||||
</DriverNameContainer>
|
||||
</RowLeftHalfLayout>
|
||||
<RowLeftHalfGemContainer>
|
||||
<TeamGem team={car.driver.team.id} height={timingTowerTheme.teamGemSize} />
|
||||
<TeamGem team={car.driver.team.id} height={ttTheme.teamGemSizePx} />
|
||||
</RowLeftHalfGemContainer>
|
||||
|
||||
<AnimatedRowLeftHalfOutline
|
||||
@@ -312,30 +303,31 @@ export function TimingTowerRow({
|
||||
</RowLeftHalf>
|
||||
|
||||
<RowRightHalf
|
||||
roundedCornerTop={car.position === 1 ? 5 : 0}
|
||||
roundedCornerTop={car.position === 1
|
||||
? ttTheme.rowRoundedCornerRadiusPx : 0}
|
||||
roundedCornerBottom={
|
||||
bottomRounded && orMatch(
|
||||
splitsMode,
|
||||
BGTimingTowerSplitsMode.Leader,
|
||||
BGTimingTowerSplitsMode.Interval,
|
||||
) ? 5 : 0
|
||||
) ? ttTheme.rowRoundedCornerRadiusPx : 0
|
||||
}
|
||||
open={displayMode === BGTimingTowerDisplayMode.LeftAndRight}
|
||||
transitionProps={[{
|
||||
property: "border-top-right-radius",
|
||||
duration: TRAVEL_DURATION * DDM,
|
||||
duration: ttTheme.rowTravelDurationMs * DDM,
|
||||
}, {
|
||||
property: "border-bottom-right-radius",
|
||||
duration: TRAVEL_DURATION * DDM,
|
||||
duration: ttTheme.rowTravelDurationMs * DDM,
|
||||
}]}
|
||||
transitionClosingProps={[{
|
||||
property: "width",
|
||||
duration: FULL_WIDTH_DURATION * DDM,
|
||||
duration: ttTheme.fullWidthDurationMs * DDM,
|
||||
}]}
|
||||
transitionOpeningProps={[{
|
||||
property: "width",
|
||||
duration: FULL_WIDTH_DURATION * DDM,
|
||||
delay: FULL_WIDTH_CLOSE_DELAY * DDM,
|
||||
duration: ttTheme.fullWidthDurationMs * DDM,
|
||||
delay: ttTheme.fullWidthCloseDelayMs * DDM,
|
||||
}]}
|
||||
hugRight={hugRight}
|
||||
>
|
||||
@@ -346,12 +338,12 @@ export function TimingTowerRow({
|
||||
open={displayMode === BGTimingTowerDisplayMode.LeftAndRight}
|
||||
transitionOpeningProps={[{
|
||||
property: "opacity",
|
||||
duration: FULL_WIDTH_DURATION * DDM,
|
||||
delay: FULL_WIDTH_CLOSE_DELAY * DDM,
|
||||
duration: ttTheme.fullWidthDurationMs * DDM,
|
||||
delay: ttTheme.fullWidthCloseDelayMs * DDM,
|
||||
}]}
|
||||
transitionClosingProps={[{
|
||||
property: "opacity",
|
||||
duration: FULL_WIDTH_DURATION * DDM,
|
||||
duration: ttTheme.fullWidthDurationMs * DDM,
|
||||
}]}
|
||||
>
|
||||
{rightHalfContent}
|
||||
|
||||
@@ -197,7 +197,7 @@ RowRightHalfLayout.displayName = "RowRightHalfLayout";
|
||||
|
||||
export const DriverNameContainer = styled.div`
|
||||
position: relative;
|
||||
margin-left: ${p => p.theme.design.timingTower.nameLeftMargin}px;
|
||||
margin-left: ${p => p.theme.design.timingTower.nameLeftMarginPx}px;
|
||||
`;
|
||||
DriverNameContainer.displayName = "DriverNameContainer";
|
||||
|
||||
@@ -206,7 +206,7 @@ export const DriverName = styled.span<DirectionalTransitionProps>`
|
||||
top: 0;
|
||||
left: 0;
|
||||
|
||||
color: white;
|
||||
color: ${p => p.theme.colors.textWhite};
|
||||
font-family: ${p => p.theme.fonts.f1Bold};
|
||||
font-size: 20px;
|
||||
text-transform: uppercase;
|
||||
@@ -218,8 +218,6 @@ export const DriverName = styled.span<DirectionalTransitionProps>`
|
||||
DriverName.displayName = "DriverName";
|
||||
|
||||
export const DriverNameWipe = styled.div<DirectionalTransitionProps>`
|
||||
/* background: #deadbe; */
|
||||
|
||||
width: ${({ open }) => open ? 800 : 200}px;
|
||||
height: ${p => p.theme.design.timingTower.rowHeightPx}px;
|
||||
|
||||
@@ -237,7 +235,7 @@ type TimeDiffProps = DirectionalTransitionProps & {
|
||||
yScale: Fraction,
|
||||
};
|
||||
export const TimeDiff = styled.span<TimeDiffProps>`
|
||||
color: white;
|
||||
color: ${p => p.theme.colors.textWhite};
|
||||
font-family: ${p => p.theme.fonts.f1Regular};
|
||||
font-size: 20px;
|
||||
|
||||
|
||||
+13
@@ -55,6 +55,19 @@ export function TimingTowerPrototypeControls() {
|
||||
>
|
||||
+100m performance to all
|
||||
</ClickSpan>
|
||||
<ClickSpan
|
||||
onClick={() => {
|
||||
dispatch(increaseDistance({
|
||||
cars: grid,
|
||||
distance: 1000,
|
||||
randomness: 0.05,
|
||||
usePerformance: true,
|
||||
}));
|
||||
dispatch(refreshRunningOrder());
|
||||
}}
|
||||
>
|
||||
+1000m performance to all
|
||||
</ClickSpan>
|
||||
<ClickSpan
|
||||
onClick={() => {
|
||||
dispatch(setCarStatus({
|
||||
|
||||
@@ -94,7 +94,7 @@ export default function Workspaces() {
|
||||
<Route path="timingBoard" element={
|
||||
<Workspace
|
||||
workspaceId="timingBoard"
|
||||
previewContent={<TimingBoard />}
|
||||
previewContent={<TimingBoard debug />}
|
||||
prototypeControls={<TimingTowerPrototypeControls />}
|
||||
bleedover={500}
|
||||
showAnimationSpeedSelector
|
||||
|
||||
@@ -91,6 +91,7 @@ export const workspaces: WorkspaceObject = {
|
||||
"timing-board-leader-20-out-1.png",
|
||||
"timing-board-intervals-yellow-flag.png",
|
||||
"timing-board-portrait-gap.png",
|
||||
"timing-board-fastest-lap-wide.png",
|
||||
],
|
||||
previewWindowDimensions: {
|
||||
width: 700,
|
||||
|
||||
@@ -60,6 +60,11 @@ export const broadcastGraphicsSlice = createSlice({
|
||||
state.timingBoard.timingTower.splitsMode = action.payload;
|
||||
},
|
||||
setTimingTowerDisplayMode: (state, action: PayloadAction<BGTimingTowerDisplayMode>) => {
|
||||
if (action.payload === BGTimingTowerDisplayMode.FullLeft) {
|
||||
state.timingBoard.statusIndicator.mode = BGStatusIndicatorModes.LapWide;
|
||||
} else {
|
||||
state.timingBoard.statusIndicator.mode = BGStatusIndicatorModes.LapNarrow;
|
||||
}
|
||||
state.timingBoard.timingTower.displayMode = action.payload;
|
||||
},
|
||||
},
|
||||
|
||||
@@ -26,7 +26,7 @@ const DEFAULT_TYRE: Tyre = {
|
||||
};
|
||||
|
||||
const GRID_POSITION_GAP: Meters = 8;
|
||||
const POLE_TO_START: Meters = 10;
|
||||
const POLE_TO_START: Meters = -10;
|
||||
|
||||
const initialState: RootState["event"] = {
|
||||
trackName: "Circuit de Spa-Franchorchamps",
|
||||
@@ -41,8 +41,8 @@ const initialState: RootState["event"] = {
|
||||
progress: {
|
||||
startTime: Date.now(),
|
||||
timeLimit: 60 * 60 * 2 * 1000,
|
||||
currentLap: 1,
|
||||
lapCount: 10,
|
||||
lapCount: 1,
|
||||
scheduledLaps: 44,
|
||||
},
|
||||
leaderGridSpot: 0,
|
||||
grid: [
|
||||
@@ -255,6 +255,9 @@ export const eventSlice = createSlice({
|
||||
state.grid[entry.gridSpot].position = sortedPosition + 1;
|
||||
});
|
||||
state.leaderGridSpot = sortingGrid[0].gridSpot;
|
||||
state.progress.lapCount =
|
||||
Math.max(1, Math.floor(sortingGrid[0].distance / state.trackLength) + 1);
|
||||
|
||||
state.lastUpdate = Date.now();
|
||||
},
|
||||
increaseDistance: (state, action: PayloadAction<IncreaseDistanceAction>) => {
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 125 KiB |
+17
-3
@@ -24,8 +24,10 @@ export const theme = {
|
||||
lightGrey: "#ddd",
|
||||
faintGrey: "#eee",
|
||||
darkGrey: "#303030",
|
||||
dimGrey: "#999",
|
||||
videoFrameBG: "#333",
|
||||
positionFlagBG: "#f4f3ee",
|
||||
textWhite: "#f1f1f1", // I found it to be #f2f2f2 but whatever
|
||||
teams: { // 2021 Season
|
||||
alfaRomeo: "#900000",
|
||||
alphaTauri: "#2b4562",
|
||||
@@ -65,16 +67,28 @@ export const theme = {
|
||||
fontSizes: {
|
||||
label: "0.9em",
|
||||
selector: "0.9em",
|
||||
indicatorLapLabel: "1.2em",
|
||||
indicatorLapCount: "1.5em",
|
||||
},
|
||||
design: {
|
||||
statusIndicator: {
|
||||
heightNormalPx: 73,
|
||||
roundedCornerRadiusPx: 8,
|
||||
},
|
||||
timingTower: {
|
||||
rowHeightPx: 36.5,
|
||||
rowLeftHalfWidthPx: 147,
|
||||
rowRightHalfWidthPx: 108,
|
||||
retiredTopGapPx: 3,
|
||||
teamGemSize: 30,
|
||||
posFlagSize: 32,
|
||||
nameLeftMargin: 14,
|
||||
teamGemSizePx: 30,
|
||||
posFlagSizePx: 32,
|
||||
nameLeftMarginPx: 14,
|
||||
rowRoundedCornerRadiusPx: 5,
|
||||
wipeDelayMs: 3500,
|
||||
wipeDurationMs: 400,
|
||||
rowTravelDurationMs: 750,
|
||||
fullWidthDurationMs: 750,
|
||||
fullWidthCloseDelayMs: 333,
|
||||
},
|
||||
button: {
|
||||
borderRadius: "0.25rem",
|
||||
|
||||
+1
-1
@@ -82,8 +82,8 @@ export interface Event {
|
||||
export interface EventProgress {
|
||||
startTime: Milliseconds;
|
||||
timeLimit: Milliseconds;
|
||||
currentLap: number;
|
||||
lapCount: number;
|
||||
scheduledLaps: number;
|
||||
}
|
||||
export enum EventMode {
|
||||
Race,
|
||||
|
||||
Vendored
+3
@@ -41,6 +41,9 @@ export interface TransitionArgs {
|
||||
delay?: Milliseconds,
|
||||
}
|
||||
|
||||
export type DebugDurationProps = {
|
||||
debugDurationMultiplier?: Fraction,
|
||||
};
|
||||
export type OpenProps = {
|
||||
open: boolean,
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user