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

Allow to pass JSON instead of path #31

Open
m1ga opened this issue Nov 6, 2017 · 5 comments
Open

Allow to pass JSON instead of path #31

m1ga opened this issue Nov 6, 2017 · 5 comments

Comments

@m1ga
Copy link
Owner

m1ga commented Nov 6, 2017

Add the option to pass a JSON as parameter

@m1ga m1ga self-assigned this Nov 6, 2017
@m1ga
Copy link
Owner Author

m1ga commented Nov 16, 2017

Test: https://github.com/m1ga/ti.animation/releases/tag/1.3.0.beta

var testanimation = TiAnimation.createLottieView({
	loop: true,
	json: '{"v":"4.5.9","fr":29.9700012207031,"ip":0,"op":105.000004276738,"w":800,"h":600,"ddd":0,"assets":[],"layers":[{"ddd":0,"ind":0,"ty":4,"nm":"Icon","ks":{"o":{"a":0,"k":100},"r":{"a":0,"k":0},"p":{"a":0,"k":[519.707,417.846,0]},"a":{"a":0,"k":[0,0,0]},"s":{"a":0,"k":[100,100,100]}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":0,"k":[68,8]},"p":{"a":0,"k":[0,-15]},"r":{"a":0,"k":0},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect"},{"ty":"fl","c":{"a":0,"k":[0.108,0.108,0.108,1]},"o":{"a":0,"k":100},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill"},{"ty":"tr","p":{"a":0,"k":[-119.707,-117.727],"ix":2},"a":{"a":0,"k":[0,-14.881],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":24,"s":[100],"e":[0]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":25,"s":[0],"e":[0]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":80,"s":[0],"e":[100]},{"t":81.0000032991976}],"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Rectangle 3","np":3,"mn":"ADBE Vector Group"},{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":0,"k":[68,8]},"p":{"a":1,"k":[{"i":{"x":0,"y":1},"o":{"x":0.167,"y":0.167},"n":"0_1_0p167_0p167","t":15,"s":[0,10],"e":[0,-15],"to":[0,-4.16666650772095],"ti":[0,4.16666650772095]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":25,"s":[0,-15],"e":[0,-15],"to":[0,0],"ti":[0,0]},{"i":{"x":0,"y":1},"o":{"x":0.167,"y":0.167},"n":"0_1_0p167_0p167","t":80,"s":[0,-15],"e":[0,10],"to":[0,4.16666650772095],"ti":[0,-4.16666650772095]},{"t":90.0000036657751}]},"r":{"a":0,"k":0},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect"},{"ty":"fl","c":{"a":0,"k":[0.106,0.106,0.106,1]},"o":{"a":0,"k":100},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill"},{"ty":"tr","p":{"a":0,"k":[-119.707,-117.727],"ix":2},"a":{"a":0,"k":[0,-14.881],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":1,"k":[{"i":{"x":[0],"y":[1]},"o":{"x":[0.167],"y":[0.167]},"n":["0_1_0p167_0p167"],"t":24,"s":[0],"e":[45]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":34,"s":[45],"e":[45]},{"i":{"x":[0],"y":[1]},"o":{"x":[0.167],"y":[0.167]},"n":["0_1_0p167_0p167"],"t":73,"s":[45],"e":[0]},{"t":81.0000032991976}],"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Rectangle 2","np":3,"mn":"ADBE Vector Group"},{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":0,"k":[68,8]},"p":{"a":1,"k":[{"i":{"x":0,"y":1},"o":{"x":0.167,"y":0.167},"n":"0_1_0p167_0p167","t":15,"s":[0,-10],"e":[0,15],"to":[0,4.16666650772095],"ti":[0,-4.16666650772095]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":25,"s":[0,15],"e":[0,15],"to":[0,0],"ti":[0,0]},{"i":{"x":0,"y":1},"o":{"x":0.167,"y":0.167},"n":"0_1_0p167_0p167","t":80,"s":[0,15],"e":[0,-10],"to":[0,-4.16666650772095],"ti":[0,4.16666650772095]},{"t":90.0000036657751}]},"r":{"a":0,"k":0},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect"},{"ty":"fl","c":{"a":0,"k":[0.105,0.105,0.105,1]},"o":{"a":0,"k":100},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill"},{"ty":"tr","p":{"a":0,"k":[-119.707,-117.724],"ix":2},"a":{"a":0,"k":[0,15.122],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":1,"k":[{"i":{"x":[0],"y":[1]},"o":{"x":[0.167],"y":[0.167]},"n":["0_1_0p167_0p167"],"t":24,"s":[0],"e":[-45]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"n":["0p833_0p833_0p167_0p167"],"t":34,"s":[-45],"e":[-45]},{"i":{"x":[0],"y":[1]},"o":{"x":[0.167],"y":[0.167]},"n":["0_1_0p167_0p167"],"t":73,"s":[-45],"e":[0]},{"t":81.0000032991976}],"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Rectangle 1","np":3,"mn":"ADBE Vector Group"}],"ip":0,"op":300.00001221925,"st":0,"bm":0,"sr":1}]}',
	autoStart: true,
	top: 250,
	height: 50,
	width: 50
});

@Topener
Copy link

Topener commented Nov 17, 2017

Nice! IS this for both platforms?

@m1ga
Copy link
Owner Author

m1ga commented Nov 17, 2017

Not yet, but it will/should be :)

@hansemannn
Copy link
Collaborator

@m1ga Will add it, maybe later this weekend. Shouldn't be a big change, so everyone please feel free to go ahead!

@jerry42
Copy link

jerry42 commented Apr 3, 2019

Hi guys ! Is there any update about this ?

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

No branches or pull requests

4 participants