forked from Popmotion/popmotion
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5ff6477
commit 63311e5
Showing
18 changed files
with
132 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
title: Chain | ||
description: Chain a sequence of actions, move to the next when the current one completes. | ||
category: compositors | ||
--- | ||
|
||
# Chain | ||
|
||
Chain a sequence of actions, move to the next when the current one completes. | ||
|
||
## Import | ||
|
||
```javascript | ||
import { chain } from 'popmotion'; | ||
// or stand-alone: | ||
import chain from 'popmotion/compositors/chain'; | ||
``` | ||
|
||
## Usage | ||
|
||
```javascript | ||
chain( | ||
tween({ to: 300 }), | ||
spring({ from: 300, to: 0 }) | ||
).start({ | ||
update: (v) => console.log(v), | ||
complete: () => console.log('All actions complete') | ||
}) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React from 'react'; | ||
import { Box } from '../inc'; | ||
import draggable from '../../packages/popmotion-draggable/lib'; | ||
import Draggable from '../../packages/popmotion-draggable/lib/react'; | ||
|
||
export class DraggableDOM extends React.Component { | ||
setRef = (dom) => { | ||
if (!dom) dom; | ||
this.box = draggable(dom); | ||
}; | ||
|
||
render() { | ||
return <Box innerRef={this.setRef} />; | ||
} | ||
} | ||
|
||
export const DraggableReact = () => ( | ||
<Draggable> | ||
<Box /> | ||
</Draggable> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React from 'react'; | ||
import { Box } from '../inc'; | ||
import spinnable from '../../packages/popmotion-spinnable/lib'; | ||
import Spinnable from '../../packages/popmotion-spinnable/lib/react'; | ||
|
||
export class SpinnableDOM extends React.Component { | ||
setRef = (dom) => { | ||
if (!dom) dom; | ||
this.box = spinnable(dom); | ||
}; | ||
|
||
render() { | ||
return <Box innerRef={this.setRef} />; | ||
} | ||
} | ||
|
||
export const SpinnableReact = () => ( | ||
<Spinnable> | ||
<Box /> | ||
</Spinnable> | ||
); |