better fader & meter design
This commit is contained in:
parent
372c0dffca
commit
7687a2db23
8 changed files with 2322 additions and 2231 deletions
File diff suppressed because one or more lines are too long
|
|
@ -16,7 +16,7 @@ module.exports.options = {
|
|||
top:'auto',
|
||||
width:'auto',
|
||||
height:'auto',
|
||||
align:'center',
|
||||
alignRight:false,
|
||||
horizontal:false,
|
||||
noPip:false,
|
||||
compact:false,
|
||||
|
|
@ -65,9 +65,8 @@ module.exports.create = function(widgetData,container) {
|
|||
|
||||
if (widgetData.horizontal) {
|
||||
container.addClass('horizontal')
|
||||
delete widgetData.align
|
||||
} else {
|
||||
container.addClass('align-'+widgetData.align)
|
||||
if (widgetData.alignRight) container.addClass('align-right')
|
||||
}
|
||||
|
||||
if (widgetData.compact) container.addClass('compact')
|
||||
|
|
@ -128,8 +127,6 @@ module.exports.create = function(widgetData,container) {
|
|||
|
||||
var piptext = `<span>${Math.abs(pipTexts[i])>=1000?pipTexts[i]/1000+'k':pipTexts[i]}</span>`
|
||||
|
||||
if (dimension=='height') piptext = piptext+ piptext
|
||||
|
||||
var add = `
|
||||
<div class="pip val" style="${pos}:${i}%">${piptext}</div>
|
||||
`
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ module.exports.create = function(widgetData,container) {
|
|||
axe = dimension=='height'?'X':'Y'
|
||||
|
||||
|
||||
if (widgetData.horizontal) level.addClass('horizontal')
|
||||
if (widgetData.horizontal) widget.addClass('horizontal')
|
||||
|
||||
|
||||
var rangeKeys = [],
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -12,28 +12,29 @@
|
|||
|
||||
&.align-right .fader-wrapper {
|
||||
.fader {
|
||||
margin-left:calc(50% + 15rem);
|
||||
&:before {
|
||||
box-shadow: 20rem 0 0 35rem;
|
||||
}
|
||||
margin-left:calc(50% + 10rem);
|
||||
}
|
||||
.meter-container {
|
||||
-webkit-mask:none!important;
|
||||
right:auto!important;
|
||||
width:1rem;
|
||||
right:auto;
|
||||
left:-13rem!important;
|
||||
}
|
||||
.pips {
|
||||
margin-left: -20rem;
|
||||
.pip {
|
||||
right:0;
|
||||
left:auto;
|
||||
span {
|
||||
right:3rem;
|
||||
left:auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
&.align-left .fader-wrapper {
|
||||
.fader {
|
||||
margin-right:calc(50% + 15rem);
|
||||
&:before {
|
||||
box-shadow: -20rem 0 0 35rem;
|
||||
}
|
||||
}
|
||||
|
||||
&.align-right.compact .fader-wrapper-outer .fader-wrapper .fader{
|
||||
.meter-container {
|
||||
-webkit-mask:none!important;
|
||||
left:auto!important;
|
||||
width:1rem;
|
||||
left:0!important;
|
||||
right: auto!important;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -72,16 +73,10 @@
|
|||
display: none;
|
||||
}
|
||||
.meter-container {
|
||||
-webkit-mask:none!important;
|
||||
width:3rem;
|
||||
border-left:1rem solid var(--color-bg);
|
||||
background: var(--color-track);
|
||||
left:auto;
|
||||
right:0;
|
||||
top:-1rem;
|
||||
.meter {
|
||||
background: none;
|
||||
}
|
||||
right:0!important;
|
||||
left: auto!important;
|
||||
width:3rem;;
|
||||
top:-2rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -112,6 +107,8 @@
|
|||
width:2rem;
|
||||
position: relative;
|
||||
margin:0 auto;
|
||||
margin-right:calc(50% + 15rem);
|
||||
|
||||
pointer-events: none;
|
||||
flex:1;
|
||||
&:before {
|
||||
|
|
@ -171,21 +168,18 @@
|
|||
.meter-container {
|
||||
position: absolute;
|
||||
z-index: 2;
|
||||
left:-12rem;
|
||||
right:-12rem;
|
||||
left:auto;
|
||||
right:-13rem;
|
||||
bottom:0;
|
||||
top:0;
|
||||
min-width: 0;
|
||||
min-height: 0;
|
||||
width: 2rem;
|
||||
border:0;
|
||||
box-shadow: none;
|
||||
-webkit-mask:linear-gradient(to right,#000 1rem, rgba(0,0,0,0) 1rem, rgba(0,0,0,0) 25rem, #000 25rem);
|
||||
height:auto;
|
||||
.meter {
|
||||
margin:0;
|
||||
.level {
|
||||
opacity: .75;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -196,8 +190,8 @@
|
|||
bottom:0;
|
||||
left:50%;
|
||||
z-index: 0;
|
||||
width: 38rem;
|
||||
margin-left: -19rem;
|
||||
width: 4rem;
|
||||
margin-left: 17rem;
|
||||
background: linear-gradient(to bottom, transparent 0, transparent 2px, var(--color-pips) 2px, var(--color-pips) 3px, transparent 3px, transparent 5px);
|
||||
background-size: 100% 5px;
|
||||
background-repeat: repeat-y;
|
||||
|
|
@ -207,8 +201,8 @@
|
|||
background: var(--color-pips);
|
||||
color:var(--color-fg);
|
||||
position: absolute;
|
||||
width:44rem;
|
||||
margin-left:-3rem;
|
||||
width:8rem;
|
||||
left:0;
|
||||
&:before {
|
||||
content:"";
|
||||
position: absolute;
|
||||
|
|
@ -226,13 +220,9 @@
|
|||
text-align: center;
|
||||
font-size:10rem;
|
||||
line-height: 12rem;
|
||||
left:44rem;
|
||||
left:3rem;
|
||||
top:-5.5rem;
|
||||
color:var(--color-pips);
|
||||
&:last-child {
|
||||
left:auto;
|
||||
right:44rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -277,14 +267,11 @@
|
|||
bottom:0;
|
||||
}
|
||||
.meter-container {
|
||||
left:0;
|
||||
right:-1rem;
|
||||
top:auto;
|
||||
bottom:0;
|
||||
border-left:0;
|
||||
border-top:1rem solid var(--color-bg);
|
||||
height:1rem;
|
||||
width:auto;
|
||||
top:0;
|
||||
left:0!important;
|
||||
right:-1px!important;
|
||||
width: auto;
|
||||
height: 3rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -317,15 +304,15 @@
|
|||
transform-origin: left;
|
||||
}
|
||||
.meter-container {
|
||||
top:-12rem;
|
||||
top:-13rem;
|
||||
left:0;
|
||||
right:0;
|
||||
bottom:auto;
|
||||
height:1rem;
|
||||
min-width: 0;
|
||||
min-height: 0;
|
||||
box-shadow: none;
|
||||
-webkit-mask:none!important;
|
||||
width:auto;
|
||||
height: 2rem;
|
||||
}
|
||||
.knob {
|
||||
bottom:1px;
|
||||
|
|
|
|||
|
|
@ -72,6 +72,7 @@
|
|||
display: flex;
|
||||
flex-direction: row;
|
||||
flex:1;
|
||||
position: relative;
|
||||
|
||||
background: var(--color-track);
|
||||
|
||||
|
|
@ -80,12 +81,30 @@
|
|||
flex:1;
|
||||
transform-origin: bottom;
|
||||
background:var(--color-custom);
|
||||
opacity: .5;
|
||||
&.horizontal {
|
||||
// opacity: .5;
|
||||
}
|
||||
&::after {
|
||||
content:"";
|
||||
position: absolute;
|
||||
top:0;
|
||||
left:0;
|
||||
bottom:0;
|
||||
right:0;
|
||||
background-image: linear-gradient(transparent 1px, var(--color-fg) 1px, var(--color-fg) 2px );
|
||||
background-size: 100% 2px;
|
||||
background-repeat: repeat;
|
||||
}
|
||||
&.horizontal {
|
||||
&::after {
|
||||
background-image: linear-gradient(to right, transparent 1px, var(--color-fg) 1px, var(--color-fg) 2px );
|
||||
background-size: 2px 100% ;
|
||||
}
|
||||
.level {
|
||||
transform-origin: left;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.text-container {
|
||||
|
|
|
|||
139
examples/plot.js
139
examples/plot.js
|
|
@ -10,11 +10,10 @@
|
|||
"unit": "",
|
||||
"left": "auto",
|
||||
"top": "auto",
|
||||
"width": "auto",
|
||||
"width": 100,
|
||||
"height": 254,
|
||||
"horizontal": false,
|
||||
"horizontal": true,
|
||||
"css": "",
|
||||
"absolute": false,
|
||||
"range": {
|
||||
"min": 0,
|
||||
"max": 1
|
||||
|
|
@ -23,21 +22,26 @@
|
|||
"precision": 2,
|
||||
"path": "/fader_1",
|
||||
"target": [],
|
||||
"meter": false
|
||||
"meter": true,
|
||||
"noPip": false,
|
||||
"compact": false,
|
||||
"color": "auto",
|
||||
"snap": false,
|
||||
"preArgs": [],
|
||||
"alignRight": false
|
||||
},
|
||||
{
|
||||
"type": "fader",
|
||||
"id": "fader_2",
|
||||
"id": "fader_1/meter",
|
||||
"linkId": "",
|
||||
"label": "auto",
|
||||
"unit": "",
|
||||
"left": "auto",
|
||||
"top": "auto",
|
||||
"width": "auto",
|
||||
"width": 90,
|
||||
"height": 253,
|
||||
"horizontal": false,
|
||||
"css": "",
|
||||
"absolute": false,
|
||||
"range": {
|
||||
"min": 0,
|
||||
"max": 1
|
||||
|
|
@ -46,7 +50,13 @@
|
|||
"precision": 2,
|
||||
"path": "/fader_2",
|
||||
"target": [],
|
||||
"meter": false
|
||||
"meter": false,
|
||||
"noPip": false,
|
||||
"compact": false,
|
||||
"color": "auto",
|
||||
"snap": false,
|
||||
"preArgs": [],
|
||||
"alignRight": false
|
||||
},
|
||||
{
|
||||
"type": "fader",
|
||||
|
|
@ -56,11 +66,10 @@
|
|||
"unit": "",
|
||||
"left": "auto",
|
||||
"top": "auto",
|
||||
"width": "auto",
|
||||
"width": 90,
|
||||
"height": 253,
|
||||
"horizontal": false,
|
||||
"css": "",
|
||||
"absolute": false,
|
||||
"range": {
|
||||
"min": 0,
|
||||
"max": 1
|
||||
|
|
@ -69,7 +78,13 @@
|
|||
"precision": 2,
|
||||
"path": "/fader_3",
|
||||
"target": [],
|
||||
"meter": false
|
||||
"meter": false,
|
||||
"noPip": false,
|
||||
"compact": false,
|
||||
"color": "auto",
|
||||
"snap": false,
|
||||
"preArgs": [],
|
||||
"alignRight": false
|
||||
},
|
||||
{
|
||||
"type": "fader",
|
||||
|
|
@ -83,7 +98,6 @@
|
|||
"height": 253,
|
||||
"horizontal": false,
|
||||
"css": "",
|
||||
"absolute": false,
|
||||
"range": {
|
||||
"min": 0,
|
||||
"max": 1
|
||||
|
|
@ -92,7 +106,13 @@
|
|||
"precision": 2,
|
||||
"path": "/fader_4",
|
||||
"target": [],
|
||||
"meter": false
|
||||
"meter": false,
|
||||
"noPip": false,
|
||||
"compact": false,
|
||||
"color": "auto",
|
||||
"snap": false,
|
||||
"preArgs": [],
|
||||
"alignRight": false
|
||||
},
|
||||
{
|
||||
"type": "plot",
|
||||
|
|
@ -131,7 +151,9 @@
|
|||
},
|
||||
"logScaleX": false,
|
||||
"logScaleY": false,
|
||||
"path": "/plot_1"
|
||||
"path": "/plot_1",
|
||||
"color": "auto",
|
||||
"preArgs": []
|
||||
},
|
||||
{
|
||||
"type": "visualizer",
|
||||
|
|
@ -149,7 +171,9 @@
|
|||
},
|
||||
"logScale": false,
|
||||
"label": "visualizer (fader1)",
|
||||
"path": "/visualizer_(fader_1)"
|
||||
"path": "/visualizer_(fader_1)",
|
||||
"color": "auto",
|
||||
"preArgs": []
|
||||
},
|
||||
{
|
||||
"type": "rgb",
|
||||
|
|
@ -161,11 +185,12 @@
|
|||
"width": "auto",
|
||||
"height": "auto",
|
||||
"css": "",
|
||||
"absolute": false,
|
||||
"precision": 0,
|
||||
"path": "/rgb_1",
|
||||
"split": false,
|
||||
"target": []
|
||||
"target": [],
|
||||
"snap": false,
|
||||
"preArgs": []
|
||||
},
|
||||
{
|
||||
"type": "plot",
|
||||
|
|
@ -187,7 +212,57 @@
|
|||
"logScaleY": false,
|
||||
"id": "plot_2",
|
||||
"label": "plot_2 (rgb)",
|
||||
"path": "/plot_2"
|
||||
"path": "/plot_2",
|
||||
"color": "auto",
|
||||
"preArgs": []
|
||||
},
|
||||
{
|
||||
"type": "meter",
|
||||
"top": 547,
|
||||
"left": 93,
|
||||
"id": "meter_1",
|
||||
"label": "auto",
|
||||
"unit": "",
|
||||
"width": 411,
|
||||
"height": 220,
|
||||
"horizontal": false,
|
||||
"color": "auto",
|
||||
"css": "",
|
||||
"range": {
|
||||
"min": 0,
|
||||
"max": 1
|
||||
},
|
||||
"logScale": false,
|
||||
"path": "/meter_1",
|
||||
"preArgs": []
|
||||
},
|
||||
{
|
||||
"type": "fader",
|
||||
"id": "fader_1",
|
||||
"linkId": "",
|
||||
"label": "auto",
|
||||
"unit": "",
|
||||
"left": "auto",
|
||||
"top": "auto",
|
||||
"width": 100,
|
||||
"height": 254,
|
||||
"horizontal": true,
|
||||
"css": "",
|
||||
"range": {
|
||||
"min": 0,
|
||||
"max": 1
|
||||
},
|
||||
"logScale": false,
|
||||
"precision": 2,
|
||||
"path": "/fader_1",
|
||||
"target": [],
|
||||
"meter": true,
|
||||
"noPip": false,
|
||||
"compact": true,
|
||||
"color": "auto",
|
||||
"snap": false,
|
||||
"preArgs": [],
|
||||
"alignRight": false
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
@ -212,7 +287,10 @@
|
|||
"path": "/multifader_1",
|
||||
"target": [],
|
||||
"logScale": false,
|
||||
"css": ""
|
||||
"css": "",
|
||||
"color": "auto",
|
||||
"compact": false,
|
||||
"preArgs": []
|
||||
},
|
||||
{
|
||||
"type": "plot",
|
||||
|
|
@ -234,7 +312,9 @@
|
|||
"logScaleX": false,
|
||||
"logScaleY": false,
|
||||
"path": "/plot_3",
|
||||
"css": "z-index:1"
|
||||
"css": "z-index:1",
|
||||
"color": "auto",
|
||||
"preArgs": []
|
||||
},
|
||||
{
|
||||
"type": "multitoggle",
|
||||
|
|
@ -253,7 +333,9 @@
|
|||
2
|
||||
],
|
||||
"on": 1,
|
||||
"off": 0
|
||||
"off": 0,
|
||||
"color": "auto",
|
||||
"preArgs": []
|
||||
},
|
||||
{
|
||||
"type": "plot",
|
||||
|
|
@ -275,7 +357,9 @@
|
|||
"logScaleX": false,
|
||||
"logScaleY": false,
|
||||
"id": "plot_4",
|
||||
"path": "/plot_4"
|
||||
"path": "/plot_4",
|
||||
"color": "auto",
|
||||
"preArgs": []
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
@ -300,7 +384,10 @@
|
|||
"logScale": false,
|
||||
"id": "multifader_2",
|
||||
"label": "auto",
|
||||
"path": "/multifader_2"
|
||||
"path": "/multifader_2",
|
||||
"color": "auto",
|
||||
"compact": false,
|
||||
"preArgs": []
|
||||
},
|
||||
{
|
||||
"type": "plot",
|
||||
|
|
@ -322,8 +409,10 @@
|
|||
"css": "z-index:1",
|
||||
"label": "There is a transparent multifader above this plot, just touch it... incredible, isn't it ?",
|
||||
"path": "/plot_6",
|
||||
"id": "plot_7"
|
||||
"id": "plot_7",
|
||||
"color": "auto",
|
||||
"preArgs": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
]
|
||||
|
|
@ -18,10 +18,10 @@ Sliders are unidimensional widgets that output one value at a time.
|
|||
- default: `false`
|
||||
- usage: set to `true` to display the fader horizontally
|
||||
|
||||
#### `align`
|
||||
- type: `string`
|
||||
- default: `center`
|
||||
- usage: set to `left` or `right` to display one scale instead of two
|
||||
#### `alignRight`
|
||||
- type: `boolean`
|
||||
- default: `false`
|
||||
- usage: set to `true` to invert the pip's and fader's position
|
||||
|
||||
#### `noPip`
|
||||
- type: `boolean`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue