Created
August 3, 2012 21:41
-
-
Save dziudek/3251777 to your computer and use it in GitHub Desktop.
Simple animated CSS3 switcher
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Simple animated CSS3 switcher | |
*/ | |
label { | |
display: inline-block; | |
line-height: 24px; | |
} | |
.switcher { | |
display: inline-block; | |
position: relative; | |
width: 64px; | |
} | |
.switcher:before { | |
background: #f5f5f5; | |
border: 1px solid #ddd; | |
border-radius: 12px; | |
content: ""; | |
display: inline-block; | |
height: 24px; | |
position: absolute; | |
top: -5px; | |
width: 64px; | |
} | |
.switcher:after { | |
background: #56f; | |
border-radius: 11px; | |
content: ""; | |
display: block; | |
height: 22px; | |
left: 2px; | |
position: absolute; | |
top: -3px; | |
transition: left 0.3s ease-out; | |
width: 22px; | |
} | |
.switcher:checked:after { | |
left: 42px; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- content to be placed inside <body>…</body> --> | |
<label>Use nice switchers: <input class="switcher" type="checkbox" value="0" /></label> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment