Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/Sylvenas/react-magic

A collection of magic animations for react components.
https://github.com/Sylvenas/react-magic

animation css-animations css-in-js inline-styles magic react

Last synced: 3 months ago
JSON representation

A collection of magic animations for react components.

Awesome Lists containing this project

README

        

# react-magic

[![npm version](https://badge.fury.io/js/react-magic.svg)](https://www.npmjs.com/package/react-magic)
react
react
react

A collection of magic animations for react components. Although React provides a way to implement arbitrary animations,
it is not an easy task to do it, even for simple animations. That's where react-magic package comes in. It supports inline styles work with [aphrodite](https://github.com/Khan/aphrodite).
Most animations was implemented base on [magic](https://github.com/miniMAC/magic).

> How to work with [tailwindcss](https://tailwindcss.com/)? Try [tailwindcss-magic](https://github.com/Sylvenas/tailwindcss-magic).





## Demo online

A demo is available on the Github Pages webpage for react-magic [Check out demo](https://lit-forest.github.io/react-magic/react-magic.html)!

## Installation

React-magic is distributed via [npm](https://www.npmjs.com/package/react-magic):

```
npm install --save react-magic
```

## Usage

You can import each animation directly from the main package

```js
import { swap } from "react-magic";
```

or you can import a specific animation directly

```js
import swap from "react-magic/lib/magic/swap";
```

usage with [Aphrodite](https://github.com/Khan/aphrodite)

```js
import React, { Component, PropTypes } from "react";
import { StyleSheet, css } from "aphrodite";

import { swap } from "react-magic";

const styles = StyleSheet.create({
magic: {
animationName: swap,
animationDuration: "1s",
},
});

class App extends Component {
render() {
return (



react-magic




);
}
}

export default App;
```

## Animations

```
.
├── magic
│ |── magic
│ |── twisterInDown
│ |── twisterInUp
│ └── swap
├── bling
│ |── puffIn
│ |── puffOut
│ |── vanishIn
│ └── vanishOut
├── staticEffects
│ |── openDownLeft
│ |── openDownLeftReturn
│ |── openDownRight
│ |── openDownRightReturn
│ |── openUpLeft
│ |── openUpLeftReturn
│ |── openUpRight
│ └── openUpRightReturn
├── staticEffectsOut
│ |── openDownLeftOut
│ |── openDownRightOut
│ |── openUpLeftOut
│ └── openUpRightOut
├── perspective
│ |── perspectiveDown
│ |── perspectiveDownReturn
│ |── perspectiveLeft
│ |── perspectiveLeftReturn
│ |── perspectiveRight
│ |── perspectiveRightReturn
│ |── perspectiveUp
│ └── perspectiveUpReturn
├── rotate
│ |── rotateDownIn
│ |── rotateDownOut
│ |── rotateLeftIn
│ |── rotateLeftOut
│ |── rotateRightIn
│ |── rotateRightOut
│ |── rotateUpIn
│ └── rotateUpOut
├── slide
│ |── slideDown
│ |── slideDownReturn
│ |── slideLeft
│ |── slideLeftReturn
│ |── slideRight
│ |── slideRightReturn
│ |── slideUp
│ └── slideUpReturn
├── math
│ |── foolishIn
│ |── foolishOut
│ |── holeIn
│ |── holeOut
│ |── swashIn
│ └── swashOut
├── tin
│ |── tinDownIn
│ |── tinDownOut
│ |── tinLeftIn
│ |── tinLeftOut
│ |── tinRightIn
│ |── tinRightOut
│ |── tinUpIn
│ └── tinUpOut
├── bomb
│ |── bombLeftOut
│ └── bombRightOut
├── boing
│ |── boingInUp
│ └── boingOutDown
├── space
│ |── spaceInDown
│ |── spaceInLeft
│ |── spaceInRight
│ |── spaceInUp
│ |── spaceOutDown
│ |── spaceOutLeft
│ |── spaceOutRight
│ └── spaceOutUp
```

## License

MIT