From d8ee0d4f82d3b927ed2eb098e1e629b87027d885 Mon Sep 17 00:00:00 2001 From: Carlos Valente <34649812+cpvalente@users.noreply.github.com> Date: Fri, 21 Oct 2022 19:50:25 +0200 Subject: [PATCH] styles: v2 (#229) * style: revise selected style * style: revise editor styles * style: revise viewer styles * chore: update tests --- .../components/buttons/ActionButtons.tsx | 3 +- .../buttons/TooltipLoadingActionBtn.jsx | 3 +- .../components/collapseBar/CollapseBar.jsx | 5 +- .../components/input/ColourInput.module.scss | 1 - .../src/common/components/input/TimeInput.jsx | 2 +- .../common/components/state/Empty.module.scss | 3 +- .../control/__tests__/MessageControl.test.jsx | 2 +- .../src/features/control/message/InputRow.tsx | 2 +- .../control/message/MessageControl.jsx | 6 +- .../message/MessageControl.module.scss | 2 - .../control/message/MessageControlExport.jsx | 3 +- .../playback/PlaybackControl.module.scss | 2 - .../control/playback/TimerControlExport.jsx | 3 +- .../features/control/playback/Transport.jsx | 4 +- .../src/features/editors/Editor.module.scss | 28 ++---- client/src/features/editors/Editor.tsx | 2 +- .../editors/block-block/BlockBlock.jsx | 6 +- .../editors/delay-block/DelayBlock.jsx | 8 +- .../entry-block/EntryBlock.module.scss | 1 - .../event-block/EventBlock.module.scss | 29 +++--- .../editors/event-block/EventBlock.tsx | 69 +++++++------ .../composite/EventBlockActionMenu.jsx | 3 +- .../src/features/editors/list/EventList.jsx | 8 +- .../features/editors/list/EventListExport.tsx | 3 +- .../editors/list/EventListWrapper.tsx | 16 ++- .../features/editors/list/List.module.scss | 11 ++- .../src/features/event-editor/EventEditor.jsx | 4 +- .../event-editor/EventEditor.module.scss | 13 ++- .../event-editor/EventEditorExport.jsx | 21 ++-- client/src/features/info/Info.jsx | 4 +- client/src/features/info/Info.module.scss | 28 +++--- client/src/features/info/InfoExport.jsx | 3 +- .../src/features/info/InfoLogger.module.scss | 1 - client/src/features/info/InfoNif.jsx | 4 +- client/src/features/info/InfoTitle.jsx | 4 +- client/src/features/menu/EventListMenu.jsx | 89 ----------------- ...u.module.css => EventListMenu.module.scss} | 2 +- client/src/features/menu/EventListMenu.tsx | 97 +++++++++++++++++++ .../src/features/menu/MenuActionButtons.tsx | 61 ------------ client/src/features/menu/MenuBar.jsx | 0 client/src/features/menu/MenuBar.tsx | 4 +- .../menu/__tests__/MenuActionButtons.test.jsx | 26 ----- client/src/features/table/TableWrapper.jsx | 5 +- .../features/viewers/backstage/Backstage.jsx | 2 +- .../features/viewers/backstage/Backstage.scss | 8 +- .../features/viewers/countdown/Countdown.jsx | 6 +- .../features/viewers/countdown/Countdown.scss | 2 +- .../viewers/lower-thirds/LowerClean.scss | 2 +- .../viewers/lower-thirds/LowerLines.scss | 2 +- .../viewers/picture-in-picture/Pip.jsx | 2 +- .../viewers/picture-in-picture/Pip.scss | 6 +- client/src/features/viewers/public/Public.jsx | 2 +- .../src/features/viewers/public/Public.scss | 6 +- .../features/viewers/studio/StudioClock.jsx | 2 +- client/src/features/viewers/timer/Timer.jsx | 5 +- .../features/viewers/timer/Timer.module.scss | 0 client/src/features/viewers/timer/Timer.scss | 2 +- client/src/index.scss | 2 +- client/src/theme/_main.scss | 11 ++- client/src/theme/_mixins.scss | 5 +- client/src/theme/_viewerDefs.scss | 3 +- server/cypress/integration/navigation.spec.js | 79 +++++++-------- 62 files changed, 340 insertions(+), 398 deletions(-) delete mode 100644 client/src/features/menu/EventListMenu.jsx rename client/src/features/menu/{EventListMenu.module.css => EventListMenu.module.scss} (62%) create mode 100644 client/src/features/menu/EventListMenu.tsx delete mode 100644 client/src/features/menu/MenuActionButtons.tsx delete mode 100644 client/src/features/menu/MenuBar.jsx delete mode 100644 client/src/features/menu/__tests__/MenuActionButtons.test.jsx delete mode 100644 client/src/features/viewers/timer/Timer.module.scss diff --git a/client/src/common/components/buttons/ActionButtons.tsx b/client/src/common/components/buttons/ActionButtons.tsx index e4e532565..056dfebe8 100644 --- a/client/src/common/components/buttons/ActionButtons.tsx +++ b/client/src/common/components/buttons/ActionButtons.tsx @@ -26,9 +26,10 @@ export default function ActionButtons(props: ActionButtonProps) { } colorScheme='blue' + variant='ghost' /> diff --git a/client/src/common/components/buttons/TooltipLoadingActionBtn.jsx b/client/src/common/components/buttons/TooltipLoadingActionBtn.jsx index 0b11953a5..5516ed1ee 100644 --- a/client/src/common/components/buttons/TooltipLoadingActionBtn.jsx +++ b/client/src/common/components/buttons/TooltipLoadingActionBtn.jsx @@ -3,7 +3,7 @@ import { IconButton, Tooltip } from '@chakra-ui/react'; import PropTypes from 'prop-types'; export default function TooltipLoadingActionBtn(props) { - const { clickHandler, icon, color, size = 'xs', tooltip, ...rest } = props; + const { clickHandler, icon, size = 'xs', tooltip, ...rest } = props; const [loading, setLoading] = useState(false); const handleClick = useCallback(() => { @@ -29,7 +29,6 @@ export default function TooltipLoadingActionBtn(props) { TooltipLoadingActionBtn.propTypes = { clickHandler: PropTypes.func, icon: PropTypes.element, - color: PropTypes.string, size: PropTypes.oneOf(['xs', 'sm', 'md', 'lg']), tooltip: PropTypes.string, }; diff --git a/client/src/common/components/collapseBar/CollapseBar.jsx b/client/src/common/components/collapseBar/CollapseBar.jsx index 991d64350..c2fcf2e60 100644 --- a/client/src/common/components/collapseBar/CollapseBar.jsx +++ b/client/src/common/components/collapseBar/CollapseBar.jsx @@ -5,10 +5,10 @@ import PropTypes from 'prop-types'; import style from './CollapseBar.module.scss'; export default function CollapseBar(props) { - const { title = 'Collapse bar', isCollapsed, onClick, roll } = props; + const { title = 'Collapse bar', isCollapsed, onClick } = props; return ( -
+
{title} } aria-label='automate' - colorScheme='blue' + colorScheme='whiteAlpha' style={{ borderRadius: '2px', width: 'min-content' }} tabIndex={-1} /> diff --git a/client/src/common/components/state/Empty.module.scss b/client/src/common/components/state/Empty.module.scss index 95ad20e56..dcad02bbc 100644 --- a/client/src/common/components/state/Empty.module.scss +++ b/client/src/common/components/state/Empty.module.scss @@ -2,9 +2,8 @@ .emptyContainer { width: 100%; - height: 100%; text-align: center; - color: $bg-black-300; + color: $bg-black-200; .empty { width: 100%; diff --git a/client/src/features/control/__tests__/MessageControl.test.jsx b/client/src/features/control/__tests__/MessageControl.test.jsx index d161b6cd0..4343b3346 100644 --- a/client/src/features/control/__tests__/MessageControl.test.jsx +++ b/client/src/features/control/__tests__/MessageControl.test.jsx @@ -23,7 +23,7 @@ describe('Message Control input blocks', () => { // Presenter dialog and button // substring match, ignore case render(); - expect(screen.getByPlaceholderText(/presenter/i)).toBeInTheDocument(); + expect(screen.getByPlaceholderText(/stage/i)).toBeInTheDocument(); }); test('Public dialog', async () => { diff --git a/client/src/features/control/message/InputRow.tsx b/client/src/features/control/message/InputRow.tsx index 852ea2c0b..fe0847eab 100644 --- a/client/src/features/control/message/InputRow.tsx +++ b/client/src/features/control/message/InputRow.tsx @@ -40,7 +40,7 @@ export default function InputRow(props: InputRowProps) { value={inputText} placeholder={placeholder} className={style.inline} - color={text === '' ? '#666' : 'inherit'} + color={text === '' ? '#505050' : 'inherit'} > diff --git a/client/src/features/control/message/MessageControl.jsx b/client/src/features/control/message/MessageControl.jsx index d93023a2c..a4c4227a1 100644 --- a/client/src/features/control/message/MessageControl.jsx +++ b/client/src/features/control/message/MessageControl.jsx @@ -17,7 +17,7 @@ export default function MessageControl() {
setMessage.presenterText(newValue)} @@ -25,7 +25,7 @@ export default function MessageControl() { /> setMessage.publicText(newValue)} @@ -33,7 +33,7 @@ export default function MessageControl() { /> setMessage.lowerText(newValue)} diff --git a/client/src/features/control/message/MessageControl.module.scss b/client/src/features/control/message/MessageControl.module.scss index c3f99a4c0..f09116a81 100644 --- a/client/src/features/control/message/MessageControl.module.scss +++ b/client/src/features/control/message/MessageControl.module.scss @@ -3,7 +3,6 @@ .messageContainer, .onAirToggle { - @include main-container; display: flex; gap: 0.5em; padding: 0.5em; @@ -47,7 +46,6 @@ } .inline { - background-color: $light-bg-transparent; border-color: $action-blue; } } diff --git a/client/src/features/control/message/MessageControlExport.jsx b/client/src/features/control/message/MessageControlExport.jsx index 94585c19b..f904b2635 100644 --- a/client/src/features/control/message/MessageControlExport.jsx +++ b/client/src/features/control/message/MessageControlExport.jsx @@ -10,8 +10,7 @@ import style from '../../editors/Editor.module.scss'; export default function MessageControlExport() { return ( - -

Messages Control

+ handleLinks(event, 'messagecontrol')} />
diff --git a/client/src/features/control/playback/PlaybackControl.module.scss b/client/src/features/control/playback/PlaybackControl.module.scss index d0310bc9f..8f1089de6 100644 --- a/client/src/features/control/playback/PlaybackControl.module.scss +++ b/client/src/features/control/playback/PlaybackControl.module.scss @@ -8,9 +8,7 @@ gap: 4px; } -.timeContainer, .playbackContainer { - @include second-container; padding: 0.5em; } diff --git a/client/src/features/control/playback/TimerControlExport.jsx b/client/src/features/control/playback/TimerControlExport.jsx index bf4b2cc3d..1c41abc30 100644 --- a/client/src/features/control/playback/TimerControlExport.jsx +++ b/client/src/features/control/playback/TimerControlExport.jsx @@ -10,8 +10,7 @@ import style from '../../editors/Editor.module.scss'; export default function TimerControlExport() { return ( - -

Timer Control

+ handleLinks(event, 'timercontrol')} />
diff --git a/client/src/features/control/playback/Transport.jsx b/client/src/features/control/playback/Transport.jsx index 3443e8bdd..2dddb107b 100644 --- a/client/src/features/control/playback/Transport.jsx +++ b/client/src/features/control/playback/Transport.jsx @@ -1,4 +1,4 @@ -import { IoArrowUndo } from '@react-icons/all-files/io5/IoArrowUndo'; +import { IoPlayBack } from '@react-icons/all-files/io5/IoPlayBack'; import { IoPlaySkipBack } from '@react-icons/all-files/io5/IoPlaySkipBack'; import { IoPlaySkipForward } from '@react-icons/all-files/io5/IoPlaySkipForward'; import PropTypes from 'prop-types'; @@ -30,7 +30,7 @@ export default function Transport(props) { clickHandler={() => playbackControl.reload()} disabled={selectedId == null || isRolling || noEvents} tooltip='Reload event' - icon={} + icon={} /> playbackControl.stop()} diff --git a/client/src/features/editors/Editor.module.scss b/client/src/features/editors/Editor.module.scss index 65d43cca8..27fd59ea6 100644 --- a/client/src/features/editors/Editor.module.scss +++ b/client/src/features/editors/Editor.module.scss @@ -114,12 +114,6 @@ } } -h1 { - font-size: max(1.5em, 16px); - color: $bg-gray-100; - padding-bottom: 0.25em; -} - .mainContainer { .settings, .editor, @@ -128,9 +122,8 @@ h1 { .info { border-radius: 8px; height: 100%; - background-color: $bg-gray-1000; + background-color: $bg-container-l1; padding: 0.8em 1.5em; - display: flex; flex-direction: column; } @@ -138,9 +131,8 @@ h1 { .eventEditor { border-radius: 3px 3px 0 0; - background-color: $bg-gray-950; - border-top: 1px solid $bg-gray-900; - padding: 0.8em 1.5em; + background-color: $bg-container-l1; + border-top: $border-l1; position: absolute; bottom: 0; width: 100vw; @@ -155,14 +147,14 @@ h1 { transition: bottom 0.7s; } - .header { + .eventEditorLayout { display: flex; } .header { - h1 { - margin-right: auto; - } + background-color: $bg-container-l2; + padding: 8px; + border-left: 1px solid $bg-container-l3; } } @@ -194,8 +186,8 @@ h1 { .playback { grid-area: play; - min-height: 320px; - max-height: 320px; + min-height: 270px; + max-height: 270px; min-width: 480px; } @@ -211,5 +203,5 @@ h1 { } .content { - padding-top: 0.5em; + padding-top: 24px; } diff --git a/client/src/features/editors/Editor.tsx b/client/src/features/editors/Editor.tsx index 608fe0e53..b5944324b 100644 --- a/client/src/features/editors/Editor.tsx +++ b/client/src/features/editors/Editor.tsx @@ -39,7 +39,7 @@ export default function Editor() { -
+
actionHandler('delete')} icon={} - colorScheme='red' tooltip='Delete' - _hover={{ bg: 'red.400' }} + variant='ghost' + _hover={{ bg: 'red.400', color: 'white' }} + color='red.500' + size='sm' /> diff --git a/client/src/features/editors/delay-block/DelayBlock.jsx b/client/src/features/editors/delay-block/DelayBlock.jsx index c528dd137..5aa491cab 100644 --- a/client/src/features/editors/delay-block/DelayBlock.jsx +++ b/client/src/features/editors/delay-block/DelayBlock.jsx @@ -54,7 +54,7 @@ export default function DelayBlock(props) {
@@ -190,13 +197,17 @@ export default function EventBlock(props: EventBlockProps) { {note}
- } - aria-label='event options' - onClick={() => setOpenId((prev) => prev === eventId ? null : eventId)} + } + clickHandler={() => setOpenId((prev) => prev === eventId ? null : eventId)} + tooltip='Event options' + aria-label='Event options' tabIndex={-1} + backgroundColor={openId === eventId ? '#ebedf0' : 'transparent'} + color={openId === eventId ? '#333' : '#ebedf0'} + _hover={{ bg: '#ebedf0', color: '#333' }} /> ; + return ( +
+ + +
+ ); } let cumulativeDelay = 0; let eventIndex = -1; diff --git a/client/src/features/editors/list/EventListExport.tsx b/client/src/features/editors/list/EventListExport.tsx index 100d47ac5..47753093c 100644 --- a/client/src/features/editors/list/EventListExport.tsx +++ b/client/src/features/editors/list/EventListExport.tsx @@ -11,8 +11,7 @@ import style from '../Editor.module.scss'; export default function EventListExport() { return ( - -

Event List

+ handleLinks(event, 'eventlist')} diff --git a/client/src/features/editors/list/EventListWrapper.tsx b/client/src/features/editors/list/EventListWrapper.tsx index 613da0577..fbec73cc4 100644 --- a/client/src/features/editors/list/EventListWrapper.tsx +++ b/client/src/features/editors/list/EventListWrapper.tsx @@ -20,15 +20,13 @@ export default function EventListWrapper() { }, [emitError, isError]); return ( - <> +
-
- {status === 'success' && data ? ( - - ) : ( - - )} -
- + {status === 'success' && data ? ( + + ) : ( + + )} +
); } diff --git a/client/src/features/editors/list/List.module.scss b/client/src/features/editors/list/List.module.scss index 12acd6683..1a418a2a2 100644 --- a/client/src/features/editors/list/List.module.scss +++ b/client/src/features/editors/list/List.module.scss @@ -2,7 +2,6 @@ @use '../../../theme/mixins' as *; .eventContainer { - @include second-container; margin-top: 1em; display: flex; flex-direction: column; @@ -22,8 +21,8 @@ } .cursor { - box-shadow: 2px 2px 0 $ontime-pink; border-radius: 3px; + outline: 1px solid $action-blue; } .bgElement { @@ -31,3 +30,11 @@ background: rgba(214, 158, 46, 0.3); } } + +.alignCenter { + text-align: center; + flex-direction: column; + button { + margin-top: 24px; + } +} diff --git a/client/src/features/event-editor/EventEditor.jsx b/client/src/features/event-editor/EventEditor.jsx index 7011f9bd6..6f79142c0 100644 --- a/client/src/features/event-editor/EventEditor.jsx +++ b/client/src/features/event-editor/EventEditor.jsx @@ -162,7 +162,7 @@ export default function EventEditor() { leftIcon={} size='sm' colorScheme='blue' - variant={event.isPublic ? 'solid' : 'outline'} + variant={event.isPublic ? 'solid' : 'ghost'} onClick={() => togglePublic(event.isPublic)} > {event.isPublic ? 'Event is Public' : 'Make event public'} @@ -180,7 +180,7 @@ export default function EventEditor() { + + + } + colorScheme='blue' + variant='outline' + /> + + + } onClick={() => actionHandler('event')}> + Add Event first + + } onClick={() => actionHandler('delay')}> + Add Delay first + + } onClick={() => actionHandler('block')}> + Add Block first + + + } onClick={() => actionHandler('delete-all')} color='red.500'> + Delete All + + + + + ); +}; + +export default memo(EventListMenu); diff --git a/client/src/features/menu/MenuActionButtons.tsx b/client/src/features/menu/MenuActionButtons.tsx deleted file mode 100644 index b0eca81ba..000000000 --- a/client/src/features/menu/MenuActionButtons.tsx +++ /dev/null @@ -1,61 +0,0 @@ -import { - IconButton, - Divider, - Menu, - MenuButton, - MenuItem, - MenuList, - Tooltip, -} from '@chakra-ui/react'; -import { FiClock } from '@react-icons/all-files/fi/FiClock'; -import { FiMinusCircle } from '@react-icons/all-files/fi/FiMinusCircle'; -import { FiPlus } from '@react-icons/all-files/fi/FiPlus'; -import { FiTrash2 } from '@react-icons/all-files/fi/FiTrash2'; -import { useEventAction } from 'common/hooks/useEventAction'; -import { Size } from 'common/models/UtilTypes'; - - -interface MenuActionButtonsProps { - actionHandler: (action: string) => void; - size?: Size; -} - -// Todo: add useEventActionsHook -export default function MenuActionButtons(props: MenuActionButtonsProps) { - const { actionHandler, size = 'xs' } = props; - const { deleteAllEvents } = useEventAction(); - const menuStyle = { - color: '#000000', - backgroundColor: 'rgba(255,255,255,1)', - }; - - return ( - - - } - colorScheme='blue' - /> - - - } onClick={() => actionHandler('event')}> - Add Event first - - } onClick={() => actionHandler('delay')}> - Add Delay first - - } onClick={() => actionHandler('block')}> - Add Block first - - - } onClick={() => deleteAllEvents()} color='red.500'> - Delete All - - - - ); -} - diff --git a/client/src/features/menu/MenuBar.jsx b/client/src/features/menu/MenuBar.jsx deleted file mode 100644 index e69de29bb..000000000 diff --git a/client/src/features/menu/MenuBar.tsx b/client/src/features/menu/MenuBar.tsx index 77b23d9ed..a4e5776ea 100644 --- a/client/src/features/menu/MenuBar.tsx +++ b/client/src/features/menu/MenuBar.tsx @@ -4,8 +4,8 @@ import { FiHelpCircle } from '@react-icons/all-files/fi/FiHelpCircle'; import { FiMaximize } from '@react-icons/all-files/fi/FiMaximize'; import { FiMinimize } from '@react-icons/all-files/fi/FiMinimize'; import { FiSave } from '@react-icons/all-files/fi/FiSave'; -import { FiSettings } from '@react-icons/all-files/fi/FiSettings'; import { FiUpload } from '@react-icons/all-files/fi/FiUpload'; +import { IoSettingsOutline } from '@react-icons/all-files/io5/IoSettingsOutline'; import { downloadEvents } from 'common/api/ontimeApi'; import QuitIconBtn from '../../common/components/buttons/QuitIconBtn'; @@ -116,7 +116,7 @@ export default function MenuBar(props: MenuBarProps) { /> } + icon={} className={isSettingsOpen ? style.open : ''} clickHandler={onSettingsOpen} tooltip='Settings' diff --git a/client/src/features/menu/__tests__/MenuActionButtons.test.jsx b/client/src/features/menu/__tests__/MenuActionButtons.test.jsx deleted file mode 100644 index cf4cc9b10..000000000 --- a/client/src/features/menu/__tests__/MenuActionButtons.test.jsx +++ /dev/null @@ -1,26 +0,0 @@ -import { QueryClientProvider } from '@tanstack/react-query'; -import { render, screen } from '@testing-library/react'; -import { vi } from 'vitest'; - -import { queryClientMock } from '../../../__mocks__/QueryClient.mock'; -import MenuActionButtons from '../MenuActionButtons'; - -const actionHandler = vi.fn(); -const renderInMock = () => { - render( - - - , - ); -}; - -test('check that menu bar renders correctly', () => { - // need to inject the react query provider - renderInMock(); - - const b = screen.getByRole('button', { - name: /create menu/i, - }); - - expect(b).toBeInTheDocument(); -}); \ No newline at end of file diff --git a/client/src/features/table/TableWrapper.jsx b/client/src/features/table/TableWrapper.jsx index 806819b1d..add666899 100644 --- a/client/src/features/table/TableWrapper.jsx +++ b/client/src/features/table/TableWrapper.jsx @@ -83,7 +83,10 @@ export default function TableWrapper() { return loading...; } return ( -
+
+
{general.title}
diff --git a/client/src/features/viewers/backstage/Backstage.scss b/client/src/features/viewers/backstage/Backstage.scss index 55810553b..22801f663 100644 --- a/client/src/features/viewers/backstage/Backstage.scss +++ b/client/src/features/viewers/backstage/Backstage.scss @@ -31,7 +31,7 @@ .today-container { background-color: var(--outdent-background-color-override, $viewer-outdent-bg-color); padding: 1vh 1vw; - border-radius: 1vw; + border-radius: $element-border-radius; .label { font-size: 1.3vw; @@ -50,7 +50,7 @@ } .event { - border-radius: 0 2vw 2vw 0; + border-radius: 0 $element-border-radius $element-border-radius 0; margin-left: -1vw; padding: 1vh 2vw; overflow: hidden; @@ -115,12 +115,12 @@ .clock-container { grid-area: time; - border-radius: 0 0 1vw 1vw; + border-radius: 0 0 $element-border-radius $element-border-radius; } .timer-container { grid-area: clck; - border-radius: 1vw 1vw 0 0; + border-radius: $element-border-radius $element-border-radius 0 0; } .info { diff --git a/client/src/features/viewers/countdown/Countdown.jsx b/client/src/features/viewers/countdown/Countdown.jsx index 22e9201a1..f75cf1392 100644 --- a/client/src/features/viewers/countdown/Countdown.jsx +++ b/client/src/features/viewers/countdown/Countdown.jsx @@ -90,10 +90,10 @@ export default function Countdown(props) { : formatTime(follow.timeEnd + delay, formatOptions); return ( -
+
{follow === null ? ( -
+
Select an event to follow
    {backstageEvents.length === 0 ? ( @@ -112,7 +112,7 @@ export default function Countdown(props) {
) : ( -
+
Time Now
diff --git a/client/src/features/viewers/countdown/Countdown.scss b/client/src/features/viewers/countdown/Countdown.scss index ccaeeaf09..fb744551c 100644 --- a/client/src/features/viewers/countdown/Countdown.scss +++ b/client/src/features/viewers/countdown/Countdown.scss @@ -80,7 +80,7 @@ color: var(--accent-color-override, $accent-color); background-color: var(--outdent-background-color-override, $viewer-outdent-bg-color); padding: 1vh 2vw; - border-radius: 1vw; + border-radius: $element-border-radius; } .status { diff --git a/client/src/features/viewers/lower-thirds/LowerClean.scss b/client/src/features/viewers/lower-thirds/LowerClean.scss index b32cca142..51bf1dfdb 100644 --- a/client/src/features/viewers/lower-thirds/LowerClean.scss +++ b/client/src/features/viewers/lower-thirds/LowerClean.scss @@ -10,7 +10,7 @@ .lower-container { position: absolute; padding: 1vh 2vh; - border-radius: 1vh; + border-radius: 8px; } .message-container { diff --git a/client/src/features/viewers/lower-thirds/LowerLines.scss b/client/src/features/viewers/lower-thirds/LowerLines.scss index 72b2a8537..04792b5f9 100644 --- a/client/src/features/viewers/lower-thirds/LowerLines.scss +++ b/client/src/features/viewers/lower-thirds/LowerLines.scss @@ -15,7 +15,7 @@ display: flex; flex-direction: column; width: 45vw; - border-radius: 0 1vh 1vh 0; + border-radius: 0 8px 8px 0; } .message-container { diff --git a/client/src/features/viewers/picture-in-picture/Pip.jsx b/client/src/features/viewers/picture-in-picture/Pip.jsx index a073233f0..5120bb86b 100644 --- a/client/src/features/viewers/picture-in-picture/Pip.jsx +++ b/client/src/features/viewers/picture-in-picture/Pip.jsx @@ -65,7 +65,7 @@ export default function Pip(props) { const clock = formatTime(time.clock, formatOptions); return ( -
+
{general.title}
diff --git a/client/src/features/viewers/picture-in-picture/Pip.scss b/client/src/features/viewers/picture-in-picture/Pip.scss index fde38641a..10e2cbc22 100644 --- a/client/src/features/viewers/picture-in-picture/Pip.scss +++ b/client/src/features/viewers/picture-in-picture/Pip.scss @@ -27,7 +27,7 @@ .timer-container { background-color: var(--outdent-background-color-override, $viewer-outdent-bg-color); padding: 1vh 1vw; - border-radius: 1vw; + border-radius: $element-border-radius; .label { font-size: 1.3vw; @@ -126,11 +126,11 @@ .clock-container { grid-area: time; - border-radius: 0 0 1vw 1vw; + border-radius: 0 0 $element-border-radius $element-border-radius; } .timer-container { grid-area: clck; - border-radius: 1vw 1vw 0 0; + border-radius: $element-border-radius $element-border-radius 0 0; } } diff --git a/client/src/features/viewers/public/Public.jsx b/client/src/features/viewers/public/Public.jsx index 5cb49d01c..3a436f252 100644 --- a/client/src/features/viewers/public/Public.jsx +++ b/client/src/features/viewers/public/Public.jsx @@ -38,7 +38,7 @@ export default function Public(props) { const clock = formatTime(time.clock, formatOptions); return ( -
+
{general.title}
diff --git a/client/src/features/viewers/public/Public.scss b/client/src/features/viewers/public/Public.scss index fb5fa3c38..f13abfa95 100644 --- a/client/src/features/viewers/public/Public.scss +++ b/client/src/features/viewers/public/Public.scss @@ -31,7 +31,7 @@ .today-container { background-color: var(--outdent-background-color-override, $viewer-outdent-bg-color); padding: 1vh 1vw; - border-radius: 1vw; + border-radius: $element-border-radius; .label { font-size: 1.3vw; @@ -50,7 +50,7 @@ } .event { - border-radius: 0 2vw 2vw 0; + border-radius: 0 $element-border-radius $element-border-radius 0; margin-left: -1vw; padding: 1vh 2vw; overflow: hidden; @@ -114,7 +114,7 @@ .clock-container { grid-area: time; - border-radius: 1vw; + border-radius: $element-border-radius; } .info { diff --git a/client/src/features/viewers/studio/StudioClock.jsx b/client/src/features/viewers/studio/StudioClock.jsx index 74688657e..74a899720 100644 --- a/client/src/features/viewers/studio/StudioClock.jsx +++ b/client/src/features/viewers/studio/StudioClock.jsx @@ -54,7 +54,7 @@ export default function StudioClock(props) { const [, , secondsNow] = stringFromMillis(time.clock).split(':'); return ( -
+
{clock}
diff --git a/client/src/features/viewers/timer/Timer.jsx b/client/src/features/viewers/timer/Timer.jsx index 2e5e8f1e2..b26e88d51 100644 --- a/client/src/features/viewers/timer/Timer.jsx +++ b/client/src/features/viewers/timer/Timer.jsx @@ -66,7 +66,10 @@ export default function Timer(props) { }; return ( -
+
{pres.text}
diff --git a/client/src/features/viewers/timer/Timer.module.scss b/client/src/features/viewers/timer/Timer.module.scss deleted file mode 100644 index e69de29bb..000000000 diff --git a/client/src/features/viewers/timer/Timer.scss b/client/src/features/viewers/timer/Timer.scss index 88948c4f0..28073c155 100644 --- a/client/src/features/viewers/timer/Timer.scss +++ b/client/src/features/viewers/timer/Timer.scss @@ -30,7 +30,7 @@ .event { background-color: var(--outdent-background-color-override, $viewer-outdent-bg-color); padding: 1vh 2vw; - border-radius: 1vw; + border-radius: $element-border-radius; max-width: 100%; &.now { diff --git a/client/src/index.scss b/client/src/index.scss index f44154719..1888f9b34 100644 --- a/client/src/index.scss +++ b/client/src/index.scss @@ -3,7 +3,7 @@ * { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; - scrollbar-color: rgba(255, 255, 255, 0.15) rgba(255, 255, 255, 0.01); + scrollbar-color: #2b2b2b rgba(255, 255, 255, 0.01); scrollbar-width: thin; } diff --git a/client/src/theme/_main.scss b/client/src/theme/_main.scss index 67dead90e..df9da6fa0 100644 --- a/client/src/theme/_main.scss +++ b/client/src/theme/_main.scss @@ -6,6 +6,7 @@ $bg-black-100: #070707; $bg-black-200: #1a1a1a; // container borders $bg-black-300: #1f1f1f; // container text $bg-gray-1100: #232323; // container borders +$bg-gray-1050: #242424; // container borders $bg-gray-1000: #262626; // container borders $bg-gray-950: #292929; $bg-gray-900: #303030; @@ -42,7 +43,7 @@ $opacity-disabled: 0.4; $notes-color: #d69e2e; $text-white: #fffffa; -$text-gray-disabled: #999; +$text-gray-disabled: #505050; $header-gray: #ccc; $label-gray: #aaa; $clocks: #ddd; @@ -64,11 +65,17 @@ $title-gray: #ddd; $subtitle-gray: #aaa; //////////////////////////////////// block elements +$bg-container-l1: #202020; +$bg-container-l2: #232323; +$bg-container-l3: #2b2b2b; +$border-l1: 1px solid $bg-gray-1000; +$border-l3: 1px solid $bg-gray-900; + $block-delay-color: #ecc94b; $delay-text: #d69e2e; $block-delay-border: #d69e2e55; $block-block-color: #805ad5; -$block-border: 1px solid $bg-gray-900; +$block-border: 1px solid $bg-gray-1100; //////////////////////////////////// viewer cards @mixin card-title { diff --git a/client/src/theme/_mixins.scss b/client/src/theme/_mixins.scss index bacbcfcfb..44f0b194c 100644 --- a/client/src/theme/_mixins.scss +++ b/client/src/theme/_mixins.scss @@ -9,13 +9,12 @@ } @mixin second-container { - background-color: $bg-gray-1100; - border: 1px solid rgba(0, 0, 0, 0.05); + background-color: $bg-container-l2; border-radius: 4px; } @mixin third-container { - background-color: $bg-black-300; + background-color: $bg-gray-1100; border: 1px solid rgba(0, 0, 0, 0.05); border-radius: 2px; } diff --git a/client/src/theme/_viewerDefs.scss b/client/src/theme/_viewerDefs.scss index 067dbab38..bb9da705e 100644 --- a/client/src/theme/_viewerDefs.scss +++ b/client/src/theme/_viewerDefs.scss @@ -7,8 +7,9 @@ $delay-color: $delay-text; // Main Properties of a viewer $viewer-background-color: $bg-black; // --background-color-override $viewer-color: $title-white; // --color-override -$viewer-outdent-bg-color: $bg-gray-1100; // --outdent-background-color-override +$viewer-outdent-bg-color: $bg-container-l1; // --outdent-background-color-override $viewer-overlay-bg-color: $bg-overlay; +$element-border-radius: 8px; // Properties related to timer $timer-finished-color: $ontime-pink-variant; diff --git a/server/cypress/integration/navigation.spec.js b/server/cypress/integration/navigation.spec.js index b47ecf8de..fa90eed38 100644 --- a/server/cypress/integration/navigation.spec.js +++ b/server/cypress/integration/navigation.spec.js @@ -3,38 +3,37 @@ describe('validate routes', () => { describe('viewer routes', () => { it('default to stage timer', () => { cy.visit('http://localhost:4001/'); + cy.get('[data-testid="timer-view"]').should('exist'); cy.contains('Time Now'); }); - it('renders stage timer', () => { + it('renders stage timer routes', () => { cy.visit('http://localhost:4001/timer'); + cy.get('[data-testid="timer-view"]').should('exist'); cy.contains('Time Now'); - }); - it('renders presenter', () => { cy.visit('http://localhost:4001/presenter'); + cy.get('[data-testid="timer-view"]').should('exist'); cy.contains('Time Now'); - }); - it('renders speaker', () => { cy.visit('http://localhost:4001/speaker'); + cy.get('[data-testid="timer-view"]').should('exist'); cy.contains('Time Now'); - }); - it('renders backstage view /stage', () => { cy.visit('http://localhost:4001/stage'); + cy.get('[data-testid="timer-view"]').should('exist'); cy.contains('Time Now'); }); - it('renders backstage view /backstage', () => { + it('renders backstage routes', () => { cy.visit('http://localhost:4001/backstage'); + cy.get('[data-testid="backstage-view"]').should('exist'); cy.contains('Today'); cy.contains('Time Now'); cy.contains('Info'); - }); - it('renders backstage view /sm', () => { cy.visit('http://localhost:4001/sm'); + cy.get('[data-testid="backstage-view"]').should('exist'); cy.contains('Today'); cy.contains('Time Now'); cy.contains('Info'); @@ -42,6 +41,7 @@ describe('validate routes', () => { it('renders public view', () => { cy.visit('http://localhost:4001/public'); + cy.get('[data-testid="public-view"]').should('exist'); cy.contains('Today'); cy.contains('Time Now'); cy.contains('Info'); @@ -49,8 +49,8 @@ describe('validate routes', () => { it('renders pip view', () => { cy.visit('http://localhost:4001/pip'); + cy.get('[data-testid="pip-view"]').should('exist'); cy.contains('Today'); - cy.contains('Info'); }); it('renders lower third with no errors', () => { @@ -60,16 +60,21 @@ describe('validate routes', () => { it('renders studio clock', () => { cy.visit('http://localhost:4001/studio'); + cy.get('[data-testid="studio-view"]').should('exist'); cy.contains('ON AIR'); }); it('renders countdown selection', () => { cy.visit('http://localhost:4001/countdown'); + cy.get('[data-testid="countdown-view"]').should('exist'); + cy.get('[data-testid="countdown-select"]').should('exist'); cy.contains('Select an event to follow'); }); it('renders countdown with event', () => { cy.visit('http://localhost:4001/countdown?event=1'); + cy.get('[data-testid="countdown-view"]').should('exist'); + cy.get('[data-testid="countdown-event"]').should('exist'); cy.contains('Time Now'); cy.contains('Start Time'); cy.contains('End Time'); @@ -78,38 +83,30 @@ describe('validate routes', () => { describe('clock view timer', () => { it('renders base route', () => { - // base route cy.visit('http://localhost:4001/clock'); cy.get('[data-testid="clock-view"]').should('exist'); - // ontime fallsback to stage timer on errors, so we check for that cy.get('.App').should('not.contain', 'Time Now'); }); }); describe('minimal timer and options', () => { it('renders base route', () => { - // base route cy.visit('http://localhost:4001/minimal'); cy.get('[data-testid="minimal-timer"]').should('exist'); - // ontime fallsback to stage timer on errors, so we check for that cy.get('.App').should('not.contain', 'Time Now'); }); it('renders with defined options', () => { - // route with options cy.visit( 'http://localhost:4001/minimal?font=arial=1&size=1.5&text=0f0&key=ff0&hideovertime=true&alignx=start&aligny=end&offsetx=100&offsety=-100&hidemessages=true' ); cy.get('[data-testid="minimal-timer"]').should('exist'); - // ontime fallback to stage timer on errors, so we check for that cy.get('.App').should('not.contain', 'Time Now'); }); it('hides nav on given option', () => { - // route with options for no nav cy.visit('http://localhost:4001/minimal?hidenav=true'); cy.get('[data-testid="minimal-timer"]').should('exist'); - // ontime fallback to stage timer on errors, so we check for that cy.get('.App').should('not.contain', 'Time Now'); cy.get('[data-testid="nav-logo"]').should('not.exist'); }); @@ -118,49 +115,53 @@ describe('validate routes', () => { describe('editor routes', () => { it('app editor', () => { cy.visit('http://localhost:4001/editor'); - cy.contains('Event List'); - cy.contains('Timer Control'); - cy.contains('Messages Control'); - cy.contains('Info'); + cy.get('[data-testid="event-editor"]').should('exist'); + cy.get('[data-testid="panel-event-list"]').should('exist'); + cy.get('[data-testid="panel-timer-control"]').should('exist'); + cy.get('[data-testid="panel-messages-control"]').should('exist'); + cy.get('[data-testid="panel-info"]').should('exist'); }); it('self contained eventlist', () => { cy.visit('http://localhost:4001/eventlist'); - cy.get('.App').should('contain', 'Event List'); - cy.get('.App').should('not.contain', 'Timer Control'); - cy.get('.App').should('not.contain', 'Messages Control'); - cy.get('.App').should('not.contain', 'Info'); + cy.get('[data-testid="panel-event-list"]').should('exist'); + cy.get('[data-testid="panel-timer-control"]').should('not.exist'); + cy.get('[data-testid="panel-messages-control"]').should('not.exist'); + cy.get('[data-testid="panel-info"]').should('not.exist'); }); it('self contained timercontrol', () => { cy.visit('http://localhost:4001/timercontrol'); - cy.get('.App').should('not.contain', 'Event List'); - cy.get('.App').should('contain', 'Timer Control'); - cy.get('.App').should('not.contain', 'Messages Control'); - cy.get('.App').should('not.contain', 'Info'); + cy.get('[data-testid="panel-event-list"]').should('not.exist'); + cy.get('[data-testid="panel-timer-control"]').should('exist'); + cy.get('[data-testid="panel-messages-control"]').should('not.exist'); + cy.get('[data-testid="panel-info"]').should('not.exist'); }); it('self contained messagecontrol', () => { cy.visit('http://localhost:4001/messagecontrol'); - cy.get('.App').should('not.contain', 'Event List'); - cy.get('.App').should('not.contain', 'Timer Control'); - cy.get('.App').should('contain', 'Messages Control'); - cy.get('.App').should('not.contain', 'Info'); + cy.get('[data-testid="panel-event-list"]').should('not.exist'); + cy.get('[data-testid="panel-timer-control"]').should('not.exist'); + cy.get('[data-testid="panel-messages-control"]').should('exist'); + cy.get('[data-testid="panel-info"]').should('not.exist'); }); it('self contained info', () => { cy.visit('http://localhost:4001/info'); - cy.get('.App').should('not.contain', 'Event List'); - cy.get('.App').should('not.contain', 'Timer Control'); - cy.get('.App').should('not.contain', 'Messages Control'); - cy.get('.App').should('contain', 'Info'); + cy.get('[data-testid="panel-event-list"]').should('not.exist'); + cy.get('[data-testid="panel-timer-control"]').should('not.exist'); + cy.get('[data-testid="panel-messages-control"]').should('not.exist'); + cy.get('[data-testid="panel-info"]').should('exist'); }); }); it('table routes', () => { cy.visit('http://localhost:4001/table'); cy.contains('Running Timer'); + cy.get('[data-testid="cuesheet"]').should('exist'); cy.visit('http://localhost:4001/cuesheet'); cy.contains('Running Timer'); + cy.get('[data-testid="cuesheet"]').should('exist'); cy.visit('http://localhost:4001/cuelist'); cy.contains('Running Timer'); + cy.get('[data-testid="cuesheet"]').should('exist'); }); });