mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-06 20:52:40 +00:00
Styled the homepage a bit better
This commit is contained in:
@@ -14,7 +14,7 @@ var Homebrew = React.createClass({
|
|||||||
return {
|
return {
|
||||||
url : "",
|
url : "",
|
||||||
text : "",
|
text : "",
|
||||||
entry : {
|
brew : {
|
||||||
text : "",
|
text : "",
|
||||||
shareId : null,
|
shareId : null,
|
||||||
editId : null,
|
editId : null,
|
||||||
@@ -26,10 +26,10 @@ var Homebrew = React.createClass({
|
|||||||
componentWillMount: function() {
|
componentWillMount: function() {
|
||||||
Router = CreateRouter({
|
Router = CreateRouter({
|
||||||
'/homebrew/edit/:id' : (args) => {
|
'/homebrew/edit/:id' : (args) => {
|
||||||
return <EditPage id={args.id} entry={this.props.entry} />
|
return <EditPage id={args.id} entry={this.props.brew} />
|
||||||
},
|
},
|
||||||
'/homebrew/share/:id' : (args) => {
|
'/homebrew/share/:id' : (args) => {
|
||||||
return <SharePage id={args.id} entry={this.props.entry} />
|
return <SharePage id={args.id} entry={this.props.brew} />
|
||||||
},
|
},
|
||||||
'/homebrew*' : <HomePage />,
|
'/homebrew*' : <HomePage />,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -29,56 +29,60 @@
|
|||||||
.sequentialDelay(0.5s, 1s);
|
.sequentialDelay(0.5s, 1s);
|
||||||
.fadeInDown(1s);
|
.fadeInDown(1s);
|
||||||
.keep();
|
.keep();
|
||||||
opacity : 0;
|
|
||||||
display : inline-block;
|
display : inline-block;
|
||||||
|
|
||||||
|
|
||||||
cursor : pointer;
|
cursor : pointer;
|
||||||
|
opacity : 0;
|
||||||
text-align : center;
|
text-align : center;
|
||||||
border-right : 5px solid @silver;
|
border-right : 1px solid #333;
|
||||||
&:last-child{
|
&:last-child{
|
||||||
border : none;
|
border : none;
|
||||||
}
|
}
|
||||||
.content{
|
.content{
|
||||||
.addSketch(360px);
|
.addSketch(360px);
|
||||||
.animate(background-color, 0.5s);
|
.animate(background-color, 0.5s);
|
||||||
padding : 40px;
|
width : 500px;
|
||||||
width : 500px;
|
padding : 40px;
|
||||||
|
|
||||||
&:hover{
|
&:hover{
|
||||||
background-color: fade(@red, 20%);
|
|
||||||
svg, h2{
|
svg, h2{
|
||||||
.transform(scale(1.3));
|
.transform(scale(1.3));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
h2{
|
h2{
|
||||||
|
.animateAll(0.5s);
|
||||||
font-family : 'CodeBold';
|
font-family : 'CodeBold';
|
||||||
font-size : 2em;
|
font-size : 2em;
|
||||||
.animateAll(0.5s);
|
|
||||||
}
|
}
|
||||||
p{
|
p{
|
||||||
max-width : 300px;
|
max-width : 300px;
|
||||||
margin : 20px auto;
|
margin : 20px auto;
|
||||||
|
line-height: 1.5em;
|
||||||
}
|
}
|
||||||
svg{
|
svg{
|
||||||
.animateAll(0.5s);
|
.animateAll(0.5s);
|
||||||
height : 10em;
|
height : 10em;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Proejct specific styles
|
||||||
|
&.homebrew{
|
||||||
|
.content:hover{
|
||||||
|
background-color : fade(@teal, 20%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&.combat{
|
||||||
|
.content:hover{
|
||||||
|
background-color : fade(@red, 20%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.addSketch(@length, @color : black){
|
.addSketch(@length, @color : black){
|
||||||
&:hover{
|
|
||||||
path, line, polyline, circle, rect, polygon{
|
|
||||||
.sketch(@length, @color, 2s)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
path, line, polyline, circle, rect, polygon {
|
path, line, polyline, circle, rect, polygon {
|
||||||
|
.sketch(@length, @color, 4s);
|
||||||
stroke-dasharray : @length;
|
stroke-dasharray : @length;
|
||||||
stroke-dashoffset : 0px;
|
stroke-dashoffset : 0px;
|
||||||
stroke : @color;
|
stroke : @color;
|
||||||
@@ -87,6 +91,21 @@
|
|||||||
//.animateAll(3s);
|
//.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){
|
.sketch(@length, @color : black, @duration : 3s, @easing : @defaultEasing){
|
||||||
.createAnimation(bounce, @duration, @easing);
|
.createAnimation(bounce, @duration, @easing);
|
||||||
.sketchKeyFrames(){
|
.sketchKeyFrames(){
|
||||||
@@ -101,4 +120,5 @@
|
|||||||
@-ms-keyframes bounce {.sketchKeyFrames();}
|
@-ms-keyframes bounce {.sketchKeyFrames();}
|
||||||
@-o-keyframes bounce {.sketchKeyFrames();}
|
@-o-keyframes bounce {.sketchKeyFrames();}
|
||||||
@keyframes bounce {.sketchKeyFrames();}
|
@keyframes bounce {.sketchKeyFrames();}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
@@ -12,31 +12,6 @@ module.exports = function(app){
|
|||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
//Edit Page
|
|
||||||
app.get('/homebrew/edit/:id', function(req, res){
|
|
||||||
HomebrewModel.find({editId : req.params.id}, function(err, objs){
|
|
||||||
var resObj = null;
|
|
||||||
var errObj = {text: "# oops\nCould not find the homebrew."}
|
|
||||||
if(objs.length){
|
|
||||||
resObj = objs[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
vitreumRender({
|
|
||||||
page: './build/homebrew/bundle.dot',
|
|
||||||
globals:{},
|
|
||||||
prerenderWith : './client/homebrew/homebrew.jsx',
|
|
||||||
initialProps: {
|
|
||||||
url: req.originalUrl,
|
|
||||||
entry : resObj || errObj
|
|
||||||
},
|
|
||||||
clearRequireCache : true,
|
|
||||||
}, function (err, page) {
|
|
||||||
return res.send(page)
|
|
||||||
});
|
|
||||||
})
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
//Updating
|
//Updating
|
||||||
app.put('/homebrew/update/:id', function(req, res){
|
app.put('/homebrew/update/:id', function(req, res){
|
||||||
HomebrewModel.find({editId : req.params.id}, function(err, objs){
|
HomebrewModel.find({editId : req.params.id}, function(err, objs){
|
||||||
@@ -68,6 +43,32 @@ module.exports = function(app){
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Edit Page
|
||||||
|
app.get('/homebrew/edit/:id', function(req, res){
|
||||||
|
HomebrewModel.find({editId : req.params.id}, function(err, objs){
|
||||||
|
var resObj = null;
|
||||||
|
var errObj = {text: "# oops\nCould not find the homebrew."}
|
||||||
|
if(objs.length){
|
||||||
|
resObj = objs[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
vitreumRender({
|
||||||
|
page: './build/homebrew/bundle.dot',
|
||||||
|
globals:{},
|
||||||
|
prerenderWith : './client/homebrew/homebrew.jsx',
|
||||||
|
initialProps: {
|
||||||
|
url: req.originalUrl,
|
||||||
|
brew : resObj || errObj
|
||||||
|
},
|
||||||
|
clearRequireCache : true,
|
||||||
|
}, function (err, page) {
|
||||||
|
return res.send(page)
|
||||||
|
});
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
//Share Page
|
//Share Page
|
||||||
app.get('/homebrew/share/:id', function(req, res){
|
app.get('/homebrew/share/:id', function(req, res){
|
||||||
HomebrewModel.find({shareId : req.params.id}, function(err, objs){
|
HomebrewModel.find({shareId : req.params.id}, function(err, objs){
|
||||||
@@ -87,7 +88,7 @@ module.exports = function(app){
|
|||||||
prerenderWith : './client/homebrew/homebrew.jsx',
|
prerenderWith : './client/homebrew/homebrew.jsx',
|
||||||
initialProps: {
|
initialProps: {
|
||||||
url: req.originalUrl,
|
url: req.originalUrl,
|
||||||
entry : resObj || errObj
|
brew : resObj || errObj
|
||||||
},
|
},
|
||||||
clearRequireCache : true,
|
clearRequireCache : true,
|
||||||
}, function (err, page) {
|
}, function (err, page) {
|
||||||
|
|||||||
Reference in New Issue
Block a user