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

♻️ Require trigger="visibility" to run an <amp-story-animation> effect #28257

Merged
merged 6 commits into from May 11, 2020

Conversation

alanorozco
Copy link
Member

@alanorozco alanorozco commented May 7, 2020

This disambiguates effect specs that trigger with page entrance versus those that are triggered by other specs (subanimations).

Note that subanimations are not currently supported, but this change prevents issues when introducing the feature.

@amp-owners-bot
Copy link

amp-owners-bot bot commented May 7, 2020

Hey @newmuis, @Enriqe! These files were changed:

extensions/amp-story/1.0/animation.js
extensions/amp-story/1.0/test/test-animation.js

@alanorozco alanorozco changed the title ♻️ Require trigger=in in amp-story-animation ♻️ Require trigger="in" to run an <amp-story-animation> effect May 7, 2020
@gmajoulet
Copy link
Contributor

Can you elaborate on your plans for the trigger parameter on amp-story-animation? (This trigger="in" is not documented)
What's the API going to look like for subanimations? No trigger at all?

@dvoytenko
Copy link
Contributor

Can you elaborate on your plans for the trigger parameter on amp-story-animation? (This trigger="in" is not documented)
What's the API going to look like for subanimations? No trigger at all?

Correct. Subanimations have no trigger at all. TBH, I don't like everything about it, but we thought that adding a trigger for now would be safer - it will keep the door open for sub-animations done the old way. And if we find a good new way, we can always default it and make it optional.

The "in" is a new value, just for stories. We can instead go to "visible", which is a standard value.

@alanorozco alanorozco force-pushed the amp-story-animation-trigger branch from 33e15a4 to 5cb9b2f Compare May 8, 2020 16:26
Copy link
Contributor

@gmajoulet gmajoulet left a comment

Choose a reason for hiding this comment

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

Sounds good thanks for clarifying :))

"visible" might be easier to understand, or if we want to match the analytics events we send on page navigation for consistency, something like "story-page-visible".

@dvoytenko
Copy link
Contributor

Sounds good thanks for clarifying :))

"visible" might be easier to understand, or if we want to match the analytics events we send on page navigation for consistency, something like "story-page-visible".

In that case I'd vote for trigger="visibility". It fits ok with the original intent of amp-animation.

@alanorozco
Copy link
Member Author

Using visibility. PTAL

@alanorozco alanorozco changed the title ♻️ Require trigger="in" to run an <amp-story-animation> effect ♻️ Require trigger="visibility" to run an <amp-story-animation> effect May 11, 2020
@alanorozco alanorozco merged commit 022bbca into ampproject:master May 11, 2020
@alanorozco alanorozco deleted the amp-story-animation-trigger branch May 11, 2020 19:26
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.

None yet

5 participants