sci-pro
Version:
60 lines (59 loc) • 1.14 kB
CSS
.sci-switch {
width: 40px;
height: 20px;
}
.sci-switch .sci-switch-content {
position: relative;
width: 40px;
height: 20px;
cursor: pointer;
background: #c4c9cf;
border: 1px solid #c4c9cf;
border-radius: 10px;
}
.sci-switch .sci-switch-content-circle {
position: absolute;
top: 1px;
left: 1px;
display: flex;
align-items: center;
width: 16px;
height: 16px;
font-size: 12px;
background: #fff;
border-radius: 100%;
transition: all 0.3s;
animation: sci-switch-loading-rotate 1s linear infinite;
}
.sci-switch.sci-is-checked .sci-switch-content {
background: #1890ff;
border: 1px solid #1890ff;
}
.sci-switch.sci-is-checked .sci-switch-content-circle {
left: 100%;
margin-left: -17px;
}
.sci-switch.sci-switch-small {
transform: scale(0.7);
}
.sci-switch.sci-switch-disabled .sci-switch-content {
cursor: not-allowed;
opacity: 0.45;
}
@keyframes sci-switch-loading-rotate {
0% {
transform: rotate(0);
}
25% {
transform: rotate(90deg);
}
50% {
transform: rotate(180deg);
}
75% {
transform: rotate(270deg);
}
100% {
transform: rotate(360deg);
}
}