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

110 lines
1.7 KiB
Stylus
Raw Normal View History

2014-08-16 21:16:02 +00:00
@import '../shared';
2014-08-15 16:32:49 +00:00
2014-08-15 22:04:51 +00:00
fill-color = number-color
track-color = light
2014-08-15 16:32:49 +00:00
track-size = 1px;
fill-size = 1px;
knob-size = 6px
2014-08-23 23:27:00 +00:00
#container {
height: 100%;
}
2014-08-15 16:32:49 +00:00
#track-container {
2014-08-23 23:27:00 +00:00
height: 100%;
2014-08-15 16:32:49 +00:00
}
#track {
width: 100%;
height: track-size;
border-radius: track-size;
display: inline-block;
position: relative;
2014-08-15 22:04:51 +00:00
background: track-color;
2014-08-15 16:32:49 +00:00
}
#fill {
height: fill-size;
margin-top: ( ( track-size - fill-size ) / 2 );
margin-left: 1px;
border-radius: fill-size;
position: absolute;
2014-08-15 22:04:51 +00:00
background: fill-color;
2014-08-15 16:32:49 +00:00
pointer-events: none;
}
#knob {
width: knob-size;
height: knob-size;
margin-left: -( knob-size / 2 );
margin-top: -( knob-size / 2 );
2014-08-15 22:04:51 +00:00
transition: transform 0.1s ease;
2014-08-15 16:32:49 +00:00
pointer-events: none;
position: absolute;
2014-08-15 22:04:51 +00:00
background-color: fill-color;
2014-08-15 16:32:49 +00:00
border-radius: 100%;
}
#track-container:hover #knob {
2014-08-15 22:04:51 +00:00
transform: scale( 2 )
2014-08-15 16:32:49 +00:00
}
#track-container:active #knob {
2014-08-15 22:04:51 +00:00
transform: scale( 1.5 )
}
2014-08-15 16:32:49 +00:00
2014-08-15 22:04:51 +00:00
// .transition #knob {
// transition: left 0.2s ease, transform 0.1s ease;
// }
2014-08-15 16:32:49 +00:00
2014-08-15 22:04:51 +00:00
// .transition #fill {
// transition: left 0.2s ease, right 0.2s ease, width 0.2s ease;
// }
2014-08-15 16:32:49 +00:00
input {
2014-08-16 21:16:02 +00:00
2014-08-23 07:05:22 +00:00
panel-font()
color: text-color;
2014-08-23 23:27:00 +00:00
height: 100%;
2014-08-15 16:32:49 +00:00
display: inline-block;
background: transparent;
border: 0;
outline: none;
2014-08-21 17:20:06 +00:00
.slider-true & {
2014-08-23 07:05:22 +00:00
text-align: center;
2014-08-21 17:20:06 +00:00
margin-left: padding;
2014-08-23 23:27:00 +00:00
width: 25%;
2014-08-21 17:20:06 +00:00
transition: width 0.2s ease;
&:hover {
2014-08-23 23:27:00 +00:00
width: 33%;
2014-08-21 17:20:06 +00:00
}
&:focus {
width: 50%;
}
2014-08-15 16:32:49 +00:00
2014-08-21 17:20:06 +00:00
}
2014-08-15 16:32:49 +00:00
2014-08-23 07:05:22 +00:00
.slider-false & {
// border-bottom: 1px solid number-color;
2014-08-23 23:27:00 +00:00
width: 100%;
2014-08-23 07:05:22 +00:00
}
2014-08-15 16:32:49 +00:00
}
input::selection {
2014-08-24 06:03:17 +00:00
background-color: number-color;
2014-08-15 16:32:49 +00:00
}