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

https://github.com/jpgorman/postcss-invert-keyframes

PostCss plugin that takes a keyframe animation and duplicates it, with a reversed or mirror version. This creates a reverse of the given keyframe animation.
https://github.com/jpgorman/postcss-invert-keyframes

keyframe-animation keyframes postcss postcss-plugin reverse

Last synced: 3 days ago
JSON representation

PostCss plugin that takes a keyframe animation and duplicates it, with a reversed or mirror version. This creates a reverse of the given keyframe animation.

Awesome Lists containing this project

README

          

[![Build Status](https://travis-ci.org/jpgorman/postcss-invert-keyframes.svg?branch=master)](https://travis-ci.org/jpgorman/postcss-invert-keyframes)
[![npm version](https://badge.fury.io/js/postcss-invert-keyframes.svg)](https://badge.fury.io/js/postcss-invert-keyframes)

#PostCSS plugin invert-keyframes
[PostCSS] plugin that copies as set of keyframes, copies them and then adds an inverted version so that the animation can be reversed.

[PostCSS]: https://github.com/postcss/postcss

#Installation
```sh
npm i postcss-invert-keyframes --save-dev
```

#Example
```css
/* Input example */
@-invert-keyframes test {
0%, 10%{
transform: translate3d(0, 0, 0);
}
50% {
transform: translate3d(190px, 0, 0);
}
100%{
transform: translate3d(150px, 0, 0);
}
}
```

```css
/* Output example */
@keyframes test {
0%, 10%{
transform: translate3d(0, 0, 0);
}
50% {
transform: translate3d(190px, 0, 0);
}
100%{
transform: translate3d(150px, 0, 0);
}
}

@keyframes test-inverted {
0%{
transform: translate3d(150px, 0, 0);
}
50% {
transform: translate3d(190px, 0, 0);
}
100%, 90%{
transform: translate3d(0, 0, 0);
}
}
```

## Usage

```js
postcss([ require('postcss-invert-keyframes') ])
```

See [PostCSS] docs for examples for your environment.