Skip to content

Commit 1a93ba2

Browse files
committed
[Frontend] Styling for TOI element in TC
Fixes #933 Fixes #1193 Final for now; both types of TOI added to TC markup; Hover behavior; constant values in the right places;
1 parent c0a96b3 commit 1a93ba2

File tree

7 files changed

+100
-41
lines changed

7 files changed

+100
-41
lines changed

platform/commonUI/general/res/sass/plots/_plots-main.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@
9191
.l-toi-holder {
9292
//@include test(green);
9393
$cBg: $toiColorBg;
94-
$cBgPinnedOpacity: 0.3;
95-
$cBgPinned: $toiColorBgPinned;
94+
$cBgPinnedOpacity: 0.4;
95+
$cBgPinned: rgba($toiColorBgPinned, 0.4);
9696
pointer-events: none;
9797
position: absolute;
9898
top: 0;

platform/commonUI/themes/espresso/res/sass/_constants.scss

+1-2
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,9 @@ $colorInspectorSectionHeaderFg: pullForward($colorInspectorBg, 40%);
107107
$toiColorBg: #666;
108108
$toiColorBgHov: #999;
109109
$toiColorFg: #fff;
110-
$toiColorBgPinned: rgba($colorKey, 0.4);
110+
$toiColorBgPinned: $colorKey;
111111
$toiColorFgPinned: #fff;
112112

113-
114113
// Status colors, mainly used for messaging and item ancillary symbols
115114
$colorStatusFg: #ccc;
116115
$colorStatusDefault: #ccc;

platform/commonUI/themes/snow/res/sass/_constants.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ $colorInspectorSectionHeaderFg: pullForward($colorInspectorBg, 40%);
105105

106106
// Time of Interest
107107
$toiColorBg: #666;
108-
$toiColorBgHov: #999;
108+
$toiColorBgHov: #333;
109109
$toiColorFg: #fff;
110-
$toiColorBgPinned: rgba($colorKey, 0.4);
110+
$toiColorBgPinned: $colorKey;
111111
$toiColorFgPinned: #fff;
112112

113113
// Status colors, mainly used for messaging and item ancillary symbols

platform/features/conductor-v2/conductor/res/sass/_time-conductor-base.scss

+75-29
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,8 @@
190190
.l-axis-holder {
191191
height: $r1H;
192192
position: absolute;
193-
left: nth($timeCondAxisLROffset,1);
194-
right: nth($timeCondAxisLROffset,2);
193+
left: nth($timeCondAxisLROffset, 1);
194+
right: nth($timeCondAxisLROffset, 2);
195195
svg {
196196
text-rendering: geometricPrecision;
197197
width: 100%;
@@ -220,16 +220,18 @@
220220
.l-page-button,
221221
.l-data-visualization {
222222
position: absolute;
223-
top: 0; bottom: 0;
223+
top: 0;
224+
bottom: 0;
224225
}
225226

226227
.l-page-button {
227228
@if nth($timeCondAxisLROffset, 1) + nth($timeCondAxisLROffset, 2) > 30 {
228229
left: 0;
229-
width: nth($timeCondAxisLROffset,1);
230+
width: nth($timeCondAxisLROffset, 1);
230231
&.align-right {
231-
left: auto; right: 0;
232-
width: nth($timeCondAxisLROffset,2);
232+
left: auto;
233+
right: 0;
234+
width: nth($timeCondAxisLROffset, 2);
233235
}
234236
} @else {
235237
// Hide these if the offsets aren't enough
@@ -241,6 +243,21 @@
241243
background: $colorTimeCondDataVisBg;
242244
left: nth($timeCondAxisLROffset, 1);
243245
right: nth($timeCondAxisLROffset, 2);
246+
&:hover {
247+
// Hide the cursor, because the TOI element essentially "becomes" the cursor
248+
// when the user is hovering over the visualization area.
249+
cursor: none;
250+
.l-toi-holder {
251+
opacity: 1;
252+
}
253+
.l-toi-holder.pinned {
254+
opacity: 0.4;
255+
.l-toi-val {
256+
pointer-events: none;
257+
opacity: 0;
258+
}
259+
}
260+
}
244261
}
245262
}
246263

@@ -254,44 +271,54 @@
254271
}
255272

256273
.l-toi-holder {
257-
$c: $toiColorBg;
274+
$c: $colorTimeCondTOIBg;
258275
$cHov: $toiColorBgHov;
276+
$cPinned: rgba($toiColorBgPinned, 0.8);
277+
$cPinnedHov: $toiColorBgPinned;
259278
$linesVOffset: 2px;
260279
@include transform(translateX(-50%));
261-
top: 0px; bottom: 0px;
280+
@include trans-prop-nice($props: opacity, $dur: 200ms);
281+
color: $c;
282+
opacity: 0; // Hide by default, only show when user hovers over .l-data-visualization
283+
top: 0px;
284+
bottom: 0px;
262285
width: $timeCondTOIIconD;
263-
left: auto; right: auto;
286+
left: auto;
287+
right: auto;
264288
z-index: 1;
265289
&:before,
266290
&:after {
267291
// Vertical lines
268292
content: '';
269293
background-color: $c;
270294
left: 50%;
271-
height: (($r2H - $timeCondTOIIconD)/2) + $linesVOffset; width: 1px;
295+
height: (($r2H - $timeCondTOIIconD)/2) + $linesVOffset;
296+
width: 1px;
272297
z-index: 0;
273298
}
274299

275300
&:before {
276301
@include transform(translate(-50%, $linesVOffset * -1));
277-
top: 0px; bottom: auto;
302+
top: 0px;
303+
bottom: auto;
278304
}
279305

280306
&:after {
281307
@include transform(translate(-50%, $linesVOffset));
282-
top: auto; bottom: 0px;
308+
top: auto;
309+
bottom: 0px;
283310
}
284311

285312
.l-toi {
286313
$d: $timeCondTOIIconD;
287314
@include transform(translate(-50%, -50%));
288-
color: $c;
289315
font-size: $d;
290316
line-height: $d;
291317
text-align: center;
292318
left: 50%;
293319
top: 50%;
294-
height: $d; width: $d;
320+
height: $d;
321+
width: $d;
295322
z-index: 1;
296323
&:before {
297324
@extend .ui-symbol;
@@ -301,7 +328,6 @@
301328

302329
.l-toi-val {
303330
@include transform(translateY(-51%));
304-
display: none; // Only show when TOI is active
305331
font-size: 0.7rem;
306332
position: absolute;
307333
top: 50%;
@@ -316,20 +342,34 @@
316342
}
317343
}
318344

319-
&.s-status-active {
320-
.l-toi-val {
321-
display: block;
345+
&.pinned {
346+
opacity: 1;
347+
z-index: 2; // Get this above a non-pinned instance so user can access the remove "x" button.
348+
&.active {
349+
opacity: 1;
322350
}
323-
}
324-
325-
&:hover {
326351
&:before,
327352
&:after {
328-
background-color: $cHov !important;
353+
// Vertical lines
354+
background-color: $cPinned;
329355
}
330-
.l-toi,
331-
.l-toi-val {
332-
color: $cHov !important;
356+
color: $cPinned;
357+
358+
&:hover {
359+
opacity: 1 !important;
360+
+ .l-toi-holder {
361+
// Important note: the non-pinned TOI element must come after the pinned version in markup.
362+
opacity: 0;
363+
364+
}
365+
}
366+
367+
.l-toi:hover {
368+
color: $cPinnedHov;
369+
cursor: pointer;
370+
&:before {
371+
content: $glyph-icon-x-in-circle;
372+
}
333373
}
334374
}
335375
}
@@ -356,7 +396,9 @@
356396
&.realtime-mode,
357397
&.lad-mode {
358398
.time-conductor-icon {
359-
&:before { color: $colorTimeCondKeyBg; }
399+
&:before {
400+
color: $colorTimeCondKeyBg;
401+
}
360402
div[class*="hand"] {
361403
@include animation-name(clock-hands);
362404
&:before {
@@ -398,13 +440,15 @@
398440

399441
.l-data-visualization {
400442
background: $colorTimeCondDataVisRtBg !important;
401-
//height: $r2HRt;
402443
}
403444

404445
.mode-selector .s-menu-button {
405446
$fg: $colorTimeCondKeyFg;
406447
@include btnSubtle($bg: $colorTimeCondKeyBg, $bgHov: pullForward($colorTimeCondKeyBg, $ltGamma), $fg: $colorTimeCondKeyFg);
407-
&:before { color: $fg !important; };
448+
&:before {
449+
color: $fg !important;
450+
}
451+
;
408452
color: $fg !important;
409453
}
410454
}
@@ -466,7 +510,9 @@
466510
/******************************************************************** MOBILE */
467511

468512
@include phoneandtablet {
469-
.l-time-conductor-holder { min-width: 0 !important; }
513+
.l-time-conductor-holder {
514+
min-width: 0 !important;
515+
}
470516
.super-menu.mini {
471517
width: 200px;
472518
height: 100px;

platform/features/conductor-v2/conductor/res/sass/time-conductor-espresso.scss

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
$colorTimeCondTicks: pullForward($colorBodyBg, 30%);
3535
$colorTimeCondKeyBg: #4e70dc;
3636
$colorTimeCondKeyFg: #fff;
37-
$colorTimeCondDataVisBg: pullForward($colorBodyBg, 10%);
37+
$colorTimeCondDataVisBg: pullForward($colorBodyBg, 5%);
3838
$colorTimeCondDataVisRtBg: pushBack($colorTimeCondKeyBg, 10%);
39+
$colorTimeCondTOIBg: lighten($toiColorBg, 20%);
3940
@import "time-conductor-base";

platform/features/conductor-v2/conductor/res/sass/time-conductor-snow.scss

+2
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,6 @@ $colorTimeCondKeyBg: #6178dc;
3636
$colorTimeCondKeyFg: #fff;
3737
$colorTimeCondDataVisBg: pullForward($colorBodyBg, 10%);
3838
$colorTimeCondDataVisRtBg: pushBack($colorTimeCondKeyBg, 30%);
39+
$colorTimeCondTOIBg: darken($toiColorBg, 20%);
40+
$colorTimeCondTOIBgHov: $toiColorBg;
3941
@import "time-conductor-base";

platform/features/conductor-v2/conductor/res/templates/time-conductor.html

+16-5
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,22 @@
9898
<div class="l-data-visualization-holder l-row-elem flex-elem">
9999
<a class="l-page-button s-icon-button icon-pointer-left"></a>
100100
<div class="l-data-visualization">
101-
102-
<!-- val-to-right should be applied when l-toi-holder left < 160px -->
103-
<div class="l-toi-holder slidable horz"
104-
ng-class="{ 's-status-active':true, 'val-to-right': false }"
105-
style="left: 100%">
101+
<!-- Note:
102+
- val-to-right should be applied when l-toi-holder left < 160px
103+
- The pinned TOI must precede the non-pinned version in markup,
104+
so that we can hide the non-pinned TOI when hovering over the pinned one.
105+
-->
106+
<div class="l-toi-holder horz pinned"
107+
ng-show="true"
108+
ng-class="{ 'active': false, 'val-to-right': true }"
109+
ng-click="this.active = false"
110+
style="left: 5%">
111+
<div class="l-toi s-toi"></div>
112+
<div class="l-toi-val">2016-09-15 21:31:30.000Z</div>
113+
</div>
114+
<div class="l-toi-holder horz"
115+
ng-class="{ 'val-to-right': false }"
116+
style="left: 75%">
106117
<div class="l-toi s-toi"></div>
107118
<div class="l-toi-val">2016-09-15 21:31:30.000Z</div>
108119
</div>

0 commit comments

Comments
 (0)