Skip to content

Commit ada8852

Browse files
committed
Basic readme structure
1 parent b013fe0 commit ada8852

File tree

2 files changed

+48
-5
lines changed

2 files changed

+48
-5
lines changed

README.md

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,47 @@
1-
# css-spring
2-
[![npm version](https://badge.fury.io/js/css-spring.svg)](https://badge.fury.io/js/css-spring) [![Build Status](https://travis-ci.org/codepunkt/css-spring.svg?branch=master)](https://travis-ci.org/codepunkt/css-spring) [![Coverage Status](https://coveralls.io/repos/github/codepunkt/css-spring/badge.svg?branch=master)](https://coveralls.io/github/codepunkt/css-spring?branch=master)
1+
# css-spring 🚀
2+
[![NPM Version](https://img.shields.io/npm/v/css-spring.svg?style=flat&label=NPM%20Version)](http://npm.im/css-spring)
3+
[![Build Status](https://img.shields.io/travis/codepunkt/css-spring.svg?style=flat&label=Build%20Status)](https://travis-ci.org/codepunkt/css-spring)
4+
[![Code Coverage](https://img.shields.io/coveralls/codepunkt/css-spring.svg?style=flat&label=Code%20Coverage)](https://coveralls.io/github/codepunkt/css-spring?branch=master)
5+
[![MIT License](https://img.shields.io/npm/l/css-spring.svg?style=flat&label=License)](http://opensource.org/licenses/MIT)
36

4-
Generates values for physics based css-keyframe animations
7+
Generates physics based css-keyframe animations.
8+
9+
```javascript
10+
import spring, { format } from 'css-spring'
11+
12+
const keyframes = spring(
13+
{ translate3d: 0 },
14+
{ translate3d: 250 },
15+
{ preset: 'wobbly', precision: 5 }
16+
)
17+
18+
const moveLeft = format(
19+
keyframes,
20+
(k, v) => `transform: ${k}(${v} 0 0);`
21+
)
22+
```
23+
24+
## TOC
25+
26+
- [Introduction](#introduction)
27+
- [Examples](#examples)
28+
- [styled-components](#styled-components)
29+
- [API](#api)
30+
- [spring(start, target, options)](#springstart-target-options)
31+
- [format(keyframes, formatter)](#formatkeyframes-formatter)
32+
33+
## Introduction
34+
35+
Some introductory text
36+
37+
## Examples
38+
39+
Some example text
40+
41+
### styled-components
42+
43+
styled-components example
44+
45+
## API
46+
### `spring(start, target, options)`
47+
### `format(keyframes, formatter)`

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const defaults = {
1414
precision: 3,
1515
}
1616

17-
export const getKeyframes = (startProps, targetProps, options = {}) => {
17+
export const spring = (startProps, targetProps, options = {}) => {
1818
const { stiffness, damping, precision } = Object.assign(
1919
{}, defaults, options,
2020
presets[options.preset] || {}
@@ -39,4 +39,4 @@ export const getKeyframes = (startProps, targetProps, options = {}) => {
3939
}
4040

4141
export { default as format } from './format';
42-
export default getKeyframes
42+
export default spring

0 commit comments

Comments
 (0)