From ef7a5009409b133e5724b3b707c863a7a16354b5 Mon Sep 17 00:00:00 2001 From: Scott Tolksdorf Date: Sun, 20 Dec 2015 13:24:23 -0500 Subject: [PATCH] Increasing size of first letter, and setting up for ajax communication --- client/homebrew/editPage/editPage.jsx | 24 ++++++++++-- client/homebrew/navbar/navbar.jsx | 17 --------- client/homebrew/navbar/navbar.less | 3 -- client/homebrew/phb/phb.less | 26 ++++++------- gulpfile.js | 2 + package.json | 1 + server.js | 17 +-------- server/homebrew.api.js | 54 +++++++++++++++++++++++++++ 8 files changed, 92 insertions(+), 52 deletions(-) delete mode 100644 client/homebrew/navbar/navbar.jsx delete mode 100644 client/homebrew/navbar/navbar.less diff --git a/client/homebrew/editPage/editPage.jsx b/client/homebrew/editPage/editPage.jsx index bd6e294..9ab38ee 100644 --- a/client/homebrew/editPage/editPage.jsx +++ b/client/homebrew/editPage/editPage.jsx @@ -2,6 +2,11 @@ var React = require('react'); var _ = require('lodash'); var cx = require('classnames'); +var PHB = require('../phb/phb.jsx'); +var Editor = require('../editor/editor.jsx'); + +var request = require("superagent"); + var EditPage = React.createClass({ getDefaultProps: function() { return { @@ -10,13 +15,26 @@ var EditPage = React.createClass({ }; }, + getInitialState: function() { + return { + text: this.props.text + }; + }, + + handleTextChange : function(text){ + this.setState({ + text : text + }); + + //Ajax time + }, + render : function(){ var self = this; return(
- {this.props.id} - EditPage Ready! - {this.props.text} + +
); } diff --git a/client/homebrew/navbar/navbar.jsx b/client/homebrew/navbar/navbar.jsx deleted file mode 100644 index 48e0eb5..0000000 --- a/client/homebrew/navbar/navbar.jsx +++ /dev/null @@ -1,17 +0,0 @@ -var React = require('react'); -var _ = require('lodash'); -var cx = require('classnames'); - -var Navbar = React.createClass({ - - render : function(){ - var self = this; - return( -
- Navbar Ready! -
- ); - } -}); - -module.exports = Navbar; diff --git a/client/homebrew/navbar/navbar.less b/client/homebrew/navbar/navbar.less deleted file mode 100644 index f6858f1..0000000 --- a/client/homebrew/navbar/navbar.less +++ /dev/null @@ -1,3 +0,0 @@ -.navbar{ - -} \ No newline at end of file diff --git a/client/homebrew/phb/phb.less b/client/homebrew/phb/phb.less index ee74bc4..0890bb9 100644 --- a/client/homebrew/phb/phb.less +++ b/client/homebrew/phb/phb.less @@ -7,42 +7,42 @@ } @font-face { font-family : BookInsanity; - src : url('/assets/naturalCrit/homebrew/assets/Bookinsanity.otf'); + src : url('/assets/homebrew/assets/Bookinsanity.otf'); } @font-face { font-family : BookInsanityBold; - src : url('/assets/naturalCrit/homebrew/assets/Bookinsanity Bold.otf'); + src : url('/assets/homebrew/assets/Bookinsanity Bold.otf'); } @font-face { font-family : BookInsanityItalic; - src : url('/assets/naturalCrit/homebrew/assets/Bookinsanity Italic.otf'); + src : url('/assets/homebrew/assets/Bookinsanity Italic.otf'); } @font-face { font-family : BookInsanityBoldItalic; - src : url('/assets/naturalCrit/homebrew/assets/Bookinsanity Bold Italic.otf'); + src : url('/assets/homebrew/assets/Bookinsanity Bold Italic.otf'); } @font-face { font-family : ScalaSans; - src : url('/assets/naturalCrit/homebrew/assets/Scaly Sans.otf'); + src : url('/assets/homebrew/assets/Scaly Sans.otf'); } /* @font-face { font-family : ScalaSansBold; - src : url('/assets/naturalCrit/homebrew/assets/Scala Sans Bold.ttf'); + src : url('/assets/homebrew/assets/Scala Sans Bold.ttf'); } */ @font-face { font-family : ScalaSansSmallCaps; - src : url('/assets/naturalCrit/homebrew/assets/Scala Sans SmallCaps.ttf'); + src : url('/assets/homebrew/assets/Scala Sans SmallCaps.ttf'); } @font-face { font-family : Solbera; - src : url('/assets/naturalCrit/homebrew/assets/Solbera Imitation.otf'); + src : url('/assets/homebrew/assets/Solbera Imitation.otf'); } @font-face { font-family : MrEaves; - src : url('/assets/naturalCrit/homebrew/assets/MrsEavesSmallCaps_Regular.ttf') format('truetype'), - url('/assets/naturalCrit/homebrew/assets/Mr Eaves Small Caps.otf') format('otf'); + src : url('/assets/homebrew/assets/MrsEavesSmallCaps_Regular.ttf') format('truetype'), + url('/assets/homebrew/assets/Mr Eaves Small Caps.otf') format('otf'); } .phb{ @background : #f2ece4; @@ -59,7 +59,7 @@ column-gap : 1cm; column-width : 8cm; background-color: #EEE5CE; - background-image : url('/assets/naturalCrit/homebrew/assets/PHB-background.png'); + background-image : url('/assets/homebrew/assets/PHB-background.png'); -webkit-column-count : 2; -moz-column-count : 2; -webkit-column-width : 8cm; @@ -297,9 +297,9 @@ &::first-letter{ float : left; margin-top : 20px; - margin-bottom : 10px; + margin-bottom : 15px; font-family : Solbera; - font-size : 4.5em; + font-size : 7em; } } } diff --git a/gulpfile.js b/gulpfile.js index 4bbf7d5..9a86463 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -27,6 +27,8 @@ var gulp = vitreumTasks(gulp, { "classnames", "jsoneditor", + "superagent", + "marked", "pico-router", "pico-flux" diff --git a/package.json b/package.json index 82602a6..5fa5234 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "react": "^0.14.2", "react-dom": "^0.14.2", "shortid": "^2.2.4", + "superagent": "^1.6.1", "vitreum": "^3.1.1" } } diff --git a/server.js b/server.js index 05bf1a0..415867c 100644 --- a/server.js +++ b/server.js @@ -7,22 +7,7 @@ app.use(express.static(__dirname + '/build')); - -app.get('/homebrew*', function (req, res) { - vitreumRender({ - page: './build/homebrew/bundle.dot', - globals:{}, - prerenderWith : './client/homebrew/homebrew.jsx', - initialProps: { - url: req.originalUrl, - - text : "cool" - }, - clearRequireCache : true, - }, function (err, page) { - return res.send(page) - }); -}); +app = require('./server/homebrew.api.js')(app); diff --git a/server/homebrew.api.js b/server/homebrew.api.js index e69de29..23b1909 100644 --- a/server/homebrew.api.js +++ b/server/homebrew.api.js @@ -0,0 +1,54 @@ +var vitreumRender = require('vitreum/render'); + + + +module.exports = function(app){ + + + + + + app.get('/homebrew/edit/:id', function(req, res){ + + console.log(req.params.id); + + + vitreumRender({ + page: './build/homebrew/bundle.dot', + globals:{}, + prerenderWith : './client/homebrew/homebrew.jsx', + initialProps: { + url: req.originalUrl, + }, + clearRequireCache : true, + }, function (err, page) { + return res.send(page) + }); + }); + + + app.get('/homebrew*', function (req, res) { + vitreumRender({ + page: './build/homebrew/bundle.dot', + globals:{}, + prerenderWith : './client/homebrew/homebrew.jsx', + initialProps: { + url: req.originalUrl, + }, + clearRequireCache : true, + }, function (err, page) { + return res.send(page) + }); + }); + + + + + + + + + + + return app; +} \ No newline at end of file