Skip to content

Features/time component#19

Open
phil-linnell wants to merge 43 commits intomasterfrom
features/time-component
Open

Features/time component#19
phil-linnell wants to merge 43 commits intomasterfrom
features/time-component

Conversation

@phil-linnell
Copy link
Copy Markdown
Owner

@arnau

Isolated the duration from the animation declaration and convert to milliseconds.

I wanted to do a test for the case of having no duration but I will need your help with that.

Need to pass it into keyframes() now

Comment thread lib/ornithopter.js Outdated
* {step: 100, properties: [{name: 'color', value: 'green'}]]
*
* @example
* Given a 2s animation:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll have to remove these comments, well clean up the example

@arnau
Copy link
Copy Markdown
Contributor

arnau commented May 22, 2016

@phil-linnell I think we have to discuss how predictable is the "accuracy" concept from the user perspective. I struggle all the time with the magic of 2 means 2 edge values plus one interpolated value. I think we need to find a way to make the relation obvious, either 3 == 3 keyframes or 1 == 1 interpolated value. Then internally we will adapt the value to our needs.

@arnau
Copy link
Copy Markdown
Contributor

arnau commented May 22, 2016

@phil-linnell I fixed everything but the postcss tests. We should review that all computations for linear functions are what we think it is right. e.g. for a situation with accuracy 2 right now we create a set of keyframes with percentages 0%, 33.33%, 100%.

I believe this is a regression as the expected value is 50% right?

@phil-linnell
Copy link
Copy Markdown
Owner Author

@arnau Re: 33.33%. Yes that doesn't seem to be right.

You make a good point about the accuracy. In a way the second example (1 == 1 interpolated) makes more sense to me. It is a given that you have a beginning and end keyframe, i.e. 2 keyframes for free. the accuracy is then used to created the interpolated keyframes. So an accuracy of 2 would give additional 33.33 and 66.66.

Hmmm, however I can't help but still feel the way we have it makes sense to me when I think about a "journey". I go from point a (0%) to b (100%). One step is straight there. So an accuracy of 1. 1 step. If I want to go from a to b with an accuracy of 2 then i would step at 50% before finishing at 100%. It's like drawing points on a graph.

Sorry. I've very mixed feelings about this!

@arnau
Copy link
Copy Markdown
Contributor

arnau commented May 22, 2016

I see your point with the number of steps, the question is, what is more straightforward to grasp? I think the one that is more obvious is the one we should use.

@arnau arnau force-pushed the features/time-component branch from edce49e to 52fa7ad Compare May 22, 2016 15:34
@arnau
Copy link
Copy Markdown
Contributor

arnau commented May 22, 2016

I fixed the 50% vs 33.33% issue by splitting valueByLinear in two, so now we have valueByLinear and stepByLinear. The latter needs a review given the value is not computed based on previous and final values but by position which, yes, it is easier in the linear case but it is less flexible when we want to do more complex things.

Besides that, there is something funny going on with accuracy and step by linear. Let's focus on this next day.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants