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

Refactor and improve animation logic. #295

Merged
merged 1 commit into from
Feb 18, 2015
Merged

Conversation

nicksay
Copy link
Contributor

@nicksay nicksay commented Feb 17, 2015

  • Make the start state more reliable by delaying for 17ms
    (1 frame at 60 frames/second) before running the animation.
  • Refactor the animation logic into separate dedicated functions for
    clarity: prepare, run, complete.
  • Store animation-related data in a dedicated object.
  • Rename a couple DOM methods to better communicate what they do.
@nicksay
Copy link
Contributor Author

nicksay commented Feb 17, 2015

I'm going to split the refactoring and logic changes out from the demo CSS changes so they're isolated.

@nicksay
Copy link
Contributor Author

nicksay commented Feb 18, 2015

Updated this PR to remove the changes to the development demo

@nicksay
Copy link
Contributor Author

nicksay commented Feb 18, 2015

The demo CSS changes are now in #296.

} else {
spf.tasks.suspend(key); // Suspend main queue for animation.
var animationKey = spf.tasks.key(el);

Copy link
Contributor

Choose a reason for hiding this comment

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

extra nl here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed

- Make the start state more reliable by delaying for 17ms
  (1 frame at 60 frames/second) before running the animation.
- Refactor the animation logic into separate dedicated functions for
  clarity: prepare, run, complete.
- Store animation-related data in a dedicated object.
- Rename a couple DOM methods to better communicate what they do.
@nicksay
Copy link
Contributor Author

nicksay commented Feb 18, 2015

Extra blank lines removed.

@awbraunstein
Copy link
Contributor

lgtm

nicksay added a commit that referenced this pull request Feb 18, 2015
Refactor and improve animation logic.
@nicksay nicksay merged commit 6bf1bfe into youtube:master Feb 18, 2015
@nicksay nicksay deleted the animation branch February 18, 2015 20:31
@nicksay
Copy link
Contributor Author

nicksay commented Feb 23, 2015

Post-commit associating this with #299.

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