widgets: add encoder
This commit is contained in:
parent
2e7444ae32
commit
b978d4b9fe
3 changed files with 31 additions and 3 deletions
|
|
@ -2,6 +2,7 @@ var widgets = {
|
|||
// sliders
|
||||
fader: require('./widgets/sliders/fader'),
|
||||
knob: require('./widgets/sliders/knob'),
|
||||
encoder: require('./widgets/sliders/encoder'),
|
||||
|
||||
// buttons
|
||||
toggle: require('./widgets/buttons/toggle'),
|
||||
|
|
@ -42,7 +43,7 @@ var widgets = {
|
|||
}
|
||||
|
||||
module.exports.categories = {
|
||||
'Sliders':['fader','knob'],
|
||||
'Sliders':['fader','knob', 'encoder'],
|
||||
'Buttons':['toggle','push','switch'],
|
||||
'Pads':['xy','rgb','multixy'],
|
||||
'Matrices':['multifader','multitoggle','multipush', 'keyboard'],
|
||||
|
|
|
|||
|
|
@ -142,8 +142,9 @@ module.exports = class Knob extends _sliders_base {
|
|||
|
||||
this.minDimension = Math.min(this.width, this.height)
|
||||
this.gaugeWidth = this.minDimension / 8
|
||||
|
||||
if (this.widgetData.compact) {
|
||||
this.canvas[0].style.top = this.input[0].style.marginTop = (this.minDimension) * this.lostHeightFactor - this.gaugeWidth / 4 + 'px'
|
||||
this.canvas[0].style.top = this.input[0].style.marginTop = (this.minDimension) * this.lostHeightFactor - (this.widgetData.label === false ? 0 : this.gaugeWidth / 4) + 'px'
|
||||
} else {
|
||||
this.canvas[0].style.top = Math.min((this.minDimension) * this.lostHeightFactor - this.margin * PXSCALE / 2, this.input.outerHeight() * .5) + 'px'
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
.knob-container {
|
||||
.knob-container, .encoder-container {
|
||||
--color-pips: var(--color-text-fade);
|
||||
--color-gauge: var(--color-custom);
|
||||
--color-knob: var(--color-custom);
|
||||
|
|
@ -8,6 +8,7 @@
|
|||
height: 120rem;
|
||||
align-items: center;
|
||||
flex-shrink: 0;
|
||||
|
||||
}
|
||||
|
||||
.knob {
|
||||
|
|
@ -53,3 +54,28 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.encoder {
|
||||
--color-gauge: transparent;
|
||||
|
||||
height:100%;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
position: relative;
|
||||
|
||||
.wrapper {
|
||||
overflow: hidden;
|
||||
flex:1;
|
||||
max-height: 100%;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.input {
|
||||
// display: none;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue