CSS
语言:
CSSSCSS
确定
/* entypo */
@import url(http://weloveiconfonts.com/api/?family=entypo);
[class*="entypo-"]:before {
font-family: 'entypo', sans-serif;
}
body {
background: #ccc url(http://subtlepatterns.com/patterns/binding_light_@2X.png);
background-size: 180px;
}
::selection {
background: transparent;
}
.box {
width: 120px;
height: 50px;
margin: 50px auto 0px auto;
}
input[type="checkbox"] {
display: none;
}
label[for="lock"] {
float: left;
display: block;
width: 60px;
height: 20px;
padding: 3px;
margin: 0px 10px;
border-radius: 30px;
background: rgba(0, 0, 0, .1);
box-shadow: inset 0 2px 10px #666, 0 2px 5px #eee;
}
label[for="lock_one"] {
float: left;
display: block;
width: 60px;
height: 20px;
padding: 3px;
margin: 0px 10px;
border-radius: 30px;
background: rgba(0, 0, 0, .1);
box-shadow: inset 0 2px 10px #666, 0 2px 5px #eee;
}
.switch {
display: block;
width: 10px;
height: 10px;
padding: 5px;
background: #eee;
box-shadow: inset 0 0 5px rgba(255, 165, 0, 0.25), 0 0 5px #888;
border-radius: 20px;
-webkit-transition: 0.3s;
-moz-transition: 0.3s;
-o-transition: 0.3s;
transition: 0.3s;
}
.switch:after {
content: '';
display: block;
margin: 0;
width: 10px;
height: 10px;
background: #47929f;
border-radius: 8px;
box-shadow: inset 0 0 3px #555;
}
input[type="checkbox"]:checked ~ label[for="lock"] .switch {
margin-left: 40px;
}
input[type="checkbox"]:checked ~ label[for="lock_one"] .switch {
margin-left: 40px;
}
span[class*="entypo"] {
color: rgba(0, 0, 0, 0.15);
float: left;
font-size: 22px;
line-height: 26px;
}
input[type="checkbox"]:not(:checked) ~ span[class="entypo-lock"] {
color: #47929f;
text-shadow: 0 0 3px #cfcfcf, 0 -1px 2px rgba(255, 165, 0, .5), 0 0 3px #cfcfcf;
}
input[type="checkbox"]:checked ~ span[class*="open"] {
color: #47929f;
text-shadow: 0 0 3px #cfcfcf, 0 -1px 2px rgba(255, 165, 0, .5), 0 0 3px #cfcfcf;
}