mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-22 15:39:11 +00:00
feat: operator view
This commit is contained in:
@@ -8,10 +8,11 @@ import { tooltipDelayFast } from '../../../ontimeConfig';
|
|||||||
|
|
||||||
interface PlaybackIconProps {
|
interface PlaybackIconProps {
|
||||||
state: Playback;
|
state: Playback;
|
||||||
|
className?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function PlaybackIcon(props: PlaybackIconProps) {
|
export default function PlaybackIcon(props: PlaybackIconProps) {
|
||||||
const { state } = props;
|
const { state, className } = props;
|
||||||
|
|
||||||
// if timer is Pause or Armed
|
// if timer is Pause or Armed
|
||||||
let label = 'Timer Paused';
|
let label = 'Timer Paused';
|
||||||
@@ -30,7 +31,7 @@ export default function PlaybackIcon(props: PlaybackIconProps) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Tooltip openDelay={tooltipDelayFast} label={label} shouldWrapChildren>
|
<Tooltip openDelay={tooltipDelayFast} label={label} shouldWrapChildren>
|
||||||
<Icon />
|
<Icon className={className} />
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
.title {
|
.title {
|
||||||
font-size: 1.5rem;
|
font-size: 1.5rem;
|
||||||
letter-spacing: 0.02px;
|
letter-spacing: 0.5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cue {
|
.cue {
|
||||||
@@ -52,7 +52,7 @@
|
|||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color: $orange-500;
|
color: $orange-500;
|
||||||
|
|
||||||
letter-spacing: 0.02px;
|
letter-spacing: 0.5px;
|
||||||
height: fit-content;
|
height: fit-content;
|
||||||
|
|
||||||
transition-property: height;
|
transition-property: height;
|
||||||
|
|||||||
@@ -8,13 +8,19 @@
|
|||||||
background-color: $gray-1350;
|
background-color: $gray-1350;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
|
|
||||||
padding: 0.5rem;
|
padding: 0.5rem 1rem;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
border-top: 1px solid $white-10;
|
border-top: 1px solid $white-10;
|
||||||
box-shadow: $large-bottom-drawer-shadow;
|
box-shadow: $large-bottom-drawer-shadow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.playbackIcon {
|
||||||
|
font-size: 2rem;
|
||||||
|
color: $gray-700;
|
||||||
|
}
|
||||||
|
|
||||||
.column {
|
.column {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@@ -25,10 +31,21 @@
|
|||||||
.clock {
|
.clock {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 1.5rem;
|
gap: 1.5rem;
|
||||||
margin-right: 1rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.label {
|
.label {
|
||||||
font-size: 0.75rem;
|
font-size: 0.75rem;
|
||||||
color: gray;
|
color: $gray-700;
|
||||||
|
}
|
||||||
|
|
||||||
|
.timer {
|
||||||
|
letter-spacing: 0.5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
// tablet
|
||||||
|
@media (min-width: $min-tablet) {
|
||||||
|
.clock {
|
||||||
|
display: flex;
|
||||||
|
gap: 1.5rem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { OntimeEvent, Playback } from 'ontime-types';
|
|||||||
import { millisToString } from 'ontime-utils';
|
import { millisToString } from 'ontime-utils';
|
||||||
|
|
||||||
import PlaybackIcon from '../../../common/components/playback-icon/PlaybackIcon';
|
import PlaybackIcon from '../../../common/components/playback-icon/PlaybackIcon';
|
||||||
|
import useMediaQuery from '../../../common/context/useMediaQuery';
|
||||||
import { useTimer } from '../../../common/hooks/useSocket';
|
import { useTimer } from '../../../common/hooks/useSocket';
|
||||||
import { formatTime } from '../../../common/utils/time';
|
import { formatTime } from '../../../common/utils/time';
|
||||||
|
|
||||||
@@ -17,6 +18,7 @@ export default function StatusBar({
|
|||||||
selectedEventId: string | null;
|
selectedEventId: string | null;
|
||||||
}) {
|
}) {
|
||||||
const timer = useTimer();
|
const timer = useTimer();
|
||||||
|
const isMobile = useMediaQuery('(max-width: 450px)');
|
||||||
|
|
||||||
const getTimeEnd = () => {
|
const getTimeEnd = () => {
|
||||||
if (lastEvent === null) {
|
if (lastEvent === null) {
|
||||||
@@ -37,16 +39,18 @@ export default function StatusBar({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.statusBar}>
|
<div className={styles.statusBar}>
|
||||||
<PlaybackIcon state={playback} />
|
<PlaybackIcon state={playback} className={styles.playbackIcon} />
|
||||||
<div className={styles.clock}>
|
<div className={styles.clock}>
|
||||||
<div className={styles.column}>
|
<div className={styles.column}>
|
||||||
<span className={styles.label}>Time now</span>
|
<span className={styles.label}>Time now</span>
|
||||||
<span className={styles.timer}>{timeNow}</span>
|
<span className={styles.timer}>{timeNow}</span>
|
||||||
</div>
|
</div>
|
||||||
<div className={styles.column}>
|
{!isMobile && (
|
||||||
<span className={styles.label}>Time to end</span>
|
<div className={styles.column}>
|
||||||
<span className={styles.timer}>{getTimeEnd()}</span>
|
<span className={styles.label}>Last end</span>
|
||||||
</div>
|
<span className={styles.timer}>{getTimeEnd()}</span>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
<div className={styles.column}>
|
<div className={styles.column}>
|
||||||
<span className={styles.label}>Elapsed time</span>
|
<span className={styles.label}>Elapsed time</span>
|
||||||
<span className={styles.timer}>{elapsedTime}</span>
|
<span className={styles.timer}>{elapsedTime}</span>
|
||||||
|
|||||||
Reference in New Issue
Block a user