Experience-Monks / f1-dom

Create f1 ui with the dom
MIT License
12 stars 4 forks source link

Write a parser to handle percentages #7

Closed mikkoh closed 8 years ago

mikkoh commented 8 years ago

It would be nice if you could do something like.

from: 
  left: "10%"

to:
  left: "50%"

Where F1 could animate these values.

Also a similar case would be to handle translate: [ '-50%', 0, 0]. Although this may not be possible as the translate array gets calculated into a transformation matrix and therefore we'd need to know the calculated size of the element we're animating.

andrevenancio commented 8 years ago

any news on this feature?

mikkoh commented 8 years ago

It's something I'd like to look at this week depending on how much other stuff comes up.

I think one thing that's tough is lets say you're using percentages and then you switch in another state to not use percentages it will cause issues.

I'm not sure how browsers handle that case when using CSS transitions.

andrevenancio commented 8 years ago

Is this implemented?

njam3 commented 8 years ago

@andrevenancio Yup! sorry, should have mentioned it. It was added to the f1 library as of version 8.0.0 I have not updated the dependencies in f1-dom yet though, I will do so soon.