Conductor fixes (#2189)

* Conductor fixes

- Restore RT update time field;
- Colors tweaked;
- Much better mobile layout;

* Significant fixes in Conductor markup and styling

- Markup/CSS simplified and clearer;
- Better coloring in both Themes;
- Better clarity for axis UI element;
- Fixed hover and focus styles on inputs;
This commit is contained in:
Charles Hacskaylo 2018-10-10 17:03:52 -07:00 committed by Pete Richards
parent 5f9f3cd8e8
commit 88bcb6078e
5 changed files with 150 additions and 118 deletions

View File

@ -27,65 +27,61 @@
<ConductorModeIcon class="c-conductor__mode-icon"></ConductorModeIcon> <ConductorModeIcon class="c-conductor__mode-icon"></ConductorModeIcon>
<div class="c-conductor__start-input"> <div class="c-ctrl-wrapper c-conductor-input c-conductor__start-fixed"
<!-- Start input and controls --> v-if="isFixed">
<div class="c-ctrl-wrapper c-conductor-input c-conductor__start__fixed" <!-- Fixed start -->
v-if="isFixed"> <div class="c-conductor__start-fixed__label">Start</div>
<!-- Fixed input --> <input class="c-input--datetime"
<div class="c-conductor__start__fixed__label">Start</div> type="text" autocorrect="off" spellcheck="false"
<input class="c-input--datetime" ref="startDate"
type="text" autocorrect="off" spellcheck="false" v-model="formattedBounds.start"
ref="startDate" @change="validateBounds('start', $event.target); setBoundsFromView()" />
v-model="formattedBounds.start" <date-picker
@change="validateBounds('start', $event.target); setBoundsFromView()" /> :default-date-time="formattedBounds.start"
<date-picker :formatter="timeFormatter"
:default-date-time="formattedBounds.start" @date-selected="startDateSelected"></date-picker>
:formatter="timeFormatter"
@date-selected="startDateSelected"></date-picker>
</div>
<div class="c-ctrl-wrapper c-conductor-input c-conductor__start__delta"
v-if="!isFixed">
<!-- RT input -->
<div class="c-direction-indicator icon-minus"></div>
<input class="c-input--hrs-min-sec"
type="text" autocorrect="off"
spellcheck="false"
v-model="offsets.start"
@change="validateOffsets($event); setOffsetsFromView()">
</div>
</div> </div>
<div class="c-conductor__end-input"> <div class="c-ctrl-wrapper c-conductor-input c-conductor__start-delta"
<!-- End input and controls --> v-if="!isFixed">
<div class="c-ctrl-wrapper c-conductor-input c-conductor__end__fixed" <!-- RT start -->
v-if="isFixed"> <div class="c-direction-indicator icon-minus"></div>
<!-- Fixed input --> <input class="c-input--hrs-min-sec"
<div class="c-conductor__end__fixed__label">End</div> type="text" autocorrect="off"
<input class="c-input--datetime" spellcheck="false"
type="text" autocorrect="off" spellcheck="false" v-model="offsets.start"
v-model="formattedBounds.end" @change="validateOffsets($event); setOffsetsFromView()">
:disabled="!isFixed" </div>
ref="endDate"
@change="validateBounds('end', $event.target); setBoundsFromView()">
<date-picker
class="c-ctrl-wrapper--menus-left"
:default-date-time="formattedBounds.end"
:formatter="timeFormatter"
@date-selected="endDateSelected"></date-picker>
</div>
<div class="c-ctrl-wrapper c-conductor-input c-conductor__end__delta" <div class="c-ctrl-wrapper c-conductor-input c-conductor__end-fixed">
v-if="!isFixed"> <!-- Fixed end and RT 'last update' display -->
<!-- RT input --> <div class="c-conductor__end-fixed__label">
<div class="c-direction-indicator icon-plus"></div> {{ isFixed ? 'End' : 'Updated' }}
<input class="c-input--hrs-min-sec"
type="text"
autocorrect="off"
spellcheck="false"
v-model="offsets.end"
@change="validateOffsets($event); setOffsetsFromView()">
</div> </div>
<input class="c-input--datetime"
type="text" autocorrect="off" spellcheck="false"
v-model="formattedBounds.end"
:disabled="!isFixed"
ref="endDate"
@change="validateBounds('end', $event.target); setBoundsFromView()">
<date-picker
class="c-ctrl-wrapper--menus-left"
:default-date-time="formattedBounds.end"
:formatter="timeFormatter"
@date-selected="endDateSelected"
v-if="isFixed"></date-picker>
</div>
<div class="c-ctrl-wrapper c-conductor-input c-conductor__end-delta"
v-if="!isFixed">
<!-- RT end -->
<div class="c-direction-indicator icon-plus"></div>
<input class="c-input--hrs-min-sec"
type="text"
autocorrect="off"
spellcheck="false"
v-model="offsets.end"
@change="validateOffsets($event); setOffsetsFromView()">
</div> </div>
<conductor-axis <conductor-axis
@ -112,65 +108,28 @@
grid-row-gap: $interiorMargin; grid-row-gap: $interiorMargin;
align-items: center; align-items: center;
// Default: fixed mode, desktop
grid-template-rows: 1fr 1fr; grid-template-rows: 1fr 1fr;
grid-template-columns: 20px auto 1fr auto; grid-template-columns: 20px auto 1fr auto;
grid-template-areas: grid-template-areas:
"tc-mode-icon tc-start tc-ticks tc-end" "tc-mode-icon tc-start tc-ticks tc-end"
"tc-controls tc-controls tc-controls tc-controls"; "tc-controls tc-controls tc-controls tc-controls";
.c-conductor__end-input {
justify-content: flex-end;
}
body.phone.portrait & {
&.is-fixed-mode {
grid-row-gap: $interiorMargin;
grid-template-rows: auto auto auto;
grid-template-columns: 20px auto;
grid-template-areas:
"tc-mode-icon tc-start"
"tc-mode-icon tc-end"
"tc-mode-icon tc-controls";
.c-conductor {
&__mode-icon {
grid-row: 1;
}
&__ticks,
&__zoom {
display: none;
}
&-input [class*='__label'] {
// Start and end are in separate columns; make the labels line up
width: 40px;
}
&__end-input {
justify-content: flex-start;
}
}
}
}
&__mode-icon { &__mode-icon {
grid-area: tc-mode-icon; grid-area: tc-mode-icon;
} }
&__start-input, &__start-fixed,
&__end-input { &__start-delta {
grid-area: tc-start;
display: flex; display: flex;
} }
&__start-input { &__end-fixed,
grid-area: tc-start; &__end-delta {
}
&__end-input {
grid-area: tc-end; grid-area: tc-end;
display: flex; display: flex;
justify-content: flex-end;
} }
&__ticks { &__ticks {
@ -186,12 +145,68 @@
} }
} }
[class*='__delta'] { [class*='-delta'] {
&:before { &:before {
content: $glyph-icon-clock; content: $glyph-icon-clock;
font-family: symbolsfont; font-family: symbolsfont;
} }
} }
&.is-realtime-mode {
grid-template-columns: 20px auto 1fr auto auto;
grid-template-areas:
"tc-mode-icon tc-start tc-ticks tc-updated tc-end"
"tc-controls tc-controls tc-controls tc-controls tc-controls";
.c-conductor__end-fixed {
grid-area: tc-updated;
}
}
body.phone.portrait & {
grid-row-gap: $interiorMargin;
grid-template-rows: auto auto auto;
grid-template-columns: 20px auto auto;
&__mode-icon {
grid-row: 1;
}
&__ticks,
&__zoom {
display: none;
}
&.is-fixed-mode {
[class*='__start-fixed'],
[class*='__end-fixed'] {
[class*='__label'] {
// Start and end are in separate columns; make the labels line up
width: 30px;
}
}
[class*='__end-input'] {
justify-content: flex-start;
}
grid-template-areas:
"tc-mode-icon tc-start tc-start"
"tc-mode-icon tc-end tc-end"
"tc-mode-icon tc-controls tc-controls";
}
&.is-realtime-mode {
grid-template-areas:
"tc-mode-icon tc-start tc-updated"
"tc-mode-icon tc-end tc-end"
"tc-mode-icon tc-controls tc-controls";
.c-conductor__end-fixed {
justify-content: flex-end;
}
}
}
} }
.c-conductor-input { .c-conductor-input {
@ -215,7 +230,7 @@
} }
input:invalid { input:invalid {
background: rgba($colorFormInvalid, 0.3); background: rgba($colorFormInvalid, 0.5);
} }
} }
@ -235,6 +250,19 @@
color: $colorTime; color: $colorTime;
} }
} }
.c-conductor__end-fixed {
// Displays last RT udpate
color: $colorTime;
input {
// Remove input look
background: none;
box-shadow: none;
color: $colorTime;
pointer-events: none;
}
}
} }
</style> </style>
@ -406,5 +434,3 @@ export default {
} }
} }
</script> </script>

