Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use in environment without DOM #59

Open
mosch opened this issue Jun 18, 2015 · 2 comments
Open

Use in environment without DOM #59

mosch opened this issue Jun 18, 2015 · 2 comments

Comments

@mosch
Copy link

mosch commented Jun 18, 2015

Awesome work you've done! Looks very smooth and i'm impressed by the card animations.

I'm using react-native to build native apps in javascript. And it looks like this library is the missing piece for doing exciting animations on mobile.

React Native allows you to use transformMatrix and it should be possible to use your calculations to animate things on native mobile.

Is there a way to let the library calculate the matrix without passing in the very dom element but maybe the time / animationFrame?

@daniel-lundin
Copy link
Owner

Thanks!

I'm not so familiar with react-native(yet) but it should definitely be possible.

There are currently two things that ties snabbt to a browser environment:

  • requestAnimationFrame(is there a similar API for react-native?)
  • setting the calculated matrix transform to a DOM element(could easily be changed to a callback for every frame with the matrix)

Everything else is pure javascript.

I think I have to read up on react-native but it should definitely possible with small modifications.

@mosch
Copy link
Author

mosch commented Jun 18, 2015

Sounds great! requestAnimationFrame works in react-native like in the browser. But if found some other things that might fail.
I'll try to collet them in the #60 PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants