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