ui: simplify button widgets and optimize layering
This commit is contained in:
parent
8b9ed8c48a
commit
99ae3cc0b8
8 changed files with 2158 additions and 2207 deletions
File diff suppressed because one or more lines are too long
|
|
@ -28,12 +28,10 @@ module.exports.create = function(widgetData,container) {
|
|||
|
||||
|
||||
var widget = $(`
|
||||
<div class="push toggle">
|
||||
<div class="light"</div>
|
||||
<div class="light">
|
||||
</div>\
|
||||
`),
|
||||
$document = $(document),
|
||||
light = widget.find('.light')[0]
|
||||
$document = $(document)
|
||||
|
||||
widget.value = widget.find('span')
|
||||
widget.state = 0
|
||||
|
|
|
|||
|
|
@ -27,12 +27,10 @@ module.exports.options = {
|
|||
module.exports.create = function(widgetData,container) {
|
||||
|
||||
var widget = $(`
|
||||
<div class="toggle">
|
||||
<div class="light"></div>
|
||||
<div class="light">
|
||||
</div>\
|
||||
`),
|
||||
$document = $(document),
|
||||
light = widget.find('.light')[0]
|
||||
$document = $(document)
|
||||
|
||||
widget.value = widget.find('span')
|
||||
widget.state = 0
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -133,7 +133,7 @@
|
|||
width:100%;
|
||||
height:100%;
|
||||
background:var(--color-track);
|
||||
z-index: 1;
|
||||
// z-index: 1;
|
||||
display:block;
|
||||
position: absolute;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,46 +1,15 @@
|
|||
.push-container {
|
||||
width:100rem;
|
||||
min-height: 65rem;
|
||||
flex-shrink: 0;
|
||||
padding:0!important;
|
||||
|
||||
background: var(--color-raised);
|
||||
|
||||
.label {
|
||||
position: absolute;
|
||||
top:0;
|
||||
left:0;
|
||||
right:0;
|
||||
bottom:0;
|
||||
height:auto;
|
||||
max-height: initial;
|
||||
border:0;
|
||||
background: none!important;
|
||||
text-align: center;
|
||||
pointer-events:none;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
z-index: 1;
|
||||
&:after {
|
||||
content:"";
|
||||
position: absolute;
|
||||
top:1rem;
|
||||
right:1rem;
|
||||
border:4rem solid transparent;
|
||||
border-top:4rem solid var(--color-text-fade);
|
||||
border-right:4rem solid var(--color-text-fade);
|
||||
opacity: 0.2;
|
||||
background-blend-mode: luminosity;
|
||||
}
|
||||
@extend .toggle-container;
|
||||
.active {
|
||||
background: var(--color-fg);
|
||||
}
|
||||
.light:after {
|
||||
content:"";
|
||||
position: absolute;
|
||||
width:100%;
|
||||
height:100%;
|
||||
box-shadow: 0 0 0 4rem var(--color-text-fade) inset;
|
||||
opacity: .1;
|
||||
|
||||
cursor: pointer;
|
||||
|
||||
.push {
|
||||
box-shadow: 0 0 1rem 0 var(--color-text-fade) inset;
|
||||
&.active {
|
||||
background: var(--color-fg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
flex-direction:column;
|
||||
align-items: stretch;
|
||||
flex:1;
|
||||
z-index: 1;
|
||||
|
||||
&.horizontal {
|
||||
flex-direction:row;
|
||||
|
|
@ -64,7 +65,7 @@
|
|||
z-index: 2;
|
||||
}
|
||||
&.on:before {
|
||||
opacity: .2;
|
||||
opacity: .3;
|
||||
box-shadow: 0 0 1rem 0 var(--color-custom) inset;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,31 +23,26 @@
|
|||
}
|
||||
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.toggle {
|
||||
position: absolute;
|
||||
top:0;
|
||||
left:0;
|
||||
right:0;
|
||||
bottom:0;
|
||||
box-shadow: 0 0 1rem 0 var(--color-text-fade) inset;
|
||||
|
||||
.light {
|
||||
position: absolute;
|
||||
left:0;
|
||||
right:0;
|
||||
top:0;
|
||||
bottom:0;
|
||||
pointer-events: none;
|
||||
background: var(--color-custom);
|
||||
opacity: 0;
|
||||
z-index: 1;
|
||||
}
|
||||
&.on {
|
||||
.light{
|
||||
opacity:0.2;
|
||||
box-shadow: 0 0 1rem 0 var(--color-text-fade) inset;
|
||||
flex:1;
|
||||
|
||||
&:before {
|
||||
content:"";
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
background: var(--color-custom);
|
||||
opacity: 0;
|
||||
}
|
||||
&.on {
|
||||
|
||||
box-shadow: 0 0 1rem 0 var(--color-custom) inset;
|
||||
&:before {
|
||||
opacity: .3;
|
||||
}
|
||||
|
||||
}
|
||||
box-shadow: 0 0 1rem 0 var(--color-custom) inset;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue