style: user feedback tweaks

This commit is contained in:
cv
2023-09-02 12:50:11 +02:00
parent 6417a99281
commit 5ac95b7f80
5 changed files with 97 additions and 82 deletions
@@ -22,13 +22,3 @@
.spacer { .spacer {
min-height: 95vh; min-height: 95vh;
} }
@mixin block() {
width: 100%;
padding: 0.25rem 0.5rem;
// tablet
@media (min-width: $min-tablet) {
padding: 0.25rem 1rem;
}
}
@@ -31,12 +31,8 @@
// tablet // tablet
@media (min-width: $min-tablet) { @media (min-width: $min-tablet) {
.followButton { .followButton {
font-size: 1.5rem; font-size: 1.25rem;
gap: 1rem; gap: 1rem;
padding: 0.25rem 1rem; padding: 0.25rem 1rem;
&:not(.hidden) {
bottom: 12.5rem;
}
} }
} }
@@ -1,8 +1,16 @@
@use '../../../../src/theme/ontimeColours' as *; @use '../../../../src/theme/ontimeColours' as *;
@import '../Operator.module.scss'; @use '../../../../src/theme/v2Styles' as *;
.block { .block {
@include block(); width: 100%;
padding: 0.25rem 0.5rem;
background-color: $gray-1350; background-color: $gray-1350;
font-size: 1.25rem; font-size: 1.25rem;
} }
// tablet
@media (min-width: $min-tablet) {
.block {
padding: 0.25rem 1rem;
}
}
@@ -2,11 +2,29 @@
@use '../../../../src/theme/ontimeColours' as *; @use '../../../../src/theme/ontimeColours' as *;
@import '../Operator.module.scss'; @import '../Operator.module.scss';
@mixin clock-size {
font-size: calc(1rem - 2px);
@media (min-width: $min-tablet) {
font-size: 1rem;
}
}
.event { .event {
@include block();
background-color: $gray-1300;
opacity: 1; opacity: 1;
border-top: 1px solid $white-1; border-top: 1px solid $white-1;
padding-right: 0.5rem;
color: $white-90;
background-color: $gray-1300;
display: grid;
align-items: center;
grid-template-columns: 1.25rem 1fr auto;
grid-template-rows: auto auto auto;
column-gap: 0.5rem;
grid-template-areas:
"binder main schedule"
"binder secondary running"
"binder fields fields";
&.subscribed { &.subscribed {
background-color: $gray-1250; background-color: $gray-1250;
@@ -23,47 +41,61 @@
} }
} }
.titles { .binder {
display: flex; grid-area: binder;
align-items: center; color: $section-white;
justify-content: space-between; height: 100%;
display: grid;
.title { place-content: center;
font-size: 1.5rem; position: relative;
letter-spacing: 0.5px; background-color: $gray-1050; // to override inline
color: $ui-white;
}
.cue { .cue {
font-size: 1rem; white-space: nowrap;
background-color: $gray-1050; // to override inline overflow: hidden;
padding: 0 0.5rem; text-overflow: ellipsis;
text-align: center; text-align: center;
border-radius: $component-border-radius-sm; width: 6em;
rotate: -90deg;
letter-spacing: 0.5px;
} }
} }
.times { .mainField {
display: flex; grid-area: main;
align-items: center; font-size: 1.5rem;
justify-content: space-between; letter-spacing: 0.5px;
font-size: calc(1rem - 1px); color: $ui-white;
color: $white-90; }
.runtime { .secondaryField {
display: flex; grid-area: secondary;
align-items: center; font-size: 1.25rem;
gap: 0.25rem; letter-spacing: 0.5px;
} }
.schedule {
@include clock-size;
grid-area: schedule;
justify-self: end;
}
.running {
@include clock-size;
grid-area: running;
justify-self: end;
} }
.fields { .fields {
grid-area: fields;
font-size: 1.25rem; font-size: 1.25rem;
font-weight: 600; font-weight: 400;
color: $ui-black; color: $ui-black;
margin-top: 0.25rem; margin: 0.25rem 0;
.field { .field {
font-weight: 600;
padding: 0 0.25rem; padding: 0 0.25rem;
background-color: $orange-600; background-color: $orange-600;
margin-right: 0.5rem; margin-right: 0.5rem;
@@ -72,17 +104,8 @@
.value { .value {
color: $orange-500 color: $orange-500
} }
letter-spacing: 0.5px;
height: fit-content;
transition-property: height;
transition-duration: $transition-time-feedback;
} }
// tablet .fields::after {
@media (min-width: $min-tablet) { content: '\200b';
.times { }
font-size: 1rem;
}
}
@@ -1,4 +1,4 @@
import { RefObject } from 'react'; import { MutableRefObject } from 'react';
import { OntimeEvent, UserFields } from 'ontime-types'; import { OntimeEvent, UserFields } from 'ontime-types';
import DelayIndicator from '../../../common/components/delay-indicator/DelayIndicator'; import DelayIndicator from '../../../common/components/delay-indicator/DelayIndicator';
@@ -16,7 +16,7 @@ interface OperatorEventProps {
subscribedAlias: string; subscribedAlias: string;
showSeconds: boolean; showSeconds: boolean;
isPast: boolean; isPast: boolean;
selectedRef?: RefObject<HTMLDivElement>; selectedRef?: MutableRefObject<HTMLDivElement>;
} }
// extract this to contain re-renders // extract this to contain re-renders
@@ -43,31 +43,29 @@ export default function OperatorEvent(props: OperatorEventProps) {
return ( return (
<div className={operatorClasses} ref={selectedRef}> <div className={operatorClasses} ref={selectedRef}>
<div className={style.titles}> <div className={style.binder} style={{ ...cueColours }}>
<span className={style.title}> <span className={style.cue}>{cue}</span>
{data.title} - {data.subtitle}
</span>
<span className={style.cue} style={{ ...cueColours }}>
{cue}
</span>
</div> </div>
<div className={style.times}> <span className={style.mainField}>{data.title}</span>
<span className={style.schedule}> <span className={style.schedule}>
{start} - {end} {start} - {end}
</span> </span>
<span className={style.runtime}>
<DelayIndicator delayValue={data.delay} />
{isSelected ? <RollingTime /> : formatTime(data.duration, { showSeconds: true, format: 'hh:mm:ss' })}
</span>
</div>
{subscribedData && ( <span className={style.secondaryField}>{data.subtitle}</span>
<div className={style.fields}> <span className={style.running}>
{subscribedAlias && <span className={style.field}>{`${subscribedAlias}`}</span>} <DelayIndicator delayValue={data.delay} />
<span className={style.value}>{subscribedData}</span> {isSelected ? <RollingTime /> : formatTime(data.duration, { showSeconds: true, format: 'hh:mm:ss' })}
</div> </span>
)}
<div className={style.fields}>
{subscribedData && (
<>
<span className={style.field}>{subscribedAlias}</span>
<span className={style.value}>{subscribedData}</span>
</>
)}
</div>
</div> </div>
); );
} }