Skip to content

Commit c2e9903

Browse files
committed
- fix[Easing]: Easing on reverse fixed
- fix[RollupConfig]: config-file fixed - fix[Seek]: not works best, but works at least - compatibility[UI]: making it better compatibility for better - fix[stop]: stop method fix - feat[Easing]: stepped easing added - format[Code]: code formatting fix - break[Timeline]: now `elapsed()` is `progress()` - and some fixes, improvements and patches...
1 parent 7e4779b commit c2e9903

File tree

11 files changed

+2333
-1618
lines changed

11 files changed

+2333
-1618
lines changed

API.md

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ Lightweight, effecient and modular ES6 version of tween.js
3333
```
3434

3535
* [TWEEN](#TWEEN) : <code>object</code>
36+
* [.now](#TWEEN.now)
3637
* [.Plugins](#TWEEN.Plugins) : <code>object</code>
3738
* [.Easing](#TWEEN.Easing) : <code>object</code>
3839
* [.Interpolation](#TWEEN.Interpolation) : <code>object</code>
39-
* [.now](#TWEEN.now)
4040
* [.add(tween)](#TWEEN.add)
4141
* [.onTick(fn)](#TWEEN.onTick)
4242
* [.autoPlay(state)](#TWEEN.autoPlay)
@@ -47,6 +47,17 @@ Lightweight, effecient and modular ES6 version of tween.js
4747
* [.update(time, [preserve])](#TWEEN.update)
4848
* [.isRunning()](#TWEEN.isRunning) ⇒ <code>Boolean</code>
4949

50+
<a name="TWEEN.now"></a>
51+
52+
### TWEEN.now ⇒
53+
Get browser/Node.js current time-stamp
54+
55+
**Kind**: static property of [<code>TWEEN</code>](#TWEEN)
56+
**Returns**: Normalised current time-stamp in milliseconds
57+
**Example**
58+
```js
59+
TWEEN.now
60+
```
5061
<a name="TWEEN.Plugins"></a>
5162

5263
### TWEEN.Plugins : <code>object</code>
@@ -77,17 +88,6 @@ List of full Interpolation
7788
```js
7889
import {Interpolation, Tween} from 'es6-tween'let bezier = Interpolation.Beziernew Tween({x:0}).to({x:[0, 4, 8, 12, 15, 20, 30, 40, 20, 40, 10, 50]}, 1000).interpolation(bezier).start()
7990
```
80-
<a name="TWEEN.now"></a>
81-
82-
### TWEEN.now ⇒
83-
Get browser/Node.js current time-stamp
84-
85-
**Kind**: static constant of [<code>TWEEN</code>](#TWEEN)
86-
**Returns**: Normalised current time-stamp in milliseconds
87-
**Example**
88-
```js
89-
TWEEN.now
90-
```
9191
<a name="TWEEN.add"></a>
9292

9393
### TWEEN.add(tween)
@@ -698,7 +698,7 @@ let tween = new Tween(myNode, {width:'100px'}).to({width:'300px'}, 2000).start()
698698
* _instance_
699699
* [.isPlaying()](#Tween+isPlaying) ⇒ <code>boolean</code>
700700
* [.isStarted()](#Tween+isStarted) ⇒ <code>boolean</code>
701-
* [.reverse()](#Tween+reverse)
701+
* [.reverse([state])](#Tween+reverse)
702702
* [.reversed()](#Tween+reversed) ⇒ <code>boolean</code>
703703
* [.pause()](#Tween+pause)
704704
* [.play()](#Tween+play)
@@ -714,7 +714,7 @@ let tween = new Tween(myNode, {width:'100px'}).to({width:'300px'}, 2000).start()
714714
* [.reverseDelay(amount)](#Tween+reverseDelay)
715715
* [.yoyo(state, [_easingReverse])](#Tween+yoyo)
716716
* [.easing(_easingFunction)](#Tween+easing)
717-
* [.update(time, [preserve])](#Tween+update)
717+
* [.update(time, [preserve], [forceTime])](#Tween+update)
718718
* _static_
719719
* [.fromTo(node, object, to, params)](#Tween.fromTo)
720720
* [.to(node, to, params)](#Tween.to)
@@ -740,10 +740,15 @@ tween.isStarted() // returns `true` if tween in started
740740
```
741741
<a name="Tween+reverse"></a>
742742

743-
### tween.reverse()
743+
### tween.reverse([state])
744744
Reverses the tween state/direction
745745

746746
**Kind**: instance method of [<code>Tween</code>](#Tween)
747+
748+
| Param | Type | Description |
749+
| --- | --- | --- |
750+
| [state] | <code>boolean</code> | Set state of current reverse |
751+
747752
**Example**
748753
```js
749754
tween.reverse()
@@ -848,7 +853,7 @@ Start the tweening
848853

849854
| Param | Type | Description |
850855
| --- | --- | --- |
851-
| time | <code>number</code> | setting manual time instead of Current browser timestamp |
856+
| time | <code>number</code> \| <code>string</code> | setting manual time instead of Current browser timestamp or like `+1000` relative to current timestamp |
852857

853858
**Example**
854859
```js
@@ -957,7 +962,7 @@ tween.easing(Easing.Elastic.InOut)
957962
```
958963
<a name="Tween+update"></a>
959964

960-
### tween.update(time, [preserve])
965+
### tween.update(time, [preserve], [forceTime])
961966
Updates initial object to target value by given `time`
962967

963968
**Kind**: instance method of [<code>Tween</code>](#Tween)
@@ -966,6 +971,7 @@ Updates initial object to target value by given `time`
966971
| --- | --- | --- |
967972
| time | <code>Time</code> | Current time |
968973
| [preserve] | <code>boolean</code> | Prevents from removing tween from store |
974+
| [forceTime] | <code>boolean</code> | Forces to be frame rendered, even mismatching time |
969975

970976
**Example**
971977
```js

0 commit comments

Comments
 (0)