- removed knob pan option (looked too ugly, use css var to hide gauge instead)

- knob/fader/toggle gauge width reduced to 2px, looks slicker
This commit is contained in:
jean-emmanuel 2016-03-25 01:26:13 +01:00
parent f732feff29
commit aed0812b04
8 changed files with 65 additions and 64 deletions

View file

@ -1,5 +1,10 @@
# Changelog
## 0.4.4
- misc
- refining the fader's pip scale that looked choppy on mobile devices. All pips are now evenly spaced, not relatively to the fader's height.
## 0.4.3
- features

File diff suppressed because one or more lines are too long

View file

@ -22,8 +22,6 @@ module.exports.options = {
separator2:'behaviour',
absolute:false,
pan:false,
separator3:'osc',
@ -59,7 +57,6 @@ module.exports.create = function(widgetData,container) {
range = widgetData.range,
unit = widgetData.unit?' '+widgetData.unit.trim(): '',
absolute = widgetData.absolute,
pan = widgetData.pan,
logScale = widgetData.logScale,
roundFactor = Math.pow(10,widgetData.precision)
@ -167,9 +164,6 @@ module.exports.create = function(widgetData,container) {
knob[0].setAttribute('style','transform:rotateZ('+r+'deg)')
handle[0].setAttribute('style','transform:rotateZ('+(r-45)+'deg)')
if (pan && r<135) {mask.removeClass('pan-right').addClass('pan-left')}
else if (pan) {mask.removeClass('pan-left').addClass('pan-right')}
if (r>180) {knob.addClass('d3')}
else if (r>90) {knob.removeClass('d3').addClass('d2')}
else {knob.removeClass('d3 d2')}

View file

@ -1,9 +1,14 @@
.fader-container {
--color-pips: var(--color-text-fade);
--color-gauge: var(--color-accent);
--color-knob: var(--color-accent);
width:100rem;
min-height: 200rem;
height:100%;
--color-pips:var(--color-text-fade);
&.align-right .fader-wrapper {
.fader {
@ -54,7 +59,7 @@
cursor: -webkit-grabbing;
}
.fader {
width:4rem;
width:2rem;
position: relative;
margin:0 auto;
pointer-events: none;
@ -79,7 +84,7 @@
transform-origin: bottom;
max-height:100%;
max-width:100%;
background:var(--color-accent);
background:var(--color-gauge);
z-index: 3;
transform-style: preserve-3d;
backface-visibility: hidden;
@ -96,10 +101,10 @@
content:"";
position: absolute;
top:-4rem;
left:-2rem;
left:-3rem;
height:8rem;
width:8rem;
background:var(--color-accent);
background:var(--color-knob);
border:none!important;
border-radius: 100%!important;
}
@ -107,12 +112,12 @@
content:"";
position: absolute;
top:-10rem;
left:-8rem;
left:-9rem;
height:20rem;
width:20rem;
border:none!important;
border-radius: 100%!important;
background:var(--color-accent);
background:var(--color-knob);
opacity: .2;
}
}
@ -127,7 +132,7 @@
min-height: 0;
border:0;
box-shadow: none;
-webkit-mask:linear-gradient(to right,#000 1rem, rgba(0,0,0,0) 1rem, rgba(0,0,0,0) 27rem, #000 27rem);
-webkit-mask:linear-gradient(to right,#000 1rem, rgba(0,0,0,0) 1rem, rgba(0,0,0,0) 25rem, #000 25rem);
opacity:0.75;
height:auto;
.meter {
@ -196,7 +201,7 @@
overflow: hidden;
.fader-wrapper {
padding:20rem 20rem 35rem;
padding:20rem 20rem 40rem;
display: block;
flex:0;
flex-shrink: 0;
@ -205,7 +210,7 @@
width:100%;
left:auto;
top:50%;
height:4rem;
height:2rem;
&:before {
box-shadow:none;
}
@ -217,12 +222,12 @@
transform-origin: right;
}
span:before {
top:-2rem;
top:-3rem;
right:-4rem;
left:auto;
}
span:after {
top:-8rem;
top:-9rem;
right:-10rem;
left:auto
}

View file

@ -1,6 +1,8 @@
.knob-container {
--color-pips: var(--color-text-fade);
--color-gauge: var(--color-accent);
--color-knob: var(--color-accent);
width: 100rem;
align-items: center;
flex-shrink: 0;
@ -47,34 +49,10 @@
right:0;
bottom:0;
border-radius:100%;
border:4rem solid var(--color-track);
border:2rem solid var(--color-track);
transform: rotate(45deg);
z-index:4;
}
&.pan-left {
&:before {
content:"";
border-left-color: transparent;
border-bottom-color: transparent;
}
.knob:after {
border-color: var(--color-track);
border-left-color: var(--color-accent);
border-top-color: var(--color-accent);
}
}
&.pan-right {
&:before {
content:"";
border-right-color: transparent;
border-top-color: transparent;
}
.knob:after {
border-color: var(--color-track);
border-right-color: var(--color-accent);
border-bottom-color: var(--color-accent);
}
}
&:after {
content:"";
@ -117,16 +95,16 @@
right:0;
bottom:0;
border-radius:100%;
border:4rem solid var(--color-track);
border-bottom-color: var(--color-accent);
border:2rem solid var(--color-track);
border-bottom-color: var(--color-gauge);
}
&.d2:after {
border-right-color: var(--color-accent);
border-right-color: var(--color-gauge);
}
&.d3:after {
border-top-color: var(--color-accent);
border-right-color: var(--color-accent);
border-top-color: var(--color-gauge);
border-right-color: var(--color-gauge);
}
@ -145,11 +123,11 @@
content:"";
position: absolute;
top:50%;
left:-2rem;
margin-top:-4rem;
left:-3rem;
margin-top:-5rem;
height:8rem;
width:8rem;
background:var(--color-accent);
background:var(--color-knob);
border:none!important;
border-radius: 100%!important;
}
@ -157,13 +135,13 @@
content:"";
position: absolute;
top:50%;
margin-top:-10rem;
left:-8rem;
margin-top:-11rem;
left:-9rem;
height:20rem;
width:20rem;
border:none!important;
border-radius: 100%!important;
background:var(--color-accent);
background:var(--color-knob);
opacity: .2;
}
}
@ -172,7 +150,7 @@
}
.pip {
font-size:11rem;
color:var(--color-text);
color:var(--color-pips);
pointer-events: none;
display:inline-block;
&.min {

View file

@ -31,14 +31,14 @@
left:0;
right:0;
bottom:0;
border-bottom:4rem solid var(--color-fg);
border-bottom:2rem solid var(--color-fg);
.light {
position: absolute;
left:4rem;
right:4rem;
top:4rem;
height:4rem;
left:2rem;
right:2rem;
top:2rem;
height:2rem;
pointer-events: none;
background: var(--color-accent);
&:after {

View file

@ -25,6 +25,10 @@ Every widget has the following properties:
**Important note about position (`left` & `top`)** : by default, the widget will be positioned according to the normal flow of the page (from left to right, by order of creation).
## CSS
The css property can be used to override theming variables (see [theming](theming.md) for a widget. Also, some widgets expose specific theming variables that allow a finer customization.
## Widget specifics
Each widget type comes with an additional set of specific properties which are described in the pages listed below.

View file

@ -15,6 +15,14 @@ absolute:false, // [bool] set to true for absolute value on touch/
meter:false, // [bool] set to true to display a vumeter which will display values send to '/widgets_path/meter'
```
**theming vars**
```
--color-gauge:CSS_COLOR;
--color-knob:CSS_COLOR;
--color-pips:CSS_COLOR;
```
## knob
```js
type:'knob',
@ -22,5 +30,12 @@ range: {"min":0,"max":1}, // [object] minimum and maximum values
logScale: false, // [bool] use logarithmic scale (log10)
unit: false, // [string] value suffix
absolute:false, // [bool] set to true for absolute value on touch/click instead of relative dragging
pan:false // [bool] true for panning knob
```
**theming vars**
```
--color-gauge:CSS_COLOR;
--color-knob:CSS_COLOR;
--color-pips:CSS_COLOR;
```