[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.
This commit is contained in:
Charles Hacskaylo 2016-07-14 18:30:49 -07:00
parent 671e3016d4
commit b3a4f52fe2
7 changed files with 61 additions and 8 deletions

View File

@ -108,6 +108,9 @@
&.grows { &.grows {
@include flex(1 1 auto); @include flex(1 1 auto);
} }
&.contents-align-right {
text-align: right;
}
} }
.flex-container { .flex-container {
// Apply to wrapping elements, mct-includes, etc. // Apply to wrapping elements, mct-includes, etc.

View File

@ -185,21 +185,15 @@
} }
@mixin sliderTrack($bg: $scrollbarTrackColorBg) { @mixin sliderTrack($bg: $scrollbarTrackColorBg) {
//$b: 1px solid lighten($bg, 30%);
border-radius: 2px; border-radius: 2px;
box-sizing: border-box; box-sizing: border-box;
@include boxIncised(0.7); @include boxIncised(0.7);
background-color: $bg; background-color: $bg;
//border-bottom: $b;
//border-right: $b;
} }
@mixin controlGrippy($b, $direction: horizontal, $w: 1px, $style: dotted) { @mixin controlGrippy($b, $direction: horizontal, $w: 1px, $style: dotted) {
//&:before {
//@include trans-prop-nice("border-color", 25ms);
content: ''; content: '';
display: block; display: block;
//height: auto;
pointer-events: none; pointer-events: none;
position: absolute; position: absolute;
z-index: 2; z-index: 2;
@ -305,7 +299,6 @@
border-radius: $controlCr; border-radius: $controlCr;
box-sizing: border-box; box-sizing: border-box;
color: $fg; color: $fg;
display: inline-block;
} }
@mixin btnBase($bg: $colorBodyBg, $bgHovColor: none, $fg: $colorBodyFg, $ic: $colorBtnIcon) { @mixin btnBase($bg: $colorBodyBg, $bgHovColor: none, $fg: $colorBodyFg, $ic: $colorBtnIcon) {

View File

@ -33,6 +33,7 @@ $pad: $interiorMargin * $baseRatio;
.s-btn { .s-btn {
box-sizing: border-box; box-sizing: border-box;
display: inline-block;
padding: 0 $pad; padding: 0 $pad;
font-size: 0.7rem; font-size: 0.7rem;
vertical-align: top; vertical-align: top;

View File

@ -420,6 +420,45 @@ input[type="search"] {
} }
} }
@mixin sliderKnob() {
$h: 16px;
cursor: pointer;
width: floor($h/1.75);
height: $h;
margin-top: 1 + floor($h/2) * -1;
@include btnSubtle(pullForward($colorBtnBg, 10%));
//border-radius: 50% !important;
}
input[type="range"] {
// HTML5 range inputs
-webkit-appearance: none; /* Hides the slider so that custom slider can be made */
background: transparent; /* Otherwise white in Chrome */
&:focus {
outline: none; /* Removes the blue border. You should probably do some kind of focus styling for accessibility reasons though. */
}
// Thumb
&::-webkit-slider-thumb {
-webkit-appearance: none;
@include sliderKnob();
}
&::-moz-range-thumb {
@include sliderKnob();
}
&::-ms-thumb {
@include sliderKnob();
}
// Track
&::-webkit-slider-runnable-track {
width: 100%;
height: 3px;
@include sliderTrack();
}
}
/******************************************************** DATETIME PICKER */ /******************************************************** DATETIME PICKER */
.l-datetime-picker { .l-datetime-picker {
$r1H: 15px; $r1H: 15px;

View File

@ -20,6 +20,7 @@
height: $d !important; height: $d !important;
width: $d; width: $d;
position: relative; position: relative;
// Icon shape: brackets // Icon shape: brackets
&:before, &:before,
&:after { &:after {
@ -76,7 +77,6 @@
z-index: 1; z-index: 1;
@include animation-duration(1s); @include animation-duration(1s);
&:before { &:before {
//background: green;
height: $handH; height: $handH;
} }
} }
@ -181,6 +181,7 @@
font-size: 0.9em; font-size: 0.9em;
} }
path { path {
// Line beneath ticks
display: none; display: none;
} }
line { line {
@ -188,6 +189,7 @@
stroke: $c; stroke: $c;
} }
text { text {
// Tick labels
fill: $c; fill: $c;
} }
} }
@ -199,7 +201,15 @@
} }
.l-time-conductor-controls { .l-time-conductor-controls {
align-items: center;
margin-top: $interiorMargin; margin-top: $interiorMargin;
.time-conductor-zoom {
//@include test();
min-width: 100px;
height: $r3H;
width: 25%;
}
} }
// Fixed // Fixed
&.fixed-mode { &.fixed-mode {

View File

@ -129,6 +129,8 @@
} }
.primary-pane { .primary-pane {
// Clip element that have min-widths
overflow: hidden;
// Need to lift up this pane to ensure that 'collapsed' panes don't block user interactions // Need to lift up this pane to ensure that 'collapsed' panes don't block user interactions
z-index: 4; z-index: 4;
} }

View File

@ -104,6 +104,11 @@
{name: 'SCLK', key:'sclk', glyph:'\u0043'} {name: 'SCLK', key:'sclk', glyph:'\u0043'}
]}"> ]}">
</mct-control> </mct-control>
<!-- Zoom control -->
<div class="l-time-conductor-zoom-w grows flex-elem contents-align-right">
<input class="time-conductor-zoom" type="range" />
</div>
</div> </div>
</div> </div>
</div> </div>