Skip to content

Commit 9895d1d

Browse files
author
Daniel Gómez
committed
Initial commit
0 parents  commit 9895d1d

File tree

6 files changed

+2187
-0
lines changed

6 files changed

+2187
-0
lines changed

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2017 BlackBox Vision
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Styled Animation
2+
> Handle animations with style.
3+
4+
5+
6+
##Installation
7+
8+
**YARN**
9+
10+
```javascript
11+
yarn add styled-animation
12+
```
13+
14+
**NPM**
15+
16+
```javascript
17+
npm install --save styled-animation
18+
```
19+
20+
##Usage
21+
22+
The usage is really simple:
23+
24+
```javascript
25+
import { Animation } from 'styled-animation';
26+
import React from 'react';
27+
import ReactDOM from 'react-dom';
28+
29+
const Example = (
30+
<Animation name="fadeInOut" duration="2s" timing="ease-out>
31+
Hey!, i'm animated!
32+
</Animation>
33+
);
34+
35+
ReactDOM.render(<Example />, document.getElementById("root");
36+
```
37+
38+
styled-animations supports all the animations provided by react-animations
39+
40+
41+
##Issues
42+
43+
If you found a bug, or you have an answer, or whatever. Please, open an [issue](https://github.com/BlackBoxVision/styled-animation/issues). I will do the best to fix it, or help you.
44+
45+
##Contributing
46+
47+
Of course, if you see something that you want to upgrade from this library, or a bug that needs to be solved, **PRs are welcome!**
48+
49+
##License
50+
51+
Distributed under the **MIT license**. See [LICENSE](https://github.com/BlackBoxVision/styled-animation/blob/master/LICENSE) for more information.

package.json

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"name": "styled-animation",
3+
"version": "1.0.0",
4+
"description": "Multer Storage Engine to save uploads directly to MongoDB GridFS",
5+
"main": "dist/index.js",
6+
"scripts": {
7+
"clean": "rimraf ./dist",
8+
"compile": "babel ./src -d ./dist",
9+
"build": "yarn run clean && yarn run compile",
10+
"yarn-publish": "yarn run build && yarn publish",
11+
"test": "mocha ./test --compilers js:babel-register --require babel-polyfill",
12+
"coverage": "babel-node ./node_modules/.bin/isparta cover _mocha"
13+
},
14+
"repository": "git+https://github.com/BlackBoxVision/styled-animation.git",
15+
"keywords": [
16+
"styled-component",
17+
"animate.css",
18+
"react-animations"
19+
],
20+
"author": "BlackBox Vision",
21+
"license": "MIT",
22+
"bugs": {
23+
"url": "https://github.com/BlackBoxVision/styled-animation/issues"
24+
},
25+
"homepage": "https://github.com/BlackBoxVision/multer-gridfs#readme",
26+
"dependencies": {
27+
"gridfs-stream": "^1.1.1",
28+
"react-animations": "^0.1.0",
29+
"styled-components": "^2.0.0"
30+
},
31+
"devDependencies": {
32+
"babel-cli": "^6.22.2",
33+
"babel-preset-babili": "^0.0.10",
34+
"babel-preset-es2015": "^6.22.0",
35+
"babel-preset-stage-0": "^6.22.0",
36+
"rimraf": "^2.5.4"
37+
}
38+
}

src/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export Animation from './lib/Animation';

src/lib/Animation.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import styled, { keyframes } from 'styled-components';
2+
3+
import * as animations from 'react-animations';
4+
5+
const frames = (name) => keyframes`
6+
${animations[name]}
7+
`;
8+
9+
const Animation = styled.div`
10+
animation: ${({name}) => frames(name)} ${({duration}) => duration? duration : "1s"} ${({timing}) => timing? timing : "ease"};
11+
`;
12+
13+
export default Animation;

0 commit comments

Comments
 (0)