@import '../../less/color';

.switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 32px;
  vertical-align: middle;
  box-sizing: border-box;
  border-radius: 16px;
}

.switch-success {
  background: #44db5e;
  border: 1px solid #44db5e
}

.switch-kai {
  background: @kai;
  border: 1px solid @kai;
}

.switch-warn {
  background: @warn;
  border: 1px solid @warn
}

.switch-danger {
  background: @danger;
  border: 1px solid @danger
}

.switch-circle {
  position: absolute;
  top: 0;
  left: 0;
  width: 30px;
  height: 30px;
  display: inline-block;
  background: #fff;
  border-radius: 15px;
  box-sizing: border-box;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .1), 0 3px 1px 0 rgba(0, 0, 0, .05), 0 2px 2px 0 rgba(0, 0, 0, .1), 0 3px 3px 0 rgba(0, 0, 0, .05);
  transition: transform .35s cubic-bezier(.45, 1, .4, 1);
  z-index: 2
}

.switch-bg {
  position: absolute;
  top: -1px;
  left: -1px;
  width: 52px;
  height: 32px;
  background: #fff;
  border-radius: 26px;
  display: inline-block;
  border: 1px solid #e5e5e5;
  box-sizing: border-box;
  transition: transform .35s cubic-bezier(.45, 1, .4, 1);
  transform: scale(0);
  transform-origin: 36px 16px
}

.switch-on .switch-circle {
  transform: translateX(20px)
}

.switch-off .switch-bg {
  transform: scale(1)
}

.swtich-disabled {
  opacity: .4
}

.loading-circle{
  display:flex;
  flex-direction:row;
  justify-content:center;
  align-items:center;
}

.switch-loading {
  position: absolute;
  left: 7px;
  top: 7px;
  width: 16px;
  height: 16px; //http://images.kaishiba.com/ic_load.png http://images.kaishiba.com/ref.png
  background: url('http://images.kaishiba.com/ic_load.png') no-repeat;
  background-size: 16px 16px;
  animation: switch-loading .8s infinite linear
}

@keyframes switch-loading {
  from {
    transform: rotate(0)
  }
  to {
    transform: rotate(360deg)
  }
}