-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
102 additions
and
2 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
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,41 @@ | ||
'use strict'; | ||
|
||
var React = require('react'); | ||
|
||
var RSGCheckbox = React.createClass({ | ||
displayName: 'RSGCheckbox', | ||
|
||
render: function render() { | ||
var classes = "switch"; | ||
if(this.props.RSGType && this.props.RSGType === "lg"){ | ||
classes += " switch-lg" | ||
} | ||
|
||
var input = React.DOM.input( | ||
Object.assign( | ||
{type: 'checkbox', key: 1}, | ||
_.omit(this.props, ['type']) | ||
) | ||
); | ||
|
||
var span = React.DOM.span({key: 2}); | ||
var style1 = this.props.style1; | ||
|
||
var label = React.DOM.label( | ||
Object.assign( | ||
{className: classes, style: style1}, | ||
_.omit(this.props, ['className']) | ||
), | ||
[ | ||
input, | ||
span | ||
] | ||
); | ||
|
||
return label; | ||
|
||
} | ||
}); | ||
|
||
exports['RSGCheckbox'] = RSGCheckbox; | ||
module.exports = exports['RSGCheckbox']; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
.switch input:checked+span { | ||
background-color: #5d9cec; | ||
border-color: #5d9cec; | ||
transition: all .5s; | ||
} | ||
.switch.switch-lg span { | ||
width: 50px; | ||
height: 25px; | ||
} | ||
.switch span { | ||
position: relative; | ||
display: inline-block; | ||
width: 40px; | ||
height: 20px; | ||
background-color: #fff; | ||
border: 1px solid #ddd; | ||
border-radius: 100px; | ||
transition: all .5s; | ||
box-shadow: 1px 2px 3px rgba(0,0,0,.1) inset; | ||
vertical-align: middle; | ||
} | ||
.switch * { | ||
cursor: pointer; | ||
} | ||
.switch span:after { | ||
content: ""; | ||
position: absolute; | ||
background-color: #fff; | ||
top: 0; | ||
left: 0; | ||
height: 18px; | ||
width: 18px; | ||
border: 1px solid #ddd; | ||
border-radius: 400px; | ||
box-shadow: 1px 1px 3px rgba(0,0,0,.1); | ||
-webkit-transition: all .2s; | ||
} | ||
.switch input { | ||
opacity: 0; | ||
position: absolute; | ||
z-index: -1; | ||
} | ||
.switch input:checked+span:after { | ||
left: 50%; | ||
transition: all .2s; | ||
} | ||
.switch.switch-lg span:after { | ||
height: 23px; | ||
width: 23px; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.