Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update deps, add note on popStateTransitionName & example #2

Merged
merged 1 commit into from
Oct 4, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 7 additions & 7 deletions bundle.js

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ var AnimatedLocations = React.createClass({
var App = React.createClass({
render: function() {
return (
<AnimatedLocations hash className="Main" transitionName="moveUp">
<AnimatedLocations hash className="Main" transitionName="moveUp" popStateTransitionName="fade">
<Location path="/" handler={MainPage} />
<Location path="/about" handler={AboutPage} />
</AnimatedLocations>
Expand All @@ -65,7 +65,7 @@ var MainPage = React.createClass({
All you need is to use <code>AnimatedLocations</code> router:
</p>
<pre>{[
'<AnimatedLocations className="Main" transitionName="moveUp">',
'<AnimatedLocations className="Main" transitionName="moveUp" popStateTransitionName="fade">',
' <Location path="/" handler={MainPage} />',
' <Location path="/about" handler={AboutPage} />',
'</AnimatedLocations>'
Expand Down Expand Up @@ -111,6 +111,11 @@ var AboutPage = React.createClass({
This link will lead to <Link noTransition transitionName="moveDown" href="/">main page
</Link> too but with no animated transition.
</p>
<p>
You can also use the back/forward buttons in your browser. <br />
Back/forward actions will use the <code>popStateTransitionName</code> specified in the props. <br />
It is set to a fade transition in this demo. If none is specified, no animation will be used.
</p>
</div>
</div>
)
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"description": "Demo for React + React Router component + page transitions",
"main": "index.js",
"dependencies": {
"browserify": "~3.30.2",
"envify": "~1.2.1",
"reactify": "~0.8.1",
"uglifyjs": "^2.3.6",
"watchify": "^0.6.1",
"react": "~0.10.0",
"react-async": "~0.9.2",
"react-router-component": "~0.18.2"
"browserify": "~6.0.2",
"envify": "~3.0.0",
"reactify": "~0.14.0",
"uglifyjs": "~2.3.6",
"watchify": "~1.0.6",
"react": "~0.11.2",
"react-async": "~1.0.2",
"react-router-component": "~0.21.2"
},
"devDependencies": {},
"scripts": {
Expand Down
18 changes: 18 additions & 0 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,21 @@ pre {
-webkit-transform: translate3d(0,15%,0);
opacity: 0.3;
}

.fade-enter {
opacity: 0.01;
transition: opacity .1s ease-in;
}

.fade-enter.fade-enter-active {
opacity: 1;
}

.fade-leave {
opacity: 1;
transition: opacity .1s ease-in;
}

.fade-leave.fade-leave-active {
opacity: 0.01;
}