View File

@ -37,6 +37,7 @@
@include bgTicks($c: rgba($colorBodyFg, 0.4)); @include bgTicks($c: rgba($colorBodyFg, 0.4));
background-position: 0 50%; background-position: 0 50%;
background-size: 5px 2px; background-size: 5px 2px;
border-radius: $controlCr;
height: $h; height: $h;
svg { svg {
@ -76,34 +77,37 @@
body.desktop .is-fixed-mode & { body.desktop .is-fixed-mode & {
@include cursorGrab(); @include cursorGrab();
background-size: 3px 30%; background-size: 3px 30%;
border-radius: $controlCr;
background-color: $colorBodyBgSubtle; background-color: $colorBodyBgSubtle;
box-shadow: inset rgba(black, 0.2) 0 1px 1px; box-shadow: inset rgba(black, 0.4) 0 1px 1px;
transition: $transOut;
svg text { svg text {
fill: $colorBodyFg; fill: $colorBodyFg;
stroke: $colorBodyBgSubtle; stroke: $colorBodyBgSubtle;
transition: $transOut;
} }
&:hover, &:hover,
&:active { &:active {
$c: $colorKeySubtle; $c: $colorKeySubtle;
background-color: $c; background-color: $c;
transition: $transIn;
svg text { svg text {
stroke: $c; stroke: $c;
transition: $transIn;
} }
} }
} }
.is-realtime-mode & { .is-realtime-mode & {
$c: 1px solid rgba($colorTime, 0.7);
border-left: $c;
border-right: $c;
svg text { svg text {
fill: $colorTime; fill: $colorTime;
} }
} }
} }
</style> </style>
<script> <script>

