better fader & meter design

This commit is contained in:
bordun 2016-06-06 16:24:25 +02:00
parent 372c0dffca
commit 7687a2db23
8 changed files with 2322 additions and 2231 deletions

File diff suppressed because one or more lines are too long

View file

@ -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>
`

View file

@ -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

View file

@ -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;

View file

@ -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 {