122 lines
2.3 KiB
CSS
122 lines
2.3 KiB
CSS
.am-switch {
|
|
position: relative;
|
|
|
|
display: block;
|
|
|
|
width: 74px;
|
|
height: 30px;
|
|
|
|
-webkit-transition-timing-function: ease-in-out;
|
|
transition-timing-function: ease-in-out;
|
|
-webkit-transition-duration: .2s;
|
|
transition-duration: .2s;
|
|
-webkit-transition-property: background-color, border;
|
|
transition-property: background-color, border;
|
|
|
|
-webkit-box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
|
|
-webkit-user-select: none;
|
|
|
|
outline: none;
|
|
|
|
-webkit-tap-highlight-color: transparent;
|
|
-webkit-tap-highlight-color: transparent;
|
|
|
|
border: 2px solid #ddd;
|
|
border-radius: 20px;
|
|
background-color: #fff;
|
|
background-clip: padding-box;
|
|
}
|
|
|
|
.am-switch.am-disabled {
|
|
opacity: .3;
|
|
}
|
|
|
|
.am-switch .am-switch-handle {
|
|
position: absolute;
|
|
z-index: 1;
|
|
top: -1px;
|
|
left: -1px;
|
|
|
|
width: 28px;
|
|
height: 28px;
|
|
|
|
-webkit-transition: .2s ease-in-out;
|
|
transition: .2s ease-in-out;
|
|
-webkit-transition-property: -webkit-transform, width, left;
|
|
transition-property: transform, width, left;
|
|
|
|
border-radius: 16px;
|
|
background-color: #fff;
|
|
background-clip: padding-box;
|
|
-webkit-box-shadow: 0 2px 5px rgba(0, 0, 0, .4);
|
|
box-shadow: 0 2px 5px rgba(0, 0, 0, .4);
|
|
}
|
|
|
|
.am-switch:before {
|
|
font-size: 13px;
|
|
|
|
position: absolute;
|
|
top: 3px;
|
|
right: 11px;
|
|
|
|
content: 'Off';
|
|
text-transform: uppercase;
|
|
|
|
color: #999;
|
|
}
|
|
|
|
.am-switch.am-dragging {
|
|
border-color: #f7f7f7;
|
|
background-color: #f7f7f7;
|
|
}
|
|
|
|
.am-switch.am-dragging .am-switch-handle {
|
|
width: 38px;
|
|
}
|
|
|
|
.am-switch.am-dragging.am-active .am-switch-handle {
|
|
left: -11px;
|
|
|
|
width: 38px;
|
|
}
|
|
|
|
.am-switch.am-active {
|
|
border-color: #00B050;
|
|
background-color: #00B050;
|
|
}
|
|
|
|
.am-switch.am-active .am-switch-handle {
|
|
-webkit-transform: translate(43px, 0);
|
|
transform: translate(43px, 0);
|
|
}
|
|
|
|
.am-switch.am-active:before {
|
|
right: auto;
|
|
left: 15px;
|
|
content: 'On';
|
|
color: #fff;
|
|
}
|
|
|
|
.am-switch input[type='checkbox'] {
|
|
display: none;
|
|
}
|
|
|
|
.am-switch-mini {
|
|
width: 47px;
|
|
}
|
|
|
|
.am-switch-mini:before {
|
|
display: none;
|
|
}
|
|
|
|
.am-switch-mini.am-active .am-switch-handle {
|
|
-webkit-transform: translate(16px, 0);
|
|
transform: translate(16px, 0);
|
|
}
|
|
|
|
.am-switch-blue.am-active {
|
|
border: 2px solid #007aff;
|
|
background-color: #007aff;
|
|
} |