diff --git a/client/home/home.jsx b/client/home/home.jsx deleted file mode 100644 index 21c2025..0000000 --- a/client/home/home.jsx +++ /dev/null @@ -1,29 +0,0 @@ -var React = require('react'); -var _ = require('lodash'); -var cx = require('classnames'); - - - - -//var Icon = require('naturalcrit/icon.svg.jsx'); -//var Logo = require('naturalcrit/logo/logo.jsx'); - -//var HomebrewIcon = require('naturalcrit/homebrewIcon.svg.jsx'); -//var CombatIcon = require('naturalcrit/combatIcon.svg.jsx'); - -var Home = React.createClass({ - - navigate : function(){ - - }, - - render : function(){ - return( -
- -
- ); - } -}); - -module.exports = Home; diff --git a/client/home/home.less b/client/home/home.less deleted file mode 100644 index ec02809..0000000 --- a/client/home/home.less +++ /dev/null @@ -1,178 +0,0 @@ -@import 'naturalcrit/styles/reset.less'; -//@import 'naturalcrit/styles/elements.less'; -@import 'naturalcrit/styles/animations.less'; -@import 'naturalcrit/styles/colors.less'; -@import 'naturalcrit/styles/tooltip.less'; - -html,body, #reactContainer{ - min-height: 100vh; - height: 100vh; - margin: 0; - font-family : 'Open Sans', sans-serif; -} - - -.home{ - height : 100vh; - background-color : white; - .top{ - .fadeInTop(1s); - .delay(0.5); - margin-bottom : 100px; - padding-top : 100px; - text-align : center; - .logo{ - font-size : 4em; - color : black; - svg{ - fill : black; - } - } - p{ - margin-top : 10px; - font-size : 1.3em; - font-style : italic; - color : @grey; - } - } - .tools{ - width : 100%; - text-align : center; - .toolContainer{ - .sequentialDelay(0.5s, 1s); - .fadeInDown(1s); - .keep(); - display : inline-block; - cursor : pointer; - opacity : 0; - text-align : center; - border-right : 1px solid #333; - &:last-child{ - border : none; - } - .content{ - .addSketch(360px); - .animateAll(0.5s); - position : relative; - width : 500px; - padding : 40px; - &:hover{ - svg, h2{ - .transform(scale(1.3)); - } - } - h2{ - .animateAll(0.5s); - font-family : 'CodeBold'; - font-size : 2em; - } - p{ - max-width : 300px; - margin : 20px auto; - line-height : 1.5em; - } - svg{ - .animateAll(0.5s); - height : 10em; - } - } - //Proejct specific styles - &.homebrew{ - .content:hover{ - background-color : fade(@teal, 20%); - } - } - &.combat{ - .content:hover{ - background-color : fade(@red, 20%); - } - } - //Under Construction styles - &.underConstruction{ - cursor : initial; - .content{ - &:hover{ - svg, h2{ - .transform(scale(1.0)); - } - } - svg, h2{ - opacity : 0.3; - } - &:after{ - .animateAll(); - content : "Under Construction"; - position : absolute; - display : block; - top : 120px; - left : 0px; - width : 100%; - padding : 10px 0px; - //opacity : 0; - background-color : fade(@grey, 50%); - font-size : 2em; - font-weight : 800; - text-align : center; - text-transform : uppercase; - } - &:before{ - content : ""; - position : absolute; - display : block; - top : 130px; - right : 30px; - height : 50px; - width : 40px; - //opacity : 0; - background-image : url('/assets/naturalCrit/home/bulldozer.png'); - background-repeat : no-repeat; - background-size : contain; - animation-iteration-count : infinite; - } - } - } - } - } -} -.addSketch(@length, @color : black){ - path, line, polyline, circle, rect, polygon { - .sketch(@length, @color, 4s); - stroke-dasharray : @length; - stroke-dashoffset : 0px; - stroke : @color; - stroke-width : 0.5px; - fill : @color; - //.animateAll(3s); - } -} -.sketch(@length, @color : black, @duration : 3s, @easing : @defaultEasing){ - .createAnimation(sketch, @duration, @easing); - .sketchKeyFrames(){ - 0% { stroke-dashoffset : @length; fill: transparent;} - 50% { stroke-dashoffset : @length; fill: transparent;} - 80% { stroke-dashoffset : 0px; fill: transparent;} - 100% { stroke-dashoffset : 0px; fill:@color;} - } - @-webkit-keyframes sketch {.sketchKeyFrames();} - @-moz-keyframes sketch {.sketchKeyFrames();} - @-ms-keyframes sketch {.sketchKeyFrames();} - @-o-keyframes sketch {.sketchKeyFrames();} - @keyframes sketch {.sketchKeyFrames();} -} -/* -.sketch(@length, @color : black, @duration : 3s, @easing : @defaultEasing){ - .createAnimation(bounce, @duration, @easing); - .sketchKeyFrames(){ - 0% { stroke-dashoffset : 0px; fill:@color;} - 15% { stroke-dashoffset : 0px; fill : transparent} - 50% { stroke-dashoffset : @length; fill: transparent} - 85% { stroke-dashoffset : 0px; fill:transparent;} - 100% { stroke-dashoffset : 0px; fill:@color;} - } - @-webkit-keyframes bounce {.sketchKeyFrames();} - @-moz-keyframes bounce {.sketchKeyFrames();} - @-ms-keyframes bounce {.sketchKeyFrames();} - @-o-keyframes bounce {.sketchKeyFrames();} - @keyframes bounce {.sketchKeyFrames();} -} -*/ \ No newline at end of file diff --git a/client/homebrew/brewRenderer/brewRenderer.jsx b/client/homebrew/brewRenderer/brewRenderer.jsx index 96605f2..67a6fbd 100644 --- a/client/homebrew/brewRenderer/brewRenderer.jsx +++ b/client/homebrew/brewRenderer/brewRenderer.jsx @@ -21,20 +21,16 @@ var BrewRenderer = React.createClass({ totalPages : 0, height : 0, - componentDidMount: function() { this.setState({ height : this.refs.main.parentNode.clientHeight }); - }, - handleScroll : function(e){ this.setState({ viewablePageNumber : Math.floor(e.target.scrollTop / PAGE_HEIGHT) }); }, - //Implement later scrollToPage : function(pageNumber){ }, diff --git a/client/homebrew/navbar/editTitle.navitem.jsx b/client/homebrew/navbar/editTitle.navitem.jsx index 45e00a1..85a27fb 100644 --- a/client/homebrew/navbar/editTitle.navitem.jsx +++ b/client/homebrew/navbar/editTitle.navitem.jsx @@ -6,7 +6,7 @@ var Nav = require('naturalcrit/nav/nav.jsx'); const MAX_TITLE_LENGTH = 50; -var RedditShare = React.createClass({ +var EditTitle = React.createClass({ getDefaultProps: function() { return { title : '', @@ -30,4 +30,4 @@ var RedditShare = React.createClass({ }); -module.exports = RedditShare; \ No newline at end of file +module.exports = EditTitle; \ No newline at end of file diff --git a/client/homebrew/navbar/navbar.jsx b/client/homebrew/navbar/navbar.jsx index 3b59a9c..9ab1427 100644 --- a/client/homebrew/navbar/navbar.jsx +++ b/client/homebrew/navbar/navbar.jsx @@ -19,11 +19,7 @@ var Navbar = React.createClass({ v1.5.0 - - - - - {this.props.children} + {this.props.children} } }); diff --git a/client/homebrew/pageContainer/pageContainer.jsx b/client/homebrew/pageContainer/pageContainer.jsx deleted file mode 100644 index 123105d..0000000 --- a/client/homebrew/pageContainer/pageContainer.jsx +++ /dev/null @@ -1,53 +0,0 @@ -var React = require('react'); -var _ = require('lodash'); -var cx = require('classnames'); - -var Markdown = require('marked'); - -var PAGE_HEIGHT = 1056 + 30; - -var PageContainer = React.createClass({ - getDefaultProps: function() { - return { - text : "" - }; - }, - getInitialState: function() { - return { - viewablePageIndex: 0 - }; - }, - - handleScroll : function(e){ - this.setState({ - viewablePageIndex : Math.floor(e.target.scrollTop / PAGE_HEIGHT) - }); - }, - - renderDummyPage : function(key){ - return
- -
- }, - - renderPages : function(){ - var currentIndex = this.state.viewablePageIndex; - return _.map(this.props.text.split('\\page'), (pageText, index) => { - if(currentIndex - 1 == index || currentIndex == index || currentIndex + 1 == index){ - return
- }else{ - return this.renderDummyPage(index); - } - }) - }, - - render : function(){ - return
-
- {this.renderPages()} -
-
; - } -}); - -module.exports = PageContainer; diff --git a/client/homebrew/pageContainer/pageContainer.less b/client/homebrew/pageContainer/pageContainer.less deleted file mode 100644 index 9d06624..0000000 --- a/client/homebrew/pageContainer/pageContainer.less +++ /dev/null @@ -1,14 +0,0 @@ - -@import (less) './client/homebrew/phbStyle/phb.style.less'; -.pageContainer{ - background-color : @steel; - .pages{ - padding : 30px 0px; - &>.phb{ - margin-right : auto; - margin-bottom : 30px; - margin-left : auto; - box-shadow : 1px 4px 14px #000; - } - } -} \ No newline at end of file diff --git a/client/homebrew/statusbar/statusbar.jsx b/client/homebrew/statusbar/statusbar.jsx deleted file mode 100644 index 14eab41..0000000 --- a/client/homebrew/statusbar/statusbar.jsx +++ /dev/null @@ -1,173 +0,0 @@ -var React = require('react'); -var _ = require('lodash'); -var cx = require('classnames'); -var Moment = require('moment'); -var request = require('superagent') - -var Logo = require('naturalcrit/logo/logo.jsx'); - -var replaceAll = function(str, find, replace) { - return str.replace(new RegExp(find, 'g'), replace); -} - -var Statusbar = React.createClass({ - - getDefaultProps: function() { - return { - editId: null, - sourceText : null, - shareId : null, - printId : null, - isPending : false, - lastUpdated : null, - info : null, - views : 0 - }; - }, - - componentDidMount: function() { - //Updates the last updated text every 10 seconds - if(this.props.lastUpdated){ - this.refreshTimer = setInterval(()=>{ - this.forceUpdate(); - }, 10000) - } - }, - - componentWillUnmount: function() { - clearInterval(this.refreshTimer); - }, - - - deleteBrew : function(){ - if(!confirm("are you sure you want to delete this brew?")) return; - if(!confirm("are you REALLY sure? You will not be able to recover it")) return; - - request.get('/homebrew/api/remove/' + this.props.editId) - .send() - .end(function(err, res){ - window.location.href = '/homebrew'; - }); - }, - - - openSourceWindow : function(){ - var sourceWindow = window.open(); - var content = replaceAll(this.props.sourceText, '<', '<'); - content = replaceAll(content, '>', '>'); - sourceWindow.document.write('
' + content + '
'); - }, - - - - renderInfo : function(){ - if(!this.props.lastUpdated) return null; - - return [ -
- Views: {this.props.views} -
, -
- Last updated: {Moment(this.props.lastUpdated).fromNow()} -
- ]; - - }, - - renderChromeTip : function(){ - if(typeof window !== 'undefined' && window.chrome) return; - return
- - Optimized for Chrome -
- }, - - renderSourceButton : function(){ - if(!this.props.sourceText) return null; - - return - View Source - - }, - - renderNewButton : function(){ - if(this.props.editId || this.props.shareId) return null; - - return - New Brew - - }, - - renderChangelogButton : function(){ - if(this.props.editId || this.props.shareId) return null; - - return - Changelog - - }, - - renderShare : function(){ - if(!this.props.shareId) return null; - - return - Share Link - - }, - - renderPrintButton : function(){ - if(!this.props.printId) return null; - - return - Print View - - }, - - renderDeleteButton : function(){ - if(!this.props.editId) return null; - - - return
- Delete -
- }, - - renderStatus : function(){ - if(!this.props.editId) return null; - - var text = 'Saved.' - if(this.props.isPending){ - text = 'Saving...' - } - return
- {text} -
- }, - - render : function(){ - return
- - -
- {this.renderChromeTip()} - {this.renderChangelogButton()} - {this.renderStatus()} - {this.renderInfo()} - {this.renderSourceButton()} - {this.renderDeleteButton()} - {this.renderPrintButton()} - {this.renderShare()} - {this.renderNewButton()} -
-
- } -}); - -module.exports = Statusbar; diff --git a/client/homebrew/statusbar/statusbar.less b/client/homebrew/statusbar/statusbar.less deleted file mode 100644 index bfe2f3d..0000000 --- a/client/homebrew/statusbar/statusbar.less +++ /dev/null @@ -1,135 +0,0 @@ - -.statusbar{ - position : fixed; - z-index : 1000; - height : 25px; - width : 100%; - background-color : black; - font-size : 24px; - color : white; - line-height : 1.0em; - border-bottom : 1px solid @grey; - .logo{ - display : inline-block; - vertical-align : middle; - margin-top : -5px; - margin-right : 20px; - svg{ - margin-top : -6px; - } - } - .left{ - display : inline-block; - vertical-align : top; - } - .right{ - float : right; - } - .toolName{ - display : block; - vertical-align : middle; - font-family : CodeBold; - font-size : 16px; - color : white; - line-height : 30px; - text-decoration : none; - small{ - font-family : CodeBold; - } - } - .controls{ - font-size : 12px; - >*{ - display : inline-block; - height : 100%; - padding : 0px 10px; - border-left : 1px solid @grey; - } - .savingStatus{ - width : 56px; - color : @grey; - text-align : center; - } - .newButton{ - .animate(background-color); - color : white; - text-decoration : none; - &:hover{ - background-color : fade(@green, 70%); - } - } - .chromeField{ - background-color: @orange; - color : white; - text-decoration : none; - i{ - margin-right: 10px; - } - } - .changelogButton{ - .animate(background-color); - color : white; - text-decoration : none; - &:hover{ - background-color : fade(@purple, 70%); - } - } - .deleteButton{ - .animate(background-color); - color : white; - text-decoration : none; - cursor: pointer; - &:hover{ - background-color : fade(@red, 70%); - } - } - .shareField{ - .animate(background-color); - cursor : pointer; - color : white; - text-decoration : none; - &:hover{ - background-color : fade(@teal, 70%); - } - span{ - margin-right : 5px; - } - input{ - width : 100px; - font-size : 12px; - } - } - .printField{ - .animate(background-color); - cursor : pointer; - color : white; - text-decoration : none; - &:hover{ - background-color : fade(@orange, 70%); - } - span{ - margin-right : 5px; - } - input{ - width : 100px; - font-size : 12px; - } - } - .sourceField{ - .animate(background-color); - cursor : pointer; - color : white; - text-decoration : none; - &:hover{ - background-color : fade(@teal, 70%); - } - span{ - margin-right : 5px; - } - input{ - width : 100px; - font-size : 12px; - } - } - } -} \ No newline at end of file diff --git a/shared/naturalcrit/splitPane/splitPane.jsx b/shared/naturalcrit/splitPane/splitPane.jsx index 336311e..4e98216 100644 --- a/shared/naturalcrit/splitPane/splitPane.jsx +++ b/shared/naturalcrit/splitPane/splitPane.jsx @@ -5,12 +5,13 @@ var cx = require('classnames'); var SplitPane = React.createClass({ getDefaultProps: function() { return { + storageKey : 'naturalcrit-pane-split', onDragFinish : function(){} //fires when dragging + }; }, getInitialState: function() { return { - storageKey : 'naturalcrit-pane-split', size : null, isDragging : false }; @@ -69,6 +70,11 @@ var SplitPane = React.createClass({ } }); + + + + + var Pane = React.createClass({ getDefaultProps: function() { return {