Добавлен эффект отскока, посмотрите, нравится ли вам
#bounds {
padding: 2px;
transition: all .2s ease;
border: 4px solid #ececec;
border-radius: 2em;
overflow: auto;
float: left;
color: transparent;
height: 25px;
}
#bounds label {
float: left;
width: 2.0em;
}
#bounds label span {
text-align: center;
padding: 3px 0px;
display: block;
height: 19px;
}
#bounds label input {
position: absolute;
top: -20px;
}
#bounds input:checked+span {
background-color: #404040;
color: transparent;
}
#bounds label.on input:checked+span {
background: #7FC6A6;
color: transparent;
border-radius: 1em;
-webkit-animation: toggleOn 0.1s; /* Safari 4.0 - 8.0 */
animation: toggleOn 0.1s;
}
#bounds label.off input:checked+span {
background: #ececec;
color: transparent;
border-radius: 1em;
}
@-webkit-keyframes toggleOn {
0% {
transform: translate3d(0px, 0, 1);
}
30% {
transform: translate3d(-10px, 0px, 1);
background-color: #404055;
}
60% {
transform: translate3d(-5px, 0px, 1px);
}
}
@keyframes toggleOn {
0% {
transform: translate3d(0px, 0, 1);
}
30% {
transform: translate3d(-10px, 0px, 1);
background-color: #404055;
}
60% {
transform: translate3d(-5px, 0px, 1px);
}
}
<div id="bounds">
<label class="off"><input type="radio" name="toggle" checked><span></span></label>
<label class="on"><input type="radio" name="toggle"><span></span></label>
</div>