-
Notifications
You must be signed in to change notification settings - Fork 329
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
1 parent
263257b
commit cb5b634
Showing
13 changed files
with
305 additions
and
116 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 |
---|---|---|
@@ -1,3 +1,30 @@ | ||
.COM{ | ||
.box{ | ||
position : relative; | ||
padding : 10px; | ||
margin: 10px; | ||
|
||
&.border{ | ||
border: 1px solid black; | ||
} | ||
&.shadow{ | ||
background-color: #ddd; | ||
} | ||
|
||
|
||
h5{ | ||
text-transform: uppercase; | ||
font-size : 0.6em; | ||
text-align: center; | ||
width : 100%; | ||
font-weight: 800; | ||
|
||
&.title{ | ||
margin-top: -5px; | ||
margin-bottom: 10px; | ||
} | ||
&.label{ | ||
margin-bottom: -5px; | ||
margin-top: 10px; | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,4 +1,13 @@ | ||
module.exports = { | ||
TextInput : require('./textInput/textInput.jsx'), | ||
PlayerInfo : require('./playerInfo/playerInfo.jsx'), | ||
|
||
SkillList : require('./skillList/skillList.jsx'), | ||
Skill : require('./skill/skill.jsx'), | ||
|
||
//ShadowBox : require('./shadowBox/shadowBox.jsx'), | ||
//BorderBox : require('./borderBox/borderBox.jsx'), | ||
|
||
|
||
Box : require('./box/box.jsx') | ||
} |
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,64 @@ | ||
var React = require('react'); | ||
var _ = require('lodash'); | ||
var cx = require('classnames'); | ||
|
||
var utils = require('../utils'); | ||
|
||
var Skill = React.createClass({ | ||
getDefaultProps: function() { | ||
return { | ||
name : 'skill', | ||
defaultData : { | ||
prof : false, | ||
expert : false, | ||
val : '' | ||
}, | ||
|
||
id : '', | ||
label : '', | ||
sublabel : '', | ||
showExpert : false | ||
}; | ||
}, | ||
|
||
id : utils.id, | ||
data : utils.data, | ||
updateData : utils.updateData, | ||
|
||
handleToggleProf : function(){ | ||
this.updateData({ | ||
prof : !this.data().prof | ||
}) | ||
}, | ||
handleToggleExpert : function(){ | ||
this.updateData({ | ||
expert : !this.data().expert | ||
}) | ||
}, | ||
handleValChange : function(e){ | ||
console.log('yo'); | ||
this.updateData({ | ||
val : e.target.value | ||
}) | ||
}, | ||
|
||
renderExpert : function(){ | ||
if(this.props.showExpert){ | ||
return <input type="radio" className='expertToggle' onChange={this.handleToggleExpert} checked={this.data().expert} /> | ||
} | ||
}, | ||
|
||
render : function(){ | ||
return <div className='skill'> | ||
{this.renderExpert()} | ||
<input type="radio" className='skillToggle' onChange={this.handleToggleProf} checked={this.data().prof} /> | ||
<input type='text' onChange={this.handleValChange} value={this.data().val} /> | ||
<label> | ||
{this.props.label} | ||
<small>{this.props.sublabel}</small> | ||
</label> | ||
</div> | ||
} | ||
}); | ||
|
||
module.exports = Skill; |
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,35 @@ | ||
|
||
.skill{ | ||
position : relative; | ||
padding-left : 15px; | ||
input[type="radio"]{ | ||
margin : 0px; | ||
} | ||
.expertToggle{ | ||
position : absolute; | ||
top : 1px; | ||
left : 0px; | ||
} | ||
input[type="text"]{ | ||
width : 25px; | ||
margin-left : 10px; | ||
background-color : transparent; | ||
text-align : center; | ||
border : none; | ||
border-bottom : 1px solid black; | ||
outline : none; | ||
&:focus{ | ||
background-color : #ddd; | ||
} | ||
} | ||
label{ | ||
margin-left : 10px; | ||
font-size : 0.8em; | ||
small{ | ||
margin-left : 5px; | ||
font-size : 0.8em; | ||
color : #999; | ||
text-transform : uppercase; | ||
} | ||
} | ||
} |
61 changes: 61 additions & 0 deletions
61
client/splatsheet/sheetRenderer/parts/skillList/skillList.jsx
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,61 @@ | ||
var React = require('react'); | ||
var _ = require('lodash'); | ||
var cx = require('classnames'); | ||
|
||
var Skill = require('../skill/skill.jsx'); | ||
var Box = require('../box/box.jsx'); | ||
|
||
|
||
var skill_list = [ | ||
{name : 'Acrobatics', stat : 'Dex'}, | ||
{name : 'Animal Handling', stat : 'Wis'}, | ||
{name : 'Arcana', stat : 'Int'}, | ||
{name : 'Athletics', stat : 'Str'}, | ||
{name : 'Deception', stat : 'Cha'}, | ||
{name : 'History', stat : 'Int'}, | ||
{name : 'Insight', stat : 'Wis'}, | ||
{name : 'Intimidation', stat : 'Cha'}, | ||
{name : 'Investigation', stat : 'Int'}, | ||
{name : 'Medicine', stat : 'Wis'}, | ||
{name : 'Nature', stat : 'Int'}, | ||
{name : 'Perception', stat : 'Wis'}, | ||
{name : 'Performance', stat : 'Cha'}, | ||
{name : 'Persuasion', stat : 'Cha'}, | ||
{name : 'Religion', stat : 'Int'}, | ||
{name : 'Sleight of Hand', stat : 'Dex'}, | ||
{name : 'Stealth', stat : 'Dex'}, | ||
{name : 'Survival', stat : 'Wis'} | ||
] | ||
|
||
|
||
var SkillList = React.createClass({ | ||
getDefaultProps: function() { | ||
return { | ||
name : 'skills', | ||
|
||
//title : 'Skills', | ||
shadow : true, | ||
border : false, | ||
showExpert : false | ||
}; | ||
}, | ||
|
||
|
||
renderSkills : function(){ | ||
return _.map(skill_list, (skill)=>{ | ||
return <Skill | ||
label={skill.name} | ||
sublabel={'(' + skill.stat + ')'} | ||
showExpert={this.props.showExpert} /> | ||
}) | ||
}, | ||
|
||
render : function(){ | ||
return <Box className='skillList' {...this.props}> | ||
{this.renderSkills()} | ||
{this.props.children} | ||
</Box> | ||
} | ||
}); | ||
|
||
module.exports = SkillList; |
3 changes: 3 additions & 0 deletions
3
client/splatsheet/sheetRenderer/parts/skillList/skillList.less
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,3 @@ | ||
.COM{ | ||
|
||
} |
Oops, something went wrong.