diff --git a/src/app/main/main-home/main-home-page.scss b/src/app/main/main-home/main-home-page.scss index 005e036c..df8c4f56 100644 --- a/src/app/main/main-home/main-home-page.scss +++ b/src/app/main/main-home/main-home-page.scss @@ -1,6 +1,4 @@ .main-home-page { - text-align: center; - min-height: 400px; &--widget { display: inline-block; diff --git a/src/app/main/main-layout.js b/src/app/main/main-layout.js index 429762be..41e5f58c 100644 --- a/src/app/main/main-layout.js +++ b/src/app/main/main-layout.js @@ -3,6 +3,8 @@ import {RouteHandler} from 'react-router'; import MainHeader from 'app/main/main-layout-header'; import MainFooter from 'app/main/main-layout-footer'; +import {TransitionMotion, spring} from 'react-motion'; +import RouteTransition from 'utils/route-transition'; var MainLayout = React.createClass({ @@ -12,7 +14,9 @@ var MainLayout = React.createClass({ - {this.props.children} +
+ {this.props.children} +
diff --git a/src/app/main/main-layout.scss b/src/app/main/main-layout.scss index ee3c21f6..4a9c408a 100644 --- a/src/app/main/main-layout.scss +++ b/src/app/main/main-layout.scss @@ -6,4 +6,10 @@ background-color: $grey; max-width: 1100px; border-radius: 4px; + + &--content { + text-align: center; + min-height: 400px; + width: 1100px; + } } diff --git a/src/app/main/main-signup/main-signup-page.js b/src/app/main/main-signup/main-signup-page.js index a5570d9d..989cfb1a 100644 --- a/src/app/main/main-signup/main-signup-page.js +++ b/src/app/main/main-signup/main-signup-page.js @@ -1,12 +1,14 @@ import React from 'react/addons'; import {RouteHandler} from 'react-router'; +import MainHomePageLoginWidget from 'app/main/main-home/main-home-page-login-widget'; var MainSignUpPage = React.createClass({ render() { return ( -
- this is the sing up page +
+ This is the sign up page +
); } diff --git a/src/utils/route-transition.js b/src/utils/route-transition.js new file mode 100644 index 00000000..13c633c1 --- /dev/null +++ b/src/utils/route-transition.js @@ -0,0 +1,64 @@ +const React = require('react/addons'); +const { PropTypes } = React; +const { TransitionMotion, spring } = require('react-motion'); + +const RouteTransition = React.createClass({ + propTypes: { + pathname: PropTypes.string.isRequired + }, + + willEnter() { + const { children } = this.props; + + return { + handler: children, + opacity: spring(0, [200,10]) + }; + }, + + willLeave(key, value) { + return { + handler: value.handler, + opacity: spring(0, [200,10]) + }; + }, + + getEndValue() { + const { children, pathname } = this.props; + + return { + [pathname]: { + handler: children, + opacity: spring(1, [200,10]) + } + }; + }, + + render() { + return ( + + {interpolated => { + return (
+ {Object.keys(interpolated).map(key => +
+ {interpolated[key].handler} + {interpolated[key].opacity} +
+ )} +
);}} + +
+ ); + } +}); + +module.exports = RouteTransition; \ No newline at end of file