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

Enable animation based on navigation transitions. #310

Merged
merged 1 commit into from
Mar 10, 2015

Conversation

nicksay
Copy link
Contributor

@nicksay nicksay commented Mar 6, 2015

Responses can now send a name value which will be used to construct "from"
and "to" CSS classes that will be applied during updates. These two classes
will be applied with the following patterns:

  • config['animation-class'] + '-from-' + _previous_name_
  • config['animation-class'] + '-to-' + _current_name_

This will allow transitions to be applied based on state of the page (i.e.
navigating from page A to page B) instead of based on the action (i.e.
navigating back in the history stack).

Currently, a name must be sent with each part of a multipart response for it
to be used when processing that part. The last name value will be saved
for upcoming "from" classes.

In order to initialize a "from" class before the first SPF navigation, pages
can set the data-spf-name attribute on the <body> tag:

<body data-spf-name="home" ...>

Progress on #299.

@zhaoz
Copy link
Contributor

zhaoz commented Mar 10, 2015

LGTM

Responses can now send a `name` value which will be used to construct "from"
and "to" CSS classes that will be applied during updates.  These two classes
will be applied with the following patterns:

* `config['animation-class'] + '-from-' + _previous_name_`
* `config['animation-class'] + '-to-' + _current_name_`

This will allow transitions to be applied based on state of the page (i.e.
navigating from page A to page B) instead of based on the action (i.e.
navigating back in the history stack).

Currently, a `name` must be sent with each part of a multipart response for it
to be used when processing that part.  The last `name` value will be saved
for upcoming "from" classes.

In order to initialize a "from" class before the first SPF navigation, pages
can set the `data-spf-name` attribute on the `<body>` tag:

```html
<body data-spf-name="home" ...>
```

Progress on youtube#299.
nicksay added a commit that referenced this pull request Mar 10, 2015
Enable animation based on navigation transitions.
@nicksay nicksay merged commit 536fe43 into youtube:master Mar 10, 2015
@nicksay nicksay deleted the anim-name branch March 10, 2015 06:59
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

Successfully merging this pull request may close these issues.

2 participants