From cf6ce880f41d15c2fcf058e16b3b837e69b0dd37 Mon Sep 17 00:00:00 2001 From: Carlos Valente <34649812+cpvalente@users.noreply.github.com> Date: Tue, 6 Jun 2023 21:23:00 +0200 Subject: [PATCH] feat: patch params editor (#428) * feat: configure params in views --- .../NavigationMenu.module.scss | 3 +- .../components/progress-bar/ProgressBar.scss | 1 + .../ParamInput.tsx} | 4 +- .../ViewParamsEditor.module.scss} | 6 + .../ViewParamsEditor.tsx} | 18 ++- .../constants.ts | 48 +++---- .../types.ts | 0 .../features/viewers/backstage/Backstage.tsx | 6 +- .../src/features/viewers/clock/Clock.tsx | 8 +- .../features/viewers/countdown/Countdown.tsx | 6 +- .../viewers/lower-thirds/LowerClean.jsx | 131 ------------------ .../viewers/lower-thirds/LowerClean.scss | 27 ---- .../{LowerLines.jsx => LowerLines.tsx} | 37 ++--- .../{LowerWrapper.jsx => LowerWrapper.tsx} | 114 +++++++-------- .../viewers/minimal-timer/MinimalTimer.tsx | 8 +- .../src/features/viewers/public/Public.scss | 2 +- .../src/features/viewers/public/Public.tsx | 6 +- .../features/viewers/studio/StudioClock.jsx | 6 +- .../src/features/viewers/timer/Timer.tsx | 6 +- apps/client/src/theme/ontimeButton.ts | 5 + apps/client/src/theme/theme.ts | 2 + 21 files changed, 150 insertions(+), 294 deletions(-) rename apps/client/src/common/components/{edit-form-drawer/EditFormInput.tsx => view-params-editor/ParamInput.tsx} (87%) rename apps/client/src/common/components/{edit-form-drawer/EditFormDrawer.module.scss => view-params-editor/ViewParamsEditor.module.scss} (87%) rename apps/client/src/common/components/{edit-form-drawer/EditFormDrawer.tsx => view-params-editor/ViewParamsEditor.tsx} (85%) rename apps/client/src/common/components/{edit-form-drawer => view-params-editor}/constants.ts (87%) rename apps/client/src/common/components/{edit-form-drawer => view-params-editor}/types.ts (100%) delete mode 100644 apps/client/src/features/viewers/lower-thirds/LowerClean.jsx delete mode 100644 apps/client/src/features/viewers/lower-thirds/LowerClean.scss rename apps/client/src/features/viewers/lower-thirds/{LowerLines.jsx => LowerLines.tsx} (80%) rename apps/client/src/features/viewers/lower-thirds/{LowerWrapper.jsx => LowerWrapper.tsx} (53%) diff --git a/apps/client/src/common/components/navigation-menu/NavigationMenu.module.scss b/apps/client/src/common/components/navigation-menu/NavigationMenu.module.scss index dcfb044dc..c4e942229 100644 --- a/apps/client/src/common/components/navigation-menu/NavigationMenu.module.scss +++ b/apps/client/src/common/components/navigation-menu/NavigationMenu.module.scss @@ -27,6 +27,7 @@ $button-size: 48px; position: fixed; left: 0; top: 0; + z-index: 2; &.hidden { opacity: 0; @@ -46,7 +47,7 @@ $button-size: 48px; .navButton { @extend .button; - z-index: 2; + z-index: 3; } .menuContainer { diff --git a/apps/client/src/common/components/progress-bar/ProgressBar.scss b/apps/client/src/common/components/progress-bar/ProgressBar.scss index 0eb6eaad7..2b9d1b5e2 100644 --- a/apps/client/src/common/components/progress-bar/ProgressBar.scss +++ b/apps/client/src/common/components/progress-bar/ProgressBar.scss @@ -18,5 +18,6 @@ $progress-bar-br: 6px; height: $progress-bar-size; background-color: var(--timer-progress-override, $accent-color); transition: 1s linear; + border-radius: $progress-bar-br 0 0 $progress-bar-br; transition-property: width; } diff --git a/apps/client/src/common/components/edit-form-drawer/EditFormInput.tsx b/apps/client/src/common/components/view-params-editor/ParamInput.tsx similarity index 87% rename from apps/client/src/common/components/edit-form-drawer/EditFormInput.tsx rename to apps/client/src/common/components/view-params-editor/ParamInput.tsx index 6918c9fdd..73af5dab6 100644 --- a/apps/client/src/common/components/edit-form-drawer/EditFormInput.tsx +++ b/apps/client/src/common/components/view-params-editor/ParamInput.tsx @@ -9,7 +9,7 @@ interface EditFormInputProps { paramField: ParamField; } -export default function EditFormInput({ paramField }: EditFormInputProps) { +export default function ParamInput({ paramField }: EditFormInputProps) { const [searchParams] = useSearchParams(); const { id, type } = paramField; @@ -38,7 +38,7 @@ export default function EditFormInput({ paramField }: EditFormInputProps) { if (type === 'number') { const defaultNumberValue = searchParams.get(id) ?? ''; - return ; + return ; } const defaultStringValue = searchParams.get(id) ?? ''; diff --git a/apps/client/src/common/components/edit-form-drawer/EditFormDrawer.module.scss b/apps/client/src/common/components/view-params-editor/ViewParamsEditor.module.scss similarity index 87% rename from apps/client/src/common/components/edit-form-drawer/EditFormDrawer.module.scss rename to apps/client/src/common/components/view-params-editor/ViewParamsEditor.module.scss index 108fcae6c..38c18e674 100644 --- a/apps/client/src/common/components/edit-form-drawer/EditFormDrawer.module.scss +++ b/apps/client/src/common/components/view-params-editor/ViewParamsEditor.module.scss @@ -13,8 +13,14 @@ .drawerFooter { @extend .drawerContent; display: flex; + justify-content: start; gap: $element-spacing; + button[type='reset'] { + padding: 0 2em; + margin-right: auto; + } + button[type='submit'] { padding: 0 2em; } diff --git a/apps/client/src/common/components/edit-form-drawer/EditFormDrawer.tsx b/apps/client/src/common/components/view-params-editor/ViewParamsEditor.tsx similarity index 85% rename from apps/client/src/common/components/edit-form-drawer/EditFormDrawer.tsx rename to apps/client/src/common/components/view-params-editor/ViewParamsEditor.tsx index 9a68be302..92d275518 100644 --- a/apps/client/src/common/components/edit-form-drawer/EditFormDrawer.tsx +++ b/apps/client/src/common/components/view-params-editor/ViewParamsEditor.tsx @@ -12,16 +12,16 @@ import { useDisclosure, } from '@chakra-ui/react'; -import EditFormInput from './EditFormInput'; +import ParamInput from './ParamInput'; import { ParamField } from './types'; -import style from './EditFormDrawer.module.scss'; +import style from './ViewParamsEditor.module.scss'; interface EditFormDrawerProps { paramFields: ParamField[]; } -export default function EditFormDrawer({ paramFields }: EditFormDrawerProps) { +export default function ViewParamsEditor({ paramFields }: EditFormDrawerProps) { const [searchParams, setSearchParams] = useSearchParams(); const { isOpen, onClose, onOpen } = useDisclosure(); @@ -40,6 +40,11 @@ export default function EditFormDrawer({ paramFields }: EditFormDrawerProps) { setSearchParams(searchParams); }; + const clearParams = () => { + setSearchParams(); + onClose(); + }; + const onParamsFormSubmit = (formEvent: FormEvent) => { formEvent.preventDefault(); @@ -53,8 +58,6 @@ export default function EditFormDrawer({ paramFields }: EditFormDrawerProps) { return newSearchParams; }, new URLSearchParams()); - - onEditDrawerClose(); setSearchParams(newSearchParams); }; @@ -74,7 +77,7 @@ export default function EditFormDrawer({ paramFields }: EditFormDrawerProps) { ))} @@ -82,6 +85,9 @@ export default function EditFormDrawer({ paramFields }: EditFormDrawerProps) { + diff --git a/apps/client/src/common/components/edit-form-drawer/constants.ts b/apps/client/src/common/components/view-params-editor/constants.ts similarity index 87% rename from apps/client/src/common/components/edit-form-drawer/constants.ts rename to apps/client/src/common/components/view-params-editor/constants.ts index ca9363e26..c7e746aa7 100644 --- a/apps/client/src/common/components/edit-form-drawer/constants.ts +++ b/apps/client/src/common/components/view-params-editor/constants.ts @@ -9,9 +9,10 @@ export const TIME_FORMAT_OPTION: ParamField = { }; export const CLOCK_OPTIONS: ParamField[] = [ + TIME_FORMAT_OPTION, { id: 'key', - title: 'Key', + title: 'Key Colour', description: 'Background colour in hexadecimal', type: 'string', }, @@ -65,30 +66,14 @@ export const CLOCK_OPTIONS: ParamField[] = [ description: 'Offsets the timer vertical position by a given amount in pixels', type: 'number', }, - { - id: 'hidenav', - title: 'Hide Nav', - description: 'Whether to hide the nav logo in the right corner', - type: 'boolean', - }, - TIME_FORMAT_OPTION, ]; -export const TIMER_OPTIONS: ParamField[] = [ - { - id: 'progress', - title: 'Progress Bar', - description: 'Whether bar counts up or down', - type: 'option', - values: ['up', 'down'], - }, - TIME_FORMAT_OPTION, -]; +export const TIMER_OPTIONS: ParamField[] = [TIME_FORMAT_OPTION]; export const MINIMAL_TIMER_OPTIONS: ParamField[] = [ { id: 'key', - title: 'Key', + title: 'Key Colour', description: 'Background colour in hexadecimal', type: 'string', }, @@ -142,12 +127,6 @@ export const MINIMAL_TIMER_OPTIONS: ParamField[] = [ description: 'Offsets the timer vertical position by a given amount in pixels', type: 'number', }, - { - id: 'hidenav', - title: 'Hide Nav', - description: 'Whether to hide the nav logo in the right corner', - type: 'boolean', - }, { id: 'hideovertime', title: 'Hide Overtime', @@ -160,13 +139,19 @@ export const MINIMAL_TIMER_OPTIONS: ParamField[] = [ description: 'Whether to hide the overlay from showing timer screen messages', type: 'boolean', }, + { + id: 'hideendmessage', + title: 'Hide End Message', + description: 'Whether to hide end message and continue showing the clock if timer is in overtime', + type: 'boolean', + }, ]; export const LOWER_THIRDS_OPTIONS: ParamField[] = [ { id: 'preset', title: 'Preset', - description: 'Selects a style preset', + description: 'Selects a style preset (0-1)', type: 'number', }, { @@ -183,19 +168,19 @@ export const LOWER_THIRDS_OPTIONS: ParamField[] = [ }, { id: 'text', - title: 'Text', + title: 'Text Colour', description: 'Text colour in hexadecimal', type: 'string', }, { id: 'bg', - title: 'BG', + title: 'Text Background', description: 'Text background colour in hexadecimal', type: 'string', }, { id: 'key', - title: 'Key', + title: 'Key Colour', description: 'Screen background colour in hexadecimal', type: 'string', }, @@ -205,15 +190,14 @@ export const LOWER_THIRDS_OPTIONS: ParamField[] = [ description: 'Time (in seconds) the lower third displays before fading out', type: 'number', }, - TIME_FORMAT_OPTION, ]; export const STUDIO_CLOCK_OPTIONS: ParamField[] = [ + TIME_FORMAT_OPTION, { id: 'seconds', - title: 'Seconds', + title: 'Show Seconds', description: 'Shows seconds in clock', type: 'boolean', }, - TIME_FORMAT_OPTION, ]; diff --git a/apps/client/src/common/components/edit-form-drawer/types.ts b/apps/client/src/common/components/view-params-editor/types.ts similarity index 100% rename from apps/client/src/common/components/edit-form-drawer/types.ts rename to apps/client/src/common/components/view-params-editor/types.ts diff --git a/apps/client/src/features/viewers/backstage/Backstage.tsx b/apps/client/src/features/viewers/backstage/Backstage.tsx index ce8b1bf9a..d2846070b 100644 --- a/apps/client/src/features/viewers/backstage/Backstage.tsx +++ b/apps/client/src/features/viewers/backstage/Backstage.tsx @@ -5,14 +5,14 @@ import { EventData, Message, OntimeEvent, ViewSettings } from 'ontime-types'; import { formatDisplay } from 'ontime-utils'; import { overrideStylesURL } from '../../../common/api/apiConstants'; -import { TIME_FORMAT_OPTION } from '../../../common/components/edit-form-drawer/constants'; -import EditFormDrawer from '../../../common/components/edit-form-drawer/EditFormDrawer'; import NavigationMenu from '../../../common/components/navigation-menu/NavigationMenu'; import ProgressBar from '../../../common/components/progress-bar/ProgressBar'; import Schedule from '../../../common/components/schedule/Schedule'; import { ScheduleProvider } from '../../../common/components/schedule/ScheduleContext'; import ScheduleNav from '../../../common/components/schedule/ScheduleNav'; import TitleCard from '../../../common/components/title-card/TitleCard'; +import { TIME_FORMAT_OPTION } from '../../../common/components/view-params-editor/constants'; +import ViewParamsEditor from '../../../common/components/view-params-editor/ViewParamsEditor'; import { useRuntimeStylesheet } from '../../../common/hooks/useRuntimeStylesheet'; import { TimeManagerType } from '../../../common/models/TimeManager.type'; import { getEventsWithDelay } from '../../../common/utils/eventsManager'; @@ -79,7 +79,7 @@ export default function Backstage(props: BackstageProps) { return (
- +
{general.title}
diff --git a/apps/client/src/features/viewers/clock/Clock.tsx b/apps/client/src/features/viewers/clock/Clock.tsx index 36bb3c7ce..ef40764a2 100644 --- a/apps/client/src/features/viewers/clock/Clock.tsx +++ b/apps/client/src/features/viewers/clock/Clock.tsx @@ -3,9 +3,9 @@ import { useSearchParams } from 'react-router-dom'; import { ViewSettings } from 'ontime-types'; import { overrideStylesURL } from '../../../common/api/apiConstants'; -import { CLOCK_OPTIONS } from '../../../common/components/edit-form-drawer/constants'; -import EditFormDrawer from '../../../common/components/edit-form-drawer/EditFormDrawer'; import NavigationMenu from '../../../common/components/navigation-menu/NavigationMenu'; +import { CLOCK_OPTIONS } from '../../../common/components/view-params-editor/constants'; +import ViewParamsEditor from '../../../common/components/view-params-editor/ViewParamsEditor'; import { useRuntimeStylesheet } from '../../../common/hooks/useRuntimeStylesheet'; import { TimeManagerType } from '../../../common/models/TimeManager.type'; import { OverridableOptions } from '../../../common/models/View.types'; @@ -129,12 +129,12 @@ export default function Clock(props: ClockProps) { style={{ backgroundColor: userOptions.keyColour, justifyContent: userOptions.justifyContent, - alignItems: userOptions.alignItems, + alignContent: userOptions.alignItems, }} data-testid='clock-view' > - +
- + {follow === null ? ( ) : ( diff --git a/apps/client/src/features/viewers/lower-thirds/LowerClean.jsx b/apps/client/src/features/viewers/lower-thirds/LowerClean.jsx deleted file mode 100644 index 24961f176..000000000 --- a/apps/client/src/features/viewers/lower-thirds/LowerClean.jsx +++ /dev/null @@ -1,131 +0,0 @@ -import { useEffect, useState } from 'react'; -import { AnimatePresence, motion } from 'framer-motion'; - -import NavigationMenu from '../../../common/components/navigation-menu/NavigationMenu'; - -import './LowerClean.scss'; - -export default function LowerClean(props) { - const { lower, title, options } = props; - const defaults = { - size: 1, - transitionIn: 3, - textColour: '#fffffa', - posX: 50, - posY: 700, - }; - - const [showLower, setShowLower] = useState(true); - // Unmount if fadeOut - useEffect(() => { - if (!options.fadeOut) return; - - // Calculate time - const fadeOutTime = (parseInt(options.fadeOut, 10) + (options.transitionIn || defaults.transitionIn)) * 1000; - if (isNaN(fadeOutTime)) return; - - const timeout = setTimeout(() => { - setShowLower(false); - }, fadeOutTime); - - return () => clearTimeout(timeout); - }, [options.fadeOut, options.transitionIn, defaults.transitionIn]); - - // Format messages - const showLowerMessage = lower.text !== '' && lower.visible; - - // motion - // transition segments - const t = options.transitionIn || defaults.transitionIn; - const quarter = t / 4; - const third = t / 3; - const half = t / 2; - - const lowerThirdVariants = { - hidden: { - opacity: 0, - }, - visible: { - opacity: 1, - transition: { - duration: third, - }, - }, - exit: { - opacity: 0, - transition: { - duration: third, - }, - }, - }; - - const titleVariants = { - hidden: { - opacity: 0, - }, - visible: { - opacity: 1, - transition: { - delay: quarter, - duration: half, - }, - }, - }; - - const sizeMultiplier = (options.size || 1) * 4; - - return ( -
- - - - {showLower && ( - - - {title.titleNow} - - - {title.presenterNow} - - - )} - - - - {showLowerMessage && ( - -
{lower.text}
-
- )} -
-
- ); -} diff --git a/apps/client/src/features/viewers/lower-thirds/LowerClean.scss b/apps/client/src/features/viewers/lower-thirds/LowerClean.scss deleted file mode 100644 index ac46163f7..000000000 --- a/apps/client/src/features/viewers/lower-thirds/LowerClean.scss +++ /dev/null @@ -1,27 +0,0 @@ -.lower-third.clean { - margin: 0; - box-sizing: border-box; - overflow: hidden; - width: 100%; - height: 100%; - color: #fffffa; - font-size: 4vh; - background-color: white; - - .lower-container { - position: absolute; - padding: 1vh 2vh; - border-radius: 8px; - } - - .message-container { - position: absolute; - bottom: 2vh; - width: 100%; - text-align: center; - - .message { - font-size: 3.5vh; - } - } -} diff --git a/apps/client/src/features/viewers/lower-thirds/LowerLines.jsx b/apps/client/src/features/viewers/lower-thirds/LowerLines.tsx similarity index 80% rename from apps/client/src/features/viewers/lower-thirds/LowerLines.jsx rename to apps/client/src/features/viewers/lower-thirds/LowerLines.tsx index 533f361c3..1b0b84f52 100644 --- a/apps/client/src/features/viewers/lower-thirds/LowerLines.jsx +++ b/apps/client/src/features/viewers/lower-thirds/LowerLines.tsx @@ -1,20 +1,24 @@ import { useEffect, useState } from 'react'; import { AnimatePresence, motion } from 'framer-motion'; +import { Message } from 'ontime-types'; -import { LOWER_THIRDS_OPTIONS } from '../../../common/components/edit-form-drawer/constants'; -import EditFormDrawer from '../../../common/components/edit-form-drawer/EditFormDrawer'; import NavigationMenu from '../../../common/components/navigation-menu/NavigationMenu'; +import { LOWER_THIRDS_OPTIONS } from '../../../common/components/view-params-editor/constants'; +import ViewParamsEditor from '../../../common/components/view-params-editor/ViewParamsEditor'; +import { TitleManager } from '../ViewWrapper'; + +import { LowerOptions } from './LowerWrapper'; import './LowerLines.scss'; -export default function LowerLines(props) { +interface LowerLinesProps { + lower: Message; + title: TitleManager; + options: LowerOptions; +} + +export default function LowerLines(props: LowerLinesProps) { const { lower, title, options } = props; - const defaults = { - size: 1, - transitionIn: 3, - textColour: '#fffffa', - bgColour: '#00000033', - }; const [showLower, setShowLower] = useState(true); // Unmount if fadeOut @@ -22,15 +26,14 @@ export default function LowerLines(props) { if (!options.fadeOut) return; // Calculate time - const fadeOutTime = (parseInt(options.fadeOut, 10) + (options.transitionIn || defaults.transitionIn)) * 1000; - if (isNaN(fadeOutTime)) return; + const fadeOutTime = (options.fadeOut + options.transitionIn) * 1000; const timeout = setTimeout(() => { setShowLower(false); }, fadeOutTime); return () => clearTimeout(timeout); - }, [options.fadeOut, options.transitionIn, defaults.transitionIn]); + }, [options.fadeOut, options.transitionIn]); useEffect(() => { setShowLower(title.showNow); @@ -41,7 +44,7 @@ export default function LowerLines(props) { // motion // transition segments - const t = options.transitionIn || defaults.transitionIn; + const t = options.transitionIn; const eight = t / 8; const quarter = t / 4; const third = t / 3; @@ -123,19 +126,19 @@ export default function LowerLines(props) {
- + {showLower && ( { +export type LowerOptions = { + size: number; + transitionIn: number; + textColour: string; + bgColour: string; + keyColour?: string; + fadeOut: number; +}; +interface LowerProps { + title: TitleManager; + lower: Message; + viewSettings: ViewSettings; +} + +// prevent triggering animation without a content change +const areEqual = (prevProps: LowerProps, nextProps: LowerProps) => { return isEqual(prevProps.title, nextProps.title) && isEqual(prevProps.lower, nextProps.lower); }; -const Lower = (props) => { +const Lower = (props: LowerProps) => { const { title, lower, viewSettings } = props; const { shouldRender } = useRuntimeStylesheet(viewSettings?.overrideStyles && overrideStylesURL); const [searchParams] = useSearchParams(); - const [titles, setTitles] = useState({ + const [titles, setTitles] = useState({ titleNow: '', titleNext: '', subtitleNow: '', subtitleNext: '', presenterNow: '', presenterNext: '', + noteNow: '', + noteNext: '', showNow: false, showNext: false, }); @@ -36,7 +54,7 @@ const Lower = (props) => { useEffect(() => { // clear titles if necessary // will trigger an animation out in the component - let timeout = null; + let timeout: NodeJS.Timeout | null = null; if ( title?.titleNow !== titles?.titleNow || title?.subtitleNow !== titles?.subtitleNow || @@ -56,7 +74,7 @@ const Lower = (props) => { clearTimeout(timeout); } }; - // eslint-disable-next-line + // eslint-disable-next-line -- we do this to keep animations }, [title.titleNow, title.subtitleNow, title.presenterNow]); // defer rendering until we load stylesheets @@ -64,72 +82,60 @@ const Lower = (props) => { return null; } - // TODO: sanitize data - // getting config from URL: preset, size, transition, bg, text, key - // eg. http://localhost:3000/lower?bg=ff2&text=f00&size=0.6&transition=5 - // Check for user options - // create aux - const options = {}; - - // preset: selector - // Should be a number 1-n - const p = parseInt(searchParams.get('preset'), 10); - const preset = !isNaN(p) ? 1 : p; + const options: LowerOptions = { + size: 1, + transitionIn: 3, + textColour: '#fffffa', + bgColour: '#00000033', + fadeOut: 3, + }; // size: multiplier // Should be a number 0.0-n - const s = searchParams.get('size'); - if (s) options.size = s; + const _size = searchParams.get('size'); + if (_size) { + const parsedValue = Number(_size); + if (!Number.isNaN(parsedValue)) { + options.size = parsedValue; + } + } // transitionIn: seconds // Should be a number 0-n - const t = parseInt(searchParams.get('transition'), 10); - if (!isNaN(t)) options.transitionIn = t; + const _transitionIn = searchParams.get('transition'); + if (_transitionIn) { + const parsedValue = Number(_transitionIn); + if (!Number.isNaN(parsedValue)) { + options.transitionIn = parsedValue; + } + } // textColour: string // Should be a hex string '#ffffff' - const c = searchParams.get('text'); - if (c) options.textColour = `#${c}`; + const _textColour = searchParams.get('text'); + if (_textColour) options.textColour = `#${_textColour}`; // bgColour: string // Should be a hex string '#ffffff' - const b = searchParams.get('bg'); - if (b) options.bgColour = `#${b}`; + const _bgColour = searchParams.get('bg'); + if (_bgColour) options.bgColour = `#${_bgColour}`; // key: string // Should be a hex string '#00FF00' with key colour - const k = searchParams.get('key'); - if (k) options.keyColour = `#${k}`; + const _key = searchParams.get('key'); + if (_key) options.keyColour = `#${_key}`; // fadeOut: seconds // Should be a number 0-n - const f = parseInt(searchParams.get('fadeout'), 10); - if (!isNaN(f)) options.fadeOut = f; - - // x: pixels - // Should be a number 0-n - const x = parseInt(searchParams.get('x'), 10); - if (!isNaN(x)) options.posX = x; - - // y: pixels - // Should be a number 0-n - const y = parseInt(searchParams.get('y'), 10); - if (!isNaN(y)) options.posY = y; - - switch (preset) { - case 0: - return ; - case 1: - return ; - default: - return ; + const _fadeOut = searchParams.get('fadeout'); + if (_fadeOut) { + const parsedValue = Number(_transitionIn); + if (!Number.isNaN(parsedValue)) { + options.fadeOut = parsedValue; + } } + + return ; }; export default memo(Lower, areEqual); - -Lower.propTypes = { - title: PropTypes.object, - lower: PropTypes.object, - viewSettings: PropTypes.object, -}; diff --git a/apps/client/src/features/viewers/minimal-timer/MinimalTimer.tsx b/apps/client/src/features/viewers/minimal-timer/MinimalTimer.tsx index 02ddd59d1..35c77a4fa 100644 --- a/apps/client/src/features/viewers/minimal-timer/MinimalTimer.tsx +++ b/apps/client/src/features/viewers/minimal-timer/MinimalTimer.tsx @@ -3,9 +3,9 @@ import { useSearchParams } from 'react-router-dom'; import { EventData, Playback, TimerMessage, TimerType, ViewSettings } from 'ontime-types'; import { overrideStylesURL } from '../../../common/api/apiConstants'; -import { MINIMAL_TIMER_OPTIONS } from '../../../common/components/edit-form-drawer/constants'; -import EditFormDrawer from '../../../common/components/edit-form-drawer/EditFormDrawer'; import NavigationMenu from '../../../common/components/navigation-menu/NavigationMenu'; +import { MINIMAL_TIMER_OPTIONS } from '../../../common/components/view-params-editor/constants'; +import ViewParamsEditor from '../../../common/components/view-params-editor/ViewParamsEditor'; import { useRuntimeStylesheet } from '../../../common/hooks/useRuntimeStylesheet'; import { TimeManagerType } from '../../../common/models/TimeManager.type'; import { OverridableOptions } from '../../../common/models/View.types'; @@ -169,12 +169,12 @@ export default function MinimalTimer(props: MinimalTimerProps) { style={{ backgroundColor: userOptions.keyColour, justifyContent: userOptions.justifyContent, - alignItems: userOptions.alignItems, + alignContent: userOptions.alignItems, }} data-testid='minimal-timer' > - + {!hideMessagesOverlay && (
{pres.text}
diff --git a/apps/client/src/features/viewers/public/Public.scss b/apps/client/src/features/viewers/public/Public.scss index 1606d7288..fd353bfec 100644 --- a/apps/client/src/features/viewers/public/Public.scss +++ b/apps/client/src/features/viewers/public/Public.scss @@ -87,7 +87,7 @@ grid-area: schedule; overflow: hidden; height: 100%; - margin-left: 16px; + margin-left: clamp(16px, 5vw, 64px);; } .schedule-nav-container { diff --git a/apps/client/src/features/viewers/public/Public.tsx b/apps/client/src/features/viewers/public/Public.tsx index 8bb98cc36..8e71697e7 100644 --- a/apps/client/src/features/viewers/public/Public.tsx +++ b/apps/client/src/features/viewers/public/Public.tsx @@ -4,13 +4,13 @@ import { AnimatePresence, motion } from 'framer-motion'; import { EventData, Message, OntimeEvent, ViewSettings } from 'ontime-types'; import { overrideStylesURL } from '../../../common/api/apiConstants'; -import { TIME_FORMAT_OPTION } from '../../../common/components/edit-form-drawer/constants'; -import EditFormDrawer from '../../../common/components/edit-form-drawer/EditFormDrawer'; import NavigationMenu from '../../../common/components/navigation-menu/NavigationMenu'; import Schedule from '../../../common/components/schedule/Schedule'; import { ScheduleProvider } from '../../../common/components/schedule/ScheduleContext'; import ScheduleNav from '../../../common/components/schedule/ScheduleNav'; import TitleCard from '../../../common/components/title-card/TitleCard'; +import { TIME_FORMAT_OPTION } from '../../../common/components/view-params-editor/constants'; +import ViewParamsEditor from '../../../common/components/view-params-editor/ViewParamsEditor'; import { useRuntimeStylesheet } from '../../../common/hooks/useRuntimeStylesheet'; import { TimeManagerType } from '../../../common/models/TimeManager.type'; import { formatTime } from '../../../common/utils/time'; @@ -57,7 +57,7 @@ export default function Public(props: BackstageProps) { return (
- +
{general.title}
diff --git a/apps/client/src/features/viewers/studio/StudioClock.jsx b/apps/client/src/features/viewers/studio/StudioClock.jsx index 255314f7a..433b21270 100644 --- a/apps/client/src/features/viewers/studio/StudioClock.jsx +++ b/apps/client/src/features/viewers/studio/StudioClock.jsx @@ -4,9 +4,9 @@ import { formatDisplay, millisToString } from 'ontime-utils'; import PropTypes from 'prop-types'; import { overrideStylesURL } from '../../../common/api/apiConstants'; -import { STUDIO_CLOCK_OPTIONS } from '../../../common/components/edit-form-drawer/constants'; -import EditFormDrawer from '../../../common/components/edit-form-drawer/EditFormDrawer'; import NavigationMenu from '../../../common/components/navigation-menu/NavigationMenu'; +import { STUDIO_CLOCK_OPTIONS } from '../../../common/components/view-params-editor/constants'; +import ViewParamsEditor from '../../../common/components/view-params-editor/ViewParamsEditor'; import useFitText from '../../../common/hooks/useFitText'; import { useRuntimeStylesheet } from '../../../common/hooks/useRuntimeStylesheet'; import { formatEventList, getEventsWithDelay, trimRundown } from '../../../common/utils/eventsManager'; @@ -74,7 +74,7 @@ export default function StudioClock(props) { return (
- +
{clock}
- +
{pres.text}
diff --git a/apps/client/src/theme/ontimeButton.ts b/apps/client/src/theme/ontimeButton.ts index 7d1be9a90..ab50a341b 100644 --- a/apps/client/src/theme/ontimeButton.ts +++ b/apps/client/src/theme/ontimeButton.ts @@ -47,6 +47,11 @@ export const ontimeButtonSubtle = { }, }; +export const ontimeButtonGhosted = { + ...ontimeButtonSubtle, + backgroundColor: 'transparent', +}; + export const ontimeButtonSubtleOnLight = { backgroundColor: '#ececec', // $gray-100 color: '#595959', // $gray-800 diff --git a/apps/client/src/theme/theme.ts b/apps/client/src/theme/theme.ts index bb3a4706e..44d2dcfe3 100644 --- a/apps/client/src/theme/theme.ts +++ b/apps/client/src/theme/theme.ts @@ -3,6 +3,7 @@ import { extendTheme } from '@chakra-ui/react'; import { ontimeAlertOnLight } from './OntimeAlert'; import { ontimeButtonFilled, + ontimeButtonGhosted, ontimeButtonOutlined, ontimeButtonSubtle, ontimeButtonSubtleOnLight, @@ -42,6 +43,7 @@ const theme = extendTheme({ 'ontime-filled': { ...ontimeButtonFilled }, 'ontime-outlined': { ...ontimeButtonOutlined }, 'ontime-subtle': { ...ontimeButtonSubtle }, + 'ontime-ghosted': { ...ontimeButtonGhosted }, 'ontime-subtle-white': { ...ontimeButtonSubtleWhite }, 'ontime-subtle-on-light': { ...ontimeButtonSubtleOnLight }, 'ontime-ghost-on-light': { ...ontimeGhostOnLight },