Created
December 1, 2012 17:58
-
-
Save radmar/4183603 to your computer and use it in GitHub Desktop.
Checkbox alternative UI
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
| /** | |
| * Checkbox alternative UI | |
| */ | |
| .switch-toggle { | |
| display: none; | |
| visibility: hidden; | |
| } | |
| .switch-content { | |
| /*-webkit-transition: all 500ms ease-in-out; | |
| -moz-transition: all 500ms ease-in-out; | |
| -ms-transition: all 500ms ease-in-out; | |
| -o-transition: all 500ms ease-in-out;*/ | |
| transition: all 500ms ease-in-out; | |
| } | |
| .switch { | |
| display: inline-block; | |
| height: 30px; | |
| overflow: hidden; | |
| width: auto; | |
| position: relative; | |
| margin: 0; | |
| cursor: pointer; | |
| line-height: 30px; | |
| } | |
| .switch-content { | |
| height: 200%; | |
| position: relative; | |
| width: auto; | |
| display: inline-block; | |
| color: white | |
| } | |
| .switch-content-checked, .switch-content-unchecked { | |
| /*background: rgba(157, 38, 29, 0.5);*/ | |
| cursor: pointer; | |
| display: block; | |
| height: 50%; | |
| width: auto; | |
| text-align: center; | |
| padding: 0 5px; | |
| } | |
| .switch-toggle:checked + .switch > .switch-content { top: 0; background-color: green;} | |
| .switch-toggle + .switch > .switch-content { top: -100%; background-color: red;} |
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> --> | |
| <input type="checkbox" id="check1" class="switch-toggle" /> | |
| <label class="switch" for="check1"> | |
| <div class="switch-content"> | |
| <div class="switch-content-checked">Enabled</div> | |
| <div class="switch-content-unchecked">Disabled</div> | |
| </div> | |
| </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
| // alert('Hello world!'); |
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":"separate","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