Hotfix/4.0.2 (#64)

* hotfix 4.0.2: implement playback router
* hotfix 4.0.2: fix studio clock styles
* hotfix 4.0.2: broadcast clock always
* hotfix 4.0.2: fix overflow in timer control
This commit is contained in:
Carlos Valente
2021-12-14 22:39:01 +01:00
committed by GitHub
parent 3582ce18e1
commit 52f02f153c
10 changed files with 87 additions and 79 deletions
@@ -6,13 +6,13 @@ import {formatDisplay} from "../../../common/utils/dateConfig";
import {formatEventList, trimEventlist} from "../../../common/utils/eventsManager";
export default function StudioClock(props) {
const { title, time, backstageEvents, selectedId, nextId, onAir } = props;
const { fontSize, ref } = useFitText({maxFontSize:500});
const [hoursNow, minutesNow] = time.clockNoSeconds.split(':');
const {title, time, backstageEvents, selectedId, nextId, onAir} = props;
const {fontSize, ref} = useFitText({maxFontSize: 500});
const [, , secondsNow] = time.clock.split(':');
const [schedule, setSchedule] = useState([]);
const hoursIndicators = [...Array(12).keys()];
const minutesIndicators = [...Array(60).keys()];
const activeIndicators = [...Array(12).keys()];
const secondsIndicators = [...Array(60).keys()];
const MAX_TITLES = 8;
// Set window title
@@ -35,35 +35,35 @@ export default function StudioClock(props) {
return (
<div className={style.container}>
<NavLogo />
<NavLogo/>
<div className={style.clockContainer}>
<div className={style.time}>{time.clockNoSeconds}</div>
<div
ref={ref}
className={style.nextTitle}
style={{fontSize, height:'100px', width:'100%', maxWidth:'680px'}}
style={{fontSize, height: '100px', width: '100%', maxWidth: '680px'}}
>
{title.titleNext}
</div>
<div className={time.running > 0 ? style.nextCountdown: style.nextCountdown__overtime}>
{selectedId != null && formatDisplay(time.running)}
</div>
<div className={time.running > 0 ? style.nextCountdown : style.nextCountdown__overtime}>
{selectedId != null && formatDisplay(time.running)}
</div>
<div className={style.indicators}>
{hoursIndicators.map(i => (
{activeIndicators.map(i => (
<div
key = {i}
className={i <= hoursNow ? style.hours__active : style.hours}
key={i}
className={style.hours__active}
style={{
transform: `rotate(${360/12*i-90}deg) translateX(380px)`
transform: `rotate(${360 / 12 * i - 90}deg) translateX(380px)`
}}/>
)
)}
{minutesIndicators.map(i => (
{secondsIndicators.map(i => (
<div
key={i}
className={i <= minutesNow ? style.min__active : style.min}
className={i <= secondsNow ? style.min__active : style.min}
style={{
transform: `rotate(${360/60*i-90}deg) translateX(415px)`
transform: `rotate(${360 / 60 * i - 90}deg) translateX(415px)`
}}/>
)
)}
@@ -75,9 +75,9 @@ export default function StudioClock(props) {
<ul>
{schedule.map((s) => (
<li key={s.id} className={s.isNow ? style.now : s.isNext ? style.next : ''}>
<div className={s.isNow ? style.decorator__active : s.isNext ? style.decorator__next : style.decorator}/>{`${s.time} ${s.title}`}
{`${s.time} ${s.title}`}
</li>
))
))
}
</ul>
</div>
@@ -11,7 +11,7 @@
height: 100vh;
padding: 1vw;
background: #111;
background: #000;
display: grid;
grid-template-columns: 1000px 1fr;
@@ -26,7 +26,7 @@
$size-min: 18px;
$half-min: 9px;
$red-active: #c53030;
$red-idle: darken($red-active, 30%);
$red-idle: #300000;
$cyan-active: #0ff;
$cyan-idle: #0aa;
@@ -46,9 +46,8 @@
.time {
margin-top: 175px;
color: $red-active;
font-size: 275px;
font-size: 300px;
line-height: 0.8em;
text-shadow: rgb(180,0,0) 0 0 20px;
}
.nextTitle:after,
.nextCountdown:after,
@@ -118,13 +117,11 @@
font-family: digital-clock, monospace;
text-transform: uppercase;
.onAir,
.onAir__idle{
padding-bottom: 50px;
font-size: 190px;
font-size: 170px;
line-height: 0.9em;
letter-spacing: 0.05em;
}
.onAir {
color: $red-active;
@@ -148,30 +145,10 @@
gap: 20px;
}
.now {
color: $cyan-active;
text-shadow: rgb(0,100,100) 0 0 20px;
color: $red-active;
}
.next {
color: $red-active;
text-shadow: rgb(100,0,0) 0 0 20px;
}
.decorator,
.decorator__active,
.decorator__next {
aspect-ratio: 1;
border-radius: 50%;
background: $red-idle;
min-height: $size-hours;
max-height: $size-hours;
width: $size-hours;
}
.decorator__active {
background: $cyan-active;
box-shadow: 0 0 10px 2px rgba(0,255,255,0.25);
}
.decorator__next{
background: $red-active;
box-shadow: 0 0 10px 2px rgba(255,0,0,0.25);
color: $cyan-active;
}
}
}