dat.gui/elements/controller-number/controller-number.styl

104 lines
1.6 KiB
Stylus
Raw Normal View History

2014-09-03 16:52:28 +00:00
@import '../shared/shared';
2014-08-27 00:01:15 +00:00
track-size = 1px;
fill-size = 1px;
knob-size = 6px
#container {
height: 100%;
}
#track-container {
height: 100%;
2014-09-02 17:13:35 +00:00
padding: 0 padding;
2014-08-27 00:01:15 +00:00
}
#track {
width: 100%;
height: track-size;
border-radius: track-size;
display: inline-block;
position: relative;
2014-09-02 17:13:35 +00:00
background: light;
2014-08-27 00:01:15 +00:00
}
#fill {
height: fill-size;
margin-top: ( ( track-size - fill-size ) / 2 );
margin-left: 1px;
border-radius: fill-size;
position: absolute;
2014-09-02 17:13:35 +00:00
background: number-color;
2014-08-27 00:01:15 +00:00
pointer-events: none;
}
#knob {
width: knob-size;
height: knob-size;
margin-left: -( knob-size / 2 );
margin-top: -( knob-size / 2 );
transition: transform 0.1s ease;
pointer-events: none;
position: absolute;
2014-09-02 17:13:35 +00:00
background-color: number-color;
2014-08-27 00:01:15 +00:00
border-radius: 100%;
}
#track-container:hover #knob {
transform: scale( 2 )
}
#track-container:active #knob {
transform: scale( 1.5 )
}
// .transition #knob {
// transition: left 0.2s ease, transform 0.1s ease;
// }
// .transition #fill {
// transition: left 0.2s ease, right 0.2s ease, width 0.2s ease;
// }
input {
2014-09-03 16:52:28 +00:00
color: number-color;
2014-08-27 00:01:15 +00:00
.slider-true & {
text-align: center;
2014-09-03 16:16:11 +00:00
width: 33%;
2014-08-27 00:01:15 +00:00
transition: width 0.2s ease;
padding: 0;
&:hover {
2014-09-03 16:16:11 +00:00
width: 40%;
2014-08-27 00:01:15 +00:00
}
&:focus {
width: 50%;
}
}
.slider-false & {
// border-bottom: 1px solid number-color;
2014-09-02 17:13:35 +00:00
padding-left: padding
2014-08-27 00:01:15 +00:00
width: 100%;
}
}
input::selection {
2014-09-02 17:13:35 +00:00
background-color: light;
2014-08-27 00:01:15 +00:00
}