Skip to content

Commit fb56b6b

Browse files
committed
wip: next bar alignment when no text
1 parent cb00684 commit fb56b6b

File tree

3 files changed

+34
-9
lines changed

3 files changed

+34
-9
lines changed

packages/webui/src/client/styles/countdown/director.scss

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,18 +109,20 @@ $hold-status-color: $liveline-timecode-color;
109109
&.notext {
110110
background: $general-next-color;
111111
height: 20px;
112+
margin-top: 8vh;
112113
text-shadow: 0px 0px 6px #000000;
113114
}
114115
.director-screen__body__segment__countdown {
115116
position: absolute;
116117
font-size: 110px;
117118
top: 0;
118-
right: 3vw;
119+
right: 0px;
119120
height: 100%;
120121
width: 20vw;
121-
float: right;
122-
text-align: left;
122+
float: left;
123+
text-align: right;
123124
padding-left: 4vw;
125+
padding-top: 6px;
124126
color: #ff0;
125127
background: linear-gradient(
126128
90deg,
@@ -170,6 +172,7 @@ $hold-status-color: $liveline-timecode-color;
170172
display: flex;
171173
flex-direction: column;
172174
text-align: left;
175+
width: 87vw;
173176

174177
.director-screen__body__part__piece-name {
175178
font-size: 13em;
@@ -270,6 +273,10 @@ $hold-status-color: $liveline-timecode-color;
270273
z-index: 1;
271274
font-stretch: 25;
272275
}
276+
.director-screen__body__part__next-icon--notext,
277+
.director-screen__body__part__auto-icon--notext {
278+
margin-top: 4vh !important; /* Override the default -50px when notext is true */
279+
}
273280
}
274281

275282
.clocks-segment-countdown-red {

packages/webui/src/client/ui/ClockView/DirectorScreen.tsx

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ function getShowStyleBaseIdSegmentPartUi(
157157
}
158158
}
159159

160-
export const getDirectorScreenReactive = (props: DirectorScreenProps): DirectorScreenTrackedProps => {
160+
const getDirectorScreenReactive = (props: DirectorScreenProps): DirectorScreenTrackedProps => {
161161
const studio = UIStudios.findOne(props.studioId)
162162

163163
let playlist: DBRundownPlaylist | undefined
@@ -269,7 +269,7 @@ export const getDirectorScreenReactive = (props: DirectorScreenProps): DirectorS
269269
}
270270
}
271271

272-
export function useDirectorScreenSubscriptions(props: DirectorScreenProps): void {
272+
function useDirectorScreenSubscriptions(props: DirectorScreenProps): void {
273273
useSubscription(MeteorPubSub.uiStudio, props.studioId)
274274

275275
const playlist = useTracker(
@@ -442,7 +442,7 @@ function DirectorScreenRender({
442442
width: '90vw',
443443
fontFamily: 'Roboto Flex',
444444
fontSize: '1.4em',
445-
minFontWidth: 20,
445+
minFontWidth: 32,
446446
maxFontWidth: 90,
447447
minLetterSpacing: 2,
448448
}}
@@ -502,9 +502,23 @@ function DirectorScreenRender({
502502
{nextPartInstance && nextShowStyleBaseId ? (
503503
<>
504504
{currentPartInstance && currentPartInstance.instance.part.autoNext ? (
505-
<span className="director-screen__body__part__auto-icon">AUTO</span>
505+
<span
506+
className={ClassNames('director-screen__body__part__auto-icon', {
507+
'director-screen__body__part__auto-icon--notext':
508+
nextSegment === undefined || nextSegment?._id === currentSegment?._id,
509+
})}
510+
>
511+
AUTO
512+
</span>
506513
) : (
507-
<span className="director-screen__body__part__next-icon">NEXT</span>
514+
<span
515+
className={ClassNames('director-screen__body__part__next-icon', {
516+
'director-screen__body__part__next-icon--notext':
517+
nextSegment === undefined || nextSegment?._id === currentSegment?._id,
518+
})}
519+
>
520+
NEXT
521+
</span>
508522
)}
509523
<div className="director-screen__body__part__piece-icon">
510524
<PieceIconContainer
@@ -528,7 +542,7 @@ function DirectorScreenRender({
528542
width: '90vw',
529543
fontFamily: 'Roboto Flex',
530544
fontSize: '1.4em',
531-
minFontWidth: 20,
545+
minFontWidth: 32,
532546
maxFontWidth: 90,
533547
minLetterSpacing: 2,
534548
}}

packages/webui/src/client/ui/util/AdjustLabelFit.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ export const AdjustLabelFit: React.FC<AdjustLabelFitProps> = ({
8282
}) => {
8383
const labelRef = useRef<HTMLSpanElement>(null)
8484
const containerRef = useRef<HTMLDivElement>(null)
85+
// If label is longer than 140 characters, cut it off
86+
if (label.length > 140) {
87+
label = label.slice(0, 137) + '...'
88+
}
8589

8690
// Convert to CSS values:
8791
const widthValue = typeof width === 'number' ? `${width}px` : width

0 commit comments

Comments
 (0)