Skip to content

Commit b3a4f52

Browse files
committed
[Frontend] Styling for Time Conductor v2
Fixes #933 WIP: Adding zoom control with HTML5 input range type; Refactored sass slightly to move display: inline-block out of mixin containerBase and into .s-btn.
1 parent 671e301 commit b3a4f52

File tree

7 files changed

+61
-8
lines changed

7 files changed

+61
-8
lines changed

platform/commonUI/general/res/sass/_archetypes.scss

+3
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@
108108
&.grows {
109109
@include flex(1 1 auto);
110110
}
111+
&.contents-align-right {
112+
text-align: right;
113+
}
111114
}
112115
.flex-container {
113116
// Apply to wrapping elements, mct-includes, etc.

platform/commonUI/general/res/sass/_mixins.scss

-7
Original file line numberDiff line numberDiff line change
@@ -185,21 +185,15 @@
185185
}
186186

187187
@mixin sliderTrack($bg: $scrollbarTrackColorBg) {
188-
//$b: 1px solid lighten($bg, 30%);
189188
border-radius: 2px;
190189
box-sizing: border-box;
191190
@include boxIncised(0.7);
192191
background-color: $bg;
193-
//border-bottom: $b;
194-
//border-right: $b;
195192
}
196193

197194
@mixin controlGrippy($b, $direction: horizontal, $w: 1px, $style: dotted) {
198-
//&:before {
199-
//@include trans-prop-nice("border-color", 25ms);
200195
content: '';
201196
display: block;
202-
//height: auto;
203197
pointer-events: none;
204198
position: absolute;
205199
z-index: 2;
@@ -305,7 +299,6 @@
305299
border-radius: $controlCr;
306300
box-sizing: border-box;
307301
color: $fg;
308-
display: inline-block;
309302
}
310303

311304
@mixin btnBase($bg: $colorBodyBg, $bgHovColor: none, $fg: $colorBodyFg, $ic: $colorBtnIcon) {

platform/commonUI/general/res/sass/controls/_buttons.scss

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ $pad: $interiorMargin * $baseRatio;
3333

3434
.s-btn {
3535
box-sizing: border-box;
36+
display: inline-block;
3637
padding: 0 $pad;
3738
font-size: 0.7rem;
3839
vertical-align: top;

platform/commonUI/general/res/sass/controls/_controls.scss

+39
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,45 @@ input[type="search"] {
420420
}
421421
}
422422

423+
@mixin sliderKnob() {
424+
$h: 16px;
425+
cursor: pointer;
426+
width: floor($h/1.75);
427+
height: $h;
428+
margin-top: 1 + floor($h/2) * -1;
429+
@include btnSubtle(pullForward($colorBtnBg, 10%));
430+
//border-radius: 50% !important;
431+
}
432+
433+
input[type="range"] {
434+
// HTML5 range inputs
435+
436+
-webkit-appearance: none; /* Hides the slider so that custom slider can be made */
437+
background: transparent; /* Otherwise white in Chrome */
438+
&:focus {
439+
outline: none; /* Removes the blue border. You should probably do some kind of focus styling for accessibility reasons though. */
440+
}
441+
442+
// Thumb
443+
&::-webkit-slider-thumb {
444+
-webkit-appearance: none;
445+
@include sliderKnob();
446+
}
447+
&::-moz-range-thumb {
448+
@include sliderKnob();
449+
}
450+
&::-ms-thumb {
451+
@include sliderKnob();
452+
}
453+
454+
// Track
455+
&::-webkit-slider-runnable-track {
456+
width: 100%;
457+
height: 3px;
458+
@include sliderTrack();
459+
}
460+
}
461+
423462
/******************************************************** DATETIME PICKER */
424463
.l-datetime-picker {
425464
$r1H: 15px;

platform/commonUI/general/res/sass/controls/_time-conductor.scss

+11-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
height: $d !important;
2121
width: $d;
2222
position: relative;
23+
2324
// Icon shape: brackets
2425
&:before,
2526
&:after {
@@ -76,7 +77,6 @@
7677
z-index: 1;
7778
@include animation-duration(1s);
7879
&:before {
79-
//background: green;
8080
height: $handH;
8181
}
8282
}
@@ -181,13 +181,15 @@
181181
font-size: 0.9em;
182182
}
183183
path {
184+
// Line beneath ticks
184185
display: none;
185186
}
186187
line {
187188
// Tick marks
188189
stroke: $c;
189190
}
190191
text {
192+
// Tick labels
191193
fill: $c;
192194
}
193195
}
@@ -199,7 +201,15 @@
199201
}
200202

201203
.l-time-conductor-controls {
204+
align-items: center;
202205
margin-top: $interiorMargin;
206+
.time-conductor-zoom {
207+
//@include test();
208+
min-width: 100px;
209+
height: $r3H;
210+
width: 25%;
211+
}
212+
203213
}
204214
// Fixed
205215
&.fixed-mode {

platform/commonUI/general/res/sass/user-environ/_layout.scss

+2
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@
129129
}
130130

131131
.primary-pane {
132+
// Clip element that have min-widths
133+
overflow: hidden;
132134
// Need to lift up this pane to ensure that 'collapsed' panes don't block user interactions
133135
z-index: 4;
134136
}

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

+5
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@
104104
{name: 'SCLK', key:'sclk', glyph:'\u0043'}
105105
]}">
106106
</mct-control>
107+
<!-- Zoom control -->
108+
<div class="l-time-conductor-zoom-w grows flex-elem contents-align-right">
109+
<input class="time-conductor-zoom" type="range" />
110+
</div>
107111
</div>
112+
108113
</div>
109114
</div>

0 commit comments

Comments
 (0)