0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-29 19:52:43 +00:00

Full class tables workign with background

This commit is contained in:
Scott
2015-12-28 21:03:20 -05:00
parent ecd17a22c7
commit 29d03c8263
12 changed files with 131 additions and 28 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@@ -2,6 +2,7 @@ var React = require('react');
var _ = require('lodash');
var cx = require('classnames');
var Statusbar = require('../statusbar/statusbar.jsx');
var PHB = require('../phb/phb.jsx');
var Editor = require('../editor/editor.jsx');
@@ -25,7 +26,8 @@ var EditPage = React.createClass({
getInitialState: function() {
return {
text: this.props.entry.text
text: this.props.entry.text,
pending : false
};
},
@@ -65,6 +67,12 @@ var EditPage = React.createClass({
return <div className='editPage'>
<button onClick={this.handleSave}>save</button> {temp}
<Statusbar
editId={this.props.entry.editId}
shareId={this.props.entry.shareId}
isPending={this.state.pending} />
<Editor text={this.state.text} onChange={this.handleTextChange} />
<PHB text={this.state.text} />
</div>

View File

@@ -38,7 +38,7 @@ var Icons = [
},
{
icon : 'fa-table',
snippet : "",
snippet : Snippets.classTable,
tooltip : "Class Table"
},
{

View File

@@ -104,7 +104,11 @@ module.exports = {
"> ***Multiattack.*** The armor makes two two melee attacks.",
">",
"> ***Slam.*** *Melee Weapon Attack:* +4 to hit, reach 5ft., one target. *Hit* 5 (1d6 + 2) ",
].join('\n')
].join('\n'),
classTable : [
].join('\n'),
}

View File

@@ -73,27 +73,17 @@
overflow: hidden;
//Accents
&:before, &:after{
&:after{
content : "";
position: absolute;
height: 50px;
width: 100%;
bottom : 0px;
left: 0px;
background-size: cover;
width : 100%;
background-image : url('/assets/homebrew/assets/accent.png');
}
&:before{
top: 0px;
}
&:after{
-moz-transform: scaleY(-1);
-o-transform: scaleY(-1);
-webkit-transform: scaleY(-1);
transform: scaleY(-1);
bottom : 0px;
}
p,ul,blockquote{
@@ -140,6 +130,14 @@
-webkit-column-span : all;
column-span : all;
background-color: white;
border-image-source: url('/assets/homebrew/assets/frame_border.png');
border-image-slice: 150 200 150 200;
border-image-width: 47px;
border-image-outset: 37px 17px;
border-image-repeat: round;
margin: 40px 0px;
border-collapse: separate;
border: initial;
}
table{
width : 100%;
@@ -151,13 +149,19 @@
th{
padding-bottom : 0.3em;
}
}
tr{
td{
padding : 0.2em 0em;
tr{
//background-color : white;
}
&:nth-child(even){
background : @green;
}
tbody{
tr{
td{
padding : 0.2em 0em;
}
&:nth-child(odd){
background-color : @green;
}
}
}
}
@@ -218,6 +222,18 @@
-webkit-column-span : 1;
column-span : 1;
background-color: transparent;
border-image: none;
margin: 0;
thead{
tr{
//background-color: transparent;
}
}
tbody{
tr:nth-child(odd), tr:nth-child(even){
background-color: transparent;
}
}
}
table{
color : @header;
@@ -323,7 +339,7 @@
&::first-letter{
float: left;
margin-top: 0.3em;
margin-bottom: 0.3em;
margin-bottom: 0.4em;
font-family: Solbera;
font-size: 10em;
color : #222;

View File

@@ -2,21 +2,73 @@ var React = require('react');
var _ = require('lodash');
var cx = require('classnames');
var Logo = require('naturalCrit/logo/logo.jsx');
var Statusbar = React.createClass({
getDefaultProps: function() {
return {
editId: null,
shareId : null,
isPending : false,
info : null
};
},
render : function(){
var self = this;
return(
<div className='statusbar'>
Statusbar Ready!
renderInfo : function(){
//render last update?
//number of times viewed?
},
renderNewButton : function(){
if(this.props.editId) return null;
return <a className='newButton' target='_blank' href='/homebrew/new'>
<i className='fa fa-new' />
New
</a>
},
renderLinks : function(){
if(!this.props.editId) return null;
return [
<div className='' key='edit'>
<span>Edit Link</span>
<input type='text' readOnly value={this.props.editId} />
</div>,
<div className='' key='share'>
<a herf={'/share/' + this.props.shareId}>Share Link</a>
<input type='text' readOnly value={this.props.shareId} />
</div>
);
]
},
renderStatus : function(){
if(!this.props.editId) return null;
var text = 'Saved.'
if(this.props.isPending){
text = 'Saving...'
}
return <div className='savingStatus'>
{text}
</div>
},
render : function(){
console.log(this.props);
return <div className='statusbar'>
<Logo />
Statusbar Ready!
<div className='controls'>
{this.renderLinks()}
{this.renderStatus()}
{this.renderNewButton()}
</div>
</div>
}
});

View File

@@ -1,3 +1,12 @@
.statusbar{
font-size : 1.8em;
color : white;
svg{
vertical-align : middle;
height : 1em;
margin-right : 0.2em;
cursor : pointer;
fill : white;
}
}

View File

@@ -4,6 +4,8 @@
@import 'naturalCrit/styles/colors.less';
@import 'naturalCrit/styles/tooltip.less';
@import 'font-awesome/css/font-awesome.css';
html,body, #reactContainer, .naturalCrit{
min-height : 100%;
}