diff --git a/apps/client/src/common/components/fit-text/FitText.tsx b/apps/client/src/common/components/fit-text/FitText.tsx index 3d5aa8d8d..a72189fd8 100644 --- a/apps/client/src/common/components/fit-text/FitText.tsx +++ b/apps/client/src/common/components/fit-text/FitText.tsx @@ -13,8 +13,13 @@ interface FitTextProps extends HTMLAttributes { max?: number; // inclusive } -export function FitText(props: PropsWithChildren) { - const { children, mode = 'multi', min = 16, max = 256, ...elementProps } = props; +export function FitText({ + children, + mode = 'multi', + min = 16, + max = 256, + ...elementProps +}: PropsWithChildren) { const ref = useRef(null); const isOverflown = useCallback(() => { diff --git a/apps/client/src/common/components/navigation-menu/navigation-menu-item/NavigationMenuItem.module.scss b/apps/client/src/common/components/navigation-menu/navigation-menu-item/NavigationMenuItem.module.scss index cf2d2de5d..f7c0a34a0 100644 --- a/apps/client/src/common/components/navigation-menu/navigation-menu-item/NavigationMenuItem.module.scss +++ b/apps/client/src/common/components/navigation-menu/navigation-menu-item/NavigationMenuItem.module.scss @@ -25,9 +25,8 @@ } &:focus { - outline: none; - background-color: $gray-1300; - border: 2px solid $ui-white; + outline: 2px solid $blue-500; + background-color: $gray-1350; } &.current { diff --git a/apps/client/src/common/components/popover/Popover.tsx b/apps/client/src/common/components/popover/Popover.tsx index 907c4a00d..5e4c02939 100644 --- a/apps/client/src/common/components/popover/Popover.tsx +++ b/apps/client/src/common/components/popover/Popover.tsx @@ -18,7 +18,9 @@ export default function PopoverContents({ {title && {title}} - {children} + }> + {children} + diff --git a/apps/client/src/common/components/view-params-editor/InlineColourPicker.module.scss b/apps/client/src/common/components/view-params-editor/InlineColourPicker.module.scss index 51bba65ee..32ebd4bb7 100644 --- a/apps/client/src/common/components/view-params-editor/InlineColourPicker.module.scss +++ b/apps/client/src/common/components/view-params-editor/InlineColourPicker.module.scss @@ -1,7 +1,7 @@ .inline { display: flex; align-items: center; - gap: 1rem; + gap: 0.5rem; } // attempt to match with ontimeTextInputs diff --git a/apps/client/src/common/components/view-params-editor/ParamInput.tsx b/apps/client/src/common/components/view-params-editor/ParamInput.tsx index 5fc763d72..0a816abb0 100644 --- a/apps/client/src/common/components/view-params-editor/ParamInput.tsx +++ b/apps/client/src/common/components/view-params-editor/ParamInput.tsx @@ -43,8 +43,7 @@ export default function ParamInput({ paramField }: ParamInputProps) { } if (type === 'boolean') { - const defaultCheckedValue = isStringBoolean(searchParams.get(id)) || defaultValue; - return ; + return ; } if (type === 'number') { @@ -123,3 +122,12 @@ function MultiOption({ paramField }: EditFormMultiOptionProps) { ); } + +interface ControlledSwitchProps { + id: string; + initialValue: boolean; +} +function ControlledSwitch({ id, initialValue }: ControlledSwitchProps) { + const [checked, setChecked] = useState(initialValue); + return ; +} diff --git a/apps/client/src/features/operator/Operator.tsx b/apps/client/src/features/operator/Operator.tsx index dba6362b0..3c9ffc7c5 100644 --- a/apps/client/src/features/operator/Operator.tsx +++ b/apps/client/src/features/operator/Operator.tsx @@ -115,7 +115,7 @@ export default function Operator() { const { process } = makeOperatorMetadata(selectedEventId); return ( -
+
{editEvent && setEditEvent(null)} />} diff --git a/apps/client/src/views/backstage/Backstage.tsx b/apps/client/src/views/backstage/Backstage.tsx index d618722ca..f1f7c2df6 100644 --- a/apps/client/src/views/backstage/Backstage.tsx +++ b/apps/client/src/views/backstage/Backstage.tsx @@ -35,9 +35,18 @@ interface BackstageProps { settings: Settings | undefined; } -export default function Backstage(props: BackstageProps) { - const { events, customFields, eventNext, eventNow, general, time, isMirrored, runtime, selectedId, settings } = props; - +export default function Backstage({ + events, + customFields, + eventNext, + eventNow, + general, + time, + isMirrored, + runtime, + selectedId, + settings, +}: BackstageProps) { const { getLocalizedString } = useTranslation(); const { secondarySource } = useBackstageOptions(); const [blinkClass, setBlinkClass] = useState(false); diff --git a/apps/client/src/views/studio/StudioTimers.tsx b/apps/client/src/views/studio/StudioTimers.tsx index 95f7f8663..b2ff9cd94 100644 --- a/apps/client/src/views/studio/StudioTimers.tsx +++ b/apps/client/src/views/studio/StudioTimers.tsx @@ -38,7 +38,12 @@ export default function StudioTimers({ const formattedSecondaryMessage = secondaryMessage || '-'; // gather presentation styles - const timerColour = getTimerColour(viewSettings, time.phase === TimerPhase.Warning, time.phase === TimerPhase.Danger); + const timerColour = getTimerColour( + viewSettings, + undefined, + time.phase === TimerPhase.Warning, + time.phase === TimerPhase.Danger, + ); return (
diff --git a/apps/client/src/views/timer/Timer.scss b/apps/client/src/views/timer/Timer.scss index 11bb797a4..ef8055a12 100644 --- a/apps/client/src/views/timer/Timer.scss +++ b/apps/client/src/views/timer/Timer.scss @@ -101,7 +101,7 @@ .timer { opacity: 1; font-family: var(--timer-font, var(--font-family-override, $viewer-font-family)); - color: var(--timer-colour, var(--timer-color-override, var(--phase-color))); + color: var(--timer-colour, var(--timer-color-override, $ui-white)); line-height: 0.9em; text-align: center; letter-spacing: 0.05em; @@ -117,14 +117,14 @@ // use a class instead of a phase, to allow suppressing overtime style &--finished { - color: var(--timer-overtime-color-override, $timer-finished-color); + color: var(--timer-colour, var(--timer-overtime-color-override, $timer-finished-color)); } &[data-phase="warning"] { - color: var(--timer-warning-color-override, var(--phase-color)); + color: var(--timer-colour, var(--timer-warning-color-override)); } &[data-phase="danger"] { - color: var(--timer-danger-color-override, var(--phase-color)); + color: var(--timer-colour, var(--timer-danger-color-override)); } } } diff --git a/apps/client/src/views/timer/Timer.tsx b/apps/client/src/views/timer/Timer.tsx index 762b40179..d5384de34 100644 --- a/apps/client/src/views/timer/Timer.tsx +++ b/apps/client/src/views/timer/Timer.tsx @@ -68,7 +68,7 @@ export default function Timer({ timerType, freezeOvertime, freezeMessage, - hideOvertime, + hidePhase, font, keyColour, textColour, @@ -88,7 +88,7 @@ export default function Timer({ time.phase, freezeOvertime, freezeMessage, - hideOvertime, + hidePhase, ); const isPlaying = getIsPlaying(time.playback); const showClock = !hideClock && getShowClock(viewTimerType); @@ -136,11 +136,11 @@ export default function Timer({ ); // gather presentation styles - const timerColour = getTimerColour(viewSettings, showWarning, showDanger); + const timerColour = getTimerColour(viewSettings, textColour, showWarning, showDanger); const { timerFontSize, externalFontSize } = getEstimatedFontSize(display, secondaryContent); const userStyles = { ...(keyColour && { '--timer-bg': keyColour }), - ...(textColour && { '--timer-colour': textColour }), + ...(textColour && { '--timer-colour': timerColour }), ...(font && { '--timer-font': font }), }; @@ -183,10 +183,7 @@ export default function Timer({ ) : (
{display} diff --git a/apps/client/src/views/timer/timer.options.ts b/apps/client/src/views/timer/timer.options.ts index 991a8f3fc..2069d4374 100644 --- a/apps/client/src/views/timer/timer.options.ts +++ b/apps/client/src/views/timer/timer.options.ts @@ -65,9 +65,9 @@ export const getTimerOptions = (timeFormat: string, customFields: CustomFields): placeholder: 'e.g. Time is up!', }, { - id: 'hideOvertime', - title: 'Hide Overtime', - description: 'Whether to suppress overtime styles (red borders and red text)', + id: 'hidePhase', + title: 'Hide progress styles', + description: 'Whether to suppress the progress styles (warning, danger and overtime)', type: 'boolean', defaultValue: false, }, @@ -187,7 +187,7 @@ type TimerOptions = { timerType?: TimerType; freezeOvertime: boolean; freezeMessage: string; - hideOvertime: boolean; + hidePhase: boolean; font?: string; keyColour?: string; textColour?: string; @@ -217,7 +217,7 @@ function getOptionsFromParams(searchParams: URLSearchParams): TimerOptions { timerType: timerType === TimerType.None ? undefined : timerType, freezeOvertime: isStringBoolean(searchParams.get('freezeOvertime')), freezeMessage: searchParams.get('freezeMessage') ?? '', - hideOvertime: isStringBoolean(searchParams.get('hideOvertime')), + hidePhase: isStringBoolean(searchParams.get('hidePhase')), font: searchParams.get('font') ?? undefined, keyColour: makeColourString(searchParams.get('keyColour')), diff --git a/apps/client/src/views/timer/timer.utils.ts b/apps/client/src/views/timer/timer.utils.ts index 0f2dac51d..8531776f2 100644 --- a/apps/client/src/views/timer/timer.utils.ts +++ b/apps/client/src/views/timer/timer.utils.ts @@ -83,15 +83,32 @@ export function getShowModifiers( phase: TimerPhase, freezeOvertime: boolean, freezeMessage: string, - hideOvertime: boolean, + hidePhase: boolean, ) { + if (hidePhase) { + return { + showEndMessage: false, + showFinished: false, + showWarning: false, + showDanger: false, + }; + } + const showModifiers = timerType === TimerType.CountDown || countToEnd; - const finished = phase === TimerPhase.Overtime; + if (!showModifiers) { + return { + showEndMessage: false, + showFinished: false, + showWarning: false, + showDanger: false, + }; + } + return { - showEndMessage: showModifiers && finished && freezeOvertime && freezeMessage !== '', - showFinished: showModifiers && !hideOvertime && finished, - showWarning: showModifiers && phase === TimerPhase.Warning, - showDanger: showModifiers && phase === TimerPhase.Danger, + showEndMessage: freezeOvertime && freezeMessage !== '', + showFinished: phase === TimerPhase.Overtime, + showWarning: phase === TimerPhase.Warning, + showDanger: phase === TimerPhase.Danger, }; } diff --git a/apps/client/src/views/utils/presentation.utils.ts b/apps/client/src/views/utils/presentation.utils.ts index 9891e2acb..adcc6a5e5 100644 --- a/apps/client/src/views/utils/presentation.utils.ts +++ b/apps/client/src/views/utils/presentation.utils.ts @@ -3,8 +3,13 @@ import { ViewSettings } from 'ontime-types'; /** * Which colour should the timer have at a given moment */ -export function getTimerColour(viewSettings: ViewSettings, showWarning: boolean, showDanger: boolean) { +export function getTimerColour( + viewSettings: ViewSettings, + timerColour: string | undefined, + showWarning: boolean, + showDanger: boolean, +) { if (showWarning) return viewSettings.warningColor; if (showDanger) return viewSettings.dangerColor; - return viewSettings.normalColor; + return timerColour || viewSettings.normalColor; }