Skip to content

Commit

Permalink
feat: add fadeInExpand animation
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Mar 17, 2018
1 parent e330080 commit cc3e75e
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions .storybook/animate.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const {addon: addonKeyframes} = require('../addon/keyframes');
const animations = [
'fadeIn',
'fadeInDown',
'fadeInExpand',
];

const nano = create();
Expand Down
25 changes: 25 additions & 0 deletions addon/animate/fadeInExpand.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
'use strict';

exports.addon = function (renderer) {
if (process.env.NODE_ENV !== 'production') {
require('../__dev__/warnOnMissingDependencies')('animate', renderer, ['keyframes']);
}

renderer.put('', {
'@keyframes fadeInExpand': {
from: {
opacity: 0,
transform: 'scale(.95)'
},

to: {
opacity: 1,
transform: 'scale(1)',
}
},

'.fadeInExpand': {
animation: 'fadeInExpand .3s',
}
});
};
1 change: 1 addition & 0 deletions docs/animations.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ name.

- `animate/fadeIn`
- `animate/fadeInDown`
- `animate/fadeInExpand`

Read more about the [Addons Installation](./Addons.md#addon-installation).

Expand Down

0 comments on commit cc3e75e

Please sign in to comment.