forked from Freeboard/freeboard
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from netpieio/dev
add a toggle widget
- Loading branch information
Showing
4 changed files
with
228 additions
and
35 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
.netpie-button { | ||
height : 36px; | ||
width : 50%; | ||
display : inline-block; | ||
box-shadow : 0px 1px 0px 1px #111111; | ||
border-radius : 4px; | ||
text-decoration : none; | ||
text-align : center; | ||
outline : none; | ||
font-size : 125%; | ||
float : left; | ||
} | ||
.netpie-button-text { | ||
vertical-align : bottom; | ||
padding : 8px 0px 0px 15px; | ||
float : left; | ||
} | ||
|
||
.netpie-toggle { | ||
float : left; | ||
position: relative; width: 100px; margin-top: 6px; | ||
-webkit-user-select:none; -moz-user-select:none; -ms-user-select: none; | ||
} | ||
.netpie-toggle-text { | ||
|
||
vertical-align : top; | ||
padding : 15px 0px 0px 15px; | ||
float : left; | ||
} | ||
.netpie-toggle-checkbox { | ||
display: none; | ||
} | ||
|
||
.netpie-toggle-label { | ||
display: block; overflow: hidden; cursor: pointer; | ||
border: 2px solid #999999; border-radius: 20px; | ||
} | ||
.netpie-toggle-inner { | ||
display: block; width: 200%; margin-left: -100%; | ||
transition: margin 0.1s ease-in 0s; | ||
} | ||
.netpie-toggle-inner:before, .netpie-toggle-inner:after { | ||
display: block; float: left; width: 50%; height: 30px; padding: 0; line-height: 30px; | ||
font-size: 14px; color: white; font-family: Trebuchet, Arial, sans-serif; font-weight: bold; | ||
box-sizing: border-box; | ||
} | ||
.netpie-toggle-inner:before { | ||
content: attr(ontext); | ||
padding-left: 15px; | ||
background-color: #2ecc71; color: #FFFFFF; | ||
text-align: left; | ||
} | ||
.netpie-toggle-inner:after { | ||
content: attr(offtext); | ||
padding-right: 15px; | ||
background-color: #E74C3C; color: #FFFFFF; | ||
text-align: right; | ||
} | ||
.netpie-toggle-switch { | ||
display: block; width: 18px; margin: 6px; | ||
background: #FFFFFF; | ||
position: absolute; top: 0; bottom: 0; | ||
right: 66px; | ||
border: 2px solid #999999; border-radius: 20px; | ||
transition: all 0.1s ease-in 0s; | ||
} | ||
.netpie-toggle-checkbox:checked + .netpie-toggle-label .netpie-toggle-inner { | ||
margin-left: 0; | ||
} | ||
.netpie-toggle-checkbox:checked + .netpie-toggle-label .netpie-toggle-switch { | ||
right: 0px; | ||
} |
This file contains 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
This file contains 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
This file contains 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