Skip to content

Commit

Permalink
feat: add fadeIn animation story
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Mar 17, 2018
1 parent 3b5f0b0 commit b17051d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
25 changes: 25 additions & 0 deletions .storybook/animate.stories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import {createElement as h} from 'react';
import {storiesOf} from '@storybook/react';
const {action} = require('@storybook/addon-actions');
const {linkTo} = require('@storybook/addon-links');
const {create} = require('../index');
const {addon: addonRule} = require('../addon/rule');
const {addon: addonKeyframes} = require('../addon/keyframes');
const {addon: addonFadeIn} = require('../addon/animate/fadeIn');

const nano = create();
addonRule(nano);
addonKeyframes(nano);
addonFadeIn(nano);
const {rule} = nano;

var className = rule({
width: '200px',
height: '200px',
background: 'red',
});

storiesOf('Addons/Animate', module)
.add('fadeIn', () =>
h('div', {className: 'fadeIn' + className}, 'Hello world')
)
2 changes: 1 addition & 1 deletion addon/animate/fadeIn.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ exports.addon = function (renderer) {
},

'.fadeIn': {
animationName: 'fadeIn',
animation: 'fadeIn .4s linear',
}
});
};

0 comments on commit b17051d

Please sign in to comment.