Commit 530b6a50 by Torkel Ödegaard

ux(): another checkbox design

parent 5e52aaac
...@@ -80,11 +80,21 @@ ...@@ -80,11 +80,21 @@
<h5 class="section-heading">Multiple Series</h5> <h5 class="section-heading">Multiple Series</h5>
<div class="gf-form"> <div class="gf-form">
<label class="gf-form-label width-7">Stack</label> <label class="gf-form-label width-7">Stack</label>
<editor-checkbox text="Enable" model="ctrl.panel.stack" change="ctrl.render()"></editor-checkbox> <div class="gf-form-switch-wrapper">
<div class="switch">
<input id="cmn-toggle-7" class="cmn-toggle cmn-toggle-yes-no" type="checkbox" ng-model="ctrl.panel.stack">
<label for="cmn-toggle-7" data-on="Yes" data-off="No"></label>
</div>
</div>
</div> </div>
<div class="gf-form" ng-show="ctrl.panel.stack"> <div class="gf-form" ng-show="ctrl.panel.stack">
<label class="gf-form-label width-7">Percent</label> <label class="gf-form-label width-7">Percent</label>
<editor-checkbox text="Enable" model="ctrl.panel.percent" change="ctrl.render()"></editor-checkbox> <div class="gf-form-switch-wrapper">
<div class="switch">
<input id="cmn-toggle-8" class="cmn-toggle cmn-toggle-yes-no" type="checkbox" ng-model="ctrl.panel.percent">
<label for="cmn-toggle-8" data-on="Yes" data-off="No"></label>
</div>
</div>
</div> </div>
<div class="gf-form" ng-show="ctrl.panel.stack"> <div class="gf-form" ng-show="ctrl.panel.stack">
<label class="gf-form-label width-7">Tooltip value</label> <label class="gf-form-label width-7">Tooltip value</label>
......
...@@ -174,7 +174,7 @@ label.cr1 { ...@@ -174,7 +174,7 @@ label.cr1 {
cursor:pointer; cursor:pointer;
} }
input[type="checkbox"]:checked+label { input[type="checkbox"].cr1:checked+label {
background: url($checkboxImageUrl) 0px -18px no-repeat; background: url($checkboxImageUrl) 0px -18px no-repeat;
} }
......
...@@ -52,8 +52,6 @@ $gf-form-label-margin: 0.25rem; ...@@ -52,8 +52,6 @@ $gf-form-label-margin: 0.25rem;
.gf-form-switch-wrapper { .gf-form-switch-wrapper {
margin-right: $gf-form-label-margin; margin-right: $gf-form-label-margin;
padding: $input-padding-y $input-padding-x;
background-color: $input-bg;
} }
.gf-form-checkbox { .gf-form-checkbox {
......
...@@ -66,76 +66,16 @@ input.cmn-toggle-round:checked + label:after { ...@@ -66,76 +66,16 @@ input.cmn-toggle-round:checked + label:after {
} }
/* ============================================================ /* ============================================================
SWITCH 2 - ROUND FLAT
============================================================ */
input.cmn-toggle-round-flat + label {
padding: 2px;
width: 120px;
height: 60px;
background-color: #dddddd;
-webkit-border-radius: 60px;
-moz-border-radius: 60px;
-ms-border-radius: 60px;
-o-border-radius: 60px;
border-radius: 60px;
-webkit-transition: background 0.4s;
-moz-transition: background 0.4s;
-o-transition: background 0.4s;
transition: background 0.4s;
}
input.cmn-toggle-round-flat + label:before, input.cmn-toggle-round-flat + label:after {
display: block;
position: absolute;
content: "";
}
input.cmn-toggle-round-flat + label:before {
top: 2px;
left: 2px;
bottom: 2px;
right: 2px;
background-color: #fff;
-webkit-border-radius: 60px;
-moz-border-radius: 60px;
-ms-border-radius: 60px;
-o-border-radius: 60px;
border-radius: 60px;
-webkit-transition: background 0.4s;
-moz-transition: background 0.4s;
-o-transition: background 0.4s;
transition: background 0.4s;
}
input.cmn-toggle-round-flat + label:after {
top: 4px;
left: 4px;
bottom: 4px;
width: 52px;
background-color: #dddddd;
-webkit-border-radius: 52px;
-moz-border-radius: 52px;
-ms-border-radius: 52px;
-o-border-radius: 52px;
border-radius: 52px;
-webkit-transition: margin 0.4s, background 0.4s;
-moz-transition: margin 0.4s, background 0.4s;
-o-transition: margin 0.4s, background 0.4s;
transition: margin 0.4s, background 0.4s;
}
input.cmn-toggle-round-flat:checked + label {
background-color: #8ce196;
}
input.cmn-toggle-round-flat:checked + label:after {
margin-left: 60px;
background-color: #8ce196;
}
/* ============================================================
SWITCH 3 - YES NO SWITCH 3 - YES NO
============================================================ */ ============================================================ */
input.cmn-toggle-yes-no + label { input.cmn-toggle-yes-no + label {
padding: 2px; padding: 2px;
width: 120px; width: 5rem;
height: 60px; height: 2.6rem;
padding: $input-padding-y $input-padding-x;
background-color: $input-bg;
} }
input.cmn-toggle-yes-no + label:before, input.cmn-toggle-yes-no + label:after { input.cmn-toggle-yes-no + label:before, input.cmn-toggle-yes-no + label:after {
display: block; display: block;
position: absolute; position: absolute;
...@@ -144,53 +84,32 @@ input.cmn-toggle-yes-no + label:before, input.cmn-toggle-yes-no + label:after { ...@@ -144,53 +84,32 @@ input.cmn-toggle-yes-no + label:before, input.cmn-toggle-yes-no + label:after {
bottom: 0; bottom: 0;
right: 0; right: 0;
color: #fff; color: #fff;
font-family: "Roboto Slab", serif; font-family: "Open Sans";
font-size: 20px; font-size: $font-size-sm;
text-align: center; text-align: center;
line-height: 60px; line-height: 2.6rem;
} }
input.cmn-toggle-yes-no + label:before { input.cmn-toggle-yes-no + label:before {
background-color: #dddddd; @include buttonBackground($btn-inverse-bg, $btn-inverse-bg-hl);
content: attr(data-off); content: attr(data-off);
-webkit-transition: -webkit-transform 0.5s;
-moz-transition: -moz-transform 0.5s;
-o-transition: -o-transform 0.5s;
transition: transform 0.5s; transition: transform 0.5s;
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
-ms-backface-visibility: hidden;
-o-backface-visibility: hidden;
backface-visibility: hidden; backface-visibility: hidden;
} }
input.cmn-toggle-yes-no + label:after { input.cmn-toggle-yes-no + label:after {
background-color: #8ce196; //@include buttonBackground($btn-success-bg, $btn-success-bg-hl);
@include buttonBackground($btn-secondary-bg, $btn-secondary-bg-hl);
content: attr(data-on); content: attr(data-on);
-webkit-transition: -webkit-transform 0.5s;
-moz-transition: -moz-transform 0.5s;
-o-transition: -o-transform 0.5s;
transition: transform 0.5s; transition: transform 0.5s;
-webkit-transform: rotateY(180deg);
-moz-transform: rotateY(180deg);
-ms-transform: rotateY(180deg);
-o-transform: rotateY(180deg);
transform: rotateY(180deg); transform: rotateY(180deg);
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
-ms-backface-visibility: hidden;
-o-backface-visibility: hidden;
backface-visibility: hidden; backface-visibility: hidden;
} }
input.cmn-toggle-yes-no:checked + label:before { input.cmn-toggle-yes-no:checked + label:before {
-webkit-transform: rotateY(180deg);
-moz-transform: rotateY(180deg);
-ms-transform: rotateY(180deg);
-o-transform: rotateY(180deg);
transform: rotateY(180deg); transform: rotateY(180deg);
} }
input.cmn-toggle-yes-no:checked + label:after { input.cmn-toggle-yes-no:checked + label:after {
-webkit-transform: rotateY(0);
-moz-transform: rotateY(0);
-ms-transform: rotateY(0);
-o-transform: rotateY(0);
transform: rotateY(0); transform: rotateY(0);
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment