Skip to content

Commit 1ad02b3

Browse files
Readme review
1 parent e6a99bd commit 1ad02b3

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

README.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@ GUI for live easing/property curves editing.
44

55
![mojs-curve-editor](logo.png "mojs-curve-editor")
66

7-
`MojsCurveEditor` is a GUI plugin for interactive `custom easings`/`property curves` editing while crafting your animations. Part of `mojs` tools.
7+
`MojsCurveEditor` is a GUI plugin for interactive custom easings and property curves editing while crafting your animations. It is part of [`mojs` tools](https://mojs.github.io/tools/).
88

99
## Installation
1010

1111
The `MojsCurveEditor` depends on `mojs >= 0.225.2`, tween autoupdates available for `mojs >= 0.276.2`. Please make sure you've linked [mojs](https://github.com/mojs/mojs) library first.
1212

1313
```console
14+
# npm
15+
npm install @mojs/curve-editor
16+
1417
# cdn
1518
<script src="https://cdn.jsdelivr.net/npm/@mojs/curve-editor"></script>
16-
17-
# npm
18-
[sudo] npm install @mojs/curve-editor
1919
```
2020

21-
Import `MojsCurveEditor` constructor to your code, depending on your environment:
21+
Import `MojsCurveEditor` constructor inside your code, depending on your environment:
2222

2323
```javascript
2424
const MojsCurveEditor = require('mojs-curve-editor').default;
@@ -63,7 +63,10 @@ After that you can "connect" the curve with your `mojs` modules by passing a "sa
6363

6464
const html = new mojs.Html({
6565
el: '#js-el',
66-
x: { 0: 100, curve: mojsCurve.getEasing() }
66+
x: {
67+
0: 100,
68+
curve: mojsCurve.getEasing()
69+
}
6770
});
6871

6972
```
@@ -76,19 +79,23 @@ The `getEasing` function receives options hash:
7679

7780
```javascript
7881
easing: mojsCurve.getEasing({
82+
7983
// `transform` function that pipes through the current value
8084
// of the curve so you can transform it
8185
transform: (k) => { return k; }
8286
});
8387

8488
```
8589

86-
After you are happy with the curve you made, you need to change the `sample`(`mojsCurve.getEasing()` calls) with actual path data which you can get by clicking on the `code` button (<img width="32" style="margin-bottom: -10px" src="https://github.com/legomushroom/mojs-curve-editor/blob/master/mockups/code-button.png?raw=true" alt="code button" />):
90+
After you are happy with the curve you made, you need to change the `sample`, `mojsCurve.getEasing()` calls, with the actual path data that you can get by clicking on the `code` button <img width="32" style="margin-bottom: -10px" src="https://github.com/mojs/mojs-curve-editor/blob/master/mockups/code-button.png?raw=true" alt="code button" />:
8791

8892
```javascript
8993
const html = new mojs.Html({
9094
el: '#js-el',
91-
x: { 0: 100, easing: 'M0, 100 C0, 100 19.8984745544779, 40.10152544552211 30, 30 C40.1015254455221, 19.89847455447789 80, 45 80, 45 C80, 45 100, 0 100, 0 ' }
95+
x: {
96+
0: 100,
97+
easing: 'M0, 100 L100, 0'
98+
}
9299
});
93100
```
94101

@@ -98,6 +105,7 @@ Constructor accepts the next options:
98105

99106
```javascript
100107
const curveEditor = new MojsCurveEditor({
108+
101109
// name of the curve editor
102110
name: 'bounce curve'
103111

0 commit comments

Comments
 (0)