View File

@ -73,7 +73,7 @@ $colorOk: #33cc33;
// Base variations // Base variations
$colorBodyBgSubtle: lighten($colorBodyBg, 5%); $colorBodyBgSubtle: lighten($colorBodyBg, 5%);
$colorBodyBgSubtleHov: darken($colorKey, 50%); $colorBodyBgSubtleHov: darken($colorKey, 50%);
$colorKeySubtle: darken($colorKey, 50%); $colorKeySubtle: darken($colorKey, 10%);
// Time Colors // Time Colors
$colorTime: #618cff; $colorTime: #618cff;
@ -152,8 +152,8 @@ $colorFormText: darken($colorBodyFg, 10%);
$colorInputIcon: darken($colorBodyFg, 25%); $colorInputIcon: darken($colorBodyFg, 25%);
$colorFieldHint: lighten($colorBodyFg, 40%); $colorFieldHint: lighten($colorBodyFg, 40%);
$shdwInput: inset rgba(black, 0.4) 0 0 1px; $shdwInput: inset rgba(black, 0.4) 0 0 1px;
$shdwInputHov: inset rgba(black, 0.7) 0 0 1px; $shdwInputHov: inset rgba(black, 0.7) 0 0 2px;
$shdwInputFoc: inset rgba(black, 0.7) 0 0 3px; $shdwInputFoc: inset rgba(black, 0.8) 0 0.25px 3px;
// Inspector // Inspector
$colorInspectorBg: lighten($colorBodyBg, 5%); $colorInspectorBg: lighten($colorBodyBg, 5%);

View File

@ -151,9 +151,9 @@ $colorInputPlaceholder: lighten($colorBodyFg, 20%);
$colorFormText: lighten($colorBodyFg, 10%); $colorFormText: lighten($colorBodyFg, 10%);
$colorInputIcon: lighten($colorBodyFg, 25%); $colorInputIcon: lighten($colorBodyFg, 25%);
$colorFieldHint: darken($colorBodyFg, 40%); $colorFieldHint: darken($colorBodyFg, 40%);
$shdwInput: inset rgba(black, 0.4) 0 0 1px; $shdwInput: inset rgba(black, 0.7) 0 0 1px;
$shdwInputHov: inset rgba(black, 0.7) 0 0 1px; $shdwInputHov: inset rgba(black, 0.7) 0 0 2px;
$shdwInputFoc: inset rgba(black, 0.7) 0 0 3px; $shdwInputFoc: inset rgba(black, 0.8) 0 0.25px 3px;
// Inspector // Inspector
$colorInspectorBg: darken($colorBodyBg, 5%); $colorInspectorBg: darken($colorBodyBg, 5%);

View File

@ -188,13 +188,15 @@
box-shadow: $shdwInput; box-shadow: $shdwInput;
color: $fg; color: $fg;
@include hover() {
box-shadow: $shdwInputHov;
}
&:focus { &:focus {
box-shadow: $shdwInputFoc; box-shadow: $shdwInputFoc;
} }
@include hover() {
&:not(:focus) {
box-shadow: $shdwInputHov;
}
}
} }
@mixin button($bg: $colorBtnBg, $fg: $colorBtnFg, $radius: $controlCr, $shdw: none) { @mixin button($bg: $colorBtnBg, $fg: $colorBtnFg, $radius: $controlCr, $shdw: none) {